diff --git a/AtlasGeometryCommon/CavernInfraGeoModel/CMakeLists.txt b/AtlasGeometryCommon/CavernInfraGeoModel/CMakeLists.txt index b3d9e54616c961917e9e00beac6a3f44354541ef..5309743d9e32f2c9404d53ea6747ed94ab8997b0 100644 --- a/AtlasGeometryCommon/CavernInfraGeoModel/CMakeLists.txt +++ b/AtlasGeometryCommon/CavernInfraGeoModel/CMakeLists.txt @@ -7,8 +7,7 @@ atlas_subdir( CavernInfraGeoModel ) # Declare the package's dependencies: atlas_depends_on_subdirs( PUBLIC - Control/CLIDSvc - Control/SGTools + Control/AthenaKernel Database/RDBAccessSvc DetectorDescription/GeoModel/GeoModelKernel DetectorDescription/GeoModel/GeoModelUtilities @@ -27,7 +26,7 @@ atlas_add_component( CavernInfraGeoModel src/*.cxx src/components/*.cxx INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} ${CLHEP_LIBRARIES} SGTools GeoModelKernel GeoModelUtilities StoreGateLib SGtests GaudiKernel ) + LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} ${CLHEP_LIBRARIES} GeoModelKernel GeoModelUtilities StoreGateLib SGtests GaudiKernel ) # Install files from the package: atlas_install_headers( CavernInfraGeoModel ) diff --git a/AtlasGeometryCommon/CavernInfraGeoModel/CavernInfraGeoModel/CavernInfraDetectorManager.h b/AtlasGeometryCommon/CavernInfraGeoModel/CavernInfraGeoModel/CavernInfraDetectorManager.h index 217b73c054c50aa3a888aebb00905cd51f4ea176..151d1c0fcf2b68ce0079755b08d6a4d5fc3cefae 100755 --- a/AtlasGeometryCommon/CavernInfraGeoModel/CavernInfraGeoModel/CavernInfraDetectorManager.h +++ b/AtlasGeometryCommon/CavernInfraGeoModel/CavernInfraGeoModel/CavernInfraDetectorManager.h @@ -35,7 +35,7 @@ class CavernInfraDetectorManager : public GeoVDetectorManager }; #ifndef GAUDI_NEUTRAL -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" CLASS_DEF(CavernInfraDetectorManager, 1500000300, 1) #endif diff --git a/AtlasTest/DatabaseTest/AthenaDBTestRec/AthenaDBTestRec/TestCoolRecPoolData.h b/AtlasTest/DatabaseTest/AthenaDBTestRec/AthenaDBTestRec/TestCoolRecPoolData.h index 385f616473b0e126874e8145f5565167d5a4c559..a40d9d02a02faac5e6e1f32f2e253f81fe97bf88 100644 --- a/AtlasTest/DatabaseTest/AthenaDBTestRec/AthenaDBTestRec/TestCoolRecPoolData.h +++ b/AtlasTest/DatabaseTest/AthenaDBTestRec/AthenaDBTestRec/TestCoolRecPoolData.h @@ -10,7 +10,7 @@ #include<vector> #include<string> -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" class TestCoolRecPoolData { public: diff --git a/AtlasTest/DatabaseTest/AthenaDBTestRec/AthenaDBTestRec/TestCoolRecPoolDataColl.h b/AtlasTest/DatabaseTest/AthenaDBTestRec/AthenaDBTestRec/TestCoolRecPoolDataColl.h index 9dbbfb1fe14fc71a6641e6d1b0676687f35f630f..96ebf519afe0d86a25127c20782a5ffe20155320 100644 --- a/AtlasTest/DatabaseTest/AthenaDBTestRec/AthenaDBTestRec/TestCoolRecPoolDataColl.h +++ b/AtlasTest/DatabaseTest/AthenaDBTestRec/AthenaDBTestRec/TestCoolRecPoolDataColl.h @@ -9,7 +9,7 @@ // Richard Hawkings, started 16/8/06 #include "AthenaPoolUtilities/CondMultChanCollection.h" #include "AthenaDBTestRec/TestCoolRecPoolData.h" -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" typedef CondMultChanCollection<TestCoolRecPoolData> TestCoolRecPoolDataColl; diff --git a/AtlasTest/DatabaseTest/AthenaDBTestRec/CMakeLists.txt b/AtlasTest/DatabaseTest/AthenaDBTestRec/CMakeLists.txt index fa78dfc02d36a8c281482a4f71c933b76397bb58..85cc80bc4082db746d6f50676ea59d6978ffece3 100644 --- a/AtlasTest/DatabaseTest/AthenaDBTestRec/CMakeLists.txt +++ b/AtlasTest/DatabaseTest/AthenaDBTestRec/CMakeLists.txt @@ -9,8 +9,6 @@ atlas_subdir( AthenaDBTestRec ) atlas_depends_on_subdirs( PUBLIC Control/AthenaBaseComps Control/AthenaKernel - Control/CLIDSvc - Control/SGTools Control/StoreGate Database/AthenaPOOL/AthenaPoolUtilities GaudiKernel @@ -38,31 +36,31 @@ atlas_add_library( AthenaDBTestRecLib src/lib/*.cxx PUBLIC_HEADERS AthenaDBTestRec PRIVATE_INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} - LINK_LIBRARIES AthenaBaseComps AthenaKernel SGTools AthenaPoolUtilities GaudiKernel StoreGateLib SGtests AthenaPoolCnvSvcLib + LINK_LIBRARIES AthenaBaseComps AthenaKernel AthenaPoolUtilities GaudiKernel StoreGateLib SGtests AthenaPoolCnvSvcLib PRIVATE_LINK_LIBRARIES ${COOL_LIBRARIES} ${Boost_LIBRARIES} ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} CollectionBase CollectionUtilities PersistencySvc StorageSvc CoraCool PersistentDataModel EventInfo ) atlas_add_component( AthenaDBTestRec src/components/*.cxx INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} - LINK_LIBRARIES ${COOL_LIBRARIES} ${Boost_LIBRARIES} ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} AthenaBaseComps AthenaKernel SGTools StoreGateLib SGtests AthenaPoolUtilities GaudiKernel CollectionBase CollectionUtilities PersistencySvc StorageSvc AthenaPoolCnvSvcLib CoraCool PersistentDataModel EventInfo AthenaDBTestRecLib ) + LINK_LIBRARIES ${COOL_LIBRARIES} ${Boost_LIBRARIES} ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} AthenaBaseComps AthenaKernel StoreGateLib SGtests AthenaPoolUtilities GaudiKernel CollectionBase CollectionUtilities PersistencySvc StorageSvc AthenaPoolCnvSvcLib CoraCool PersistentDataModel EventInfo AthenaDBTestRecLib ) atlas_add_poolcnv_library( AthenaDBTestRecPoolCnv src/*.cxx FILES AthenaDBTestRec/TestCoolRecPoolData.h AthenaDBTestRec/TestCoolRecPoolDataColl.h MULT_CHAN_TYPES TestCoolRecPoolDataColl INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} - LINK_LIBRARIES ${COOL_LIBRARIES} ${Boost_LIBRARIES} ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} AthenaBaseComps AthenaKernel SGTools StoreGateLib SGtests AthenaPoolUtilities GaudiKernel CollectionBase CollectionUtilities PersistencySvc StorageSvc AthenaPoolCnvSvcLib CoraCool PersistentDataModel EventInfo AthenaDBTestRecLib ) + LINK_LIBRARIES ${COOL_LIBRARIES} ${Boost_LIBRARIES} ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} AthenaBaseComps AthenaKernel StoreGateLib SGtests AthenaPoolUtilities GaudiKernel CollectionBase CollectionUtilities PersistencySvc StorageSvc AthenaPoolCnvSvcLib CoraCool PersistentDataModel EventInfo AthenaDBTestRecLib ) atlas_add_dictionary( AthenaDBTestRecDataDict AthenaDBTestRec/AthenaDBTestRecDataDict.h AthenaDBTestRec/selection.xml INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} - LINK_LIBRARIES ${COOL_LIBRARIES} ${Boost_LIBRARIES} ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} AthenaBaseComps AthenaKernel SGTools StoreGateLib SGtests AthenaPoolUtilities GaudiKernel CollectionBase CollectionUtilities PersistencySvc StorageSvc AthenaPoolCnvSvcLib CoraCool PersistentDataModel EventInfo AthenaDBTestRecLib ) + LINK_LIBRARIES ${COOL_LIBRARIES} ${Boost_LIBRARIES} ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} AthenaBaseComps AthenaKernel StoreGateLib SGtests AthenaPoolUtilities GaudiKernel CollectionBase CollectionUtilities PersistencySvc StorageSvc AthenaPoolCnvSvcLib CoraCool PersistentDataModel EventInfo AthenaDBTestRecLib ) atlas_add_executable( TestCoolRecWriter src/app/*.cxx INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} - LINK_LIBRARIES ${COOL_LIBRARIES} ${Boost_LIBRARIES} ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} AthenaBaseComps AthenaKernel SGTools StoreGateLib SGtests AthenaPoolUtilities GaudiKernel CollectionBase CollectionUtilities PersistencySvc StorageSvc AthenaPoolCnvSvcLib CoraCool PersistentDataModel EventInfo AthenaDBTestRecLib ) + LINK_LIBRARIES ${COOL_LIBRARIES} ${Boost_LIBRARIES} ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} AthenaBaseComps AthenaKernel StoreGateLib SGtests AthenaPoolUtilities GaudiKernel CollectionBase CollectionUtilities PersistencySvc StorageSvc AthenaPoolCnvSvcLib CoraCool PersistentDataModel EventInfo AthenaDBTestRecLib ) # Install files from the package: atlas_install_joboptions( share/*.py ) diff --git a/AtlasTest/TestTools/share/post.sh b/AtlasTest/TestTools/share/post.sh index 238d519f852609f69cf52da19f4dab5099549818..2ea658f7bcd77ca2c357b9db5e04e22f63f94647 100755 --- a/AtlasTest/TestTools/share/post.sh +++ b/AtlasTest/TestTools/share/post.sh @@ -228,6 +228,9 @@ else echo "$GREEN post.sh> OK: ${test} exited normally. Output is in $joblog $RESET" fi reflog=../share/${test}.ref + if [ "$reflog_location" != "" ]; then + reflog=$reflog_location/${test}.ref + fi # If we can't find the reference file, maybe it's located outside # the repo. With the switch to git, we have to fall back diff --git a/Calorimeter/CaloCellCorrection/python/CaloCellPedestalCorrDefault.py b/Calorimeter/CaloCellCorrection/python/CaloCellPedestalCorrDefault.py index 77f6f90e9db9c5f2048cbc40b9a219e03ff0ea38..4a7abc45a5075236e1e4a1d0151d08736cefb2ec 100644 --- a/Calorimeter/CaloCellCorrection/python/CaloCellPedestalCorrDefault.py +++ b/Calorimeter/CaloCellCorrection/python/CaloCellPedestalCorrDefault.py @@ -13,29 +13,17 @@ def CaloCellPedestalCorrDefault(name='CaloCellPedestalCorr'): except: mlog.error("could not get handle to CaloCellPedestalCorr Quit") print traceback.format_exc() - ToolSvc += theCaloCellPedestalCorr - - try: - from CaloRec.CaloRecConf import CaloCellContainerCorrectorTool - from CaloIdentifier import SUBCALO - thePedestalTool = CaloCellContainerCorrectorTool("PedestalTool", - CaloNums = [ SUBCALO.NSUBCALO], - CellCorrectionToolNames = [theCaloCellPedestalCorr] ) - except: - mlog.error("could not get handle to CaloCellContainerCorrectorTool Quit") - print traceback.format_exc() - return False - + #ToolSvc += theCaloCellPedestalCorr if globalflags.DataSource()=='data' : from IOVDbSvc.CondDB import conddb if conddb.isOnline: folder = '/CALO/Pedestal/CellPedestal' - conddb.addFolder('CALO_ONL',folder) + conddb.addFolder('CALO_ONL',folder,className="CondAttrListCollection") else: folder= '/CALO/Ofl/Pedestal/CellPedestal' - conddb.addFolder('CALO_OFL',folder) - theCaloCellPedestalCorr.FolderName = folder + conddb.addFolder('CALO_OFL',folder,className="CondAttrListCollection") + theCaloCellPedestalCorr.PedestalShiftFolder = folder theCaloCellPedestalCorr.isMC=False else: theCaloCellPedestalCorr.isMC=True @@ -44,15 +32,16 @@ def CaloCellPedestalCorrDefault(name='CaloCellPedestalCorr'): from CaloRec.CaloCellFlags import jobproperties if globalflags.DataSource()=='data' and (not jobproperties.CaloCellFlags.doPileupOffsetBCIDCorr()) and (not athenaCommonFlags.isOnline()): lumiFolder = '/TRIGGER/LUMI/LBLESTONL' - conddb.addFolder('TRIGGER_ONL',lumiFolder); + conddb.addFolder('TRIGGER_ONL',lumiFolder,className="CondAttrListCollection"); theCaloCellPedestalCorr.Luminosity = -1 theCaloCellPedestalCorr.LumiFolderName = lumiFolder if jobproperties.CaloCellFlags.doPileupOffsetBCIDCorr() and (not athenaCommonFlags.isOnline()): - from CaloTools.CaloLumiBCIDToolDefault import CaloLumiBCIDToolDefault - theCaloLumiBCIDTool = CaloLumiBCIDToolDefault() - ToolSvc += theCaloLumiBCIDTool - theCaloCellPedestalCorr.LumiBCIDTool = theCaloLumiBCIDTool - + from CaloRec.CaloBCIDAvgAlgDefault import CaloBCIDAvgAlgDefault + CaloBCIDAvgAlgDefault() + theCaloCellPedestalCorr.CaloBCIDAverageKey="CaloBCIDAverage" + else: + theCaloCellPedestalCorr.CaloBCIDAverageKey="" + - return thePedestalTool + return theCaloCellPedestalCorr diff --git a/Calorimeter/CaloCellCorrection/src/CaloCellPedestalCorr.cxx b/Calorimeter/CaloCellCorrection/src/CaloCellPedestalCorr.cxx index dff34577162070668c1eca7c7919c892f9beb259..97c62d592ce9ee99f79f20c9238fcd7ad8705374 100755 --- a/Calorimeter/CaloCellCorrection/src/CaloCellPedestalCorr.cxx +++ b/Calorimeter/CaloCellCorrection/src/CaloCellPedestalCorr.cxx @@ -13,7 +13,7 @@ #include "CaloCellPedestalCorr.h" -#include "CaloEvent/CaloCell.h" +#include "CaloEvent/CaloCellContainer.h" #include "CaloDetDescr/CaloDetDescrElement.h" //=== AttributeList @@ -32,19 +32,15 @@ CaloCellPedestalCorr::CaloCellPedestalCorr( const std::string& type, const std::string& name, const IInterface* parent) - : CaloCellCorrection(type, name, parent), - m_caloCoolIdTool("CaloCoolIdTool"), + : AthAlgTool(type, name, parent), + m_caloCoolIdTool("CaloCoolIdTool",this), m_cellId(nullptr), - m_caloLumiBCIDTool(""), - m_isMC(false) -{ - declareInterface<CaloCellCorrection>(this); - declareProperty("Luminosity",m_lumi0=0,"Luminosity in 10**33 units"); - declareProperty("CaloCoolIdTool",m_caloCoolIdTool,"Tool for Calo cool Id"); - declareProperty("FolderName",m_folderName="/CALO/Pedestal/CellPedestal"); - declareProperty("LumiFolderName",m_lumiFolderName="/TRIGGER/LUMI/LBLESTONL"); - declareProperty("LumiBCIDTool",m_caloLumiBCIDTool,"Tool for BCID pileup offset average correction"); - declareProperty("isMC",m_isMC,"Data/MC flag"); + //m_caloLumiBCIDTool(""), + m_isMC(false){ + declareInterface<ICaloCellMakerTool>(this); + declareProperty("Luminosity",m_lumi0=0,"Luminosity in 10**33 units"); + declareProperty("CaloCoolIdTool",m_caloCoolIdTool,"Tool for Calo cool Id"); + declareProperty("isMC",m_isMC,"Data/MC flag"); } //======================================================== @@ -56,133 +52,89 @@ StatusCode CaloCellPedestalCorr::initialize() ATH_CHECK(detStore()->retrieve(m_cellId, "CaloCell_ID")); - if (m_lumi0<0) { - if (detStore()->contains<CondAttrListCollection>(m_lumiFolderName)) { - const DataHandle<CondAttrListCollection> lumiData; - ATH_CHECK( detStore()->regFcn(&CaloCellPedestalCorr::updateLumi, this , lumiData, m_lumiFolderName, true) ); - ATH_MSG_INFO( " Registered a callback for " << m_lumiFolderName << " Cool folder " ); - } - m_lumi0=0; + if (m_lumi0<0 && !m_isMC) { + ATH_CHECK(m_lumiFolderName.initialize()); } - - if (!m_isMC) { - //=== Register callback for this data handle - ATH_CHECK( detStore()->regFcn(&CaloCellPedestalCorr::updateMap, this, m_noiseAttrListColl, m_folderName) ); - ATH_MSG_INFO( " registered a callback for " << m_folderName << " folder " ); - + ATH_CHECK(m_pedShiftFolder.initialize()); ATH_CHECK(m_caloCoolIdTool.retrieve()); } - if (!m_caloLumiBCIDTool.empty() ) { - ATH_CHECK(m_caloLumiBCIDTool.retrieve()); + if (!m_caloBCIDAvg.key().empty()) { + ATH_CHECK(m_caloBCIDAvg.initialize()); } ATH_MSG_INFO( "CaloCellPedestalCorr initialize() end" ); - return StatusCode::SUCCESS; - } - -//______________________________________________________________________________________ -StatusCode -CaloCellPedestalCorr::updateLumi( IOVSVC_CALLBACK_ARGS ) -{ - ATH_MSG_INFO( " in updateLumi() " ); - - const CondAttrListCollection* attrListColl = 0; - ATH_CHECK(detStore()->retrieve(attrListColl, m_lumiFolderName)); - // Loop over collection - CondAttrListCollection::const_iterator first = attrListColl->begin(); - CondAttrListCollection::const_iterator last = attrListColl->end(); - for (; first != last; ++first) { - if ((*first).first == 0) { - if (msgLvl(MSG::DEBUG)) { - std::ostringstream attrStr1; - (*first).second.toOutputStream( attrStr1 ); - ATH_MSG_DEBUG( "ChanNum " << (*first).first << " Attribute list " << attrStr1.str() ); - } - const coral::AttributeList& attrList = (*first).second; - if (attrList["LBAvInstLumi"].isNull()) { - ATH_MSG_WARNING( " NULL Luminosity information in database ... set it to 0 " ); - m_lumi0 = 0.; - } else { - m_lumi0 = attrList["LBAvInstLumi"].data<float>() *1e-3; // luminosity (from 10**30 units in db to 10*33 units) - } - break; - } - } - if ( !(m_lumi0 == m_lumi0) ) { - ATH_MSG_WARNING( " Luminosity not a number ? m_lumi0 " << m_lumi0 << " ... set it to 0 " ); - m_lumi0 = 0.; - } - ATH_MSG_INFO( " Luminosity " << m_lumi0 ); - return StatusCode::SUCCESS; +StatusCode CaloCellPedestalCorr::process( CaloCellContainer * theCellContainer) { + //This function is a stopgap solution until all CaloCellCorrector tools are const + const EventContext& ctx = Gaudi::Hive::currentContext(); + return this->process(theCellContainer,ctx); } +StatusCode CaloCellPedestalCorr::process( CaloCellContainer * theCellContainer, const EventContext& ctx) const { - -// =============================================================================== - -StatusCode CaloCellPedestalCorr::updateMap(IOVSVC_CALLBACK_ARGS_K(keys) ) -{ - msg(MSG::INFO) << " in updateMap "; - std::list<std::string>::const_iterator itr; - for (itr=keys.begin(); itr!=keys.end(); ++itr) { - msg() << *itr << " "; - } - msg() << endmsg; - - //=== loop over collection (all cool channels) - CondAttrListCollection::const_iterator iColl = m_noiseAttrListColl->begin(); - CondAttrListCollection::const_iterator last = m_noiseAttrListColl->end(); - for (; iColl != last; ++iColl) { - - //=== COOL channel number is system id - unsigned int sysId = static_cast<unsigned int>(iColl->first); - - //=== delete old CaloCondBlobFlt (which does not own the blob) - NoiseBlobMap_t::iterator iOld = m_noiseBlobMap.find(sysId); - if(iOld != m_noiseBlobMap.end()){ - delete iOld->second; + const CondAttrListCollection* pedShiftColl=nullptr; + float lumi=m_lumi0; + if (!m_isMC) { + // Get Luminosity estimate + if (lumi<0) { + SG::ReadCondHandle<CondAttrListCollection> lumiHdl(m_lumiFolderName,ctx); + const CondAttrListCollection* attrListColl=(*lumiHdl); + if (attrListColl->size() == 0) { + lumi = 0; + } + else { + const coral::AttributeList& attrList=attrListColl->attributeList(0); //Get channel number 0 + if (attrList["LBAvInstLumi"].isNull()) { + ATH_MSG_WARNING("No valid luminosity information in folder " << m_lumiFolderName.key() << ", attribute LBAvInstLumi"); + lumi=0; + } + else { + lumi=attrList["LBAvInstLumi"].data<float>() *1e-3; // luminosity (from 10**30 units in db to 10*33 units) + } + } } - - //=== Get new CaloCondBlobFlt instance, interpreting current BLOB - const coral::Blob& blob = (iColl->second)["CaloCondBlob16M"].data<coral::Blob>(); - const CaloCondBlobFlt* flt = CaloCondBlobFlt::getInstance(blob); - - //=== store new pointer in map - m_noiseBlobMap[sysId] = flt; - - }//end iColl - return StatusCode::SUCCESS; -} -// ============================================================================ + //Get Pedestal shifts + SG::ReadCondHandle<CondAttrListCollection> pedShiftHdl(m_pedShiftFolder,ctx); + pedShiftColl=(*pedShiftHdl); + } -void CaloCellPedestalCorr::MakeCorrection (CaloCell* theCell, - const EventContext& /*ctx*/) const -{ + const CaloBCIDAverage* bcidavgshift=nullptr; + if (!(m_caloBCIDAvg.key().empty())) { + SG::ReadHandle<CaloBCIDAverage> bcidavgshiftHdl(m_caloBCIDAvg,ctx); + bcidavgshift=&(*bcidavgshiftHdl); + } - float pedestal=0.; + std::pair<unsigned,const CaloCondBlobFlt*> blobCache{999999,nullptr}; + + for (CaloCell* theCell : *theCellContainer) { + float pedestal=0; + if (!m_isMC) { + const unsigned int cellHash=theCell->caloDDE()->calo_hash(); + unsigned int subHash; + const unsigned int iCool = m_caloCoolIdTool->getCoolChannelId(cellHash,subHash); + if (iCool!=blobCache.first) { + const coral::AttributeList& attrList=pedShiftColl->attributeList(iCool); + const coral::Blob& blob = attrList["CaloCondBlob16M"].data<coral::Blob>(); + //std::unique_ptr<const CaloCondBlobFlt> flt(CaloCondBlobFlt::getInstance(blob)); + blobCache.first=iCool; + delete blobCache.second; + blobCache.second=CaloCondBlobFlt::getInstance(blob); + } + + const unsigned int dbGain = CaloCondUtils::getDbCaloGain(theCell->gain()); + pedestal = blobCache.second->getCalib(subHash, dbGain, lumi); + } - if (!m_isMC) { - const unsigned int cellHash=theCell->caloDDE()->calo_hash(); - unsigned int subHash; - const unsigned int iCool = m_caloCoolIdTool->getCoolChannelId(cellHash,subHash); - //std::cout << "Got iCool=" << iCool << " subhash=" << subHash << std::endl; - NoiseBlobMap_t::const_iterator it = m_noiseBlobMap.find (iCool); - //The following checks would make sense but were omitted to speed up execution: - //1. it!=m_noiseBlobMap.end() eg, if iCool exists - //2. subHash < flt->getNChans() - const CaloCondBlobFlt* const flt = it->second; - const unsigned int dbGain = CaloCondUtils::getDbCaloGain(theCell->gain()); - pedestal = flt->getCalib(subHash, dbGain, m_lumi0); - } + if (bcidavgshift) { + pedestal = pedestal + bcidavgshift->average(theCell->ID()); + } - if (!m_caloLumiBCIDTool.empty() ) { - pedestal = pedestal + m_caloLumiBCIDTool->average(theCell,0); - } + theCell->addEnergy(-pedestal); + }//end loop over cell-container - theCell->addEnergy(-pedestal); + return StatusCode::SUCCESS; } diff --git a/Calorimeter/CaloCellCorrection/src/CaloCellPedestalCorr.h b/Calorimeter/CaloCellCorrection/src/CaloCellPedestalCorr.h index bc022c07ddd981337120559cbdd033349acb9b7e..f36b1e87559ebf50972b40619423d276b20224ee 100644 --- a/Calorimeter/CaloCellCorrection/src/CaloCellPedestalCorr.h +++ b/Calorimeter/CaloCellCorrection/src/CaloCellPedestalCorr.h @@ -1,25 +1,25 @@ +//Dear emacs, this is -*-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 */ #ifndef CALOCELLCORRECTION_CALOCELLPEDESTALCORR_H #define CALOCELLCORRECTION_CALOCELLPEDESTALCORR_H -#include "CaloUtils/CaloCellCorrection.h" -#include "CaloIdentifier/CaloGain.h" -#include "AthenaKernel/IOVSvcDefs.h" -#include "StoreGate/DataHandle.h" +#include "CaloInterface/ICaloCellMakerTool.h" +#include "AthenaBaseComps/AthAlgTool.h" +#include "GaudiKernel/ToolHandle.h" #include "CaloCondBlobObjs/ICaloCoolIdTool.h" -#include "CaloInterface/ICaloLumiBCIDTool.h" #include "AthenaPoolUtilities/CondAttrListCollection.h" -#include "GaudiKernel/ToolHandle.h" -#include <unordered_map> +#include "StoreGate/ReadHandle.h" +#include "CaloEvent/CaloBCIDAverage.h" class CaloCondBlobFlt; class CaloCell; class CaloCell_ID; -class CaloCellPedestalCorr : public CaloCellCorrection +class CaloCellPedestalCorr : public AthAlgTool, + virtual public ICaloCellMakerTool { @@ -33,29 +33,25 @@ public: virtual StatusCode initialize() override; - void MakeCorrection (CaloCell* theCell, - const EventContext& ctx) const override; + StatusCode process( CaloCellContainer * theCellContainer) override; -private: - //=== callback function for luminosity storate - virtual StatusCode updateLumi(IOVSVC_CALLBACK_ARGS); + StatusCode process( CaloCellContainer * theCellContainer, + const EventContext& ctx) const; //override; + +private: + // const DataHandle<CondAttrListCollection> m_noiseAttrListColl; - virtual StatusCode updateMap(IOVSVC_CALLBACK_ARGS); - //=== blob storage - const DataHandle<CondAttrListCollection> m_noiseAttrListColl; - typedef std::unordered_map<unsigned int, const CaloCondBlobFlt*> NoiseBlobMap_t; - NoiseBlobMap_t m_noiseBlobMap; ToolHandle<ICaloCoolIdTool> m_caloCoolIdTool; float m_lumi0; - std::string m_folderName; - std::string m_lumiFolderName; - + + SG::ReadCondHandleKey<CondAttrListCollection> m_pedShiftFolder{this,"PedestalShiftFolder","/CALO/Pedestal/CellPedestal","SG Key of Attr list containing pedestal shifts"}; + SG::ReadCondHandleKey<CondAttrListCollection> m_lumiFolderName{this,"LumiFolderName","/TRIGGER/LUMI/LBLESTONL","SG Key of Attr list for Luminosity estimate"}; const CaloCell_ID* m_cellId; - ToolHandle<ICaloLumiBCIDTool> m_caloLumiBCIDTool; - + SG::ReadHandleKey<CaloBCIDAverage> m_caloBCIDAvg{this,"CaloBCIDAverageKey","","SG Key of CaloBCIDAverage object"}; + bool m_isMC; }; diff --git a/Calorimeter/CaloEvent/CMakeLists.txt b/Calorimeter/CaloEvent/CMakeLists.txt index f746fe7a8346f70286fe4c129296fc2a0c820f96..8e0fb585bfd8bb0e3a7842828486950cded785fa 100644 --- a/Calorimeter/CaloEvent/CMakeLists.txt +++ b/Calorimeter/CaloEvent/CMakeLists.txt @@ -16,7 +16,7 @@ atlas_depends_on_subdirs( Control/AthAllocators Control/AthContainers Control/AthLinks - Control/CLIDSvc + Control/AthenaKernel Control/CxxUtils Control/Navigation DetectorDescription/GeoPrimitives @@ -24,10 +24,9 @@ atlas_depends_on_subdirs( Event/EventKernel Event/FourMom Event/NavFourMom + LArCalorimeter/LArRawConditions #not ideal .. LAr should depend on Calo. PRIVATE AtlasTest/TestTools - Control/AthenaKernel - Control/SGTools Control/StoreGate DetectorDescription/IdDictParser LArCalorimeter/LArRawConditions @@ -44,8 +43,7 @@ atlas_add_library( CaloEvent CaloEvent/*.h CaloEvent/*.icc src/*.cxx LINK_LIBRARIES CaloConditions CaloGeoHelpers CaloIdentifier AthAllocators AthContainers AthLinks CxxUtils Navigation GeoPrimitives Identifier EventKernel FourMom NavFourMom CaloDetDescrLib - PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} ${CLHEP_LIBRARIES} AthenaKernel - SGTools ) + PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} ${CLHEP_LIBRARIES} AthenaKernel ) atlas_add_dictionary( CaloEventDict CaloEvent/CaloEventDict.h CaloEvent/selection.xml diff --git a/Calorimeter/CaloEvent/CaloEvent/CaloBCIDAverage.h b/Calorimeter/CaloEvent/CaloEvent/CaloBCIDAverage.h index f50f74f5a70282f01fc012c490a8f401249a3489..2bb8e71924511e774f1fa7fab2f558331465e3d0 100644 --- a/Calorimeter/CaloEvent/CaloEvent/CaloBCIDAverage.h +++ b/Calorimeter/CaloEvent/CaloEvent/CaloBCIDAverage.h @@ -15,9 +15,12 @@ class CaloBCIDAverage { float average(const Identifier id) const { const HWIdentifier hwid=m_mcSym->ZPhiSymOfl(id); + if (!hwid.is_valid()) return 0; //Catches the tile-case const unsigned id32=hwid.get_identifier32().get_compact(); const auto it=m_avg.find(id32); - if (it==m_avg.end()) std::abort(); + if (it==m_avg.end()) { + std::abort(); + } return it->second; } @@ -28,7 +31,7 @@ class CaloBCIDAverage { }; -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" CLASS_DEF(CaloBCIDAverage, 141052237, 1) diff --git a/Calorimeter/CaloEvent/CaloEvent/CaloCell2ClusterMap.h b/Calorimeter/CaloEvent/CaloEvent/CaloCell2ClusterMap.h index 351cd38da5248d8090c4c5d7adda476c55c04f87..3d2fbaf86461dcfbc5590149c96e63eca4dca8b8 100644 --- a/Calorimeter/CaloEvent/CaloEvent/CaloCell2ClusterMap.h +++ b/Calorimeter/CaloEvent/CaloEvent/CaloCell2ClusterMap.h @@ -19,10 +19,9 @@ */ #include "AthContainers/DataVector.h" -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "Navigation/Navigable.h" #include "CaloEvent/CaloClusterContainer.h" -#include "CLIDSvc/CLASS_DEF.h" class CaloCell2ClusterMap : public DataVector< Navigable<CaloClusterContainer> > { diff --git a/Calorimeter/CaloEvent/CaloEvent/CaloCellContainer.h b/Calorimeter/CaloEvent/CaloEvent/CaloCellContainer.h index 68004e94934d31b313fb503171612f24900d2a34..e8152d8f962b8c4e09872d40e3ae35d3299e7bce 100644 --- a/Calorimeter/CaloEvent/CaloEvent/CaloCellContainer.h +++ b/Calorimeter/CaloEvent/CaloEvent/CaloCellContainer.h @@ -41,7 +41,7 @@ MODIFIED: David Rousseau: heavy modification to allow storing all ********************************************************************/ #include "AthContainers/DataVector.h" -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "CaloEvent/CaloCell.h" #include "CaloIdentifier/CaloCell_ID.h" diff --git a/Calorimeter/CaloEvent/CaloEvent/CaloCellContainerVector.h b/Calorimeter/CaloEvent/CaloEvent/CaloCellContainerVector.h index e783f47cc2fdf21519bfd0f65f2a427480f524bb..568ad10bb64f7a7a2b08eca518df1c9571db176f 100644 --- a/Calorimeter/CaloEvent/CaloEvent/CaloCellContainerVector.h +++ b/Calorimeter/CaloEvent/CaloEvent/CaloCellContainerVector.h @@ -28,7 +28,7 @@ PURPOSE: Vector Container for CaloCell ********************************************************************/ #include "AthContainers/DataVector.h" -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "CaloEvent/CaloCellContainer.h" diff --git a/Calorimeter/CaloEvent/CaloEvent/CaloCellLinkContainer.h b/Calorimeter/CaloEvent/CaloEvent/CaloCellLinkContainer.h index 24bef34182c913276cb5e7248b8e5ba3ac4a4a50..37273830f563227927e28a4f88e52c6a6eee74c6 100644 --- a/Calorimeter/CaloEvent/CaloEvent/CaloCellLinkContainer.h +++ b/Calorimeter/CaloEvent/CaloEvent/CaloCellLinkContainer.h @@ -16,7 +16,7 @@ -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "AthContainers/DataVector.h" diff --git a/Calorimeter/CaloEvent/CaloEvent/CaloClusterCellLinkContainer.h b/Calorimeter/CaloEvent/CaloEvent/CaloClusterCellLinkContainer.h index 5f3e984afe9061d4d0e293a44005f86118df3304..6220511c09b8626dce7818d1ceae0ce7fe161a6a 100644 --- a/Calorimeter/CaloEvent/CaloEvent/CaloClusterCellLinkContainer.h +++ b/Calorimeter/CaloEvent/CaloEvent/CaloClusterCellLinkContainer.h @@ -16,7 +16,7 @@ -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "AthContainers/DataVector.h" #include "CaloEvent/CaloClusterCellLink.h" diff --git a/Calorimeter/CaloEvent/CaloEvent/CaloClusterContainer.h b/Calorimeter/CaloEvent/CaloEvent/CaloClusterContainer.h index 85130c2e5164724e972674d4cb1e1bada2e9ce92..7d6b74a7adc8bde07db7b82e15578095be6dd006 100644 --- a/Calorimeter/CaloEvent/CaloEvent/CaloClusterContainer.h +++ b/Calorimeter/CaloEvent/CaloEvent/CaloClusterContainer.h @@ -23,7 +23,7 @@ PURPOSE: Container for CaloCluster objects // INCLUDE HEADER FILES: #include "AthContainers/DataVector.h" -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "CaloEvent/CaloTowerSeg.h" #include "CaloEvent/CaloCluster.h" diff --git a/Calorimeter/CaloEvent/CaloEvent/CaloCompactCell.h b/Calorimeter/CaloEvent/CaloEvent/CaloCompactCell.h index 0ea3cff15bdf720a0d379906edec7930123d5f80..e9e03dce61c07357388f52ef9f96016fa50cd56d 100644 --- a/Calorimeter/CaloEvent/CaloEvent/CaloCompactCell.h +++ b/Calorimeter/CaloEvent/CaloEvent/CaloCompactCell.h @@ -18,7 +18,7 @@ * multiples of 16bit @c shorts. */ -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include <vector> class CaloCompactCell diff --git a/Calorimeter/CaloEvent/CaloEvent/CaloCompactCellContainer.h b/Calorimeter/CaloEvent/CaloEvent/CaloCompactCellContainer.h index 7ae413695db2c586fd65ce16c280e3daceeba198..5a24503299a5570e4872c26c9951b7ac3ef461e4 100644 --- a/Calorimeter/CaloEvent/CaloEvent/CaloCompactCellContainer.h +++ b/Calorimeter/CaloEvent/CaloEvent/CaloCompactCellContainer.h @@ -23,7 +23,7 @@ * are produced by the @c CaloCompactCellTool in @c CaloTools. */ -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "CaloEvent/CaloCompactCell.h" #include <vector> diff --git a/Calorimeter/CaloEvent/CaloEvent/CaloShowerContainer.h b/Calorimeter/CaloEvent/CaloEvent/CaloShowerContainer.h index 3f51d288f16cac72da84b03ca15c77cc0d08e0fa..11d7542f53ed5799c6be143ea0b7b466970c0cd6 100644 --- a/Calorimeter/CaloEvent/CaloEvent/CaloShowerContainer.h +++ b/Calorimeter/CaloEvent/CaloEvent/CaloShowerContainer.h @@ -5,7 +5,7 @@ #ifndef CALOEVENT_CALOSHOWERCONTAINER_H #define CALOEVENT_CALOSHOWERCONTAINER_H -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "AthContainers/DataVector.h" diff --git a/Calorimeter/CaloEvent/CaloEvent/CaloTopoTowerContainer.h b/Calorimeter/CaloEvent/CaloEvent/CaloTopoTowerContainer.h index f838a0e755dc7197441bf4bf5e1f834c67440043..10f3e753f7c9a1511a1372f8768cf8632ce7e302 100644 --- a/Calorimeter/CaloEvent/CaloEvent/CaloTopoTowerContainer.h +++ b/Calorimeter/CaloEvent/CaloEvent/CaloTopoTowerContainer.h @@ -29,7 +29,7 @@ UPDATE: March 15, 2010 ********************************************************************/ // INCLUDE HEADER FILES: -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "CaloIdentifier/CaloCell_ID.h" diff --git a/Calorimeter/CaloEvent/CaloEvent/CaloTowerContainer.h b/Calorimeter/CaloEvent/CaloEvent/CaloTowerContainer.h index 51aea65a4ae45ab8fa5cc208466828c87ff96edc..4cf42d20e0b47ee31067a7f95e7c289e5f40d020 100644 --- a/Calorimeter/CaloEvent/CaloEvent/CaloTowerContainer.h +++ b/Calorimeter/CaloEvent/CaloEvent/CaloTowerContainer.h @@ -59,7 +59,7 @@ UPDATE: MAY-11-01 // INCLUDE HEADER FILES: #include "AthContainers/DataVector.h" -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "CaloIdentifier/CaloCell_ID.h" diff --git a/Calorimeter/CaloEvent/src/CaloCell.cxx b/Calorimeter/CaloEvent/src/CaloCell.cxx index dd5896d226ca7c14819060ae05ad6a9dafcd369f..df9d9412e64f6a59c99a9aabbf8f60b9bf7e31eb 100644 --- a/Calorimeter/CaloEvent/src/CaloCell.cxx +++ b/Calorimeter/CaloEvent/src/CaloCell.cxx @@ -7,7 +7,7 @@ #include "CLHEP/Geometry/Vector3D.h" #include "CLHEP/Geometry/Point3D.h" #include "CaloDetDescr/CaloDetDescrElement.h" -#include "SGTools/BaseInfo.h" +#include "AthenaKernel/BaseInfo.h" #include <cmath> CaloCell::~CaloCell() diff --git a/Calorimeter/CaloIdentifier/CMakeLists.txt b/Calorimeter/CaloIdentifier/CMakeLists.txt index 1627df779dfbd3ba6025d22682379795c848f535..21a2db78159c46c5938b6e4304e59c3697a29a28 100644 --- a/Calorimeter/CaloIdentifier/CMakeLists.txt +++ b/Calorimeter/CaloIdentifier/CMakeLists.txt @@ -8,8 +8,7 @@ atlas_subdir( CaloIdentifier ) # Declare the package's dependencies: atlas_depends_on_subdirs( PUBLIC Calorimeter/CaloGeoHelpers - Control/CLIDSvc - Control/SGTools + Control/AthenaKernel DetectorDescription/AtlasDetDescr DetectorDescription/IdDict DetectorDescription/Identifier @@ -31,131 +30,131 @@ atlas_add_library( CaloIdentifier PUBLIC_HEADERS CaloIdentifier INCLUDE_DIRS ${Boost_INCLUDE_DIRS} PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${Boost_LIBRARIES} CaloGeoHelpers SGTools AtlasDetDescr IdDict Identifier GaudiKernel StoreGateLib SGtests + LINK_LIBRARIES ${Boost_LIBRARIES} CaloGeoHelpers AthenaKernel AtlasDetDescr IdDict Identifier GaudiKernel StoreGateLib SGtests PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} TestTools CxxUtils IdDictParser PathResolver ) atlas_add_dictionary( CaloIdentifierDict CaloIdentifier/CaloIdentifierDict.h CaloIdentifier/selection.xml INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} CaloGeoHelpers SGTools AtlasDetDescr IdDict Identifier GaudiKernel TestTools CxxUtils StoreGateLib SGtests IdDictParser PathResolver CaloIdentifier ) + LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} CaloGeoHelpers AthenaKernel AtlasDetDescr IdDict Identifier GaudiKernel TestTools CxxUtils StoreGateLib SGtests IdDictParser PathResolver CaloIdentifier ) atlas_add_executable( test_lar_id test/test_lar_id.cxx INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} CaloGeoHelpers SGTools AtlasDetDescr IdDict Identifier GaudiKernel TestTools CxxUtils StoreGateLib SGtests IdDictParser PathResolver CaloIdentifier ) + LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} CaloGeoHelpers AthenaKernel AtlasDetDescr IdDict Identifier GaudiKernel TestTools CxxUtils StoreGateLib SGtests IdDictParser PathResolver CaloIdentifier ) atlas_add_executable( test_calo_dm_id test/test_calo_dm_id.cxx INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} CaloGeoHelpers SGTools AtlasDetDescr IdDict Identifier GaudiKernel TestTools CxxUtils StoreGateLib SGtests IdDictParser PathResolver CaloIdentifier ) + LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} CaloGeoHelpers AthenaKernel AtlasDetDescr IdDict Identifier GaudiKernel TestTools CxxUtils StoreGateLib SGtests IdDictParser PathResolver CaloIdentifier ) atlas_add_executable( test_cell_id test/test_cell_id.cxx INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} CaloGeoHelpers SGTools AtlasDetDescr IdDict Identifier GaudiKernel TestTools CxxUtils StoreGateLib SGtests IdDictParser PathResolver CaloIdentifier ) + LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} CaloGeoHelpers AthenaKernel AtlasDetDescr IdDict Identifier GaudiKernel TestTools CxxUtils StoreGateLib SGtests IdDictParser PathResolver CaloIdentifier ) atlas_add_executable( test_lvl1_id test/test_lvl1_id.cxx INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} CaloGeoHelpers SGTools AtlasDetDescr IdDict Identifier GaudiKernel TestTools CxxUtils StoreGateLib SGtests IdDictParser PathResolver CaloIdentifier ) + LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} CaloGeoHelpers AthenaKernel AtlasDetDescr IdDict Identifier GaudiKernel TestTools CxxUtils StoreGateLib SGtests IdDictParser PathResolver CaloIdentifier ) #atlas_add_test( GTower_ID_test # SOURCES # test/GTower_ID_test.cxx # INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} -# LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} CaloGeoHelpers SGTools AtlasDetDescr IdDict Identifier GaudiKernel TestTools CxxUtils StoreGateLib SGtests IdDictParser PathResolver CaloIdentifier +# LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} CaloGeoHelpers AthenaKernel AtlasDetDescr IdDict Identifier GaudiKernel TestTools CxxUtils StoreGateLib SGtests IdDictParser PathResolver CaloIdentifier # EXTRA_PATTERNS "mask/zero|Reading file|^AtlasDetectorID(Helper)?::" ) #atlas_add_test( JTower_ID_test # SOURCES # test/JTower_ID_test.cxx # INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} -# LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} CaloGeoHelpers SGTools AtlasDetDescr IdDict Identifier GaudiKernel TestTools CxxUtils StoreGateLib SGtests IdDictParser PathResolver CaloIdentifier +# LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} CaloGeoHelpers AthenaKernel AtlasDetDescr IdDict Identifier GaudiKernel TestTools CxxUtils StoreGateLib SGtests IdDictParser PathResolver CaloIdentifier # EXTRA_PATTERNS "mask/zero|Reading file|^AtlasDetectorID(Helper)?::" ) atlas_add_test( LArEM_ID_test SOURCES test/LArEM_ID_test.cxx INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} CaloGeoHelpers SGTools AtlasDetDescr IdDict Identifier GaudiKernel TestTools CxxUtils StoreGateLib SGtests IdDictParser PathResolver CaloIdentifier + LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} CaloGeoHelpers AthenaKernel AtlasDetDescr IdDict Identifier GaudiKernel TestTools CxxUtils StoreGateLib SGtests IdDictParser PathResolver CaloIdentifier EXTRA_PATTERNS "mask/zero|Reading file|^AtlasDetectorID(Helper)?::" ) atlas_add_test( LArEM_SuperCell_ID_test SOURCES test/LArEM_SuperCell_ID_test.cxx INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} CaloGeoHelpers SGTools AtlasDetDescr IdDict Identifier GaudiKernel TestTools CxxUtils StoreGateLib SGtests IdDictParser PathResolver CaloIdentifier + LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} CaloGeoHelpers AthenaKernel AtlasDetDescr IdDict Identifier GaudiKernel TestTools CxxUtils StoreGateLib SGtests IdDictParser PathResolver CaloIdentifier EXTRA_PATTERNS "mask/zero|Reading file|^AtlasDetectorID(Helper)?::" ) atlas_add_test( LArHEC_ID_test SOURCES test/LArHEC_ID_test.cxx INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} CaloGeoHelpers SGTools AtlasDetDescr IdDict Identifier GaudiKernel TestTools CxxUtils StoreGateLib SGtests IdDictParser PathResolver CaloIdentifier + LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} CaloGeoHelpers AthenaKernel AtlasDetDescr IdDict Identifier GaudiKernel TestTools CxxUtils StoreGateLib SGtests IdDictParser PathResolver CaloIdentifier EXTRA_PATTERNS "mask/zero|Reading file|^AtlasDetectorID(Helper)?::" ) atlas_add_test( LArHEC_SuperCell_ID_test SOURCES test/LArHEC_SuperCell_ID_test.cxx INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} CaloGeoHelpers SGTools AtlasDetDescr IdDict Identifier GaudiKernel TestTools CxxUtils StoreGateLib SGtests IdDictParser PathResolver CaloIdentifier + LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} CaloGeoHelpers AthenaKernel AtlasDetDescr IdDict Identifier GaudiKernel TestTools CxxUtils StoreGateLib SGtests IdDictParser PathResolver CaloIdentifier EXTRA_PATTERNS "mask/zero|Reading file|^AtlasDetectorID(Helper)?::" ) atlas_add_test( LArFCAL_ID_test SOURCES test/LArFCAL_ID_test.cxx INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} CaloGeoHelpers SGTools AtlasDetDescr IdDict Identifier GaudiKernel TestTools CxxUtils StoreGateLib SGtests IdDictParser PathResolver CaloIdentifier + LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} CaloGeoHelpers AthenaKernel AtlasDetDescr IdDict Identifier GaudiKernel TestTools CxxUtils StoreGateLib SGtests IdDictParser PathResolver CaloIdentifier EXTRA_PATTERNS "mask/zero|Reading file|^AtlasDetectorID(Helper)?::" ) atlas_add_test( LArFCAL_SuperCell_ID_test SOURCES test/LArFCAL_SuperCell_ID_test.cxx INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} CaloGeoHelpers SGTools AtlasDetDescr IdDict Identifier GaudiKernel TestTools CxxUtils StoreGateLib SGtests IdDictParser PathResolver CaloIdentifier + LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} CaloGeoHelpers AthenaKernel AtlasDetDescr IdDict Identifier GaudiKernel TestTools CxxUtils StoreGateLib SGtests IdDictParser PathResolver CaloIdentifier EXTRA_PATTERNS "mask/zero|Reading file|^AtlasDetectorID(Helper)?::" ) atlas_add_test( LArMiniFCAL_ID_test SOURCES test/LArMiniFCAL_ID_test.cxx INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} CaloGeoHelpers SGTools AtlasDetDescr IdDict Identifier GaudiKernel TestTools CxxUtils StoreGateLib SGtests IdDictParser PathResolver CaloIdentifier + LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} CaloGeoHelpers AthenaKernel AtlasDetDescr IdDict Identifier GaudiKernel TestTools CxxUtils StoreGateLib SGtests IdDictParser PathResolver CaloIdentifier EXTRA_PATTERNS "mask/zero|Reading file|^AtlasDetectorID(Helper)?::" ) atlas_add_test( TileID_test SOURCES test/TileID_test.cxx INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} CaloGeoHelpers SGTools AtlasDetDescr IdDict Identifier GaudiKernel TestTools CxxUtils StoreGateLib SGtests IdDictParser PathResolver CaloIdentifier + LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} CaloGeoHelpers AthenaKernel AtlasDetDescr IdDict Identifier GaudiKernel TestTools CxxUtils StoreGateLib SGtests IdDictParser PathResolver CaloIdentifier EXTRA_PATTERNS "mask/zero|Reading file|^AtlasDetectorID(Helper)?::" ) atlas_add_test( Tile_SuperCell_ID_test SOURCES test/Tile_SuperCell_ID_test.cxx INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} CaloGeoHelpers SGTools AtlasDetDescr IdDict Identifier GaudiKernel TestTools CxxUtils StoreGateLib SGtests IdDictParser PathResolver CaloIdentifier + LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} CaloGeoHelpers AthenaKernel AtlasDetDescr IdDict Identifier GaudiKernel TestTools CxxUtils StoreGateLib SGtests IdDictParser PathResolver CaloIdentifier EXTRA_PATTERNS "mask/zero|Reading file|^AtlasDetectorID(Helper)?::" ) atlas_add_test( CaloCell_ID_test SOURCES test/CaloCell_ID_test.cxx INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} CaloGeoHelpers SGTools AtlasDetDescr IdDict Identifier GaudiKernel TestTools CxxUtils StoreGateLib SGtests IdDictParser PathResolver CaloIdentifier + LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} CaloGeoHelpers AthenaKernel AtlasDetDescr IdDict Identifier GaudiKernel TestTools CxxUtils StoreGateLib SGtests IdDictParser PathResolver CaloIdentifier EXTRA_PATTERNS "mask/zero|Reading file|^AtlasDetectorID(Helper)?::" ) atlas_add_test( CaloCell_SuperCell_ID_test SOURCES test/CaloCell_SuperCell_ID_test.cxx INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} CaloGeoHelpers SGTools AtlasDetDescr IdDict Identifier GaudiKernel TestTools CxxUtils StoreGateLib SGtests IdDictParser PathResolver CaloIdentifier + LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} CaloGeoHelpers AthenaKernel AtlasDetDescr IdDict Identifier GaudiKernel TestTools CxxUtils StoreGateLib SGtests IdDictParser PathResolver CaloIdentifier EXTRA_PATTERNS "mask/zero|Reading file|^AtlasDetectorID(Helper)?::" ) atlas_add_test( CaloIDHelper_test SOURCES test/CaloIDHelper_test.cxx INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} CaloGeoHelpers SGTools AtlasDetDescr IdDict Identifier GaudiKernel TestTools CxxUtils StoreGateLib SGtests IdDictParser PathResolver CaloIdentifier + LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} CaloGeoHelpers AthenaKernel AtlasDetDescr IdDict Identifier GaudiKernel TestTools CxxUtils StoreGateLib SGtests IdDictParser PathResolver CaloIdentifier EXTRA_PATTERNS "mask/zero|Reading file|^AtlasDetectorID(Helper)?::" ) atlas_add_test( CaloHelpersTest_test diff --git a/Calorimeter/CaloIdentifier/CaloIdentifier/CaloCell_ID.h b/Calorimeter/CaloIdentifier/CaloIdentifier/CaloCell_ID.h index 16060f464b18facb4309071de67b08a70ae10b61..951e99855286e63dc6e6d0843dc7af6a0e7a8692 100755 --- a/Calorimeter/CaloIdentifier/CaloIdentifier/CaloCell_ID.h +++ b/Calorimeter/CaloIdentifier/CaloIdentifier/CaloCell_ID.h @@ -5,13 +5,13 @@ #ifndef CALOCELL_ID_H #define CALOCELL_ID_H -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "AtlasDetDescr/AtlasDetectorID.h" #include "Identifier/IdentifierHash.h" #include "CaloIdentifier/CaloID.h" #include "CaloIdentifier/CaloCell_Base_ID.h" -#include "SGTools/BaseInfo.h" +#include "AthenaKernel/BaseInfo.h" #include <vector> #include <iostream> diff --git a/Calorimeter/CaloIdentifier/CaloIdentifier/CaloCell_SuperCell_ID.h b/Calorimeter/CaloIdentifier/CaloIdentifier/CaloCell_SuperCell_ID.h index c4dcb4352b0189a85b72906db2bc1d43f6f90037..b68c76990d2c22f9651e862007fea5c857d0d84d 100644 --- a/Calorimeter/CaloIdentifier/CaloIdentifier/CaloCell_SuperCell_ID.h +++ b/Calorimeter/CaloIdentifier/CaloIdentifier/CaloCell_SuperCell_ID.h @@ -17,14 +17,14 @@ #define CALOIDENTIFIER_CALOCELL_SUPERCELL_ID_H -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "AtlasDetDescr/AtlasDetectorID.h" #include "Identifier/IdentifierHash.h" #include "CaloIdentifier/CaloID.h" #include "CaloIdentifier/CaloCell_Base_ID.h" #include "CaloIdentifier/LArNeighbours.h" -#include "SGTools/BaseInfo.h" +#include "AthenaKernel/BaseInfo.h" #include <vector> #include <iostream> diff --git a/Calorimeter/CaloIdentifier/CaloIdentifier/CaloDM_ID.h b/Calorimeter/CaloIdentifier/CaloIdentifier/CaloDM_ID.h index e5a835a0cf9950f724f4cd8933cd45e6f098303a..10518512911c4c80afa82dde2e904f8fc789445c 100755 --- a/Calorimeter/CaloIdentifier/CaloIdentifier/CaloDM_ID.h +++ b/Calorimeter/CaloIdentifier/CaloIdentifier/CaloDM_ID.h @@ -5,7 +5,7 @@ #ifndef CALODM_ID_H #define CALODM_ID_H -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "AtlasDetDescr/AtlasDetectorID.h" #include "Identifier/IdentifierHash.h" #include "Identifier/Range.h" diff --git a/Calorimeter/CaloIdentifier/CaloIdentifier/CaloIdManager.h b/Calorimeter/CaloIdentifier/CaloIdentifier/CaloIdManager.h index b21c35607b75af4e876f53723660600a3f60c8f1..3e62ccb8cfc41267e724878c439e9ed3ee8e8ad0 100755 --- a/Calorimeter/CaloIdentifier/CaloIdentifier/CaloIdManager.h +++ b/Calorimeter/CaloIdentifier/CaloIdentifier/CaloIdManager.h @@ -13,7 +13,7 @@ #ifndef CALOID_CALOIDMANAGER_H # define CALOID_CALOIDMANAGER_H -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" class CaloCell_ID; class CaloCell_SuperCell_ID; diff --git a/Calorimeter/CaloIdentifier/CaloIdentifier/CaloLVL1_ID.h b/Calorimeter/CaloIdentifier/CaloIdentifier/CaloLVL1_ID.h index a8eb1e3633ff7bc17cdc6c76db4548796d9c2100..13e6c8a57aa3c3a21a12f199bb46c763bb967058 100755 --- a/Calorimeter/CaloIdentifier/CaloIdentifier/CaloLVL1_ID.h +++ b/Calorimeter/CaloIdentifier/CaloIdentifier/CaloLVL1_ID.h @@ -5,7 +5,7 @@ #ifndef CALOLVL1_ID_H #define CALOLVL1_ID_H -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "AtlasDetDescr/AtlasDetectorID.h" #include "Identifier/IdentifierHash.h" #include "Identifier/Range.h" diff --git a/Calorimeter/CaloIdentifier/CaloIdentifier/GTower_ID.h b/Calorimeter/CaloIdentifier/CaloIdentifier/GTower_ID.h index 6c82891d6512c63eee8c5e189f96f27757cd98c3..9e463715a3120f87c806943c4d67594ea36dafc5 100644 --- a/Calorimeter/CaloIdentifier/CaloIdentifier/GTower_ID.h +++ b/Calorimeter/CaloIdentifier/CaloIdentifier/GTower_ID.h @@ -5,14 +5,14 @@ #ifndef GTOWER_ID_H #define GTOWER_ID_H -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "AtlasDetDescr/AtlasDetectorID.h" #include "Identifier/IdentifierHash.h" #include "IdDict/IdDictFieldImplementation.h" #include "IdDict/IdDictDefs.h" #include "CaloIdentifier/JGTowerBase_ID.h" -#include "SGTools/BaseInfo.h" +#include "AthenaKernel/BaseInfo.h" #include <vector> #include <algorithm> diff --git a/Calorimeter/CaloIdentifier/CaloIdentifier/JGTowerBase_ID.h b/Calorimeter/CaloIdentifier/CaloIdentifier/JGTowerBase_ID.h index 12df3a5d80897d15123d5409ee3b1c5eede87db4..17a5a8c6c160266c685fbf76c3119563e6da43fb 100644 --- a/Calorimeter/CaloIdentifier/CaloIdentifier/JGTowerBase_ID.h +++ b/Calorimeter/CaloIdentifier/CaloIdentifier/JGTowerBase_ID.h @@ -14,7 +14,7 @@ #ifndef JGTOWERBASE_ID_H #define JGTOWERBASE_ID_H -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "AtlasDetDescr/AtlasDetectorID.h" #include "Identifier/IdentifierHash.h" #include "Identifier/Range.h" diff --git a/Calorimeter/CaloIdentifier/CaloIdentifier/JTower_ID.h b/Calorimeter/CaloIdentifier/CaloIdentifier/JTower_ID.h index 6aa9057705c044ccafbd242fdeab50161b83da84..88069f8a8da446f78ebc56190dbac56e6c4def42 100644 --- a/Calorimeter/CaloIdentifier/CaloIdentifier/JTower_ID.h +++ b/Calorimeter/CaloIdentifier/CaloIdentifier/JTower_ID.h @@ -5,14 +5,14 @@ #ifndef JTOWER_ID_H #define JTOWER_ID_H -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "AtlasDetDescr/AtlasDetectorID.h" #include "Identifier/IdentifierHash.h" #include "IdDict/IdDictFieldImplementation.h" #include "IdDict/IdDictDefs.h" #include "CaloIdentifier/JGTowerBase_ID.h" -#include "SGTools/BaseInfo.h" +#include "AthenaKernel/BaseInfo.h" #include <vector> #include <algorithm> diff --git a/Calorimeter/CaloIdentifier/CaloIdentifier/LArEM_ID.h b/Calorimeter/CaloIdentifier/CaloIdentifier/LArEM_ID.h index 032cfbcb76380d623502ccbf477aa5cf9b9c1ca0..5c74216f2c9958cb34bc875e4965d3c0b2f5dde6 100755 --- a/Calorimeter/CaloIdentifier/CaloIdentifier/LArEM_ID.h +++ b/Calorimeter/CaloIdentifier/CaloIdentifier/LArEM_ID.h @@ -5,7 +5,7 @@ #ifndef LAREM_ID_H #define LAREM_ID_H -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "AtlasDetDescr/AtlasDetectorID.h" #include "Identifier/IdentifierHash.h" #include "IdDict/IdDictFieldImplementation.h" @@ -13,7 +13,7 @@ #include "CaloIdentifier/LArID_Exception.h" #include "CaloIdentifier/LArEM_Base_ID.h" -#include "SGTools/BaseInfo.h" +#include "AthenaKernel/BaseInfo.h" #include <vector> #include <algorithm> diff --git a/Calorimeter/CaloIdentifier/CaloIdentifier/LArEM_SuperCell_ID.h b/Calorimeter/CaloIdentifier/CaloIdentifier/LArEM_SuperCell_ID.h index 57fe32d783edefcc5a0abf4cb724a94b7ea81f00..6adbcbc9722f6e57057fa244fc8dd327367fdefb 100755 --- a/Calorimeter/CaloIdentifier/CaloIdentifier/LArEM_SuperCell_ID.h +++ b/Calorimeter/CaloIdentifier/CaloIdentifier/LArEM_SuperCell_ID.h @@ -16,9 +16,9 @@ #ifndef CALOIDENTIFIER_LAREM_SUPERCELL_ID_H #define CALOIDENTIFIER_LAREM_SUPERCELL_ID_H -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "CaloIdentifier/LArEM_Base_ID.h" -#include "SGTools/BaseInfo.h" +#include "AthenaKernel/BaseInfo.h" /** diff --git a/Calorimeter/CaloIdentifier/CaloIdentifier/LArFCAL_ID.h b/Calorimeter/CaloIdentifier/CaloIdentifier/LArFCAL_ID.h index 84e64285c6787c085c57d1fefd60a1e265156ae6..94a9532d641a5ade7dfd5cff033875fdcf8b1957 100755 --- a/Calorimeter/CaloIdentifier/CaloIdentifier/LArFCAL_ID.h +++ b/Calorimeter/CaloIdentifier/CaloIdentifier/LArFCAL_ID.h @@ -5,7 +5,7 @@ #ifndef LARFCAL_ID_H #define LARFCAL_ID_H -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "AtlasDetDescr/AtlasDetectorID.h" #include "Identifier/IdentifierHash.h" #include "IdDict/IdDictFieldImplementation.h" @@ -13,7 +13,7 @@ #include "CaloIdentifier/LArID_Exception.h" #include "CaloIdentifier/LArFCAL_Base_ID.h" -#include "SGTools/BaseInfo.h" +#include "AthenaKernel/BaseInfo.h" #include "boost/range/iterator_range.hpp" #include <vector> diff --git a/Calorimeter/CaloIdentifier/CaloIdentifier/LArFCAL_SuperCell_ID.h b/Calorimeter/CaloIdentifier/CaloIdentifier/LArFCAL_SuperCell_ID.h index 0ab894f5df7e5c308592d493ededcdebdb71d297..779eaee166ee2900c21e04e8a639564068e200b6 100755 --- a/Calorimeter/CaloIdentifier/CaloIdentifier/LArFCAL_SuperCell_ID.h +++ b/Calorimeter/CaloIdentifier/CaloIdentifier/LArFCAL_SuperCell_ID.h @@ -5,9 +5,9 @@ #ifndef CALOIDENTIFIER_LARFCAL_SUPERCELL_ID_H #define CALOIDENTIFIER_LARFCAL_SUPERCELL_ID_H -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "CaloIdentifier/LArFCAL_Base_ID.h" -#include "SGTools/BaseInfo.h" +#include "AthenaKernel/BaseInfo.h" #include <vector> #include <algorithm> diff --git a/Calorimeter/CaloIdentifier/CaloIdentifier/LArHEC_Base_ID.h b/Calorimeter/CaloIdentifier/CaloIdentifier/LArHEC_Base_ID.h index 37ee2db5acf0e9874f5f6b013f5f63fcac9af424..d2b03232e5f5a90471a6f807c63b4bbff96f7b81 100755 --- a/Calorimeter/CaloIdentifier/CaloIdentifier/LArHEC_Base_ID.h +++ b/Calorimeter/CaloIdentifier/CaloIdentifier/LArHEC_Base_ID.h @@ -17,7 +17,7 @@ #define CALOIDENTIFIER_LARHEC_BASE_ID_H -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "AtlasDetDescr/AtlasDetectorID.h" #include "Identifier/IdentifierHash.h" #include "IdDict/IdDictFieldImplementation.h" diff --git a/Calorimeter/CaloIdentifier/CaloIdentifier/LArHEC_ID.h b/Calorimeter/CaloIdentifier/CaloIdentifier/LArHEC_ID.h index b7f80f3dabfab713823a8cb234a2804d5ac93123..53ce898578a971ded7f9eefbc535b137853834ff 100755 --- a/Calorimeter/CaloIdentifier/CaloIdentifier/LArHEC_ID.h +++ b/Calorimeter/CaloIdentifier/CaloIdentifier/LArHEC_ID.h @@ -6,7 +6,7 @@ #define LARHEC_ID_H -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "AtlasDetDescr/AtlasDetectorID.h" #include "Identifier/IdentifierHash.h" #include "IdDict/IdDictFieldImplementation.h" @@ -14,7 +14,7 @@ #include "CaloIdentifier/LArHEC_Base_ID.h" #include "CaloIdentifier/LArID_Exception.h" -#include "SGTools/BaseInfo.h" +#include "AthenaKernel/BaseInfo.h" #include "boost/range/iterator_range.hpp" #include <vector> diff --git a/Calorimeter/CaloIdentifier/CaloIdentifier/LArHEC_SuperCell_ID.h b/Calorimeter/CaloIdentifier/CaloIdentifier/LArHEC_SuperCell_ID.h index c778a2b2cced4565290706c1cd3b03fa160532e8..6c2dc8d50c5da96c007791ba27d688c173359382 100644 --- a/Calorimeter/CaloIdentifier/CaloIdentifier/LArHEC_SuperCell_ID.h +++ b/Calorimeter/CaloIdentifier/CaloIdentifier/LArHEC_SuperCell_ID.h @@ -17,9 +17,9 @@ #define CALOIDENTIFIER_LARHEC_SUPERCELL_ID_H -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "CaloIdentifier/LArHEC_Base_ID.h" -#include "SGTools/BaseInfo.h" +#include "AthenaKernel/BaseInfo.h" /** diff --git a/Calorimeter/CaloIdentifier/CaloIdentifier/LArMiniFCAL_ID.h b/Calorimeter/CaloIdentifier/CaloIdentifier/LArMiniFCAL_ID.h index bfd6a6b6515517c0bf6b3294da2feb1638a337b2..f6328a9af76fb9de246580a2810e10fc8e6597db 100644 --- a/Calorimeter/CaloIdentifier/CaloIdentifier/LArMiniFCAL_ID.h +++ b/Calorimeter/CaloIdentifier/CaloIdentifier/LArMiniFCAL_ID.h @@ -5,7 +5,7 @@ #ifndef LARMiniFCAL_ID_H #define LARMiniFCAL_ID_H -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "AtlasDetDescr/AtlasDetectorID.h" #include "Identifier/IdentifierHash.h" #include "IdDict/IdDictFieldImplementation.h" diff --git a/Calorimeter/CaloIdentifier/CaloIdentifier/TTOnlineID.h b/Calorimeter/CaloIdentifier/CaloIdentifier/TTOnlineID.h index 487c80581bd51ef30edc78da77d889c9e4452b35..1a23595a0e27d4f41e08aace70fdc73e10c6e169 100755 --- a/Calorimeter/CaloIdentifier/CaloIdentifier/TTOnlineID.h +++ b/Calorimeter/CaloIdentifier/CaloIdentifier/TTOnlineID.h @@ -5,7 +5,7 @@ #ifndef CALOIDENTIFIER_TTONLINEID_H #define CALOIDENTIFIER_TTONLINEID_H -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "GaudiKernel/MsgStream.h" #include "AtlasDetDescr/AtlasDetectorID.h" #include "Identifier/HWIdentifier.h" diff --git a/Calorimeter/CaloIdentifier/CaloIdentifier/TileID.h b/Calorimeter/CaloIdentifier/CaloIdentifier/TileID.h index a3092279e9e1fead8f193be034a1124a4da7b232..7924db062d3e9dbcd77c29656225d5d83c1fdac0 100755 --- a/Calorimeter/CaloIdentifier/CaloIdentifier/TileID.h +++ b/Calorimeter/CaloIdentifier/CaloIdentifier/TileID.h @@ -24,8 +24,8 @@ #include "CaloIdentifier/Tile_Base_ID.h" #include "CaloIdentifier/TileID_Exception.h" -#include "CLIDSvc/CLASS_DEF.h" -#include "SGTools/BaseInfo.h" +#include "AthenaKernel/CLASS_DEF.h" +#include "AthenaKernel/BaseInfo.h" #include "boost/range/iterator_range.hpp" #include <string> diff --git a/Calorimeter/CaloIdentifier/CaloIdentifier/Tile_Base_ID.h b/Calorimeter/CaloIdentifier/CaloIdentifier/Tile_Base_ID.h index 14666ffb77cd1d1dce732fe5ec30d08fa2f05d56..00d1395013237b77afb393c324c9cdc3e62eea32 100755 --- a/Calorimeter/CaloIdentifier/CaloIdentifier/Tile_Base_ID.h +++ b/Calorimeter/CaloIdentifier/CaloIdentifier/Tile_Base_ID.h @@ -22,7 +22,7 @@ #include "CaloIdentifier/TileID_Exception.h" #include "CaloIdentifier/TileNeighbour.h" -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "boost/range/iterator_range.hpp" #include <string> diff --git a/Calorimeter/CaloIdentifier/CaloIdentifier/Tile_SuperCell_ID.h b/Calorimeter/CaloIdentifier/CaloIdentifier/Tile_SuperCell_ID.h index 245e9e8722672c73f38744d9967c8b2602a05ccc..2316620d3dc6cda73d2c73ad03c8ac5c534580d0 100755 --- a/Calorimeter/CaloIdentifier/CaloIdentifier/Tile_SuperCell_ID.h +++ b/Calorimeter/CaloIdentifier/CaloIdentifier/Tile_SuperCell_ID.h @@ -22,8 +22,8 @@ #include "CaloIdentifier/Tile_Base_ID.h" #include "CaloIdentifier/TileID_Exception.h" -#include "CLIDSvc/CLASS_DEF.h" -#include "SGTools/BaseInfo.h" +#include "AthenaKernel/CLASS_DEF.h" +#include "AthenaKernel/BaseInfo.h" #include "boost/range/iterator_range.hpp" #include <string> diff --git a/Calorimeter/CaloIdentifier/src/CaloHelpersTest.cxx b/Calorimeter/CaloIdentifier/src/CaloHelpersTest.cxx index a59a68cd2c2eb1c69159a5bbc2a96b93b0ba0071..7d9fbe28ea0dff38d5a51dc7c770c61ff0bca19b 100644 --- a/Calorimeter/CaloIdentifier/src/CaloHelpersTest.cxx +++ b/Calorimeter/CaloIdentifier/src/CaloHelpersTest.cxx @@ -20,18 +20,32 @@ CaloHelpersTest::CaloHelpersTest() IdDictMgr& idd = m_parser->parse("IdDictParser/ATLAS_IDS.xml"); m_em_idHelper.set_quiet (true); m_em_idHelper.set_do_neighbours(false); - m_em_idHelper.initialize_from_dictionary(idd); + if (m_em_idHelper.initialize_from_dictionary(idd) != 0) { + std::abort(); + } + m_hec_idHelper.set_quiet (true); - m_hec_idHelper.initialize_from_dictionary(idd); + if (m_hec_idHelper.initialize_from_dictionary(idd) != 0) { + std::abort(); + } + m_fcal_idHelper.set_quiet (true); m_fcal_idHelper.set_do_neighbours(false); - m_fcal_idHelper.initialize_from_dictionary(idd); + if (m_fcal_idHelper.initialize_from_dictionary(idd) != 0) { + std::abort(); + } + m_minifcal_idHelper.set_quiet (true); m_minifcal_idHelper.set_do_neighbours(false); - m_minifcal_idHelper.initialize_from_dictionary(idd); + if (m_minifcal_idHelper.initialize_from_dictionary(idd) != 0) { + std::abort(); + } + m_tile_idHelper.set_quiet (true); m_tile_idHelper.set_do_neighbours(false); - m_tile_idHelper.initialize_from_dictionary(idd); + if (m_tile_idHelper.initialize_from_dictionary(idd) != 0) { + std::abort(); + } m_calo_idHelper = std::make_unique<CaloCell_ID> (&m_em_idHelper, &m_hec_idHelper, @@ -39,7 +53,9 @@ CaloHelpersTest::CaloHelpersTest() &m_minifcal_idHelper, &m_tile_idHelper); m_calo_idHelper->set_quiet (true); - m_calo_idHelper->initialize_from_dictionary(idd); + if (m_calo_idHelper->initialize_from_dictionary(idd) != 0) { + std::abort(); + } } diff --git a/Calorimeter/CaloRec/python/CaloBCIDAvgAlgDefault.py b/Calorimeter/CaloRec/python/CaloBCIDAvgAlgDefault.py index 33a3e23dbaf66d48b106543f4421103e0c1a3ae8..3f0b24063d3a50d53a20aae75d54a18095f1003a 100644 --- a/Calorimeter/CaloRec/python/CaloBCIDAvgAlgDefault.py +++ b/Calorimeter/CaloRec/python/CaloBCIDAvgAlgDefault.py @@ -24,10 +24,14 @@ def CaloBCIDAvgAlgDefault(): conddb.addFolder("LAR_OFL","/LAR/ElecCalibOfl/LArPileupShape<key>LArShape32</key>",className="LArShape32MC") conddb.addFolder("LAR_OFL","/LAR/ElecCalibOfl/LArPileupAverage",className="LArMinBiasAverageMC") - #condSequence+=LArCondAlgShapeFlat(ReadKey= - topSequence+=CaloBCIDAvgAlg(isMC=False,LumiTool=theLumiTool,ShapeKey="LArShape32") else: #MC case + from LArRecUtils.LArOFCCondAlgDefault import LArOFCCondAlgDefault + from LArRecUtils.LArAutoCorrTotalCondAlgDefault import LArAutoCorrTotalCondAlgDefault + from LArRecUtils.LArADC2MeVCondAlgDefault import LArADC2MeVCondAlgDefault + LArADC2MeVCondAlgDefault() + LArAutoCorrTotalCondAlgDefault() + LArOFCCondAlgDefault() from TrigBunchCrossingTool.BunchCrossingTool import BunchCrossingTool theBunchCrossingTool = BunchCrossingTool() conddb.addFolder("LAR_OFL","/LAR/ElecCalibMC/Shape",className="LArShape32MC") diff --git a/Calorimeter/CaloRec/python/CaloCellGetter.py b/Calorimeter/CaloRec/python/CaloCellGetter.py index 701f4d03b162b0255713e5341d33f2b3b5b8c8bd..68c1f66bb87f8b016e85f022ef20726b2c9da8f7 100644 --- a/Calorimeter/CaloRec/python/CaloCellGetter.py +++ b/Calorimeter/CaloRec/python/CaloCellGetter.py @@ -7,6 +7,7 @@ from AthenaCommon.Constants import * from RecExConfig.Configured import Configured from AthenaCommon.AthenaCommonFlags import athenaCommonFlags from RecExConfig.RecFlags import rec +import traceback class CaloCellGetter (Configured) : _outputType = "CaloCellContainer" diff --git a/Calorimeter/CaloSimEvent/CMakeLists.txt b/Calorimeter/CaloSimEvent/CMakeLists.txt index 8606a9e52a4ac35d3d06ed527ea7c671ab590c25..4c30237f5bba49348db4292d68d40dbd5bcf67e8 100644 --- a/Calorimeter/CaloSimEvent/CMakeLists.txt +++ b/Calorimeter/CaloSimEvent/CMakeLists.txt @@ -7,8 +7,7 @@ atlas_subdir( CaloSimEvent ) # Declare the package's dependencies: atlas_depends_on_subdirs( PUBLIC - Control/CLIDSvc - Control/SGTools + Control/AthenaKernel DetectorDescription/Identifier Simulation/HitManagement PRIVATE @@ -22,12 +21,12 @@ atlas_add_library( CaloSimEvent src/*.cxx PUBLIC_HEADERS CaloSimEvent PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES SGTools Identifier HitManagement + LINK_LIBRARIES Identifier HitManagement PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} GaudiKernel ) atlas_add_dictionary( CaloSimEventDict CaloSimEvent/CaloSimEventDict.h CaloSimEvent/selection.xml INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} SGTools Identifier HitManagement GaudiKernel CaloSimEvent ) + LINK_LIBRARIES ${ROOT_LIBRARIES} Identifier HitManagement GaudiKernel CaloSimEvent ) diff --git a/Calorimeter/CaloSimEvent/CaloSimEvent/CaloCalibrationHitContainer.h b/Calorimeter/CaloSimEvent/CaloSimEvent/CaloCalibrationHitContainer.h index 46e22cbf120fb8f1b039fbe3570ef8bb5a93e58a..6e6ca44d1ce941d7e42af5f12d2c9aa0d057e7ad 100755 --- a/Calorimeter/CaloSimEvent/CaloSimEvent/CaloCalibrationHitContainer.h +++ b/Calorimeter/CaloSimEvent/CaloSimEvent/CaloCalibrationHitContainer.h @@ -19,7 +19,7 @@ #include "HitManagement/AthenaHitsVector.h" #include "CaloSimEvent/CaloCalibrationHit.h" -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" class CaloCalibrationHitContainer:public AthenaHitsVector<CaloCalibrationHit> { diff --git a/Calorimeter/CaloTTDetDescr/CMakeLists.txt b/Calorimeter/CaloTTDetDescr/CMakeLists.txt index 129420422e27ca58d37a6a05d21464cc822236fe..000a484ae74a5e3de38ab8ee433c8dd8df959c47 100644 --- a/Calorimeter/CaloTTDetDescr/CMakeLists.txt +++ b/Calorimeter/CaloTTDetDescr/CMakeLists.txt @@ -7,8 +7,7 @@ atlas_subdir( CaloTTDetDescr ) # Declare the package's dependencies: atlas_depends_on_subdirs( PUBLIC - Control/CLIDSvc - Control/SGTools + Control/AthenaKernel DetectorDescription/Identifier PRIVATE Calorimeter/CaloIdentifier ) @@ -17,6 +16,6 @@ atlas_depends_on_subdirs( PUBLIC atlas_add_library( CaloTTDetDescr src/*.cxx PUBLIC_HEADERS CaloTTDetDescr - LINK_LIBRARIES SGTools Identifier + LINK_LIBRARIES Identifier PRIVATE_LINK_LIBRARIES CaloIdentifier ) diff --git a/Calorimeter/CaloTTDetDescr/CaloTTDetDescr/CaloTTDescrManager.h b/Calorimeter/CaloTTDetDescr/CaloTTDetDescr/CaloTTDescrManager.h index 434cbb30af51558cf3cb908a55b3be96019107cb..c874de155aaaaf00c3f830f8bbb25bd120158b04 100755 --- a/Calorimeter/CaloTTDetDescr/CaloTTDetDescr/CaloTTDescrManager.h +++ b/Calorimeter/CaloTTDetDescr/CaloTTDetDescr/CaloTTDescrManager.h @@ -14,7 +14,7 @@ #define CALODETDESCR_CALOTTDESCRMANAGER_H #include "Identifier/Identifier.h" -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include <vector> #include <map> diff --git a/Commission/CommissionEvent/CMakeLists.txt b/Commission/CommissionEvent/CMakeLists.txt index 9aa62d5691f3c6e51b510e5fa375487bb304e807..3782927178152212c327772bca1c3b26768fe5e9 100644 --- a/Commission/CommissionEvent/CMakeLists.txt +++ b/Commission/CommissionEvent/CMakeLists.txt @@ -7,8 +7,7 @@ atlas_subdir( CommissionEvent ) # Declare the package's dependencies: atlas_depends_on_subdirs( PUBLIC - Control/CLIDSvc - Control/SGTools ) + Control/AthenaKernel ) # External dependencies: find_package( CLHEP ) @@ -21,12 +20,12 @@ atlas_add_library( CommissionEvent INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} DEFINITIONS ${CLHEP_DEFINITIONS} - LINK_LIBRARIES ${CLHEP_LIBRARIES} SGTools + LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaKernel PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} ) atlas_add_dictionary( CommissionEventDict CommissionEvent/CommissionEventDict.h CommissionEvent/selection.xml INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} SGTools CommissionEvent ) + LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} CommissionEvent ) diff --git a/Commission/CommissionEvent/CommissionEvent/ComTime.h b/Commission/CommissionEvent/CommissionEvent/ComTime.h index e18b1beba4c5a0a2427ccbf3f09520480dae8723..4a54f921755bb228262b2ae56cded62da1828929 100755 --- a/Commission/CommissionEvent/CommissionEvent/ComTime.h +++ b/Commission/CommissionEvent/CommissionEvent/ComTime.h @@ -10,7 +10,7 @@ // // /////////////////////////////////////////////////////////////////////////////// -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "CLHEP/Vector/ThreeVector.h" class ComTime diff --git a/Control/AthViews/AthViews/SimpleView.h b/Control/AthViews/AthViews/SimpleView.h index 73aa51d1534f6cedcf8c4d95dd2f4dc27fc0fac1..0a019b742e3de785fda76b50adc9c3c273878491 100644 --- a/Control/AthViews/AthViews/SimpleView.h +++ b/Control/AthViews/AthViews/SimpleView.h @@ -34,9 +34,9 @@ class SimpleView : public IProxyDict { public: DeclareInterfaceID( SimpleView, 2, 0 ); - SimpleView(); - SimpleView( std::string Name, bool AllowFallThrough = true ); - SimpleView( std::string Name, bool AllowFallThrough, std::string const& storeName ); + + SimpleView() = delete; + SimpleView( std::string Name, bool AllowFallThrough = true, std::string const& storeName = "StoreGateSvc" ); virtual ~SimpleView(); /// get default proxy with given id. Returns 0 to flag failure diff --git a/Control/AthViews/AthViews/View.h b/Control/AthViews/AthViews/View.h index e0639a980a026e865adb218dcab9acf7a8d2ed3c..e49cfdf3b3faa7d199638793987fdba0f7117219 100644 --- a/Control/AthViews/AthViews/View.h +++ b/Control/AthViews/AthViews/View.h @@ -20,8 +20,8 @@ class DataObject; namespace SG { class View : public IProxyDict { public: - View (const std::string& name, bool AllowFallThrough = true); - View (const std::string& name, bool AllowFallThrough, std::string const& storeName); + View () = delete; + View (const std::string& name, const int index, const bool AllowFallThrough = true, std::string const& storeName = "StoreGateSvc"); virtual ~View (); View (const View&) = delete; View& operator= (const View&) = delete; @@ -29,6 +29,7 @@ public: void impl ( SimpleView* impl ) { m_implementation = impl; } IProxyDict* impl (void ) { return m_implementation; } const IProxyDict* impl ( void ) const { return m_implementation; } + size_t viewID() const{ return m_index; } /** * for printing the content of the view @@ -112,6 +113,7 @@ public: private: SimpleView *m_implementation; + size_t m_index; }; } // EOF SG namespace diff --git a/Control/AthViews/AthViews/ViewHelper.h b/Control/AthViews/AthViews/ViewHelper.h index 13e720fd196a7ad99e1b970e1bd6512e3e622be8..7bc2e0ec8d271d2e2c227277de9876b320794cb3 100644 --- a/Control/AthViews/AthViews/ViewHelper.h +++ b/Control/AthViews/AthViews/ViewHelper.h @@ -36,111 +36,83 @@ namespace ViewHelper //Function to create a vector of views, each populated with one data object template< typename T > inline StatusCode MakeAndPopulate( std::string const& ViewNameRoot, ViewContainer* ViewVector, - SG::WriteHandleKey< T > const& PopulateKey, EventContext const& SourceContext, std::vector< T > const& InputData, bool const allowFallThrough=true ) + SG::WriteHandleKey< T > const& PopulateKey, EventContext const& SourceContext, std::vector< T > const& InputData, bool const allowFallThrough=true ) { + //Check for spaces in the name + if ( ViewNameRoot.find( " " ) != std::string::npos ) + { + return StatusCode::FAILURE; + } + //Make a WriteHandle to use SG::WriteHandle<T> populateHandle( PopulateKey, SourceContext ); //Loop over all input data unsigned int const viewNumber = InputData.size(); for ( unsigned int viewIndex = 0; viewIndex < viewNumber; ++viewIndex ) + { + //Create view + SG::View * outputView = new SG::View( ViewNameRoot, viewIndex, allowFallThrough ); + ViewVector->push_back( outputView ); + + //Attach a handle to the view + StatusCode sc = populateHandle.setProxyDict( outputView ); + if ( !sc.isSuccess() ) { - //Create view - std::string viewName = ViewNameRoot + std::to_string( viewIndex ); - SG::View * outputView = new SG::View( viewName, allowFallThrough ); - ViewVector->push_back( outputView ); - - //Attach a handle to the view - StatusCode sc = populateHandle.setProxyDict( outputView ); - if ( !sc.isSuccess() ) - { - ViewVector->clear(); - return sc; - } - - //Populate the view - sc = populateHandle.record( CxxUtils::make_unique< T >( InputData[ viewIndex ] ) ); - if ( !sc.isSuccess() ) - { - ViewVector->clear(); - return sc; - } + ViewVector->clear(); + return sc; } - return StatusCode::SUCCESS; - } - - //Function to add data to existing views - template< typename T > - inline StatusCode Populate( ViewContainer const& ViewVector, - SG::WriteHandleKey< T > const& PopulateKey, EventContext const& SourceContext, std::vector< T > const& InputData ) - { - //Make a WriteHandle to use - SG::WriteHandle<T> populateHandle( PopulateKey, SourceContext ); - - //Vector length check - unsigned int const viewNumber = InputData.size(); - if ( viewNumber != ViewVector.size() ) return StatusCode::FAILURE; - - //Loop over all input data - for ( unsigned int viewIndex = 0; viewIndex < viewNumber; ++viewIndex ) + //Populate the view + sc = populateHandle.record( CxxUtils::make_unique< T >( InputData[ viewIndex ] ) ); + if ( !sc.isSuccess() ) { - //Attach the handle to the view - StatusCode sc = populateHandle.setProxyDict( ViewVector.at( viewIndex ) ); - if ( !sc.isSuccess() ) - { - return sc; - } - - //Populate the view - sc = populateHandle.record( CxxUtils::make_unique< T >( InputData.at( viewIndex ) ) ); - if ( !sc.isSuccess() ) - { - return sc; - } + ViewVector->clear(); + return sc; } + } return StatusCode::SUCCESS; } //Function to attach a set of views to a graph node inline StatusCode ScheduleViews( ViewContainer * ViewVector, std::string const& NodeName, - EventContext const& SourceContext, IScheduler * Scheduler ) + EventContext const& SourceContext, IScheduler * Scheduler ) { //Prevent view nesting - test if source context has view attached Atlas::ExtendedEventContext const* extendedContext = SourceContext.template getExtension<Atlas::ExtendedEventContext>(); if ( dynamic_cast< SG::View* >( extendedContext->proxy() ) ) - { - return StatusCode::FAILURE; - } + { + return StatusCode::FAILURE; + } //Retrieve the scheduler if ( !Scheduler ) - { - return StatusCode::FAILURE; - } + { + return StatusCode::FAILURE; + } if ( not ViewVector->empty() ) + { + for ( SG::View* view : *ViewVector ) { - for ( SG::View* view : *ViewVector ) - { - //Make a context with the view attached - EventContext * viewContext = new EventContext( SourceContext ); - viewContext->setExtension( Atlas::ExtendedEventContext( view, extendedContext->conditionsRun() ) ); - - //Attach the view to the named node - StatusCode sc = Scheduler->scheduleEventView( &SourceContext, NodeName, viewContext ); - if ( !sc.isSuccess() ) - { - return StatusCode::FAILURE; - } - } + //Make a context with the view attached + EventContext * viewContext = new EventContext( SourceContext ); + viewContext->setExtension( Atlas::ExtendedEventContext( view, extendedContext->conditionsRun() ) ); + + //Attach the view to the named node + StatusCode sc = Scheduler->scheduleEventView( &SourceContext, NodeName, viewContext ); + if ( !sc.isSuccess() ) + { + return StatusCode::FAILURE; + } } + } else - { - //Disable the node if no views - return Scheduler->scheduleEventView( &SourceContext, NodeName, 0 ); - } + { + //Disable the node if no views + return Scheduler->scheduleEventView( &SourceContext, NodeName, 0 ); + } return StatusCode::SUCCESS; } @@ -163,20 +135,20 @@ namespace ViewHelper //Loop over all views for ( SG::View* inputView : ViewVector ) - { - //Attach the handle to the view - StatusCode sc = queryHandle.setProxyDict( inputView ); - if ( !sc.isSuccess() ) - { - m_msg << MSG::ERROR <<"Failed to use view " << inputView->name() << " to read " << queryHandle.key() << " resetting output" << endmsg; - OutputData.clear(); - return sc; - } - - //Merge the data - T inputData = *queryHandle; - OutputData.insert( OutputData.end(), inputData.begin(), inputData.end() ); - } + { + //Attach the handle to the view + StatusCode sc = queryHandle.setProxyDict( inputView ); + if ( !sc.isSuccess() ) + { + m_msg << MSG::ERROR <<"Failed to use view " << inputView->name() << " to read " << queryHandle.key() << " resetting output" << endmsg; + OutputData.clear(); + return sc; + } + + //Merge the data + T inputData = *queryHandle; + OutputData.insert( OutputData.end(), inputData.begin(), inputData.end() ); + } return StatusCode::SUCCESS; } @@ -189,10 +161,10 @@ namespace ViewHelper { //Check that there's a non-const aux store for output bookkeeping if ( !OutputData.getStore() ) - { - m_msg << MSG::ERROR << "output data does not have the store" << endmsg; - return StatusCode::FAILURE; - } + { + m_msg << MSG::ERROR << "output data does not have the store" << endmsg; + return StatusCode::FAILURE; + } //Make ReadHandle to access views SG::ReadHandle< DataVector< T > > queryHandle( QueryKey, SourceContext ); @@ -203,41 +175,42 @@ namespace ViewHelper //Loop over all views unsigned int offset = 0; for ( unsigned int viewIndex = 0; viewIndex < ViewVector.size(); ++viewIndex ) - { - SG::View * inputView = ViewVector.at( viewIndex ); - - //Attach the handle to the view - StatusCode sc = queryHandle.setProxyDict( inputView ); - if ( !sc.isSuccess() ) - { - m_msg << MSG::ERROR << "Failed to use view " << inputView->name() << " to read " << queryHandle.key() << " clearing output" << endmsg; - OutputData.clear(); - return sc; - } - - //Nothing to do for empty collections - if ( queryHandle->size() == 0 ) { - m_msg << MSG::DEBUG << "Empty collection " << queryHandle.key() <<" in a view " << inputView->name() <<endmsg; - continue; - } - - //Merge the data - for ( const auto inputObject : *queryHandle.cptr() ) - { - //Element-wise copy data - T * outputObject = new T(); - OutputData.push_back( outputObject ); - *outputObject = *inputObject; - - //Add aux data for bookkeeping - viewBookkeeper( *outputObject ) = viewIndex; - } - m_msg << MSG::DEBUG << "Copied " << queryHandle->size() << " objects from collection in view " << inputView->name() << endmsg; - - //Declare remapping - m_sg->remap( ClassID_traits< DataVector< T > >::ID(), inputView->name() + "_" + queryHandle.name(), queryHandle.name(), offset ); - offset += queryHandle->size(); - } + { + SG::View * inputView = ViewVector.at( viewIndex ); + + //Attach the handle to the view + StatusCode sc = queryHandle.setProxyDict( inputView ); + if ( !sc.isSuccess() ) + { + m_msg << MSG::ERROR << "Failed to use view " << inputView->name() << " to read " << queryHandle.key() << " clearing output" << endmsg; + OutputData.clear(); + return sc; + } + + //Nothing to do for empty collections + if ( queryHandle->size() == 0 ) + { + m_msg << MSG::DEBUG << "Empty collection " << queryHandle.key() <<" in a view " << inputView->name() <<endmsg; + continue; + } + + //Merge the data + for ( const auto inputObject : *queryHandle.cptr() ) + { + //Element-wise copy data + T * outputObject = new T(); + OutputData.push_back( outputObject ); + *outputObject = *inputObject; + + //Add aux data for bookkeeping + viewBookkeeper( *outputObject ) = viewIndex; + } + m_msg << MSG::DEBUG << "Copied " << queryHandle->size() << " objects from collection in view " << inputView->name() << endmsg; + + //Declare remapping + m_sg->remap( ClassID_traits< DataVector< T > >::ID(), inputView->name() + "_" + queryHandle.name(), queryHandle.name(), offset ); + offset += queryHandle->size(); + } return StatusCode::SUCCESS; } @@ -246,11 +219,15 @@ namespace ViewHelper /** * @arg unique_index - gets appended to the view name if >= 0 */ - inline SG::View* makeView( const std::string& common_name, int const unique_index=-1, bool const allowFallThrough = true) { - return (( unique_index == -1 ) ? - new SG::View( common_name, allowFallThrough ) : - new SG::View( common_name+ " "+std::to_string(unique_index), allowFallThrough ) ); + inline SG::View* makeView( const std::string& common_name, int const unique_index=-1, bool const allowFallThrough = true) + { + //Check for spaces in the name + if ( common_name.find( " " ) != std::string::npos ) + { + return nullptr; + } + return new SG::View( common_name, unique_index, allowFallThrough ); } /** @@ -315,7 +292,7 @@ namespace ViewHelper return handle; } - + /** * Create EL to a collection in view * @warning no checks are made as to the validity of the created EL diff --git a/Control/AthViews/CMakeLists.txt b/Control/AthViews/CMakeLists.txt index e17cda7bc55f3f2df18215f3c6959a8419f63af1..334a30f33e8e035ffe02a18fb6873c7868529394 100644 --- a/Control/AthViews/CMakeLists.txt +++ b/Control/AthViews/CMakeLists.txt @@ -55,7 +55,7 @@ atlas_add_test( ViewCollectionMerge_test ENVIRONMENT "JOBOPTSEARCHPATH=${CMAKE_CURRENT_SOURCE_DIR}/test") atlas_add_test( SimpleViews SCRIPT test/test_simple_view_example.sh - PROPERTIES PASS_REGULAR_EXPRESSION "INFO view_test running with store view9" ) + PROPERTIES PASS_REGULAR_EXPRESSION "INFO view_test running with store view_9" ) atlas_add_test( ViewScheduling SCRIPT test/test_view_scheduling.sh ) diff --git a/Control/AthViews/src/SimpleView.cxx b/Control/AthViews/src/SimpleView.cxx index 5f4382ad8c8fdca6d9fc069bdbb149bbbc65d7e9..77ba8d9ae1b83709d2ef7ea98820d8070eca8b58 100644 --- a/Control/AthViews/src/SimpleView.cxx +++ b/Control/AthViews/src/SimpleView.cxx @@ -8,23 +8,9 @@ using namespace std; -SimpleView::SimpleView() : - m_store( "StoreGateSvc", "SimpleView" ), - m_name( "SimpleView" ), - m_allowFallThrough( false ) -{ -} - -SimpleView::SimpleView( std::string Name, bool AllowFallThrough ) : - m_store( "StoreGateSvc", "SimpleView" ), - m_name( Name ), - m_allowFallThrough( AllowFallThrough ) -{ -} - SimpleView::SimpleView( std::string Name, bool AllowFallThrough, std::string const& storeName ) : - m_store( storeName, "SimpleView" ), - m_name( Name ), + m_store( storeName, "SimpleView" ), + m_name( Name ), m_allowFallThrough( AllowFallThrough ) { } @@ -47,9 +33,9 @@ void SimpleView::linkParent( const IProxyDict* parent ) { */ SG::DataProxy * SimpleView::proxy_exact( SG::sgkey_t sgkey ) const { - cout << "Not implemented: SimpleView::proxy_exact" << endl; - //TODO - view rename - return m_store->proxy_exact( sgkey ); + cout << "Not implemented: SimpleView::proxy_exact" << endl; + //TODO - view rename + return m_store->proxy_exact( sgkey ); } @@ -70,12 +56,12 @@ SG::DataProxy * SimpleView::proxy( const CLID& id, const std::string& key ) cons { auto isValid = [](const SG::DataProxy* p) { return p != nullptr and p->isValid(); }; const std::string viewKey = m_name + "_" + key; - auto localProxy = m_store->proxy( id, viewKey ); + auto localProxy = m_store->proxy( id, viewKey ); - // std::cout << " while looking for object " << key << " in view " << name() << " found proxy in this view store with validity " << isValid( localProxy ) << std::endl; + //std::cout << " while looking for object " << key << " in view " << name() << " found proxy in this view store with validity " << isValid( localProxy ) << std::endl; for ( auto parent: m_parents ) { - auto inParentProxy = parent->proxy( id, key ); - // std::cout << " while looking for object " << key << " in view " << name() << " found proxy in parent view store with validity " << isValid( inParentProxy ) << std::endl; + auto inParentProxy = parent->proxy( id, key ); + //std::cout << " while looking for object " << key << " in view " << name() << " found proxy in parent view store with validity " << isValid( inParentProxy ) << std::endl; if ( isValid( inParentProxy ) ) { if ( isValid( localProxy ) ) { throw std::runtime_error("Duplicate object CLID:"+ std::to_string(id) + " key: " + key + " found in views: " + name()+ " and parent " + parent->name() ); @@ -88,7 +74,7 @@ SG::DataProxy * SimpleView::proxy( const CLID& id, const std::string& key ) cons //Look in the default store if cound not find in any view - for instance for event-wise IDCs if ( (not isValid( localProxy )) and m_allowFallThrough ) { auto mainStoreProxy = m_store->proxy( id, key ); - // std::cout << " while looking for object " << key << " in view " << name() << " found proxy in the main store with validity " << isValid( mainStoreProxy ) << std::endl; + //std::cout << " while looking for object " << key << " in view " << name() << " found proxy in the main store with validity " << isValid( mainStoreProxy ) << std::endl; return mainStoreProxy; } return localProxy; // can be the nullptr still @@ -103,9 +89,9 @@ SG::DataProxy * SimpleView::proxy( const CLID& id, const std::string& key ) cons */ SG::DataProxy * SimpleView::proxy( const void* const pTransient ) const { - cout << "Not implemented: SimpleView::proxy" << endl; - //TODO - view rename - return m_store->proxy( pTransient ); + cout << "Not implemented: SimpleView::proxy" << endl; + //TODO - view rename + return m_store->proxy( pTransient ); } @@ -114,7 +100,7 @@ SG::DataProxy * SimpleView::proxy( const void* const pTransient ) const */ std::vector< const SG::DataProxy* > SimpleView::proxies() const { - return m_store->proxies(); + return m_store->proxies(); } @@ -130,8 +116,7 @@ std::vector< const SG::DataProxy* > SimpleView::proxies() const */ StatusCode SimpleView::addToStore( CLID id, SG::DataProxy * proxy ) { - const std::string viewKey = m_name + "_" + proxy->name(); - return m_store->addToStore( id, proxy ); + return m_store->addToStore( id, proxy ); } @@ -147,8 +132,8 @@ StatusCode SimpleView::addToStore( CLID id, SG::DataProxy * proxy ) */ bool SimpleView::tryELRemap( sgkey_t sgkey_in, size_t index_in, sgkey_t & sgkey_out, size_t & index_out ) { - cout << "Not implemented: SimpleView::tryELRemap" << endl; - return m_store->tryELRemap( sgkey_in, index_in, sgkey_out, index_out ); //TODO + cout << "Not implemented: SimpleView::tryELRemap" << endl; + return m_store->tryELRemap( sgkey_in, index_in, sgkey_out, index_out ); //TODO } /** @@ -164,8 +149,8 @@ bool SimpleView::tryELRemap( sgkey_t sgkey_in, size_t index_in, sgkey_t & sgkey_ */ SG::DataProxy * SimpleView::recordObject( SG::DataObjectSharedPtr<DataObject> obj, const std::string& key, bool allowMods, bool returnExisting ) { - const std::string viewKey = m_name + "_" + key; - return m_store->recordObject( obj, viewKey, allowMods, returnExisting ); + const std::string viewKey = m_name + "_" + key; + return m_store->recordObject( obj, viewKey, allowMods, returnExisting ); } /** @@ -175,7 +160,7 @@ SG::DataProxy * SimpleView::recordObject( SG::DataObjectSharedPtr<DataObject> ob */ void SimpleView::boundHandle( IResetable * handle ) { - return m_store->boundHandle( handle ); + return m_store->boundHandle( handle ); } /** @@ -185,46 +170,46 @@ void SimpleView::boundHandle( IResetable * handle ) */ void SimpleView::unboundHandle( IResetable * handle ) { - return m_store->unboundHandle( handle ); + return m_store->unboundHandle( handle ); } unsigned long SimpleView::addRef() { - cout << "Not implemented: SimpleView::addRef" << endl; - return 0; //TODO + cout << "Not implemented: SimpleView::addRef" << endl; + return 0; //TODO } unsigned long SimpleView::release() { - cout << "Not implemented: SimpleView::release" << endl; - return 0; //TODO + cout << "Not implemented: SimpleView::release" << endl; + return 0; //TODO } StatusCode SimpleView::queryInterface( const InterfaceID &/*ti*/, void** /*pp*/ ) { - cout << "Not implemented: SimpleView::queryInterface" << endl; - return StatusCode::FAILURE; //TODO + cout << "Not implemented: SimpleView::queryInterface" << endl; + return StatusCode::FAILURE; //TODO } const std::string& SimpleView::name() const { - return m_name; + return m_name; } //IStringPool IStringPool::sgkey_t SimpleView::stringToKey( const std::string& str, CLID clid ) { - const std::string viewKey = m_name + "_" + str; - return m_store->stringToKey( viewKey, clid ); + const std::string viewKey = m_name + "_" + str; + return m_store->stringToKey( viewKey, clid ); } const std::string* SimpleView::keyToString( IStringPool::sgkey_t key ) const { - cout << "Not implemented: SimpleView::keyToString" << endl; - //TODO - view rename maybe? - return m_store->keyToString( key ); + cout << "Not implemented: SimpleView::keyToString" << endl; + //TODO - view rename maybe? + return m_store->keyToString( key ); } const std::string* SimpleView::keyToString( IStringPool::sgkey_t key, CLID& clid ) const { - cout << "Not implemented: SimpleView::keyToString" << endl; - //TODO - view rename maybe? - return m_store->keyToString( key, clid ); + cout << "Not implemented: SimpleView::keyToString" << endl; + //TODO - view rename maybe? + return m_store->keyToString( key, clid ); } void SimpleView::registerKey( IStringPool::sgkey_t key, const std::string& str, CLID clid ) { diff --git a/Control/AthViews/src/View.cxx b/Control/AthViews/src/View.cxx index 0542d75c0b5f391aaefb7da5a098f59690325e9c..e9be3f7787a60d352776fb8387d5f44f52b6bb0e 100644 --- a/Control/AthViews/src/View.cxx +++ b/Control/AthViews/src/View.cxx @@ -5,12 +5,16 @@ #include "AthViews/SimpleView.h" #include "AthViews/View.h" using namespace SG; -View::View(const std::string& name, bool AllowFallThrough ) { - m_implementation = new SimpleView(name, AllowFallThrough); -} -View::View(const std::string& name, bool AllowFallThrough, std::string const& storeName) { - m_implementation = new SimpleView(name, AllowFallThrough, storeName); +View::View(const std::string& name, const int index, const bool AllowFallThrough, std::string const& storeName) { + if ( index == -1 ) { + m_index = 0; + m_implementation = new SimpleView(name, AllowFallThrough, storeName); + } + else { + m_index = index; + m_implementation = new SimpleView(name+"_"+std::to_string(index), AllowFallThrough, storeName); + } } View::~View () { diff --git a/Control/AthViews/src_dflow/DigiDemoSetupAlg.cxx b/Control/AthViews/src_dflow/DigiDemoSetupAlg.cxx index 387bbc54867898e29c8b81ca2f05ff10e232eda8..d8925b4ce4785cb8e7bf48879c42405d84d2aa6e 100644 --- a/Control/AthViews/src_dflow/DigiDemoSetupAlg.cxx +++ b/Control/AthViews/src_dflow/DigiDemoSetupAlg.cxx @@ -83,7 +83,7 @@ StatusCode DigiDemoSetupAlg::execute() //Make all the "pileup events" for ( int eventIndex = 0; eventIndex < 100; ++eventIndex ) { - SG::View * digiView = new SG::View( m_viewBaseName + std::to_string( eventIndex ), false, digiStorePointer->name() ); + SG::View * digiView = new SG::View( m_viewBaseName, eventIndex, false, digiStorePointer->name() ); SG::WriteHandle< std::vector< int > > digiHandle( m_w_ints ); digiHandle.setProxyDict( digiView ); digiHandle.record( std::make_unique< std::vector< int > >( 1, eventIndex ) ); @@ -96,7 +96,7 @@ StatusCode DigiDemoSetupAlg::execute() for ( int viewIndex = 0; viewIndex < m_viewNumber; ++viewIndex ) { int sampleIndex = ( viewIndex + ctx.evt() + 37 ) % 100; // whatever - SG::View * digiView = new SG::View( m_viewBaseName + std::to_string( sampleIndex ), false, digiStorePointer->name() ); + SG::View * digiView = new SG::View( m_viewBaseName, sampleIndex, false, digiStorePointer->name() ); viewVector->push_back( digiView ); } diff --git a/Control/AthViews/test/ViewCollectionMerge_test.cxx b/Control/AthViews/test/ViewCollectionMerge_test.cxx index 1973985ea34a6f8c7632f88b989155c1caea8378..ad9d17111e468be9ac00c4e80a4b8c138f73e782 100644 --- a/Control/AthViews/test/ViewCollectionMerge_test.cxx +++ b/Control/AthViews/test/ViewCollectionMerge_test.cxx @@ -144,7 +144,7 @@ TEST_F( ViewCollectionMerge_test, testBasicReadWrite ) { // Make a view vector auto viewVector = std::make_unique< ViewContainer >(); - viewVector->push_back( new SG::View( "testView" ) ); + viewVector->push_back( new SG::View( "testView", -1 ) ); // Store the view vector SG::WriteHandle< ViewContainer > outputViewsHandle( VIEWS_NAME ); @@ -162,7 +162,7 @@ TEST_F( ViewCollectionMerge_test, testViewReadWrite ) { // Make a view vector auto viewVector = std::make_unique< ViewContainer >(); - viewVector->push_back( new SG::View( "testView" ) ); + viewVector->push_back( new SG::View( "testView", -1 ) ); // Store the view vector SG::WriteHandle< ViewContainer > outputViewsHandle( VIEWS_NAME ); @@ -197,8 +197,8 @@ TEST_F( ViewCollectionMerge_test, testManyViewReadWrite ) { // Make a view vector auto viewVector = std::make_unique< ViewContainer >(); - viewVector->push_back( new SG::View( "testView1" ) ); - viewVector->push_back( new SG::View( "testView2" ) ); + viewVector->push_back( new SG::View( "testView", 1 ) ); + viewVector->push_back( new SG::View( "testView", 2 ) ); // Store the view vector SG::WriteHandle< ViewContainer > outputViewsHandle( VIEWS_NAME ); @@ -238,8 +238,8 @@ TEST_F( ViewCollectionMerge_test, testViewMerge ) { // Make a view vector auto viewVector = std::make_unique< ViewContainer >(); - viewVector->push_back( new SG::View( "testView1" ) ); - viewVector->push_back( new SG::View( "testView2" ) ); + viewVector->push_back( new SG::View( "testView", 1 ) ); + viewVector->push_back( new SG::View( "testView", 2 ) ); // Store the view vector SG::WriteHandle< ViewContainer > outputViewsHandle( VIEWS_NAME ); @@ -298,8 +298,8 @@ TEST_F( ViewCollectionMerge_test, testOtherViewMerge ) { // Make a view vector auto viewVector = std::make_unique< ViewContainer >(); - viewVector->push_back( new SG::View( "testView1" ) ); - viewVector->push_back( new SG::View( "testView2" ) ); + viewVector->push_back( new SG::View( "testView", 1 ) ); + viewVector->push_back( new SG::View( "testView", 2 ) ); // Store the view vector SG::WriteHandle< ViewContainer > outputViewsHandle( VIEWS_NAME ); @@ -423,7 +423,7 @@ TEST_F( ViewCollectionMerge_test, elementLinkRemapTest ) { // Make an element link and remap it in view TEST_F( ViewCollectionMerge_test, elementLinkViewRemapTest ) { - SG::View * testView = new SG::View( "testView" ); + SG::View * testView = new SG::View( "testView", -1 ); // Make a data vector auto viewData = std::make_unique< DataVector< int > >(); @@ -479,8 +479,8 @@ TEST_F( ViewCollectionMerge_test, elementLinkMergeRemapTest ) { // Make a view vector auto viewVector = std::make_unique< ViewContainer >(); - viewVector->push_back( new SG::View( "testView1" ) ); - viewVector->push_back( new SG::View( "testView2" ) ); + viewVector->push_back( new SG::View( "testView", 1 ) ); + viewVector->push_back( new SG::View( "testView", 2 ) ); // Store the view vector SG::WriteHandle< ViewContainer > outputViewsHandle( VIEWS_NAME ); @@ -544,8 +544,8 @@ TEST_F( ViewCollectionMerge_test, elementLinkMergeRemapTest ) { ASSERT_TRUE( outputDataHandle.isValid() ); // Declare remapping - pretty hacky, have to specify view object names explicitly - evtStore()->remap( ClassID_traits< DataVector< int > >::ID(), "testView1_" + DATA_NAME, DATA_NAME, 0 ); - evtStore()->remap( ClassID_traits< DataVector< int > >::ID(), "testView2_" + DATA_NAME, DATA_NAME, 1 ); + evtStore()->remap( ClassID_traits< DataVector< int > >::ID(), "testView_1_" + DATA_NAME, DATA_NAME, 0 ); + evtStore()->remap( ClassID_traits< DataVector< int > >::ID(), "testView_2_" + DATA_NAME, DATA_NAME, 1 ); // Element link should still be pointing to view container ASSERT_TRUE( dataLink.isValid() ); @@ -568,8 +568,8 @@ TEST_F( ViewCollectionMerge_test, elementLinkMergeRemapBookkeepTest ) { // Make a view vector auto viewVector = std::make_unique< ViewContainer >(); - viewVector->push_back( new SG::View( "testView1" ) ); - viewVector->push_back( new SG::View( "testView2" ) ); + viewVector->push_back( new SG::View( "testView", 1 ) ); + viewVector->push_back( new SG::View( "testView", 2 ) ); // Store the view vector SG::WriteHandle< ViewContainer > outputViewsHandle( VIEWS_NAME ); @@ -644,8 +644,8 @@ TEST_F( ViewCollectionMerge_test, elementLinkMergeRemapBookkeepTest ) { ASSERT_TRUE( auxHandle.isValid() ); // Declare remapping - pretty hacky, have to specify view object names explicitly - evtStore()->remap( ClassID_traits< DataVector< DummyData > >::ID(), "testView1_" + DATA_NAME, DATA_NAME, 0 ); - evtStore()->remap( ClassID_traits< DataVector< DummyData > >::ID(), "testView2_" + DATA_NAME, DATA_NAME, 1 ); + evtStore()->remap( ClassID_traits< DataVector< DummyData > >::ID(), "testView_1_" + DATA_NAME, DATA_NAME, 0 ); + evtStore()->remap( ClassID_traits< DataVector< DummyData > >::ID(), "testView_2_" + DATA_NAME, DATA_NAME, 1 ); // Element link should still be pointing to view container ASSERT_TRUE( dataLink.isValid() ); diff --git a/Control/AthViews/test/ViewLinking_test.cxx b/Control/AthViews/test/ViewLinking_test.cxx index c83818bf4d036107f22653e58ecd67b2e09ae636..07f61beaf87d7b8ffc40bc699a02df1534643bde 100644 --- a/Control/AthViews/test/ViewLinking_test.cxx +++ b/Control/AthViews/test/ViewLinking_test.cxx @@ -22,7 +22,7 @@ struct TestClass { CLASS_DEF( TestClass , 16530831 , 1 ) using namespace SG; void testDataInView( StoreGateSvc* /*sg*/ , MsgStream& log ) { - auto parentView = new View( "ParentView" ); + auto parentView = new View( "ParentView", -1 ); auto t1 = std::make_unique<TestClass>(); t1->value = 1; @@ -32,12 +32,11 @@ void testDataInView( StoreGateSvc* /*sg*/ , MsgStream& log ) { SG::WriteHandle<TestClass> wh( "test1" ); wh.setProxyDict( parentView ); auto status = wh.record( std::move( t1 ) ); - VALUE( status.isSuccess() ) EXPECTED( true ); + VALUE( status.isSuccess() ) EXPECTED( true ); } - auto childView = new View( "ChildView" ); + auto childView = new View( "ChildView", -1 ); - auto t2 = std::make_unique<TestClass>(); t2->value = 2; { @@ -51,7 +50,7 @@ void testDataInView( StoreGateSvc* /*sg*/ , MsgStream& log ) { { // rtivial test, we ask for a wrong object SG::ReadHandle<TestClass> rh( "test" ); - rh.setProxyDict( childView ); + rh.setProxyDict( childView ); VALUE( rh.isValid() ) EXPECTED( false ); } @@ -87,7 +86,7 @@ void testDataInView( StoreGateSvc* /*sg*/ , MsgStream& log ) { } log << MSG::INFO << "Views that are linked behave correctly " << endmsg; - // hide object from parent by adding one in the Child + // hide object from parent by adding one in the Child auto t3 = std::make_unique<TestClass>(); t3->value = 3; @@ -95,13 +94,13 @@ void testDataInView( StoreGateSvc* /*sg*/ , MsgStream& log ) { SG::WriteHandle<TestClass> wh( "test1" ); wh.setProxyDict( childView ); auto status = wh.record( std::move( t3 ) ); - VALUE( status.isSuccess() ) EXPECTED( true ); + VALUE( status.isSuccess() ) EXPECTED( true ); } { SG::ReadHandle<TestClass> rh( "test1" ); rh.setProxyDict( childView ); - EXPECT_EXCEPTION( std::runtime_error, rh.isValid() ); + EXPECT_EXCEPTION( std::runtime_error, rh.isValid() ); } log << MSG::INFO << "Hiding works as expected " << endmsg; @@ -116,17 +115,17 @@ void testFallThrough( StoreGateSvc* sg , MsgStream& log) { auto status = wh.record( std::move( t ) ); VALUE( status.isSuccess() ) EXPECTED( true ); - // the whole trick is that the read handle is pointed to the view, + // the whole trick is that the read handle is pointed to the view, // but should read from the main store if the fall though // is enabled { - auto opaqueView = new View( "OpaqueView", false ); + auto opaqueView = new View( "OpaqueView", -1, false ); SG::ReadHandle<TestClass> rh( "inStore" ); rh.setProxyDict( opaqueView ); VALUE( rh.isValid() ) EXPECTED( false ); } { - auto transparentView = new View( "TransparentView" ); + auto transparentView = new View( "TransparentView", -1 ); SG::ReadHandle<TestClass> rh( "inStore" ); rh.setProxyDict( transparentView ); VALUE( rh.isValid() ) EXPECTED( true ); @@ -161,7 +160,7 @@ int main() { return -1; } - testDataInView( pStore, log ); + testDataInView( pStore, log ); testFallThrough( pStore, log ); return 0; diff --git a/Control/AthViews/test/test_view_scheduling.sh b/Control/AthViews/test/test_view_scheduling.sh index bd09f63c3f668ecdb49d6c68ad850cfe993371a1..4199da9e144b784be4ffb622ef59aa8d28d6c73e 100755 --- a/Control/AthViews/test/test_view_scheduling.sh +++ b/Control/AthViews/test/test_view_scheduling.sh @@ -3,10 +3,10 @@ # art-ci: master athena.py --threads=1 AthViews/ViewScheduling.py | tee ViewScheduling.log -if grep "INFO condTestAlg running with store view1" ViewScheduling.log; then +if grep "INFO condTestAlg running with store view_1" ViewScheduling.log; then exit 1 fi -if ! grep "INFO condTestAlg running with store view0" ViewScheduling.log; then +if ! grep "INFO condTestAlg running with store view_0" ViewScheduling.log; then exit 1 fi if ! grep "INFO 109" ViewScheduling.log; then diff --git a/Control/AthenaCommon/python/AthOptionsParser.py b/Control/AthenaCommon/python/AthOptionsParser.py index b4c0129447c4ea25b57ccda5efc3119b01dfddf5..3583c9500cb3b6b3f287915e39f65a23ecc8c4d4 100644 --- a/Control/AthenaCommon/python/AthOptionsParser.py +++ b/Control/AthenaCommon/python/AthOptionsParser.py @@ -29,7 +29,7 @@ _userlongopts = [ "enable-ers-hdlr=", "keep-configuration","drop-configuration", "drop-and-reload", "config-only=", "dump-configuration=", - "tcmalloc", "stdcmalloc", "preloadlib=", + "tcmalloc", "stdcmalloc", "stdcmath", "imf", "preloadlib=", "nprocs=", "debugWorker", "pycintex_minvmem=", "cppyy_minvmem", @@ -93,6 +93,8 @@ Accepted command line options: --dump-configuration=<file> ... dump an ASCII version of the post-setup() configuration to <file> --tcmalloc ... use tcmalloc.so for memory allocation [DEFAULT]. This disables leak-check --stdcmalloc ... use libc malloc for memory allocation + --stdcmath ... use glibc math functions [DEFAULT] + --imf ... use Intel Math Function library: faster, but may give different numerical results from --stdcmath --preloadlib=<lib> ... localized preload of library <lib> --nprocs=n ... enable AthenaMP if n>=1 or n==-1 --threads=n ... number of threads for AthenaMT diff --git a/Control/AthenaCommon/share/athena.py b/Control/AthenaCommon/share/athena.py index 068658ad566f725dc1ac404e06939431f585d811..02d1d3402083ee1808735e3b126c2d3d43e9eb2a 100755 --- a/Control/AthenaCommon/share/athena.py +++ b/Control/AthenaCommon/share/athena.py @@ -32,6 +32,11 @@ fi export ATHENA_ADD_PRELOAD ATHENA_DROP_RELOAD=0 +export USEIMF=false +export IMF_LIB1="libimf.so" +export IMF_LIB2="libintlc.so.5" + + for a in ${@} do case "$a" in @@ -39,6 +44,8 @@ do --delete-check*) USETCMALLOC=0;; --stdcmalloc) USETCMALLOC=0;; --tcmalloc) USETCMALLOC=1;; + --stdcmath) USEIMF=0;; + --imf) USEIMF=1;; --preloadlib*) ATHENA_ADD_PRELOAD=${a#*=};; --drop-and-reload) ATHENA_DROP_RELOAD=1;; esac @@ -80,6 +87,26 @@ if [ "$USETCMALLOC" = "1" ] || [ "$USETCMALLOC" = "true" ] ; then fi fi +if [ $USEIMF == "1" ] || [ $USEIMF == true ]; then +fullimf1="$ATLASMKLLIBDIR_PRELOAD/$IMF_LIB1" +fullimf2="$ATLASMKLLIBDIR_PRELOAD/$IMF_LIB2" + if [ ! -e "$fullimf1" ]; then + echo "ERROR: $fullimf1 does not exit" + exit 1 + elif [ ! -e "$fullimf2" ]; then + echo "ERROR: $fullimf2 does not exit" + exit 1 + else + echo "Preloading $IMF_LIB1" + echo "Preloading $IMF_LIB2" + if [ -z $LD_PRELOAD ]; then + export LD_PRELOAD="$fullimf1:$fullimf2" + else + export LD_PRELOAD="$fullimf1:$fullimf2:$LD_PRELOAD" + fi + fi +fi + # optionally add user-specific preload library if [ "x$ATHENA_ADD_PRELOAD" != "x" ] && [ $ATHENA_DROP_RELOAD -eq 0 ]; then echo "Preloading $ATHENA_ADD_PRELOAD" diff --git a/Control/AthenaConfiguration/python/UnifyProperties.py b/Control/AthenaConfiguration/python/UnifyProperties.py index 4649d4bb5ff5f832e3c0414058269727c5ca6c84..35e8f5508eacbaf44c341ea463ec01d7bc5e7f3e 100644 --- a/Control/AthenaConfiguration/python/UnifyProperties.py +++ b/Control/AthenaConfiguration/python/UnifyProperties.py @@ -47,5 +47,6 @@ def unifyProperty(propname,prop1,prop2): if propname not in _propsToUnify: from AthenaConfiguration.ComponentAccumulator import DeduplicationFailed raise DeduplicationFailed("List property %s defined multiple times with conflicting values.\n " % propname \ - +"If this property should be merged, consider adding it to AthenaConfiguration/UnifyProperties.py") + + str(prop1) +"\n and \n" +str(prop2) \ + + "\nIf this property should be merged, consider adding it to AthenaConfiguration/UnifyProperties.py") return _propsToUnify[propname](prop1,prop2) diff --git a/Control/AthenaInterprocess/AthenaInterprocess/SharedQueue.h b/Control/AthenaInterprocess/AthenaInterprocess/SharedQueue.h index 4b2f405749d25fdd7a55620f611c4c7b81c32466..49e85c68d78a72f85dce4591ad8c2425fa9e9e08 100644 --- a/Control/AthenaInterprocess/AthenaInterprocess/SharedQueue.h +++ b/Control/AthenaInterprocess/AthenaInterprocess/SharedQueue.h @@ -5,7 +5,7 @@ #ifndef ATHENAINTERPROCESS_SHAREDQUEUE_H #define ATHENAINTERPROCESS_SHAREDQUEUE_H -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" // full include needed, as message_queue has changed into a // template for more recent versions of boost diff --git a/Control/AthenaInterprocess/CMakeLists.txt b/Control/AthenaInterprocess/CMakeLists.txt index ceaef821e94d82f4863efe94f3ba2fca6f73582e..ad25efbefc1567a1c17b1f81c1f26ca3aee2ac8f 100644 --- a/Control/AthenaInterprocess/CMakeLists.txt +++ b/Control/AthenaInterprocess/CMakeLists.txt @@ -7,8 +7,7 @@ atlas_subdir( AthenaInterprocess ) # Declare the package's dependencies: atlas_depends_on_subdirs( PUBLIC - Control/CLIDSvc - Control/SGTools + Control/AthenaKernel GaudiKernel ) # External dependencies: @@ -20,5 +19,5 @@ atlas_add_library( AthenaInterprocess src/*.cxx PUBLIC_HEADERS AthenaInterprocess INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${UUID_INCLUDE_DIRS} - LINK_LIBRARIES ${Boost_LIBRARIES} ${UUID_LIBRARIES} SGTools GaudiKernel ) + LINK_LIBRARIES ${Boost_LIBRARIES} ${UUID_LIBRARIES} AthenaKernel GaudiKernel rt ) diff --git a/Control/AthenaKernel/test/DirSearchPath_test.cxx b/Control/AthenaKernel/test/DirSearchPath_test.cxx index a178da992cd3bfcd867096e65c2548da20fd47d8..f868e296acec7ba0bff393107c20765c2e1df816 100644 --- a/Control/AthenaKernel/test/DirSearchPath_test.cxx +++ b/Control/AthenaKernel/test/DirSearchPath_test.cxx @@ -13,7 +13,17 @@ #undef NDEBUG #include <cassert> #include <iostream> +// Suppress a gcc8 warning from boost. +// (Binaries apparently include boost with -I rather than -isystem.) +// Fixed in boost 1.68 (see https://github.com/boostorg/mpl/issues/31) +#ifdef __GNUC__ +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wparentheses" +#endif #include "boost/filesystem/operations.hpp" +#ifdef __GNUC__ +# pragma GCC diagnostic pop +#endif #include "GaudiKernel/DirSearchPath.h" using namespace std; diff --git a/Control/CLIDSvc/CLIDSvc/tools/CLIDRegistry.h b/Control/CLIDSvc/CLIDSvc/tools/CLIDRegistry.h deleted file mode 100755 index 0afa4e25f984c78c22e9b58a18d160a50c932192..0000000000000000000000000000000000000000 --- a/Control/CLIDSvc/CLIDSvc/tools/CLIDRegistry.h +++ /dev/null @@ -1,11 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef TOOLS_CLIDREGISTRY_H -# define TOOLS_CLIDREGISTRY_H - -// forwarding to 'real' CLIDRegistry -#include "SGTools/CLIDRegistry.h" - -#endif // TOOLS_CLIDREGISTRY_H diff --git a/Control/CLIDSvc/CLIDSvc/tools/ClassID_traits.h b/Control/CLIDSvc/CLIDSvc/tools/ClassID_traits.h deleted file mode 100755 index 5f132a6a387aecbdc87a35e4a9049379a0bf73b1..0000000000000000000000000000000000000000 --- a/Control/CLIDSvc/CLIDSvc/tools/ClassID_traits.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef TOOLS_CLASSID_TRAITS_H -#define TOOLS_CLASSID_TRAITS_H - -// forwarding to 'real' ClassID_traits -#include "SGTools/ClassID_traits.h" - -#endif - - - - - diff --git a/Control/CxxUtils/Root/crc64.cxx b/Control/CxxUtils/Root/crc64.cxx index c2846f1c13acd5e3eb4c02f532b60f658ccc5c85..cc73cb4c527db4444a5d3c89a6e01a9682864630 100644 --- a/Control/CxxUtils/Root/crc64.cxx +++ b/Control/CxxUtils/Root/crc64.cxx @@ -91,9 +91,9 @@ * The way a CRC calculation works is by iteratively reducing the length * of the message in such a way that the CRC does not change. For example, * suppose we have a message M that is split into two parts, A of T bits, - * and B of U bits. This, M = 2^U A + B. Then suppose we find a shorter + * and B of U bits. Thus, M = 2^U A + B. Then suppose we find a shorter * string A' with T' bits, such that A mod P = A' mod P. It is then easy - * to show that the string M' = 2U A' + B has the same CRC: + * to show that the string M' = 2^U A' + B has the same CRC: * * M mod P = [(x^U mod P)(A mod P)] mod P + B mod P * M' mod P = [(x^U mod P)(A' mod P)] mod P + B mod P diff --git a/Control/CxxUtils/test/ConcurrentBitset_test.cxx b/Control/CxxUtils/test/ConcurrentBitset_test.cxx index 93c57415807219bc2e42fe7f026b10c31fb07da8..c305ee051234ef8c3054502872f48e52784ed3fb 100644 --- a/Control/CxxUtils/test/ConcurrentBitset_test.cxx +++ b/Control/CxxUtils/test/ConcurrentBitset_test.cxx @@ -15,7 +15,16 @@ #include "CxxUtils/ConcurrentBitset.h" #include "CxxUtils/checker_macros.h" #include "TestTools/random.h" +// Work around a warning in tbb, found by gcc8. +// Fixed in TBB 2018 U5. +#if defined(__GNUC__) && __GNUC__ >= 8 +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wclass-memaccess" +#endif #include "tbb/concurrent_unordered_set.h" +#if defined(__GNUC__) && __GNUC__ >= 8 +# pragma GCC diagnostic pop +#endif #include "boost/timer/timer.hpp" #ifdef HAVE_CK extern "C" { diff --git a/Control/DataModelAthenaPool/CMakeLists.txt b/Control/DataModelAthenaPool/CMakeLists.txt index ee83a65e4bad4f5e13cd9ccd2e35c196095a8d32..0cdd4b8b08ca7309a0fe8ee24ef500b8721e50ae 100644 --- a/Control/DataModelAthenaPool/CMakeLists.txt +++ b/Control/DataModelAthenaPool/CMakeLists.txt @@ -17,7 +17,6 @@ atlas_depends_on_subdirs( PUBLIC GaudiKernel PRIVATE AtlasTest/TestTools - Control/CLIDSvc Control/SGTools Database/AthenaPOOL/AthenaPoolUtilities Database/AthenaPOOL/RootConversions ) diff --git a/Control/DataModelAthenaPool/test/DataLink_p2_test.cxx b/Control/DataModelAthenaPool/test/DataLink_p2_test.cxx index fcd18c46a224c995863f91ec61361fd1a46d6f2a..4742e8673c6cc4ab1e97f2444214df5b772b63ff 100755 --- a/Control/DataModelAthenaPool/test/DataLink_p2_test.cxx +++ b/Control/DataModelAthenaPool/test/DataLink_p2_test.cxx @@ -15,7 +15,7 @@ #undef NDEBUG #include "AthLinks/DataLink.h" #include "DataModelAthenaPool/DataLinkCnv_p2.h" -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include <vector> #include <cassert> #include <iostream> diff --git a/Control/DataModelAthenaPool/test/ElementLinkCnv_p1_test.cxx b/Control/DataModelAthenaPool/test/ElementLinkCnv_p1_test.cxx index 472ca2c452e6546dbfd2b6c8f15a2813f468418e..d96ca65a8ab17591081960a675b7a11100dec10c 100644 --- a/Control/DataModelAthenaPool/test/ElementLinkCnv_p1_test.cxx +++ b/Control/DataModelAthenaPool/test/ElementLinkCnv_p1_test.cxx @@ -16,7 +16,7 @@ #undef NDEBUG #include "AthLinks/ElementLink.h" #include "DataModelAthenaPool/ElementLinkCnv_p1.h" -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include <vector> #include <cassert> #include <iostream> diff --git a/Control/DataModelAthenaPool/test/ElementLinkCnv_p2_test.cxx b/Control/DataModelAthenaPool/test/ElementLinkCnv_p2_test.cxx index 0ae5441fdc5e3c7c9dae6541acc65111cb8a4f8c..10a9e718bddcef1c33b3b15868fc0cac77e6ad9b 100644 --- a/Control/DataModelAthenaPool/test/ElementLinkCnv_p2_test.cxx +++ b/Control/DataModelAthenaPool/test/ElementLinkCnv_p2_test.cxx @@ -16,7 +16,7 @@ #undef NDEBUG #include "AthLinks/ElementLink.h" #include "DataModelAthenaPool/ElementLinkCnv_p2.h" -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include <vector> #include <cassert> #include <iostream> diff --git a/Control/DataModelAthenaPool/test/ElementLinkCnv_p3_test.cxx b/Control/DataModelAthenaPool/test/ElementLinkCnv_p3_test.cxx index 785920512c75f0ab8aa572dc7136e3123eb9eb74..0dfcefeeeddc1ecd879fa123166d29bc89426819 100644 --- a/Control/DataModelAthenaPool/test/ElementLinkCnv_p3_test.cxx +++ b/Control/DataModelAthenaPool/test/ElementLinkCnv_p3_test.cxx @@ -16,7 +16,7 @@ #undef NDEBUG #include "AthLinks/ElementLink.h" #include "DataModelAthenaPool/ElementLinkCnv_p3.h" -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include <vector> #include <cassert> #include <iostream> diff --git a/Control/DataModelAthenaPool/test/ElementLinkVectorCnv_p1_test.cxx b/Control/DataModelAthenaPool/test/ElementLinkVectorCnv_p1_test.cxx index 89d0ead85fd63fa1575b6d8c1746b4e3263781ba..fe006be491a95ba5d0eacf9b47dfb258e2cec236 100644 --- a/Control/DataModelAthenaPool/test/ElementLinkVectorCnv_p1_test.cxx +++ b/Control/DataModelAthenaPool/test/ElementLinkVectorCnv_p1_test.cxx @@ -16,7 +16,7 @@ #undef NDEBUG #include "AthLinks/ElementLinkVector.h" #include "DataModelAthenaPool/ElementLinkVectorCnv_p1.h" -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include <vector> #include <cassert> #include <iostream> diff --git a/Control/DataModelAthenaPool/test/NavigableCnv_p1_test.cxx b/Control/DataModelAthenaPool/test/NavigableCnv_p1_test.cxx index 8320ee5aa24f0f798f17ca52243151a43648a344..e2de60da842e1e0a6787ae59f58e4dcc93bc5b0f 100644 --- a/Control/DataModelAthenaPool/test/NavigableCnv_p1_test.cxx +++ b/Control/DataModelAthenaPool/test/NavigableCnv_p1_test.cxx @@ -18,7 +18,7 @@ #include "Navigation/NavigableTerminalNode.h" #include "DataModelAthenaPool/NavigableCnv_p1.h" #include "AthContainers/DataVector.h" -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include <vector> #include <cassert> #include <iostream> diff --git a/Control/DataModelAthenaPool/test/NavigableCnv_p2_test.cxx b/Control/DataModelAthenaPool/test/NavigableCnv_p2_test.cxx index 6d24041ebe4e223fb94ed6fc1ddd51030c220b9b..03683ae98680713314a44d7fff2a6153283852b5 100644 --- a/Control/DataModelAthenaPool/test/NavigableCnv_p2_test.cxx +++ b/Control/DataModelAthenaPool/test/NavigableCnv_p2_test.cxx @@ -18,7 +18,7 @@ #include "Navigation/NavigableTerminalNode.h" #include "DataModelAthenaPool/NavigableCnv_p2.h" #include "AthContainers/DataVector.h" -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include <vector> #include <cassert> #include <iostream> diff --git a/Control/DataModelAthenaPool/test/NavigableVectorCnv_p1_test.cxx b/Control/DataModelAthenaPool/test/NavigableVectorCnv_p1_test.cxx index c7f9eee352e01c848ed99fd678f66d2e5888c8ba..8e7d96da97a2a18ef2b5c8210d41c1971058eb0e 100644 --- a/Control/DataModelAthenaPool/test/NavigableVectorCnv_p1_test.cxx +++ b/Control/DataModelAthenaPool/test/NavigableVectorCnv_p1_test.cxx @@ -18,7 +18,7 @@ #include "Navigation/NavigableTerminalNode.h" #include "DataModelAthenaPool/NavigableVectorCnv_p1.h" #include "AthContainers/DataVector.h" -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include <vector> #include <cassert> #include <iostream> diff --git a/Control/DataModelAthenaPool/test/NavigableVectorCnv_p2_test.cxx b/Control/DataModelAthenaPool/test/NavigableVectorCnv_p2_test.cxx index ac6e3f90243a4f3cd24c168b9abc68862cc1121d..d812912eb985f78801f037c73585e98323ebd863 100644 --- a/Control/DataModelAthenaPool/test/NavigableVectorCnv_p2_test.cxx +++ b/Control/DataModelAthenaPool/test/NavigableVectorCnv_p2_test.cxx @@ -18,7 +18,7 @@ #include "Navigation/NavigableTerminalNode.h" #include "DataModelAthenaPool/NavigableVectorCnv_p2.h" #include "AthContainers/DataVector.h" -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include <vector> #include <cassert> #include <iostream> diff --git a/Control/PerformanceMonitoring/PerfMonEvent/CMakeLists.txt b/Control/PerformanceMonitoring/PerfMonEvent/CMakeLists.txt index 508f944440c3f45895063f1715a176b322aae458..b71e7773dfbe6901d2d75b8ff8c0eaad2489ebd6 100644 --- a/Control/PerformanceMonitoring/PerfMonEvent/CMakeLists.txt +++ b/Control/PerformanceMonitoring/PerfMonEvent/CMakeLists.txt @@ -13,6 +13,13 @@ atlas_depends_on_subdirs( PUBLIC find_package( PythonLibs ) find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread ) +# We don't have a direct dependency on boost from this package, but if we +# pick up the dependency implicitly rather than explicitly, we include +# root headers with -I rather than -isystem. +# That exposes us to a warning found by gcc8 in mpl/assert.h. +# [Fixed in boost 1.68; see https://github.com/boostorg/mpl/issues/31.] +find_package( Boost ) + # Component(s) in the package: atlas_add_library( PerfMonEvent src/PyStore.cxx @@ -21,9 +28,9 @@ atlas_add_library( PerfMonEvent src/MemStatsHooks.cxx src/MallocStats.cxx PUBLIC_HEADERS PerfMonEvent - INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS} + INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${PYTHON_LIBRARIES} GaudiKernel rt + LINK_LIBRARIES ${PYTHON_LIBRARIES} ${Boost_LIBRARIES} GaudiKernel rt PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} ) atlas_add_dictionary( PerfMonEventDict diff --git a/Control/SGTools/src/SGVersionedKey.cxx b/Control/SGTools/src/SGVersionedKey.cxx index df4cdd5c952272a81a5e96bfab7465972699635d..bc39b0e4acb96d9750288c8604ba7a6f64a800b8 100644 --- a/Control/SGTools/src/SGVersionedKey.cxx +++ b/Control/SGTools/src/SGVersionedKey.cxx @@ -55,8 +55,8 @@ void VersionedKey::decode(std::string& outKey, unsigned char& version) const { void VersionedKey::encode(const std::string& inKey, unsigned char version) { assert(version <= 99); - char vers[5]; - snprintf(vers, 5, versionFormatString(), version); + char vers[6]; + snprintf(vers, 6, versionFormatString(), version); m_versionKey = vers + inKey; m_baseKey = inKey; } diff --git a/Control/StoreGate/StoreGate/VarHandleKey.h b/Control/StoreGate/StoreGate/VarHandleKey.h index 297913c5a14348aaaebb195c15fcf5af6ac10f3c..cebaf602a17b0583719e5462edf974c29c0f1139 100644 --- a/Control/StoreGate/StoreGate/VarHandleKey.h +++ b/Control/StoreGate/StoreGate/VarHandleKey.h @@ -65,7 +65,7 @@ public: * @param isCond True if this is a CondHandleKey. * * The provided key may actually start with the name of the store, - * separated by a "+": "MyStore:Obj". If no "+" is present + * separated by a "+": "MyStore+Obj". If no "+" is present * the store named by @c storeName is used. However, if the key name * starts with a slash, it is interpreted as a hierarchical key name, * not an empty store name. diff --git a/Control/StoreGate/StoreGate/WriteHandle.h b/Control/StoreGate/StoreGate/WriteHandle.h index a6c3c73d512b47276bdd9e2995f0f497dfff6d95..968b3a664c07fb7ddfaefbc7a6fbf1edd5acaefe 100644 --- a/Control/StoreGate/StoreGate/WriteHandle.h +++ b/Control/StoreGate/StoreGate/WriteHandle.h @@ -267,7 +267,7 @@ public: * @param returnExisting Allow an existing object? * * Unlike record(), this does not change the handle object. - * That means that will not be able to get the object back + * That means that one will not be able to get the object back * by dereferencing the handle. * Returns the object placed in the store, or nullptr if there * was an error. @@ -285,7 +285,7 @@ public: * @param returnExisting Allow an existing object? * * Unlike record(), this does not change the handle object. - * That means that will not be able to get the object back + * That means that one will not be able to get the object back * by dereferencing the handle. * Returns the object placed in the store, or nullptr if there * was an error. @@ -303,7 +303,7 @@ public: * @param returnExisting Allow an existing object? * * Unlike record(), this does not change the handle object. - * That means that will not be able to get the object back + * That means that one will not be able to get the object back * by dereferencing the handle. * Returns the object placed in the store, or nullptr if there * was an error. @@ -322,7 +322,7 @@ public: * @param returnExisting Allow an existing object? * * Unlike record(), this does not change the handle object. - * That means that will not be able to get the object back + * That means that one will not be able to get the object back * by dereferencing the handle. * Returns the object placed in the store, or nullptr if there * was an error. @@ -342,7 +342,7 @@ public: * @param returnExisting Allow an existing object? * * Unlike record(), this does not change the handle object. - * That means that will not be able to get the object back + * That means that one will not be able to get the object back * by dereferencing the handle. * Returns the object placed in the store, or nullptr if there * was an error. @@ -360,7 +360,7 @@ public: * @param data The object to record. * * Unlike record(), this does not change the handle object. - * That means that will not be able to get the object back + * That means that one will not be able to get the object back * by dereferencing the handle. * Returns the object placed in the store, or nullptr if there * was an error. @@ -376,7 +376,7 @@ public: * @param data The object to record. * * Unlike record(), this does not change the handle object. - * That means that will not be able to get the object back + * That means that one will not be able to get the object back * by dereferencing the handle. * Returns the object placed in the store, or nullptr if there * was an error. @@ -393,7 +393,7 @@ public: * @param auxstore Auxiliary store object. * * Unlike record(), this does not change the handle object. - * That means that will not be able to get the object back + * That means that one will not be able to get the object back * by dereferencing the handle. * Returns the object placed in the store, or nullptr if there * was an error. @@ -412,7 +412,7 @@ public: * @param auxstore Auxiliary store object. * * Unlike record(), this does not change the handle object. - * That means that will not be able to get the object back + * That means that one will not be able to get the object back * by dereferencing the handle. * Returns the object placed in the store, or nullptr if there * was an error. @@ -435,7 +435,7 @@ public: * @param auxstore Auxiliary store object. * * Unlike record(), this does not change the handle object. - * That means that will not be able to get the object back + * That means that one will not be able to get the object back * by dereferencing the handle. * Returns the object placed in the store, or nullptr if there * was an error. @@ -456,7 +456,7 @@ public: * @param auxstore Auxiliary store object. * * Unlike record(), this does not change the handle object. - * That means that will not be able to get the object back + * That means that one will not be able to get the object back * by dereferencing the handle. * Returns the object placed in the store, or nullptr if there * was an error. @@ -554,7 +554,7 @@ private: * @param[out] store The store being used. * * Unlike record(), this does not change the handle object. - * That means that will not be able to get the object back + * That means that one will not be able to get the object back * by dereferencing the handle. * Returns the object placed in the store, or nullptr if there * was an error. @@ -576,7 +576,7 @@ private: * @param auxstore Auxiliary store object. * * Unlike record(), this does not change the handle object. - * That means that will not be able to get the object back + * That means that one will not be able to get the object back * by dereferencing the handle. * Returns the object placed in the store, or nullptr if there * was an error. @@ -597,7 +597,7 @@ private: * @param auxstore Auxiliary store object. * * Unlike record(), this does not change the handle object. - * That means that will not be able to get the object back + * That means that one will not be able to get the object back * by dereferencing the handle. * Returns the object placed in the store, or nullptr if there * was an error. diff --git a/Control/StoreGate/StoreGate/WriteHandle.icc b/Control/StoreGate/StoreGate/WriteHandle.icc index 5d79ff5d75f802b50a431e08efeab51a5a4f4f5c..81502357d36077883df34c058aeff7660921461a 100644 --- a/Control/StoreGate/StoreGate/WriteHandle.icc +++ b/Control/StoreGate/StoreGate/WriteHandle.icc @@ -338,7 +338,7 @@ WriteHandle<T>::recordNonConst (SG::DataObjectSharedPtr<T> data) * @param returnExisting Allow an existing object? * * Unlike record(), this does not change the handle object. - * That means that will not be able to get the object back + * That means that one will not be able to get the object back * by dereferencing the handle. * Returns the object placed in the store, or nullptr if there * was an error. @@ -363,7 +363,7 @@ WriteHandle<T>::put (std::unique_ptr<T> data, * @param returnExisting Allow an existing object? * * Unlike record(), this does not change the handle object. - * That means that will not be able to get the object back + * That means that one will not be able to get the object back * by dereferencing the handle. * Returns the object placed in the store, or nullptr if there * was an error. @@ -388,7 +388,7 @@ WriteHandle<T>::put (std::unique_ptr<const T> data, * @param returnExisting Allow an existing object? * * Unlike record(), this does not change the handle object. - * That means that will not be able to get the object back + * That means that one will not be able to get the object back * by dereferencing the handle. * Returns the object placed in the store, or nullptr if there * was an error. @@ -415,7 +415,7 @@ WriteHandle<T>::put (std::unique_ptr<const ConstDataVector<T> > data, * @param returnExisting Allow an existing object? * * Unlike record(), this does not change the handle object. - * That means that will not be able to get the object back + * That means that one will not be able to get the object back * by dereferencing the handle. * Returns the object placed in the store, or nullptr if there * was an error. @@ -442,7 +442,7 @@ WriteHandle<T>::put (const EventContext& ctx, * @param returnExisting Allow an existing object? * * Unlike record(), this does not change the handle object. - * That means that will not be able to get the object back + * That means that one will not be able to get the object back * by dereferencing the handle. * Returns the object placed in the store, or nullptr if there * was an error. @@ -467,7 +467,7 @@ WriteHandle<T>::put (const EventContext& ctx, * @param data The object to record. * * Unlike record(), this does not change the handle object. - * That means that will not be able to get the object back + * That means that one will not be able to get the object back * by dereferencing the handle. * Returns the object placed in the store, or nullptr if there * was an error. @@ -490,7 +490,7 @@ WriteHandle<T>::put (SG::DataObjectSharedPtr<T> data) const * @param data The object to record. * * Unlike record(), this does not change the handle object. - * That means that will not be able to get the object back + * That means that one will not be able to get the object back * by dereferencing the handle. * Returns the object placed in the store, or nullptr if there * was an error. @@ -514,7 +514,7 @@ WriteHandle<T>::put (const EventContext& ctx, * @param auxstore Auxiliary store object. * * Unlike record(), this does not change the handle object. - * That means that will not be able to get the object back + * That means that one will not be able to get the object back * by dereferencing the handle. * Returns the object placed in the store, or nullptr if there * was an error. @@ -538,7 +538,7 @@ WriteHandle<T>::put (std::unique_ptr<T> data, * @param auxstore Auxiliary store object. * * Unlike record(), this does not change the handle object. - * That means that will not be able to get the object back + * That means that one will not be able to get the object back * by dereferencing the handle. * Returns the object placed in the store, or nullptr if there * was an error. @@ -565,7 +565,7 @@ WriteHandle<T>::put (std::unique_ptr<const T> data, * @param auxstore Auxiliary store object. * * Unlike record(), this does not change the handle object. - * That means that will not be able to get the object back + * That means that one will not be able to get the object back * by dereferencing the handle. * Returns the object placed in the store, or nullptr if there * was an error. @@ -590,7 +590,7 @@ WriteHandle<T>::put (const EventContext& ctx, * @param auxstore Auxiliary store object. * * Unlike record(), this does not change the handle object. - * That means that will not be able to get the object back + * That means that one will not be able to get the object back * by dereferencing the handle. * Returns the object placed in the store, or nullptr if there * was an error. diff --git a/Control/StoreGateTests/CMakeLists.txt b/Control/StoreGateTests/CMakeLists.txt index 3b9f15dd0b407e4905623061236e838151dbb6e6..cf0da065b32e2075975bd785db5248aa3f565c0b 100644 --- a/Control/StoreGateTests/CMakeLists.txt +++ b/Control/StoreGateTests/CMakeLists.txt @@ -8,10 +8,9 @@ atlas_subdir( StoreGateTests ) # Declare the package's dependencies: atlas_depends_on_subdirs( PUBLIC Control/AthenaPython - Control/CLIDSvc + Control/AthenaKernel Control/AthAllocators Control/AthContainers - Control/SGTools PRIVATE Control/AthenaBaseComps Control/StoreGate @@ -25,13 +24,13 @@ atlas_add_component( StoreGateTests src/*.cxx src/components/*.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AthAllocators AthContainers SGTools AthenaBaseComps StoreGateLib SGtests GaudiKernel ) + LINK_LIBRARIES ${ROOT_LIBRARIES} AthAllocators AthContainers AthenaBaseComps StoreGateLib SGtests GaudiKernel ) atlas_add_dictionary( StoreGateTestsDict StoreGateTests/StoreGateTestsDict.h StoreGateTests/selection.xml INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AthAllocators AthContainers SGTools AthenaBaseComps StoreGateLib SGtests GaudiKernel ) + LINK_LIBRARIES ${ROOT_LIBRARIES} AthAllocators AthContainers AthenaBaseComps StoreGateLib SGtests GaudiKernel ) # Install files from the package: atlas_install_headers( StoreGateTests ) diff --git a/Control/StoreGateTests/StoreGateTests/PayLoad.h b/Control/StoreGateTests/StoreGateTests/PayLoad.h index 485f360d4ad6d6021cc9cf1c4fd172f31a28e76b..ffbbb7b08a8f1ca6412712a22e29febed2840b46 100755 --- a/Control/StoreGateTests/StoreGateTests/PayLoad.h +++ b/Control/StoreGateTests/StoreGateTests/PayLoad.h @@ -22,7 +22,7 @@ #include <vector> #include "AthContainers/DataVector.h" -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" namespace SgTests { struct PayLoad { diff --git a/Control/Valkyrie/src/ValgrindAuditor.cxx b/Control/Valkyrie/src/ValgrindAuditor.cxx index 0477b4bccd07c1cfd5227d3ca51a2fa47f483a04..f9b07091158dbb30f34862955091166c5252e639 100644 --- a/Control/Valkyrie/src/ValgrindAuditor.cxx +++ b/Control/Valkyrie/src/ValgrindAuditor.cxx @@ -92,7 +92,7 @@ StatusCode ValgrindAuditor::initialize() try { m_algsRegEx.push_back( boost::regex(re) ); } - catch ( boost::regex_error ) { + catch ( const boost::regex_error& ) { msgStream() << MSG::ERROR << "Ignoring invalid regular expression: " << re << endmsg; } } @@ -276,7 +276,7 @@ namespace { try { nameEvt.first = boost::regex(s.substr(0,loc)); } - catch ( boost::regex_error ) { + catch ( const boost::regex_error& ) { return StatusCode::FAILURE; } diff --git a/DataQuality/DataQualityConfigurations/config/TRT/collisions_run.config b/DataQuality/DataQualityConfigurations/config/TRT/collisions_run.config index 2eecb1d7bb137db4d673142a4a5d3dbd9550d846..552993d5eac547746d1a5cad8640d61dc3c5a860 100644 --- a/DataQuality/DataQualityConfigurations/config/TRT/collisions_run.config +++ b/DataQuality/DataQualityConfigurations/config/TRT/collisions_run.config @@ -201,13 +201,13 @@ dir TRT { hist hrtRelation { algorithm = TRT_Histogram_Has_NonZero_Entries output = InnerDetector/TRT/TRTB - display = polynomial(+5.119e-02, +6.046e-02, -1.692e-04, -4.869e-06)#calib 814 + display = polynomial(0.07944729328125003, 0.052537201718750016, 4.200959702343751e-05, -6.640608203125001e-06)# run 358031 } hist hrtRelation_Ar { weight = 0 algorithm = TRT_Histogram_Has_NonZero_Entries output = InnerDetector/TRT/TRTB - display = polynomial(+5.119e-02, +6.046e-02, -1.692e-04, -4.869e-06)#calib 814 + display = polynomial(-0.25539788124999774, 0.07852616992187476, -0.00039612444503905664, -5.0975400156250314e-06)# run 358031 } hist hTronTDist { algorithm = TRT_SideBand_Relative/TronTDist @@ -379,13 +379,13 @@ dir TRT { hist hrtRelation_A { algorithm = TRT_Histogram_Has_NonZero_Entries output = InnerDetector/TRT/TRTEA - display = polynomial(+5.119e-02, +6.046e-02, -1.692e-04, -4.869e-06)#calib 814 + display = polynomial(0.043732452656250025, 0.05531411160156242, -1.3958886140625016e-05, -5.9780181484374954e-06)#run 358031 } hist hrtRelation_Ar_A { weight = 0 algorithm = TRT_Histogram_Has_NonZero_Entries output = InnerDetector/TRT/TRTEA - display = polynomial(+5.119e-02, +6.046e-02, -1.692e-04, -4.869e-06)#calib 814 + display = polynomial(-0.34178648920454585, 0.08604125039772785, -0.0005760035497159088, -3.4860870939772757e-06)#run 358031 } hist hTronTDist_A { algorithm = TRT_SideBand_Relative/TronTDist @@ -535,13 +535,13 @@ dir TRT { hist hrtRelation_C { algorithm = TRT_Histogram_Has_NonZero_Entries output = InnerDetector/TRT/TRTEC - display = polynomial(+5.119e-02, +6.046e-02, -1.692e-04, -4.869e-06)#calib 814 + display = polynomial(0.043732452656250025, 0.05531411160156242, -1.3958886140625016e-05, -5.9780181484374954e-06)#run 358031 } hist hrtRelation_Ar_C { weight = 0 algorithm = TRT_Histogram_Has_NonZero_Entries output = InnerDetector/TRT/TRTEC - display = polynomial(+5.119e-02, +6.046e-02, -1.692e-04, -4.869e-06)#calib 814 + display = polynomial(-0.34178648920454585, 0.08604125039772785, -0.0005760035497159088, -3.4860870939772757e-06)#run 358031 } hist hTronTDist_C { algorithm = TRT_SideBand_Relative/TronTDist @@ -874,46 +874,55 @@ algorithm TRT_OutlierAndFlatnessTest { thresholds = TRT_OutlierAndFlatnessTest/AvgHLOcc CheckSigmaDev = 0 CheckRelDev = 1 - RelDev = 0.12 + RelDev = 0.02 } algorithm AvgLLOcc { reference = stream=physics_Main:CentrallyManagedReferences_Main;CentrallyManagedReferences thresholds = TRT_OutlierAndFlatnessTest/AvgLLOcc - CheckSigmaDev = 1 - SigmaDev = 5 + CheckSigmaDev = 0 + CheckRelDev = 1 + RelDev = 0.02 + DivideByReference = 1 } algorithm AvgTroTDetPhi { reference = stream=physics_Main:CentrallyManagedReferences_Main;CentrallyManagedReferences thresholds = TRT_OutlierAndFlatnessTest/AvgTroTDetPhi - CheckSigmaDev = 1 - SigmaDev = 5 + CheckSigmaDev = 0 + CheckRelDev = 1 + RelDev = 0.02 DivideByReference = 1 } algorithm NumHoTDetPhi { reference = stream=physics_Main:CentrallyManagedReferences_Main;CentrallyManagedReferences thresholds = TRT_OutlierAndFlatnessTest/NumHoTDetPhi - CheckSigmaDev = 1 - SigmaDev = 5 + CheckSigmaDev = 0 + CheckRelDev = 1 + RelDev = 0.02 DivideByReference = 1 } algorithm NumTrksDetPhi { reference = stream=physics_Main:CentrallyManagedReferences_Main;CentrallyManagedReferences thresholds = TRT_OutlierAndFlatnessTest/NumTrksDetPhi - CheckSigmaDev = 1 - SigmaDev = 5 + CheckSigmaDev = 0 + CheckRelDev = 1 + RelDev = 0.02 DivideByReference = 1 } algorithm EvtPhaseDetPhi { reference = stream=physics_Main:CentrallyManagedReferences_Main;CentrallyManagedReferences thresholds = TRT_OutlierAndFlatnessTest/EvtPhaseDetPhi - CheckSigmaDev = 1 - SigmaDev = 5 + CheckSigmaDev = 0 + CheckRelDev = 1 + RelDev = 0.02 + DivideByReference = 1 } algorithm HTFracTrackPhi { reference = stream=physics_Main:CentrallyManagedReferences_Main;CentrallyManagedReferences thresholds = TRT_OutlierAndFlatnessTest/HTFracTrackPhi - CheckSigmaDev = 1 - SigmaDev = 5 + CheckSigmaDev = 0 + CheckRelDev = 1 + RelDev = 0.02 + DivideByReference = 1 } } diff --git a/DataQuality/GoodRunsLists/Root/TGoodRunsList.cxx b/DataQuality/GoodRunsLists/Root/TGoodRunsList.cxx index 3d5ae8ce4eef37c4dec577d674f536991a9ea7c6..6d2307b8849f15e995dc4de826a083bedb214e60 100644 --- a/DataQuality/GoodRunsLists/Root/TGoodRunsList.cxx +++ b/DataQuality/GoodRunsLists/Root/TGoodRunsList.cxx @@ -76,7 +76,7 @@ Root::TGoodRunsList::operator=(const Root::TGoodRunsList& other) void Root::TGoodRunsList::AddGRL(const TGoodRunsList& other) { - // ensure version and metadata are identical + // ensure version and name are identical Bool_t same = this->HasSameGRLInfo(other); if (m_checkGRLInfo || other.GetCheckGRLInfo()) { if (!same) { @@ -89,6 +89,25 @@ Root::TGoodRunsList::AddGRL(const TGoodRunsList& other) } } + // merge metadata + for (const auto& othermditem : other.GetMetaData()) { + auto thismditem = m_metadata.find(othermditem.first); + if (thismditem == m_metadata.end()) { + m_metadata.insert(othermditem); + } else { + auto& nameStr = othermditem.first; + auto& thisvaluestr = thismditem->second; + if (thisvaluestr != othermditem.second) { + if (nameStr == "RunList") { + thisvaluestr += ","; + } else { + thisvaluestr += " | "; + } + thisvaluestr += othermditem.second; + } + } + } + const TGoodRunsList& diffgrl = this->GetPartOnlyIn(other); std::map<Int_t,Root::TGoodRun>::const_iterator itr; diff --git a/Database/APR/CollectionBase/test/Factory_test.cxx b/Database/APR/CollectionBase/test/Factory_test.cxx index fffbfe50c12ecc2a6f80ed123e3dcd7628d464de..6d389082da3af0880606002bc22cfffe6f1fb832 100644 --- a/Database/APR/CollectionBase/test/Factory_test.cxx +++ b/Database/APR/CollectionBase/test/Factory_test.cxx @@ -117,8 +117,10 @@ int main(int argc, char** ) collection = factory->openWithPhysicalName(physicalName, 0); } cout << (collection ? "OK":"KO") << endl; + delete collection; + collection = nullptr; + - cout << "Open collection 1 with guid .... "; if(crude) { CollectionDescription desc( guid, "" ); @@ -126,6 +128,8 @@ int main(int argc, char** ) } else collection = factory->openWithGuid(guid, 0); cout << (collection ? "OK":"KO") << endl; + delete collection; + collection = nullptr; cout << "Open collection 2 with logical name .... "; @@ -135,6 +139,8 @@ int main(int argc, char** ) } else collection = factory->openWithLogicalName("logicalName2", 0); cout << (collection ? "OK":"KO") << endl; + delete collection; + collection = nullptr; cout << "Try to create the existing collection 0 ... "; @@ -153,7 +159,7 @@ int main(int argc, char** ) } - + cout << "Try to replace the replicated collection 1 ... "; physicalName = collType+"|"+collConnection+"|"+"Collection1"; try{ @@ -181,13 +187,15 @@ int main(int argc, char** ) CollectionDescription desc( "Collection0", collType, collConnection ); collection = factory->createAndRegister( desc, 0, true, "", collMetaData ); } + delete collection; + collection = nullptr; cout << "OK, this works" << endl; }catch( std::exception& e){ cout << "ERROR, this should work" << endl; std::cout << "Exception: "<<e.what()<<std::endl; } - + cout << "Try to update the NON replicated collection 0 ... "; physicalName = collType+"|"+collConnection+"|"+"Collection0"; try{ @@ -198,6 +206,8 @@ int main(int argc, char** ) collection = factory->openWithPhysicalName( physicalName, 0, ICollection::UPDATE ); cout << "OK, this works" << endl; + delete collection; + collection = nullptr; }catch( std::exception&e ){ cout << "ERROR, this should work" << endl; std::cout << "Exception: "<<e.what()<<std::endl; @@ -227,6 +237,8 @@ int main(int argc, char** ) collection = factory->openWithLogicalName( "logicalName0", 0,// logical name false ); // readOnly cout << "OK it works" << endl; + delete collection; + collection = nullptr; }catch( std::exception&){ cout << "ERROR, this should work" << endl; } diff --git a/Database/APR/RootStorageSvc/src/RootTreeIndexContainer.h b/Database/APR/RootStorageSvc/src/RootTreeIndexContainer.h index d47c06f49881fb8bc0d957c5034d8615783f587b..84b5e6334d995d105aa805bd66b7d0f9f35ee8e1 100644 --- a/Database/APR/RootStorageSvc/src/RootTreeIndexContainer.h +++ b/Database/APR/RootStorageSvc/src/RootTreeIndexContainer.h @@ -33,6 +33,9 @@ namespace pool { /// Standard constructor RootTreeIndexContainer(); + RootTreeIndexContainer (const RootTreeIndexContainer&) = delete; + RootTreeIndexContainer& operator= (const RootTreeIndexContainer&) = delete; + /// Standard destructor virtual ~RootTreeIndexContainer(); diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.cxx b/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.cxx index dcf2b8e922966d44b8b0dbc00f68793e9df140dc..012694429ff25357cf23d4a3b3bdfc958c9315d7 100644 --- a/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.cxx +++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.cxx @@ -705,11 +705,13 @@ const Token* AthenaPoolCnvSvc::registerForWrite(const Placement* placement, buffer = nullptr; if (!sc.isSuccess()) { ATH_MSG_ERROR("Could not share object for: " << placementStr); + m_outputStreamingTool[streamClient]->putObject(nullptr, 0).ignore(); return(nullptr); } AuxDiscoverySvc auxDiscover; if (!auxDiscover.sendStore(m_serializeSvc.get(), m_outputStreamingTool[streamClient].get(), obj, pool::DbReflex::guid(classDesc), placement->containerName()).isSuccess()) { ATH_MSG_ERROR("Could not share dynamic aux store for: " << placementStr); + m_outputStreamingTool[streamClient]->putObject(nullptr, 0).ignore(); return(nullptr); } if (!m_outputStreamingTool[streamClient]->putObject(nullptr, 0).isSuccess()) { diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/CMakeLists.txt b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/CMakeLists.txt index 4a8b00339ac11fe70c88595c594640ee9e06df2c..651307a088a8e6aee037a36a5039b3376f83f4b6 100644 --- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/CMakeLists.txt +++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/CMakeLists.txt @@ -95,7 +95,7 @@ _add_test( AthenaPoolExample_Read # Read all output including scoped BackNavigation _add_test( AthenaPoolExample_ReadBN "athena.py AthenaPoolExampleAlgorithms/AthenaPoolExample_ReadBNJobOptions.py" - EXTRA_PATTERNS "BYTES_READ|DEBUG lookupPFN|DEBUG registered PFN|XMLCatalog +INFO" + EXTRA_PATTERNS "BYTES_READ|DEBUG lookupPFN|DEBUG registered PFN|XMLCatalog +INFO|Found Address:" DEPENDS AthenaPoolExampleAlgorithms_AthenaPoolExample_ReWrite_ctest ) # Read all output w/o BackNavigation _add_test( AthenaPoolExample_ReadNoBN diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Read.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Read.ref index 6fb1f58a55c5b224125ba2133b96caf7959d9120..eda00b45dab05bd456c42afc93596ad32b94a904 100644 --- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Read.ref +++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Read.ref @@ -1,11 +1,11 @@ -Tue Sep 4 17:20:15 CEST 2018 +Mon Sep 24 15:28:54 CEST 2018 Preloading tcmalloc_minimal.so Athena INFO including file "AthenaCommon/Preparation.py" Athena INFO including file "AthenaCommon/Atlas.UnixStandardJob.py" Athena INFO executing ROOT6Setup Athena INFO including file "AthenaCommon/Execution.py" Athena INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_ReadJobOptions.py" -Py:ConfigurableDb INFO Read module info for 5519 configurables from 43 genConfDb files +Py:ConfigurableDb INFO Read module info for 5494 configurables from 54 genConfDb files Py:ConfigurableDb INFO No duplicates have been found: that's good ! Athena INFO including file "AthenaCommon/runbatch.py" [?1034hApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 @@ -13,7 +13,7 @@ ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to leve ApplicationMgr SUCCESS ==================================================================================================================================== Welcome to ApplicationMgr (GaudiCoreSvc v30r3) - running on lxplus069.cern.ch on Tue Sep 4 17:20:30 2018 + running on lxplus030.cern.ch on Mon Sep 24 15:29:14 2018 ==================================================================================================================================== ApplicationMgr INFO Successfully loaded modules : AthenaServices ApplicationMgr INFO Application Manager Configured successfully @@ -21,10 +21,10 @@ ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to leve StatusCodeSvc INFO initialize AthDictLoaderSvc INFO in initialize... AthDictLoaderSvc INFO acquired Dso-registry -ClassIDSvc INFO getRegistryEntries: read 2918 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 2946 CLIDRegistry entries for module ALL CoreDumpSvc INFO install f-a-t-a-l handler... (flag = -1) AthenaEventLoopMgr INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00 -ClassIDSvc INFO getRegistryEntries: read 916 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 889 CLIDRegistry entries for module ALL ReadData DEBUG Property update for OutputLevel : new value = 2 ReadData INFO in initialize() MetaDataSvc DEBUG Property update for OutputLevel : new value = 2 @@ -36,8 +36,8 @@ PoolSvc DEBUG Service base class initialized successfully PoolSvc INFO Set connectionsvc retry/timeout/IDLE timeout to 'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled PoolSvc INFO Frontier compression level set to 5 DBReplicaSvc INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy-wigner.cern.ch:3128) will be considered for COOL data -DBReplicaSvc INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-09-03T2055/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/dbreplica.config -DBReplicaSvc INFO Total of 10 servers found for host lxplus069.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] +DBReplicaSvc INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-09-22T2103/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-dbg/share/dbreplica.config +DBReplicaSvc INFO Total of 10 servers found for host lxplus030.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] PoolSvc INFO Successfully setup replica sorting algorithm PoolSvc DEBUG OutputLevel is PoolSvc INFO Setting up APR FileCatalog and Streams @@ -620,6 +620,7 @@ PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ] PoolSvc INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #19, run #1 10 events processed so far <<<=== MetaDataSvc DEBUG handle() EndInputFile for FID:???? +EventSelector INFO Disconnecting input sourceID: ???? Domain[ROOT_All] INFO -> Deaccess DbDatabase READ [ROOT_All] ???? Domain[ROOT_All] INFO > Deaccess DbDomain READ [ROOT_All] EventSelector DEBUG Try item: "EmptyPoolFile.root" from the collection list. @@ -813,8 +814,8 @@ ReadData INFO EventInfo event: 0 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18815 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #0, run #1 11 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -841,8 +842,8 @@ ReadData INFO EventInfo event: 1 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18815 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #1, run #1 12 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -869,8 +870,8 @@ ReadData INFO EventInfo event: 2 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18815 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #2, run #1 13 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -897,8 +898,8 @@ ReadData INFO EventInfo event: 3 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18815 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #3, run #1 14 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -925,8 +926,8 @@ ReadData INFO EventInfo event: 4 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18815 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #4, run #1 15 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -953,8 +954,8 @@ ReadData INFO EventInfo event: 5 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18815 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #5, run #1 16 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -981,8 +982,8 @@ ReadData INFO EventInfo event: 6 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18815 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #6, run #1 17 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1009,8 +1010,8 @@ ReadData INFO EventInfo event: 7 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18815 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #7, run #1 18 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1037,8 +1038,8 @@ ReadData INFO EventInfo event: 8 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18815 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #8, run #1 19 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1065,8 +1066,8 @@ ReadData INFO EventInfo event: 9 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18815 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #9, run #1 20 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1093,8 +1094,8 @@ ReadData INFO EventInfo event: 10 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18815 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #10, run #1 21 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1121,8 +1122,8 @@ ReadData INFO EventInfo event: 11 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18815 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #11, run #1 22 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1149,8 +1150,8 @@ ReadData INFO EventInfo event: 12 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18815 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #12, run #1 23 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1177,8 +1178,8 @@ ReadData INFO EventInfo event: 13 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18815 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #13, run #1 24 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1205,8 +1206,8 @@ ReadData INFO EventInfo event: 14 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18815 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #14, run #1 25 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1233,8 +1234,8 @@ ReadData INFO EventInfo event: 15 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18815 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #15, run #1 26 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1261,8 +1262,8 @@ ReadData INFO EventInfo event: 16 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18815 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #16, run #1 27 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1289,8 +1290,8 @@ ReadData INFO EventInfo event: 17 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18815 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #17, run #1 28 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1317,8 +1318,8 @@ ReadData INFO EventInfo event: 18 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18815 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #18, run #1 29 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1345,8 +1346,8 @@ ReadData INFO EventInfo event: 19 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18815 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #19, run #1 30 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1374,8 +1375,8 @@ ReadData INFO EventInfo event: 20 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20440 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20439 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #20, run #2 31 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1402,8 +1403,8 @@ ReadData INFO EventInfo event: 21 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20440 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20439 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #21, run #2 32 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1430,8 +1431,8 @@ ReadData INFO EventInfo event: 22 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20440 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20439 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #22, run #2 33 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1458,8 +1459,8 @@ ReadData INFO EventInfo event: 23 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20440 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20439 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #23, run #2 34 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1486,8 +1487,8 @@ ReadData INFO EventInfo event: 24 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20440 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20439 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #24, run #2 35 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1514,8 +1515,8 @@ ReadData INFO EventInfo event: 25 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20440 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20439 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #25, run #2 36 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1542,8 +1543,8 @@ ReadData INFO EventInfo event: 26 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20440 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20439 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #26, run #2 37 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1570,8 +1571,8 @@ ReadData INFO EventInfo event: 27 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20440 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20439 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #27, run #2 38 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1598,8 +1599,8 @@ ReadData INFO EventInfo event: 28 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20440 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20439 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #28, run #2 39 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1626,8 +1627,8 @@ ReadData INFO EventInfo event: 29 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20440 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20439 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #29, run #2 40 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1654,8 +1655,8 @@ ReadData INFO EventInfo event: 30 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20440 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20439 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #30, run #2 41 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1682,8 +1683,8 @@ ReadData INFO EventInfo event: 31 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20440 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20439 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #31, run #2 42 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1710,8 +1711,8 @@ ReadData INFO EventInfo event: 32 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20440 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20439 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #32, run #2 43 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1738,8 +1739,8 @@ ReadData INFO EventInfo event: 33 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20440 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20439 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #33, run #2 44 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1766,8 +1767,8 @@ ReadData INFO EventInfo event: 34 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20440 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20439 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #34, run #2 45 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1794,8 +1795,8 @@ ReadData INFO EventInfo event: 35 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20440 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20439 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #35, run #2 46 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1822,8 +1823,8 @@ ReadData INFO EventInfo event: 36 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20440 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20439 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #36, run #2 47 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1850,8 +1851,8 @@ ReadData INFO EventInfo event: 37 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20440 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20439 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #37, run #2 48 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1878,8 +1879,8 @@ ReadData INFO EventInfo event: 38 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20440 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20439 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #38, run #2 49 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1906,10 +1907,11 @@ ReadData INFO EventInfo event: 39 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20440 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20439 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #39, run #2 50 events processed so far <<<=== MetaDataSvc DEBUG handle() EndInputFile for FID:???? +EventSelector INFO Disconnecting input sourceID: ???? Domain[ROOT_All] INFO -> Deaccess DbDatabase READ [ROOT_All] ???? Domain[ROOT_All] INFO > Deaccess DbDomain READ [ROOT_All] EventSelector DEBUG Try item: "SimplePoolFile3.root" from the collection list. @@ -2140,8 +2142,8 @@ ReadData INFO Hit x = 20.4945 y = 63.5816 z = 48.1358 detector = Dum ReadData INFO Hit x = 23.7045 y = 57.9027 z = 46.3159 detector = DummyHitDetector ReadData INFO Hit x = 26.9145 y = 52.2238 z = 44.9265 detector = DummyHitDetector ReadData INFO Hit x = 30.1245 y = 46.5449 z = 43.831 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18960 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #0, run #1 51 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2187,8 +2189,8 @@ ReadData INFO Hit x = 120.494 y = 63.5816 z = -51.8642 detector = Du ReadData INFO Hit x = 123.704 y = 57.9027 z = -53.6841 detector = DummyHitDetector ReadData INFO Hit x = 126.915 y = 52.2238 z = -55.0735 detector = DummyHitDetector ReadData INFO Hit x = 130.125 y = 46.5449 z = -56.169 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18960 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #1, run #1 52 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2234,8 +2236,8 @@ ReadData INFO Hit x = 220.494 y = 63.5816 z = -151.864 detector = Du ReadData INFO Hit x = 223.704 y = 57.9027 z = -153.684 detector = DummyHitDetector ReadData INFO Hit x = 226.915 y = 52.2238 z = -155.073 detector = DummyHitDetector ReadData INFO Hit x = 230.125 y = 46.5449 z = -156.169 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18960 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #2, run #1 53 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2281,8 +2283,8 @@ ReadData INFO Hit x = 320.495 y = 63.5816 z = -251.864 detector = Du ReadData INFO Hit x = 323.705 y = 57.9027 z = -253.684 detector = DummyHitDetector ReadData INFO Hit x = 326.915 y = 52.2238 z = -255.073 detector = DummyHitDetector ReadData INFO Hit x = 330.125 y = 46.5449 z = -256.169 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18960 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #3, run #1 54 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2328,8 +2330,8 @@ ReadData INFO Hit x = 420.495 y = 63.5816 z = -351.864 detector = Du ReadData INFO Hit x = 423.705 y = 57.9027 z = -353.684 detector = DummyHitDetector ReadData INFO Hit x = 426.915 y = 52.2238 z = -355.073 detector = DummyHitDetector ReadData INFO Hit x = 430.125 y = 46.5449 z = -356.169 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18960 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #4, run #1 55 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2375,8 +2377,8 @@ ReadData INFO Hit x = 520.495 y = 63.5816 z = -451.864 detector = Du ReadData INFO Hit x = 523.705 y = 57.9027 z = -453.684 detector = DummyHitDetector ReadData INFO Hit x = 526.914 y = 52.2238 z = -455.073 detector = DummyHitDetector ReadData INFO Hit x = 530.125 y = 46.5449 z = -456.169 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18960 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #5, run #1 56 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2422,8 +2424,8 @@ ReadData INFO Hit x = 620.495 y = 63.5816 z = -551.864 detector = Du ReadData INFO Hit x = 623.705 y = 57.9027 z = -553.684 detector = DummyHitDetector ReadData INFO Hit x = 626.914 y = 52.2238 z = -555.073 detector = DummyHitDetector ReadData INFO Hit x = 630.125 y = 46.5449 z = -556.169 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18960 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #6, run #1 57 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2469,8 +2471,8 @@ ReadData INFO Hit x = 720.495 y = 63.5816 z = -651.864 detector = Du ReadData INFO Hit x = 723.705 y = 57.9027 z = -653.684 detector = DummyHitDetector ReadData INFO Hit x = 726.914 y = 52.2238 z = -655.073 detector = DummyHitDetector ReadData INFO Hit x = 730.125 y = 46.5449 z = -656.169 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18960 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #7, run #1 58 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2516,8 +2518,8 @@ ReadData INFO Hit x = 820.495 y = 63.5816 z = -751.864 detector = Du ReadData INFO Hit x = 823.705 y = 57.9027 z = -753.684 detector = DummyHitDetector ReadData INFO Hit x = 826.914 y = 52.2238 z = -755.073 detector = DummyHitDetector ReadData INFO Hit x = 830.125 y = 46.5449 z = -756.169 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18960 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #8, run #1 59 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2563,8 +2565,8 @@ ReadData INFO Hit x = 920.495 y = 63.5816 z = -851.864 detector = Du ReadData INFO Hit x = 923.705 y = 57.9027 z = -853.684 detector = DummyHitDetector ReadData INFO Hit x = 926.914 y = 52.2238 z = -855.073 detector = DummyHitDetector ReadData INFO Hit x = 930.125 y = 46.5449 z = -856.169 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18960 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #9, run #1 60 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2610,8 +2612,8 @@ ReadData INFO Hit x = 1020.49 y = 63.5816 z = -951.864 detector = Du ReadData INFO Hit x = 1023.7 y = 57.9027 z = -953.684 detector = DummyHitDetector ReadData INFO Hit x = 1026.91 y = 52.2238 z = -955.073 detector = DummyHitDetector ReadData INFO Hit x = 1030.12 y = 46.5449 z = -956.169 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18960 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #10, run #1 61 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2657,8 +2659,8 @@ ReadData INFO Hit x = 1120.49 y = 63.5816 z = -1051.86 detector = Du ReadData INFO Hit x = 1123.7 y = 57.9027 z = -1053.68 detector = DummyHitDetector ReadData INFO Hit x = 1126.91 y = 52.2238 z = -1055.07 detector = DummyHitDetector ReadData INFO Hit x = 1130.12 y = 46.5449 z = -1056.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18960 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #11, run #1 62 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2704,8 +2706,8 @@ ReadData INFO Hit x = 1220.49 y = 63.5816 z = -1151.86 detector = Du ReadData INFO Hit x = 1223.7 y = 57.9027 z = -1153.68 detector = DummyHitDetector ReadData INFO Hit x = 1226.91 y = 52.2238 z = -1155.07 detector = DummyHitDetector ReadData INFO Hit x = 1230.12 y = 46.5449 z = -1156.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18960 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #12, run #1 63 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2751,8 +2753,8 @@ ReadData INFO Hit x = 1320.49 y = 63.5816 z = -1251.86 detector = Du ReadData INFO Hit x = 1323.7 y = 57.9027 z = -1253.68 detector = DummyHitDetector ReadData INFO Hit x = 1326.91 y = 52.2238 z = -1255.07 detector = DummyHitDetector ReadData INFO Hit x = 1330.12 y = 46.5449 z = -1256.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18960 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #13, run #1 64 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2798,8 +2800,8 @@ ReadData INFO Hit x = 1420.49 y = 63.5816 z = -1351.86 detector = Du ReadData INFO Hit x = 1423.7 y = 57.9027 z = -1353.68 detector = DummyHitDetector ReadData INFO Hit x = 1426.91 y = 52.2238 z = -1355.07 detector = DummyHitDetector ReadData INFO Hit x = 1430.12 y = 46.5449 z = -1356.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18960 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #14, run #1 65 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2845,8 +2847,8 @@ ReadData INFO Hit x = 1520.49 y = 63.5816 z = -1451.86 detector = Du ReadData INFO Hit x = 1523.7 y = 57.9027 z = -1453.68 detector = DummyHitDetector ReadData INFO Hit x = 1526.91 y = 52.2238 z = -1455.07 detector = DummyHitDetector ReadData INFO Hit x = 1530.12 y = 46.5449 z = -1456.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18960 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #15, run #1 66 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2892,8 +2894,8 @@ ReadData INFO Hit x = 1620.49 y = 63.5816 z = -1551.86 detector = Du ReadData INFO Hit x = 1623.7 y = 57.9027 z = -1553.68 detector = DummyHitDetector ReadData INFO Hit x = 1626.91 y = 52.2238 z = -1555.07 detector = DummyHitDetector ReadData INFO Hit x = 1630.12 y = 46.5449 z = -1556.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18960 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #16, run #1 67 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2939,8 +2941,8 @@ ReadData INFO Hit x = 1720.49 y = 63.5816 z = -1651.86 detector = Du ReadData INFO Hit x = 1723.7 y = 57.9027 z = -1653.68 detector = DummyHitDetector ReadData INFO Hit x = 1726.91 y = 52.2238 z = -1655.07 detector = DummyHitDetector ReadData INFO Hit x = 1730.12 y = 46.5449 z = -1656.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18960 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #17, run #1 68 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2986,8 +2988,8 @@ ReadData INFO Hit x = 1820.49 y = 63.5816 z = -1751.86 detector = Du ReadData INFO Hit x = 1823.7 y = 57.9027 z = -1753.68 detector = DummyHitDetector ReadData INFO Hit x = 1826.91 y = 52.2238 z = -1755.07 detector = DummyHitDetector ReadData INFO Hit x = 1830.12 y = 46.5449 z = -1756.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18960 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #18, run #1 69 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -3033,10 +3035,11 @@ ReadData INFO Hit x = 1920.49 y = 63.5816 z = -1851.86 detector = Du ReadData INFO Hit x = 1923.7 y = 57.9027 z = -1853.68 detector = DummyHitDetector ReadData INFO Hit x = 1926.91 y = 52.2238 z = -1855.07 detector = DummyHitDetector ReadData INFO Hit x = 1930.12 y = 46.5449 z = -1856.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18960 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #19, run #1 70 events processed so far <<<=== MetaDataSvc DEBUG handle() EndInputFile for FID:???? +EventSelector INFO Disconnecting input sourceID: ???? Domain[ROOT_All] INFO -> Deaccess DbDatabase READ [ROOT_All] ???? MetaDataSvc DEBUG handle() LastInputFile for end AthenaEventLoopMgr INFO No more events in event selection @@ -3052,9 +3055,9 @@ ToolSvc INFO Removing all tools created by ToolSvc *****Chrono***** INFO **************************************************************************************************** *****Chrono***** INFO The Final CPU consumption ( Chrono ) Table (ordered) *****Chrono***** INFO **************************************************************************************************** -cObjR_ALL INFO Time User : Tot= 30 [ms] Ave/Min/Max= 0.11(+- 1.35)/ 0/ 20 [ms] #=272 -cObj_ALL INFO Time User : Tot= 80 [ms] Ave/Min/Max=0.362(+- 2.49)/ 0/ 30 [ms] #=221 -ChronoStatSvc INFO Time User : Tot= 1.25 [s] #= 1 +cObjR_ALL INFO Time User : Tot= 70 [ms] Ave/Min/Max=0.257(+- 1.8)/ 0/ 20 [ms] #=272 +cObj_ALL INFO Time User : Tot= 210 [ms] Ave/Min/Max= 0.95(+- 5.25)/ 0/ 60 [ms] #=221 +ChronoStatSvc INFO Time User : Tot= 2.02 [s] #= 1 *****Chrono***** INFO **************************************************************************************************** ChronoStatSvc.f... INFO Service finalized successfully ApplicationMgr INFO Application Manager Finalized successfully diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReadAgain.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReadAgain.ref index fbf7cca53288da16f36376f110fd03bfe9bd3dd9..3b13ef44d385b7662dcf156875d8fe8231e9c608 100644 --- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReadAgain.ref +++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReadAgain.ref @@ -1,11 +1,11 @@ -Tue Sep 4 17:28:49 CEST 2018 +Mon Sep 24 15:52:24 CEST 2018 Preloading tcmalloc_minimal.so Athena INFO including file "AthenaCommon/Preparation.py" Athena INFO including file "AthenaCommon/Atlas.UnixStandardJob.py" Athena INFO executing ROOT6Setup Athena INFO including file "AthenaCommon/Execution.py" Athena INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_ReadAgainJobOptions.py" -Py:ConfigurableDb INFO Read module info for 5519 configurables from 43 genConfDb files +Py:ConfigurableDb INFO Read module info for 5494 configurables from 54 genConfDb files Py:ConfigurableDb INFO No duplicates have been found: that's good ! Athena INFO including file "AthenaCommon/runbatch.py" [?1034hApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 @@ -13,7 +13,7 @@ ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to leve ApplicationMgr SUCCESS ==================================================================================================================================== Welcome to ApplicationMgr (GaudiCoreSvc v30r3) - running on lxplus069.cern.ch on Tue Sep 4 17:29:01 2018 + running on lxplus030.cern.ch on Mon Sep 24 15:52:38 2018 ==================================================================================================================================== ApplicationMgr INFO Successfully loaded modules : AthenaServices ApplicationMgr INFO Application Manager Configured successfully @@ -21,10 +21,10 @@ ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to leve StatusCodeSvc INFO initialize AthDictLoaderSvc INFO in initialize... AthDictLoaderSvc INFO acquired Dso-registry -ClassIDSvc INFO getRegistryEntries: read 2918 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 2946 CLIDRegistry entries for module ALL CoreDumpSvc INFO install f-a-t-a-l handler... (flag = -1) AthenaEventLoopMgr INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00 -ClassIDSvc INFO getRegistryEntries: read 916 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 889 CLIDRegistry entries for module ALL ReadData DEBUG Property update for OutputLevel : new value = 2 ReadData INFO in initialize() MetaDataSvc DEBUG Property update for OutputLevel : new value = 2 @@ -36,8 +36,8 @@ PoolSvc DEBUG Service base class initialized successfully PoolSvc INFO Set connectionsvc retry/timeout/IDLE timeout to 'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled PoolSvc INFO Frontier compression level set to 5 DBReplicaSvc INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy-wigner.cern.ch:3128) will be considered for COOL data -DBReplicaSvc INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-09-03T2055/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/dbreplica.config -DBReplicaSvc INFO Total of 10 servers found for host lxplus069.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] +DBReplicaSvc INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-09-22T2103/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-dbg/share/dbreplica.config +DBReplicaSvc INFO Total of 10 servers found for host lxplus030.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] PoolSvc INFO Successfully setup replica sorting algorithm PoolSvc DEBUG OutputLevel is PoolSvc INFO Setting up APR FileCatalog and Streams @@ -378,7 +378,7 @@ ReadData INFO Hit x = 1023.7 y = 57.9027 z = -953.684 detector = Dum ReadData INFO Hit x = 1026.91 y = 52.2238 z = -955.073 detector = DummyHitDetector ReadData INFO Hit x = 1030.12 y = 46.5449 z = -956.169 detector = DummyHitDetector ClassIDSvc INFO getRegistryEntries: read 10 CLIDRegistry entries for module ALL -PoolSvc INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19645 +PoolSvc INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19640 PoolSvc INFO Database (SimplePoolReplica1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #10, run #1 1 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -411,7 +411,7 @@ ReadData INFO Hit x = 1120.49 y = 63.5816 z = -1051.86 detector = Du ReadData INFO Hit x = 1123.7 y = 57.9027 z = -1053.68 detector = DummyHitDetector ReadData INFO Hit x = 1126.91 y = 52.2238 z = -1055.07 detector = DummyHitDetector ReadData INFO Hit x = 1130.12 y = 46.5449 z = -1056.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19645 +PoolSvc INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19640 PoolSvc INFO Database (SimplePoolReplica1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #11, run #1 2 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -444,7 +444,7 @@ ReadData INFO Hit x = 1220.49 y = 63.5816 z = -1151.86 detector = Du ReadData INFO Hit x = 1223.7 y = 57.9027 z = -1153.68 detector = DummyHitDetector ReadData INFO Hit x = 1226.91 y = 52.2238 z = -1155.07 detector = DummyHitDetector ReadData INFO Hit x = 1230.12 y = 46.5449 z = -1156.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19645 +PoolSvc INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19640 PoolSvc INFO Database (SimplePoolReplica1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #12, run #1 3 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -477,7 +477,7 @@ ReadData INFO Hit x = 1320.49 y = 63.5816 z = -1251.86 detector = Du ReadData INFO Hit x = 1323.7 y = 57.9027 z = -1253.68 detector = DummyHitDetector ReadData INFO Hit x = 1326.91 y = 52.2238 z = -1255.07 detector = DummyHitDetector ReadData INFO Hit x = 1330.12 y = 46.5449 z = -1256.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19645 +PoolSvc INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19640 PoolSvc INFO Database (SimplePoolReplica1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #13, run #1 4 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -510,7 +510,7 @@ ReadData INFO Hit x = 1420.49 y = 63.5816 z = -1351.86 detector = Du ReadData INFO Hit x = 1423.7 y = 57.9027 z = -1353.68 detector = DummyHitDetector ReadData INFO Hit x = 1426.91 y = 52.2238 z = -1355.07 detector = DummyHitDetector ReadData INFO Hit x = 1430.12 y = 46.5449 z = -1356.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19645 +PoolSvc INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19640 PoolSvc INFO Database (SimplePoolReplica1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #14, run #1 5 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -543,7 +543,7 @@ ReadData INFO Hit x = 1520.49 y = 63.5816 z = -1451.86 detector = Du ReadData INFO Hit x = 1523.7 y = 57.9027 z = -1453.68 detector = DummyHitDetector ReadData INFO Hit x = 1526.91 y = 52.2238 z = -1455.07 detector = DummyHitDetector ReadData INFO Hit x = 1530.12 y = 46.5449 z = -1456.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19645 +PoolSvc INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19640 PoolSvc INFO Database (SimplePoolReplica1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #15, run #1 6 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -576,7 +576,7 @@ ReadData INFO Hit x = 1620.49 y = 63.5816 z = -1551.86 detector = Du ReadData INFO Hit x = 1623.7 y = 57.9027 z = -1553.68 detector = DummyHitDetector ReadData INFO Hit x = 1626.91 y = 52.2238 z = -1555.07 detector = DummyHitDetector ReadData INFO Hit x = 1630.12 y = 46.5449 z = -1556.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19645 +PoolSvc INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19640 PoolSvc INFO Database (SimplePoolReplica1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #16, run #1 7 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -609,7 +609,7 @@ ReadData INFO Hit x = 1720.49 y = 63.5816 z = -1651.86 detector = Du ReadData INFO Hit x = 1723.7 y = 57.9027 z = -1653.68 detector = DummyHitDetector ReadData INFO Hit x = 1726.91 y = 52.2238 z = -1655.07 detector = DummyHitDetector ReadData INFO Hit x = 1730.12 y = 46.5449 z = -1656.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19645 +PoolSvc INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19640 PoolSvc INFO Database (SimplePoolReplica1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #17, run #1 8 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -642,7 +642,7 @@ ReadData INFO Hit x = 1820.49 y = 63.5816 z = -1751.86 detector = Du ReadData INFO Hit x = 1823.7 y = 57.9027 z = -1753.68 detector = DummyHitDetector ReadData INFO Hit x = 1826.91 y = 52.2238 z = -1755.07 detector = DummyHitDetector ReadData INFO Hit x = 1830.12 y = 46.5449 z = -1756.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19645 +PoolSvc INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19640 PoolSvc INFO Database (SimplePoolReplica1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #18, run #1 9 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -675,12 +675,13 @@ ReadData INFO Hit x = 1920.49 y = 63.5816 z = -1851.86 detector = Du ReadData INFO Hit x = 1923.7 y = 57.9027 z = -1853.68 detector = DummyHitDetector ReadData INFO Hit x = 1926.91 y = 52.2238 z = -1855.07 detector = DummyHitDetector ReadData INFO Hit x = 1930.12 y = 46.5449 z = -1856.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19645 +PoolSvc INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19640 PoolSvc INFO Database (SimplePoolReplica1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #19, run #1 10 events processed so far <<<=== Domain[ROOT_All] INFO -> Deaccess DbDatabase READ [ROOT_All] ???? Domain[ROOT_All] INFO > Deaccess DbDomain READ [ROOT_All] MetaDataSvc DEBUG handle() EndInputFile for FID:???? +EventSelector INFO Disconnecting input sourceID: ???? EventSelector DEBUG Try item: "EmptyPoolFile.root" from the collection list. PersistencySvc:... DEBUG lookupPFN: EmptyPoolFile.root returned FID: '????' tech=ROOT_All DbSession INFO Open DbSession @@ -873,8 +874,8 @@ ReadData INFO EventInfo event: 0 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18814 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18812 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #0, run #1 11 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -901,8 +902,8 @@ ReadData INFO EventInfo event: 1 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18814 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18812 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #1, run #1 12 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -929,8 +930,8 @@ ReadData INFO EventInfo event: 2 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18814 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18812 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #2, run #1 13 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -957,8 +958,8 @@ ReadData INFO EventInfo event: 3 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18814 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18812 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #3, run #1 14 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -985,8 +986,8 @@ ReadData INFO EventInfo event: 4 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18814 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18812 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #4, run #1 15 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1013,8 +1014,8 @@ ReadData INFO EventInfo event: 5 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18814 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18812 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #5, run #1 16 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1041,8 +1042,8 @@ ReadData INFO EventInfo event: 6 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18814 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18812 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #6, run #1 17 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1069,8 +1070,8 @@ ReadData INFO EventInfo event: 7 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18814 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18812 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #7, run #1 18 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1097,8 +1098,8 @@ ReadData INFO EventInfo event: 8 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18814 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18812 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #8, run #1 19 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1125,8 +1126,8 @@ ReadData INFO EventInfo event: 9 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18814 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18812 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #9, run #1 20 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1153,8 +1154,8 @@ ReadData INFO EventInfo event: 10 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18814 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18812 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #10, run #1 21 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1181,8 +1182,8 @@ ReadData INFO EventInfo event: 11 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18814 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18812 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #11, run #1 22 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1209,8 +1210,8 @@ ReadData INFO EventInfo event: 12 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18814 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18812 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #12, run #1 23 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1237,8 +1238,8 @@ ReadData INFO EventInfo event: 13 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18814 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18812 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #13, run #1 24 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1265,8 +1266,8 @@ ReadData INFO EventInfo event: 14 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18814 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18812 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #14, run #1 25 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1293,8 +1294,8 @@ ReadData INFO EventInfo event: 15 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18814 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18812 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #15, run #1 26 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1321,8 +1322,8 @@ ReadData INFO EventInfo event: 16 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18814 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18812 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #16, run #1 27 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1349,8 +1350,8 @@ ReadData INFO EventInfo event: 17 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18814 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18812 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #17, run #1 28 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1377,8 +1378,8 @@ ReadData INFO EventInfo event: 18 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18814 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18812 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #18, run #1 29 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1405,8 +1406,8 @@ ReadData INFO EventInfo event: 19 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18814 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18812 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #19, run #1 30 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1435,7 +1436,7 @@ ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #20, run #2 31 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1463,7 +1464,7 @@ ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #21, run #2 32 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1491,7 +1492,7 @@ ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #22, run #2 33 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1519,7 +1520,7 @@ ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #23, run #2 34 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1547,7 +1548,7 @@ ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #24, run #2 35 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1575,7 +1576,7 @@ ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #25, run #2 36 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1603,7 +1604,7 @@ ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #26, run #2 37 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1631,7 +1632,7 @@ ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #27, run #2 38 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1659,7 +1660,7 @@ ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #28, run #2 39 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1687,7 +1688,7 @@ ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #29, run #2 40 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1715,7 +1716,7 @@ ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #30, run #2 41 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1743,7 +1744,7 @@ ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #31, run #2 42 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1771,7 +1772,7 @@ ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #32, run #2 43 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1799,7 +1800,7 @@ ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #33, run #2 44 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1827,7 +1828,7 @@ ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #34, run #2 45 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1855,7 +1856,7 @@ ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #35, run #2 46 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1883,7 +1884,7 @@ ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #36, run #2 47 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1911,7 +1912,7 @@ ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #37, run #2 48 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1939,7 +1940,7 @@ ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #38, run #2 49 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1967,9 +1968,10 @@ ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #39, run #2 50 events processed so far <<<=== MetaDataSvc DEBUG handle() EndInputFile for FID:???? +EventSelector INFO Disconnecting input sourceID: ???? Domain[ROOT_All] INFO -> Deaccess DbDatabase READ [ROOT_All] ???? Domain[ROOT_All] INFO > Deaccess DbDomain READ [ROOT_All] EventSelector DEBUG Try item: "SimplePoolFile4.root" from the collection list. @@ -2257,8 +2259,8 @@ ReadData INFO Hit x = 20.4945 y = 63.5816 z = 48.1358 detector = Dum ReadData INFO Hit x = 23.7045 y = 57.9027 z = 46.3159 detector = DummyHitDetector ReadData INFO Hit x = 26.9145 y = 52.2238 z = 44.9265 detector = DummyHitDetector ReadData INFO Hit x = 30.1245 y = 46.5449 z = 43.831 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19014 -PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19018 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #0, run #1 51 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2304,8 +2306,8 @@ ReadData INFO Hit x = 120.494 y = 63.5816 z = -51.8642 detector = Du ReadData INFO Hit x = 123.704 y = 57.9027 z = -53.6841 detector = DummyHitDetector ReadData INFO Hit x = 126.915 y = 52.2238 z = -55.0735 detector = DummyHitDetector ReadData INFO Hit x = 130.125 y = 46.5449 z = -56.169 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19014 -PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19018 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #1, run #1 52 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2351,8 +2353,8 @@ ReadData INFO Hit x = 220.494 y = 63.5816 z = -151.864 detector = Du ReadData INFO Hit x = 223.704 y = 57.9027 z = -153.684 detector = DummyHitDetector ReadData INFO Hit x = 226.915 y = 52.2238 z = -155.073 detector = DummyHitDetector ReadData INFO Hit x = 230.125 y = 46.5449 z = -156.169 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19014 -PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19018 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #2, run #1 53 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2398,8 +2400,8 @@ ReadData INFO Hit x = 320.495 y = 63.5816 z = -251.864 detector = Du ReadData INFO Hit x = 323.705 y = 57.9027 z = -253.684 detector = DummyHitDetector ReadData INFO Hit x = 326.915 y = 52.2238 z = -255.073 detector = DummyHitDetector ReadData INFO Hit x = 330.125 y = 46.5449 z = -256.169 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19014 -PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19018 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #3, run #1 54 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2445,8 +2447,8 @@ ReadData INFO Hit x = 420.495 y = 63.5816 z = -351.864 detector = Du ReadData INFO Hit x = 423.705 y = 57.9027 z = -353.684 detector = DummyHitDetector ReadData INFO Hit x = 426.915 y = 52.2238 z = -355.073 detector = DummyHitDetector ReadData INFO Hit x = 430.125 y = 46.5449 z = -356.169 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19014 -PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19018 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #4, run #1 55 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2492,8 +2494,8 @@ ReadData INFO Hit x = 520.495 y = 63.5816 z = -451.864 detector = Du ReadData INFO Hit x = 523.705 y = 57.9027 z = -453.684 detector = DummyHitDetector ReadData INFO Hit x = 526.914 y = 52.2238 z = -455.073 detector = DummyHitDetector ReadData INFO Hit x = 530.125 y = 46.5449 z = -456.169 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19014 -PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19018 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #5, run #1 56 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2539,8 +2541,8 @@ ReadData INFO Hit x = 620.495 y = 63.5816 z = -551.864 detector = Du ReadData INFO Hit x = 623.705 y = 57.9027 z = -553.684 detector = DummyHitDetector ReadData INFO Hit x = 626.914 y = 52.2238 z = -555.073 detector = DummyHitDetector ReadData INFO Hit x = 630.125 y = 46.5449 z = -556.169 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19014 -PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19018 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #6, run #1 57 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2586,8 +2588,8 @@ ReadData INFO Hit x = 720.495 y = 63.5816 z = -651.864 detector = Du ReadData INFO Hit x = 723.705 y = 57.9027 z = -653.684 detector = DummyHitDetector ReadData INFO Hit x = 726.914 y = 52.2238 z = -655.073 detector = DummyHitDetector ReadData INFO Hit x = 730.125 y = 46.5449 z = -656.169 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19014 -PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19018 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #7, run #1 58 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2633,8 +2635,8 @@ ReadData INFO Hit x = 820.495 y = 63.5816 z = -751.864 detector = Du ReadData INFO Hit x = 823.705 y = 57.9027 z = -753.684 detector = DummyHitDetector ReadData INFO Hit x = 826.914 y = 52.2238 z = -755.073 detector = DummyHitDetector ReadData INFO Hit x = 830.125 y = 46.5449 z = -756.169 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19014 -PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19018 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #8, run #1 59 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2680,8 +2682,8 @@ ReadData INFO Hit x = 920.495 y = 63.5816 z = -851.864 detector = Du ReadData INFO Hit x = 923.705 y = 57.9027 z = -853.684 detector = DummyHitDetector ReadData INFO Hit x = 926.914 y = 52.2238 z = -855.073 detector = DummyHitDetector ReadData INFO Hit x = 930.125 y = 46.5449 z = -856.169 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19014 -PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19018 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #9, run #1 60 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2727,8 +2729,8 @@ ReadData INFO Hit x = 1020.49 y = 63.5816 z = -951.864 detector = Du ReadData INFO Hit x = 1023.7 y = 57.9027 z = -953.684 detector = DummyHitDetector ReadData INFO Hit x = 1026.91 y = 52.2238 z = -955.073 detector = DummyHitDetector ReadData INFO Hit x = 1030.12 y = 46.5449 z = -956.169 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19014 -PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19018 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #10, run #1 61 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2774,8 +2776,8 @@ ReadData INFO Hit x = 1120.49 y = 63.5816 z = -1051.86 detector = Du ReadData INFO Hit x = 1123.7 y = 57.9027 z = -1053.68 detector = DummyHitDetector ReadData INFO Hit x = 1126.91 y = 52.2238 z = -1055.07 detector = DummyHitDetector ReadData INFO Hit x = 1130.12 y = 46.5449 z = -1056.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19014 -PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19018 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #11, run #1 62 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2821,8 +2823,8 @@ ReadData INFO Hit x = 1220.49 y = 63.5816 z = -1151.86 detector = Du ReadData INFO Hit x = 1223.7 y = 57.9027 z = -1153.68 detector = DummyHitDetector ReadData INFO Hit x = 1226.91 y = 52.2238 z = -1155.07 detector = DummyHitDetector ReadData INFO Hit x = 1230.12 y = 46.5449 z = -1156.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19014 -PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19018 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #12, run #1 63 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2868,8 +2870,8 @@ ReadData INFO Hit x = 1320.49 y = 63.5816 z = -1251.86 detector = Du ReadData INFO Hit x = 1323.7 y = 57.9027 z = -1253.68 detector = DummyHitDetector ReadData INFO Hit x = 1326.91 y = 52.2238 z = -1255.07 detector = DummyHitDetector ReadData INFO Hit x = 1330.12 y = 46.5449 z = -1256.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19014 -PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19018 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #13, run #1 64 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2915,8 +2917,8 @@ ReadData INFO Hit x = 1420.49 y = 63.5816 z = -1351.86 detector = Du ReadData INFO Hit x = 1423.7 y = 57.9027 z = -1353.68 detector = DummyHitDetector ReadData INFO Hit x = 1426.91 y = 52.2238 z = -1355.07 detector = DummyHitDetector ReadData INFO Hit x = 1430.12 y = 46.5449 z = -1356.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19014 -PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19018 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #14, run #1 65 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2962,8 +2964,8 @@ ReadData INFO Hit x = 1520.49 y = 63.5816 z = -1451.86 detector = Du ReadData INFO Hit x = 1523.7 y = 57.9027 z = -1453.68 detector = DummyHitDetector ReadData INFO Hit x = 1526.91 y = 52.2238 z = -1455.07 detector = DummyHitDetector ReadData INFO Hit x = 1530.12 y = 46.5449 z = -1456.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19014 -PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19018 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #15, run #1 66 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -3009,8 +3011,8 @@ ReadData INFO Hit x = 1620.49 y = 63.5816 z = -1551.86 detector = Du ReadData INFO Hit x = 1623.7 y = 57.9027 z = -1553.68 detector = DummyHitDetector ReadData INFO Hit x = 1626.91 y = 52.2238 z = -1555.07 detector = DummyHitDetector ReadData INFO Hit x = 1630.12 y = 46.5449 z = -1556.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19014 -PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19018 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #16, run #1 67 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -3056,8 +3058,8 @@ ReadData INFO Hit x = 1720.49 y = 63.5816 z = -1651.86 detector = Du ReadData INFO Hit x = 1723.7 y = 57.9027 z = -1653.68 detector = DummyHitDetector ReadData INFO Hit x = 1726.91 y = 52.2238 z = -1655.07 detector = DummyHitDetector ReadData INFO Hit x = 1730.12 y = 46.5449 z = -1656.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19014 -PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19018 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #17, run #1 68 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -3103,8 +3105,8 @@ ReadData INFO Hit x = 1820.49 y = 63.5816 z = -1751.86 detector = Du ReadData INFO Hit x = 1823.7 y = 57.9027 z = -1753.68 detector = DummyHitDetector ReadData INFO Hit x = 1826.91 y = 52.2238 z = -1755.07 detector = DummyHitDetector ReadData INFO Hit x = 1830.12 y = 46.5449 z = -1756.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19014 -PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19018 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #18, run #1 69 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -3150,10 +3152,11 @@ ReadData INFO Hit x = 1920.49 y = 63.5816 z = -1851.86 detector = Du ReadData INFO Hit x = 1923.7 y = 57.9027 z = -1853.68 detector = DummyHitDetector ReadData INFO Hit x = 1926.91 y = 52.2238 z = -1855.07 detector = DummyHitDetector ReadData INFO Hit x = 1930.12 y = 46.5449 z = -1856.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19014 -PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19018 +PoolSvc INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #19, run #1 70 events processed so far <<<=== MetaDataSvc DEBUG handle() EndInputFile for FID:???? +EventSelector INFO Disconnecting input sourceID: ???? Domain[ROOT_All] INFO -> Deaccess DbDatabase READ [ROOT_All] ???? MetaDataSvc DEBUG handle() LastInputFile for end AthenaEventLoopMgr INFO No more events in event selection @@ -3170,9 +3173,9 @@ ToolSvc INFO Removing all tools created by ToolSvc *****Chrono***** INFO **************************************************************************************************** *****Chrono***** INFO The Final CPU consumption ( Chrono ) Table (ordered) *****Chrono***** INFO **************************************************************************************************** -cObjR_ALL INFO Time User : Tot= 30 [ms] Ave/Min/Max=0.0965(+- 1.26)/ 0/ 20 [ms] #=311 -cObj_ALL INFO Time User : Tot= 70 [ms] Ave/Min/Max= 0.29(+- 2.48)/ 0/ 30 [ms] #=241 -ChronoStatSvc INFO Time User : Tot= 1.21 [s] #= 1 +cObjR_ALL INFO Time User : Tot= 80 [ms] Ave/Min/Max=0.257(+- 1.58)/ 0/ 10 [ms] #=311 +cObj_ALL INFO Time User : Tot= 160 [ms] Ave/Min/Max=0.664(+- 3.81)/ 0/ 40 [ms] #=241 +ChronoStatSvc INFO Time User : Tot= 1.92 [s] #= 1 *****Chrono***** INFO **************************************************************************************************** ChronoStatSvc.f... INFO Service finalized successfully ApplicationMgr INFO Application Manager Finalized successfully diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReadBN.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReadBN.ref index ae50043be7bfd3fa9e77dec21cdf12a1db78da7a..5d04ca5d9774ea5b5522ab6175514821ef61aa4b 100644 --- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReadBN.ref +++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReadBN.ref @@ -1,11 +1,11 @@ -Tue Sep 4 17:20:15 CEST 2018 +Mon Sep 24 15:58:35 CEST 2018 Preloading tcmalloc_minimal.so Athena INFO including file "AthenaCommon/Preparation.py" Athena INFO including file "AthenaCommon/Atlas.UnixStandardJob.py" Athena INFO executing ROOT6Setup Athena INFO including file "AthenaCommon/Execution.py" Athena INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_ReadBNJobOptions.py" -Py:ConfigurableDb INFO Read module info for 5519 configurables from 43 genConfDb files +Py:ConfigurableDb INFO Read module info for 5494 configurables from 54 genConfDb files Py:ConfigurableDb INFO No duplicates have been found: that's good ! Athena INFO including file "AthenaCommon/runbatch.py" [?1034hApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 @@ -13,7 +13,7 @@ ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to leve ApplicationMgr SUCCESS ==================================================================================================================================== Welcome to ApplicationMgr (GaudiCoreSvc v30r3) - running on lxplus069.cern.ch on Tue Sep 4 17:20:30 2018 + running on lxplus030.cern.ch on Mon Sep 24 15:59:02 2018 ==================================================================================================================================== ApplicationMgr INFO Successfully loaded modules : AthenaServices ApplicationMgr INFO Application Manager Configured successfully @@ -21,10 +21,10 @@ ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to leve StatusCodeSvc INFO initialize AthDictLoaderSvc INFO in initialize... AthDictLoaderSvc INFO acquired Dso-registry -ClassIDSvc INFO getRegistryEntries: read 2918 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 2946 CLIDRegistry entries for module ALL CoreDumpSvc INFO install f-a-t-a-l handler... (flag = -1) AthenaEventLoopMgr INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00 -ClassIDSvc INFO getRegistryEntries: read 916 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 889 CLIDRegistry entries for module ALL ReadData DEBUG Property update for OutputLevel : new value = 2 ReadData INFO in initialize() MetaDataSvc DEBUG Property update for OutputLevel : new value = 2 @@ -36,8 +36,8 @@ PoolSvc DEBUG Service base class initialized successfully PoolSvc INFO Set connectionsvc retry/timeout/IDLE timeout to 'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled PoolSvc INFO Frontier compression level set to 5 DBReplicaSvc INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy-wigner.cern.ch:3128) will be considered for COOL data -DBReplicaSvc INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-09-03T2055/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/dbreplica.config -DBReplicaSvc INFO Total of 10 servers found for host lxplus069.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] +DBReplicaSvc INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-09-22T2103/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-dbg/share/dbreplica.config +DBReplicaSvc INFO Total of 10 servers found for host lxplus030.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] PoolSvc INFO Successfully setup replica sorting algorithm PoolSvc DEBUG OutputLevel is PoolSvc INFO Setting up APR FileCatalog and Streams @@ -320,7 +320,7 @@ ReadData INFO Hit x = 1023.7 y = 57.9027 z = -953.684 detector = Dum ReadData INFO Hit x = 1026.91 y = 52.2238 z = -955.073 detector = DummyHitDetector ReadData INFO Hit x = 1030.12 y = 46.5449 z = -956.169 detector = DummyHitDetector ClassIDSvc INFO getRegistryEntries: read 10 CLIDRegistry entries for module ALL -PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20093 +PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20091 PoolSvc INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #10, run #1 1 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -353,7 +353,7 @@ ReadData INFO Hit x = 1120.49 y = 63.5816 z = -1051.86 detector = Du ReadData INFO Hit x = 1123.7 y = 57.9027 z = -1053.68 detector = DummyHitDetector ReadData INFO Hit x = 1126.91 y = 52.2238 z = -1055.07 detector = DummyHitDetector ReadData INFO Hit x = 1130.12 y = 46.5449 z = -1056.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20093 +PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20091 PoolSvc INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #11, run #1 2 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -386,7 +386,7 @@ ReadData INFO Hit x = 1220.49 y = 63.5816 z = -1151.86 detector = Du ReadData INFO Hit x = 1223.7 y = 57.9027 z = -1153.68 detector = DummyHitDetector ReadData INFO Hit x = 1226.91 y = 52.2238 z = -1155.07 detector = DummyHitDetector ReadData INFO Hit x = 1230.12 y = 46.5449 z = -1156.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20093 +PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20091 PoolSvc INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #12, run #1 3 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -419,7 +419,7 @@ ReadData INFO Hit x = 1320.49 y = 63.5816 z = -1251.86 detector = Du ReadData INFO Hit x = 1323.7 y = 57.9027 z = -1253.68 detector = DummyHitDetector ReadData INFO Hit x = 1326.91 y = 52.2238 z = -1255.07 detector = DummyHitDetector ReadData INFO Hit x = 1330.12 y = 46.5449 z = -1256.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20093 +PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20091 PoolSvc INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #13, run #1 4 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -452,7 +452,7 @@ ReadData INFO Hit x = 1420.49 y = 63.5816 z = -1351.86 detector = Du ReadData INFO Hit x = 1423.7 y = 57.9027 z = -1353.68 detector = DummyHitDetector ReadData INFO Hit x = 1426.91 y = 52.2238 z = -1355.07 detector = DummyHitDetector ReadData INFO Hit x = 1430.12 y = 46.5449 z = -1356.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20093 +PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20091 PoolSvc INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #14, run #1 5 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -485,7 +485,7 @@ ReadData INFO Hit x = 1520.49 y = 63.5816 z = -1451.86 detector = Du ReadData INFO Hit x = 1523.7 y = 57.9027 z = -1453.68 detector = DummyHitDetector ReadData INFO Hit x = 1526.91 y = 52.2238 z = -1455.07 detector = DummyHitDetector ReadData INFO Hit x = 1530.12 y = 46.5449 z = -1456.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20093 +PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20091 PoolSvc INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #15, run #1 6 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -518,7 +518,7 @@ ReadData INFO Hit x = 1620.49 y = 63.5816 z = -1551.86 detector = Du ReadData INFO Hit x = 1623.7 y = 57.9027 z = -1553.68 detector = DummyHitDetector ReadData INFO Hit x = 1626.91 y = 52.2238 z = -1555.07 detector = DummyHitDetector ReadData INFO Hit x = 1630.12 y = 46.5449 z = -1556.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20093 +PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20091 PoolSvc INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #16, run #1 7 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -551,7 +551,7 @@ ReadData INFO Hit x = 1720.49 y = 63.5816 z = -1651.86 detector = Du ReadData INFO Hit x = 1723.7 y = 57.9027 z = -1653.68 detector = DummyHitDetector ReadData INFO Hit x = 1726.91 y = 52.2238 z = -1655.07 detector = DummyHitDetector ReadData INFO Hit x = 1730.12 y = 46.5449 z = -1656.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20093 +PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20091 PoolSvc INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #17, run #1 8 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -584,7 +584,7 @@ ReadData INFO Hit x = 1820.49 y = 63.5816 z = -1751.86 detector = Du ReadData INFO Hit x = 1823.7 y = 57.9027 z = -1753.68 detector = DummyHitDetector ReadData INFO Hit x = 1826.91 y = 52.2238 z = -1755.07 detector = DummyHitDetector ReadData INFO Hit x = 1830.12 y = 46.5449 z = -1756.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20093 +PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20091 PoolSvc INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #18, run #1 9 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -617,10 +617,11 @@ ReadData INFO Hit x = 1920.49 y = 63.5816 z = -1851.86 detector = Du ReadData INFO Hit x = 1923.7 y = 57.9027 z = -1853.68 detector = DummyHitDetector ReadData INFO Hit x = 1926.91 y = 52.2238 z = -1855.07 detector = DummyHitDetector ReadData INFO Hit x = 1930.12 y = 46.5449 z = -1856.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20093 +PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20091 PoolSvc INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #19, run #1 10 events processed so far <<<=== MetaDataSvc DEBUG handle() EndInputFile for FID:???? +EventSelector INFO Disconnecting input sourceID: ???? Domain[ROOT_All] INFO -> Deaccess DbDatabase READ [ROOT_All] ???? Domain[ROOT_All] INFO > Deaccess DbDomain READ [ROOT_All] EventSelector DEBUG Try item: "EmptyPoolFile.root" from the collection list. @@ -814,8 +815,8 @@ ReadData INFO EventInfo event: 0 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18813 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #0, run #1 11 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -842,8 +843,8 @@ ReadData INFO EventInfo event: 1 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18813 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #1, run #1 12 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -870,8 +871,8 @@ ReadData INFO EventInfo event: 2 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18813 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #2, run #1 13 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -898,8 +899,8 @@ ReadData INFO EventInfo event: 3 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18813 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #3, run #1 14 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -926,8 +927,8 @@ ReadData INFO EventInfo event: 4 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18813 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #4, run #1 15 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -954,8 +955,8 @@ ReadData INFO EventInfo event: 5 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18813 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #5, run #1 16 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -982,8 +983,8 @@ ReadData INFO EventInfo event: 6 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18813 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #6, run #1 17 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1010,8 +1011,8 @@ ReadData INFO EventInfo event: 7 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18813 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #7, run #1 18 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1038,8 +1039,8 @@ ReadData INFO EventInfo event: 8 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18813 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #8, run #1 19 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1066,8 +1067,8 @@ ReadData INFO EventInfo event: 9 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18813 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #9, run #1 20 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1094,8 +1095,8 @@ ReadData INFO EventInfo event: 10 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18813 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #10, run #1 21 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1122,8 +1123,8 @@ ReadData INFO EventInfo event: 11 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18813 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #11, run #1 22 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1150,8 +1151,8 @@ ReadData INFO EventInfo event: 12 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18813 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #12, run #1 23 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1178,8 +1179,8 @@ ReadData INFO EventInfo event: 13 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18813 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #13, run #1 24 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1206,8 +1207,8 @@ ReadData INFO EventInfo event: 14 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18813 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #14, run #1 25 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1234,8 +1235,8 @@ ReadData INFO EventInfo event: 15 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18813 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #15, run #1 26 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1262,8 +1263,8 @@ ReadData INFO EventInfo event: 16 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18813 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #16, run #1 27 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1290,8 +1291,8 @@ ReadData INFO EventInfo event: 17 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18813 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #17, run #1 28 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1318,8 +1319,8 @@ ReadData INFO EventInfo event: 18 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18813 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #18, run #1 29 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1346,8 +1347,8 @@ ReadData INFO EventInfo event: 19 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18817 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18813 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #19, run #1 30 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1375,8 +1376,8 @@ ReadData INFO EventInfo event: 20 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20440 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #20, run #2 31 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1403,8 +1404,8 @@ ReadData INFO EventInfo event: 21 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20440 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #21, run #2 32 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1431,8 +1432,8 @@ ReadData INFO EventInfo event: 22 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20440 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #22, run #2 33 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1459,8 +1460,8 @@ ReadData INFO EventInfo event: 23 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20440 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #23, run #2 34 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1487,8 +1488,8 @@ ReadData INFO EventInfo event: 24 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20440 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #24, run #2 35 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1515,8 +1516,8 @@ ReadData INFO EventInfo event: 25 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20440 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #25, run #2 36 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1543,8 +1544,8 @@ ReadData INFO EventInfo event: 26 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20440 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #26, run #2 37 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1571,8 +1572,8 @@ ReadData INFO EventInfo event: 27 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20440 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #27, run #2 38 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1599,8 +1600,8 @@ ReadData INFO EventInfo event: 28 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20440 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #28, run #2 39 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1627,8 +1628,8 @@ ReadData INFO EventInfo event: 29 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20440 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #29, run #2 40 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1655,8 +1656,8 @@ ReadData INFO EventInfo event: 30 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20440 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #30, run #2 41 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1683,8 +1684,8 @@ ReadData INFO EventInfo event: 31 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20440 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #31, run #2 42 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1711,8 +1712,8 @@ ReadData INFO EventInfo event: 32 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20440 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #32, run #2 43 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1739,8 +1740,8 @@ ReadData INFO EventInfo event: 33 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20440 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #33, run #2 44 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1767,8 +1768,8 @@ ReadData INFO EventInfo event: 34 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20440 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #34, run #2 45 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1795,8 +1796,8 @@ ReadData INFO EventInfo event: 35 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20440 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #35, run #2 46 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1823,8 +1824,8 @@ ReadData INFO EventInfo event: 36 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20440 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #36, run #2 47 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1851,8 +1852,8 @@ ReadData INFO EventInfo event: 37 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20440 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #37, run #2 48 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1879,8 +1880,8 @@ ReadData INFO EventInfo event: 38 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20440 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #38, run #2 49 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1907,10 +1908,11 @@ ReadData INFO EventInfo event: 39 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20440 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #39, run #2 50 events processed so far <<<=== MetaDataSvc DEBUG handle() EndInputFile for FID:???? +EventSelector INFO Disconnecting input sourceID: ???? Domain[ROOT_All] INFO -> Deaccess DbDatabase READ [ROOT_All] ???? Domain[ROOT_All] INFO > Deaccess DbDomain READ [ROOT_All] EventSelector DEBUG Try item: "SimplePoolFile3.root" from the collection list. @@ -2141,8 +2143,8 @@ ReadData INFO Hit x = 20.4945 y = 63.5816 z = 48.1358 detector = Dum ReadData INFO Hit x = 23.7045 y = 57.9027 z = 46.3159 detector = DummyHitDetector ReadData INFO Hit x = 26.9145 y = 52.2238 z = 44.9265 detector = DummyHitDetector ReadData INFO Hit x = 30.1245 y = 46.5449 z = 43.831 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18969 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #0, run #1 51 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2188,8 +2190,8 @@ ReadData INFO Hit x = 120.494 y = 63.5816 z = -51.8642 detector = Du ReadData INFO Hit x = 123.704 y = 57.9027 z = -53.6841 detector = DummyHitDetector ReadData INFO Hit x = 126.915 y = 52.2238 z = -55.0735 detector = DummyHitDetector ReadData INFO Hit x = 130.125 y = 46.5449 z = -56.169 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18969 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #1, run #1 52 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2235,8 +2237,8 @@ ReadData INFO Hit x = 220.494 y = 63.5816 z = -151.864 detector = Du ReadData INFO Hit x = 223.704 y = 57.9027 z = -153.684 detector = DummyHitDetector ReadData INFO Hit x = 226.915 y = 52.2238 z = -155.073 detector = DummyHitDetector ReadData INFO Hit x = 230.125 y = 46.5449 z = -156.169 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18969 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #2, run #1 53 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2282,8 +2284,8 @@ ReadData INFO Hit x = 320.495 y = 63.5816 z = -251.864 detector = Du ReadData INFO Hit x = 323.705 y = 57.9027 z = -253.684 detector = DummyHitDetector ReadData INFO Hit x = 326.915 y = 52.2238 z = -255.073 detector = DummyHitDetector ReadData INFO Hit x = 330.125 y = 46.5449 z = -256.169 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18969 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #3, run #1 54 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2329,8 +2331,8 @@ ReadData INFO Hit x = 420.495 y = 63.5816 z = -351.864 detector = Du ReadData INFO Hit x = 423.705 y = 57.9027 z = -353.684 detector = DummyHitDetector ReadData INFO Hit x = 426.915 y = 52.2238 z = -355.073 detector = DummyHitDetector ReadData INFO Hit x = 430.125 y = 46.5449 z = -356.169 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18969 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #4, run #1 55 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2376,8 +2378,8 @@ ReadData INFO Hit x = 520.495 y = 63.5816 z = -451.864 detector = Du ReadData INFO Hit x = 523.705 y = 57.9027 z = -453.684 detector = DummyHitDetector ReadData INFO Hit x = 526.914 y = 52.2238 z = -455.073 detector = DummyHitDetector ReadData INFO Hit x = 530.125 y = 46.5449 z = -456.169 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18969 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #5, run #1 56 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2423,8 +2425,8 @@ ReadData INFO Hit x = 620.495 y = 63.5816 z = -551.864 detector = Du ReadData INFO Hit x = 623.705 y = 57.9027 z = -553.684 detector = DummyHitDetector ReadData INFO Hit x = 626.914 y = 52.2238 z = -555.073 detector = DummyHitDetector ReadData INFO Hit x = 630.125 y = 46.5449 z = -556.169 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18969 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #6, run #1 57 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2470,8 +2472,8 @@ ReadData INFO Hit x = 720.495 y = 63.5816 z = -651.864 detector = Du ReadData INFO Hit x = 723.705 y = 57.9027 z = -653.684 detector = DummyHitDetector ReadData INFO Hit x = 726.914 y = 52.2238 z = -655.073 detector = DummyHitDetector ReadData INFO Hit x = 730.125 y = 46.5449 z = -656.169 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18969 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #7, run #1 58 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2517,8 +2519,8 @@ ReadData INFO Hit x = 820.495 y = 63.5816 z = -751.864 detector = Du ReadData INFO Hit x = 823.705 y = 57.9027 z = -753.684 detector = DummyHitDetector ReadData INFO Hit x = 826.914 y = 52.2238 z = -755.073 detector = DummyHitDetector ReadData INFO Hit x = 830.125 y = 46.5449 z = -756.169 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18969 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #8, run #1 59 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2564,8 +2566,8 @@ ReadData INFO Hit x = 920.495 y = 63.5816 z = -851.864 detector = Du ReadData INFO Hit x = 923.705 y = 57.9027 z = -853.684 detector = DummyHitDetector ReadData INFO Hit x = 926.914 y = 52.2238 z = -855.073 detector = DummyHitDetector ReadData INFO Hit x = 930.125 y = 46.5449 z = -856.169 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18969 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #9, run #1 60 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2611,8 +2613,8 @@ ReadData INFO Hit x = 1020.49 y = 63.5816 z = -951.864 detector = Du ReadData INFO Hit x = 1023.7 y = 57.9027 z = -953.684 detector = DummyHitDetector ReadData INFO Hit x = 1026.91 y = 52.2238 z = -955.073 detector = DummyHitDetector ReadData INFO Hit x = 1030.12 y = 46.5449 z = -956.169 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18969 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #10, run #1 61 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2658,8 +2660,8 @@ ReadData INFO Hit x = 1120.49 y = 63.5816 z = -1051.86 detector = Du ReadData INFO Hit x = 1123.7 y = 57.9027 z = -1053.68 detector = DummyHitDetector ReadData INFO Hit x = 1126.91 y = 52.2238 z = -1055.07 detector = DummyHitDetector ReadData INFO Hit x = 1130.12 y = 46.5449 z = -1056.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18969 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #11, run #1 62 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2705,8 +2707,8 @@ ReadData INFO Hit x = 1220.49 y = 63.5816 z = -1151.86 detector = Du ReadData INFO Hit x = 1223.7 y = 57.9027 z = -1153.68 detector = DummyHitDetector ReadData INFO Hit x = 1226.91 y = 52.2238 z = -1155.07 detector = DummyHitDetector ReadData INFO Hit x = 1230.12 y = 46.5449 z = -1156.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18969 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #12, run #1 63 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2752,8 +2754,8 @@ ReadData INFO Hit x = 1320.49 y = 63.5816 z = -1251.86 detector = Du ReadData INFO Hit x = 1323.7 y = 57.9027 z = -1253.68 detector = DummyHitDetector ReadData INFO Hit x = 1326.91 y = 52.2238 z = -1255.07 detector = DummyHitDetector ReadData INFO Hit x = 1330.12 y = 46.5449 z = -1256.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18969 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #13, run #1 64 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2799,8 +2801,8 @@ ReadData INFO Hit x = 1420.49 y = 63.5816 z = -1351.86 detector = Du ReadData INFO Hit x = 1423.7 y = 57.9027 z = -1353.68 detector = DummyHitDetector ReadData INFO Hit x = 1426.91 y = 52.2238 z = -1355.07 detector = DummyHitDetector ReadData INFO Hit x = 1430.12 y = 46.5449 z = -1356.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18969 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #14, run #1 65 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2846,8 +2848,8 @@ ReadData INFO Hit x = 1520.49 y = 63.5816 z = -1451.86 detector = Du ReadData INFO Hit x = 1523.7 y = 57.9027 z = -1453.68 detector = DummyHitDetector ReadData INFO Hit x = 1526.91 y = 52.2238 z = -1455.07 detector = DummyHitDetector ReadData INFO Hit x = 1530.12 y = 46.5449 z = -1456.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18969 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #15, run #1 66 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2893,8 +2895,8 @@ ReadData INFO Hit x = 1620.49 y = 63.5816 z = -1551.86 detector = Du ReadData INFO Hit x = 1623.7 y = 57.9027 z = -1553.68 detector = DummyHitDetector ReadData INFO Hit x = 1626.91 y = 52.2238 z = -1555.07 detector = DummyHitDetector ReadData INFO Hit x = 1630.12 y = 46.5449 z = -1556.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18969 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #16, run #1 67 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2940,8 +2942,8 @@ ReadData INFO Hit x = 1720.49 y = 63.5816 z = -1651.86 detector = Du ReadData INFO Hit x = 1723.7 y = 57.9027 z = -1653.68 detector = DummyHitDetector ReadData INFO Hit x = 1726.91 y = 52.2238 z = -1655.07 detector = DummyHitDetector ReadData INFO Hit x = 1730.12 y = 46.5449 z = -1656.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18969 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #17, run #1 68 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -2987,8 +2989,8 @@ ReadData INFO Hit x = 1820.49 y = 63.5816 z = -1751.86 detector = Du ReadData INFO Hit x = 1823.7 y = 57.9027 z = -1753.68 detector = DummyHitDetector ReadData INFO Hit x = 1826.91 y = 52.2238 z = -1755.07 detector = DummyHitDetector ReadData INFO Hit x = 1830.12 y = 46.5449 z = -1756.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18969 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #18, run #1 69 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -3034,10 +3036,11 @@ ReadData INFO Hit x = 1920.49 y = 63.5816 z = -1851.86 detector = Du ReadData INFO Hit x = 1923.7 y = 57.9027 z = -1853.68 detector = DummyHitDetector ReadData INFO Hit x = 1926.91 y = 52.2238 z = -1855.07 detector = DummyHitDetector ReadData INFO Hit x = 1930.12 y = 46.5449 z = -1856.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18969 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #19, run #1 70 events processed so far <<<=== MetaDataSvc DEBUG handle() EndInputFile for FID:???? +EventSelector INFO Disconnecting input sourceID: ???? Domain[ROOT_All] INFO -> Deaccess DbDatabase READ [ROOT_All] ???? MetaDataSvc DEBUG handle() LastInputFile for end AthenaEventLoopMgr INFO No more events in event selection @@ -3053,9 +3056,9 @@ ToolSvc INFO Removing all tools created by ToolSvc *****Chrono***** INFO **************************************************************************************************** *****Chrono***** INFO The Final CPU consumption ( Chrono ) Table (ordered) *****Chrono***** INFO **************************************************************************************************** -cObjR_ALL INFO Time User : Tot= 40 [ms] Ave/Min/Max=0.147(+- 1.48)/ 0/ 20 [ms] #=272 -cObj_ALL INFO Time User : Tot= 50 [ms] Ave/Min/Max=0.226(+- 1.77)/ 0/ 20 [ms] #=221 -ChronoStatSvc INFO Time User : Tot= 1.25 [s] #= 1 +cObjR_ALL INFO Time User : Tot= 60 [ms] Ave/Min/Max=0.221(+- 1.7)/ 0/ 20 [ms] #=272 +cObj_ALL INFO Time User : Tot= 180 [ms] Ave/Min/Max=0.814(+- 4.78)/ 0/ 50 [ms] #=221 +ChronoStatSvc INFO Time User : Tot= 2.01 [s] #= 1 *****Chrono***** INFO **************************************************************************************************** ChronoStatSvc.f... INFO Service finalized successfully ApplicationMgr INFO Application Manager Finalized successfully diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReadConcat.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReadConcat.ref index 5b894c9d0d57472dbdba24b45d9e2b4f35fd4c59..e7b54eee8afcbb2cbbb413d4bc9549df16ed10db 100644 --- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReadConcat.ref +++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReadConcat.ref @@ -1,11 +1,11 @@ -Tue Sep 4 17:29:23 CEST 2018 +Mon Sep 24 14:04:29 CEST 2018 Preloading tcmalloc_minimal.so Athena INFO including file "AthenaCommon/Preparation.py" Athena INFO including file "AthenaCommon/Atlas.UnixStandardJob.py" Athena INFO executing ROOT6Setup Athena INFO including file "AthenaCommon/Execution.py" Athena INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_ReadJobOptions.py" -Py:ConfigurableDb INFO Read module info for 5519 configurables from 43 genConfDb files +Py:ConfigurableDb INFO Read module info for 5494 configurables from 54 genConfDb files Py:ConfigurableDb INFO No duplicates have been found: that's good ! Athena INFO including file "AthenaCommon/runbatch.py" [?1034hApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 @@ -13,7 +13,7 @@ ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to leve ApplicationMgr SUCCESS ==================================================================================================================================== Welcome to ApplicationMgr (GaudiCoreSvc v30r3) - running on lxplus069.cern.ch on Tue Sep 4 17:29:37 2018 + running on lxplus007.cern.ch on Mon Sep 24 14:04:40 2018 ==================================================================================================================================== ApplicationMgr INFO Successfully loaded modules : AthenaServices ApplicationMgr INFO Application Manager Configured successfully @@ -21,10 +21,10 @@ ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to leve StatusCodeSvc INFO initialize AthDictLoaderSvc INFO in initialize... AthDictLoaderSvc INFO acquired Dso-registry -ClassIDSvc INFO getRegistryEntries: read 2918 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 2946 CLIDRegistry entries for module ALL CoreDumpSvc INFO install f-a-t-a-l handler... (flag = -1) AthenaEventLoopMgr INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00 -ClassIDSvc INFO getRegistryEntries: read 916 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 889 CLIDRegistry entries for module ALL ReadData DEBUG Property update for OutputLevel : new value = 2 ReadData INFO in initialize() MetaDataSvc DEBUG Property update for OutputLevel : new value = 2 @@ -36,8 +36,8 @@ PoolSvc DEBUG Service base class initialized successfully PoolSvc INFO Set connectionsvc retry/timeout/IDLE timeout to 'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled PoolSvc INFO Frontier compression level set to 5 DBReplicaSvc INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy-wigner.cern.ch:3128) will be considered for COOL data -DBReplicaSvc INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-09-03T2055/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/dbreplica.config -DBReplicaSvc INFO Total of 10 servers found for host lxplus069.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] +DBReplicaSvc INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-09-22T2103/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-dbg/share/dbreplica.config +DBReplicaSvc INFO Total of 10 servers found for host lxplus007.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] PoolSvc INFO Successfully setup replica sorting algorithm PoolSvc DEBUG OutputLevel is PoolSvc INFO Setting up APR FileCatalog and Streams @@ -378,7 +378,7 @@ ReadData INFO Hit x = 1023.7 y = 57.9027 z = -953.684 detector = Dum ReadData INFO Hit x = 1026.91 y = 52.2238 z = -955.073 detector = DummyHitDetector ReadData INFO Hit x = 1030.12 y = 46.5449 z = -956.169 detector = DummyHitDetector ClassIDSvc INFO getRegistryEntries: read 10 CLIDRegistry entries for module ALL -PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19687 +PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19691 PoolSvc INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #10, run #1 1 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -411,7 +411,7 @@ ReadData INFO Hit x = 1120.49 y = 63.5816 z = -1051.86 detector = Du ReadData INFO Hit x = 1123.7 y = 57.9027 z = -1053.68 detector = DummyHitDetector ReadData INFO Hit x = 1126.91 y = 52.2238 z = -1055.07 detector = DummyHitDetector ReadData INFO Hit x = 1130.12 y = 46.5449 z = -1056.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19687 +PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19691 PoolSvc INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #11, run #1 2 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -444,7 +444,7 @@ ReadData INFO Hit x = 1220.49 y = 63.5816 z = -1151.86 detector = Du ReadData INFO Hit x = 1223.7 y = 57.9027 z = -1153.68 detector = DummyHitDetector ReadData INFO Hit x = 1226.91 y = 52.2238 z = -1155.07 detector = DummyHitDetector ReadData INFO Hit x = 1230.12 y = 46.5449 z = -1156.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19687 +PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19691 PoolSvc INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #12, run #1 3 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -477,7 +477,7 @@ ReadData INFO Hit x = 1320.49 y = 63.5816 z = -1251.86 detector = Du ReadData INFO Hit x = 1323.7 y = 57.9027 z = -1253.68 detector = DummyHitDetector ReadData INFO Hit x = 1326.91 y = 52.2238 z = -1255.07 detector = DummyHitDetector ReadData INFO Hit x = 1330.12 y = 46.5449 z = -1256.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19687 +PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19691 PoolSvc INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #13, run #1 4 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -510,7 +510,7 @@ ReadData INFO Hit x = 1420.49 y = 63.5816 z = -1351.86 detector = Du ReadData INFO Hit x = 1423.7 y = 57.9027 z = -1353.68 detector = DummyHitDetector ReadData INFO Hit x = 1426.91 y = 52.2238 z = -1355.07 detector = DummyHitDetector ReadData INFO Hit x = 1430.12 y = 46.5449 z = -1356.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19687 +PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19691 PoolSvc INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #14, run #1 5 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -543,7 +543,7 @@ ReadData INFO Hit x = 1520.49 y = 63.5816 z = -1451.86 detector = Du ReadData INFO Hit x = 1523.7 y = 57.9027 z = -1453.68 detector = DummyHitDetector ReadData INFO Hit x = 1526.91 y = 52.2238 z = -1455.07 detector = DummyHitDetector ReadData INFO Hit x = 1530.12 y = 46.5449 z = -1456.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19687 +PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19691 PoolSvc INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #15, run #1 6 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -576,7 +576,7 @@ ReadData INFO Hit x = 1620.49 y = 63.5816 z = -1551.86 detector = Du ReadData INFO Hit x = 1623.7 y = 57.9027 z = -1553.68 detector = DummyHitDetector ReadData INFO Hit x = 1626.91 y = 52.2238 z = -1555.07 detector = DummyHitDetector ReadData INFO Hit x = 1630.12 y = 46.5449 z = -1556.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19687 +PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19691 PoolSvc INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #16, run #1 7 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -609,7 +609,7 @@ ReadData INFO Hit x = 1720.49 y = 63.5816 z = -1651.86 detector = Du ReadData INFO Hit x = 1723.7 y = 57.9027 z = -1653.68 detector = DummyHitDetector ReadData INFO Hit x = 1726.91 y = 52.2238 z = -1655.07 detector = DummyHitDetector ReadData INFO Hit x = 1730.12 y = 46.5449 z = -1656.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19687 +PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19691 PoolSvc INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #17, run #1 8 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -642,7 +642,7 @@ ReadData INFO Hit x = 1820.49 y = 63.5816 z = -1751.86 detector = Du ReadData INFO Hit x = 1823.7 y = 57.9027 z = -1753.68 detector = DummyHitDetector ReadData INFO Hit x = 1826.91 y = 52.2238 z = -1755.07 detector = DummyHitDetector ReadData INFO Hit x = 1830.12 y = 46.5449 z = -1756.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19687 +PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19691 PoolSvc INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #18, run #1 9 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection @@ -675,12 +675,13 @@ ReadData INFO Hit x = 1920.49 y = 63.5816 z = -1851.86 detector = Du ReadData INFO Hit x = 1923.7 y = 57.9027 z = -1853.68 detector = DummyHitDetector ReadData INFO Hit x = 1926.91 y = 52.2238 z = -1855.07 detector = DummyHitDetector ReadData INFO Hit x = 1930.12 y = 46.5449 z = -1856.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19687 +PoolSvc INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19691 PoolSvc INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23 AthenaEventLoopMgr INFO ===>>> done processing event #19, run #1 10 events processed so far <<<=== Domain[ROOT_All] INFO -> Deaccess DbDatabase READ [ROOT_All] ???? Domain[ROOT_All] INFO > Deaccess DbDomain READ [ROOT_All] MetaDataSvc DEBUG handle() EndInputFile for FID:???? +EventSelector INFO Disconnecting input sourceID: ???? EventSelector DEBUG Try item: "EmptyPoolFile.root" from the collection list. PersistencySvc:... DEBUG lookupPFN: EmptyPoolFile.root returned FID: '????' tech=ROOT_All DbSession INFO Open DbSession @@ -873,8 +874,8 @@ ReadData INFO EventInfo event: 0 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18814 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18815 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #0, run #1 11 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -901,8 +902,8 @@ ReadData INFO EventInfo event: 1 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18814 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18815 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #1, run #1 12 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -929,8 +930,8 @@ ReadData INFO EventInfo event: 2 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18814 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18815 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #2, run #1 13 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -957,8 +958,8 @@ ReadData INFO EventInfo event: 3 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18814 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18815 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #3, run #1 14 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -985,8 +986,8 @@ ReadData INFO EventInfo event: 4 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18814 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18815 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #4, run #1 15 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1013,8 +1014,8 @@ ReadData INFO EventInfo event: 5 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18814 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18815 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #5, run #1 16 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1041,8 +1042,8 @@ ReadData INFO EventInfo event: 6 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18814 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18815 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #6, run #1 17 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1069,8 +1070,8 @@ ReadData INFO EventInfo event: 7 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18814 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18815 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #7, run #1 18 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1097,8 +1098,8 @@ ReadData INFO EventInfo event: 8 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18814 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18815 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #8, run #1 19 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1125,8 +1126,8 @@ ReadData INFO EventInfo event: 9 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18814 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18815 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #9, run #1 20 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1153,8 +1154,8 @@ ReadData INFO EventInfo event: 10 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18814 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18815 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #10, run #1 21 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1181,8 +1182,8 @@ ReadData INFO EventInfo event: 11 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18814 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18815 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #11, run #1 22 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1209,8 +1210,8 @@ ReadData INFO EventInfo event: 12 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18814 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18815 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #12, run #1 23 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1237,8 +1238,8 @@ ReadData INFO EventInfo event: 13 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18814 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18815 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #13, run #1 24 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1265,8 +1266,8 @@ ReadData INFO EventInfo event: 14 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18814 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18815 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #14, run #1 25 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1293,8 +1294,8 @@ ReadData INFO EventInfo event: 15 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18814 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18815 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #15, run #1 26 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1321,8 +1322,8 @@ ReadData INFO EventInfo event: 16 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18814 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18815 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #16, run #1 27 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1349,8 +1350,8 @@ ReadData INFO EventInfo event: 17 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18814 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18815 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #17, run #1 28 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1377,8 +1378,8 @@ ReadData INFO EventInfo event: 18 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18814 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18815 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #18, run #1 29 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1405,8 +1406,8 @@ ReadData INFO EventInfo event: 19 run: 1 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18814 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 26 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 18815 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 22 AthenaEventLoopMgr INFO ===>>> done processing event #19, run #1 30 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1434,8 +1435,8 @@ ReadData INFO EventInfo event: 20 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20438 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #20, run #2 31 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1462,8 +1463,8 @@ ReadData INFO EventInfo event: 21 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20438 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #21, run #2 32 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1490,8 +1491,8 @@ ReadData INFO EventInfo event: 22 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20438 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #22, run #2 33 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1518,8 +1519,8 @@ ReadData INFO EventInfo event: 23 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20438 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #23, run #2 34 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1546,8 +1547,8 @@ ReadData INFO EventInfo event: 24 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20438 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #24, run #2 35 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1574,8 +1575,8 @@ ReadData INFO EventInfo event: 25 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20438 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #25, run #2 36 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1602,8 +1603,8 @@ ReadData INFO EventInfo event: 26 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20438 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #26, run #2 37 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1630,8 +1631,8 @@ ReadData INFO EventInfo event: 27 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20438 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #27, run #2 38 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1658,8 +1659,8 @@ ReadData INFO EventInfo event: 28 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20438 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #28, run #2 39 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1686,8 +1687,8 @@ ReadData INFO EventInfo event: 29 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20438 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #29, run #2 40 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1714,8 +1715,8 @@ ReadData INFO EventInfo event: 30 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20438 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #30, run #2 41 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1742,8 +1743,8 @@ ReadData INFO EventInfo event: 31 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20438 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #31, run #2 42 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1770,8 +1771,8 @@ ReadData INFO EventInfo event: 32 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20438 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #32, run #2 43 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1798,8 +1799,8 @@ ReadData INFO EventInfo event: 33 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20438 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #33, run #2 44 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1826,8 +1827,8 @@ ReadData INFO EventInfo event: 34 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20438 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #34, run #2 45 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1854,8 +1855,8 @@ ReadData INFO EventInfo event: 35 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20438 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #35, run #2 46 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1882,8 +1883,8 @@ ReadData INFO EventInfo event: 36 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20438 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #36, run #2 47 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1910,8 +1911,8 @@ ReadData INFO EventInfo event: 37 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20438 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #37, run #2 48 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1938,8 +1939,8 @@ ReadData INFO EventInfo event: 38 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20438 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #38, run #2 49 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 3 @@ -1966,10 +1967,11 @@ ReadData INFO EventInfo event: 39 run: 2 ReadData INFO Get Smart data ptr 1 ReadData INFO Could not find ExampleTrackContainer/MyTracks ReadData INFO Could not find ExampleHitContainer/MyHits -PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20437 -PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 30 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 20438 +PoolSvc INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 25 AthenaEventLoopMgr INFO ===>>> done processing event #39, run #2 50 events processed so far <<<=== MetaDataSvc DEBUG handle() EndInputFile for FID:???? +EventSelector INFO Disconnecting input sourceID: ???? Domain[ROOT_All] INFO -> Deaccess DbDatabase READ [ROOT_All] ???? Domain[ROOT_All] INFO > Deaccess DbDomain READ [ROOT_All] EventSelector DEBUG Try item: "SimplePoolFile3.root" from the collection list. @@ -2176,8 +2178,8 @@ ReadData INFO Hit x = 20.4945 y = 63.5816 z = 48.1358 detector = Dum ReadData INFO Hit x = 23.7045 y = 57.9027 z = 46.3159 detector = DummyHitDetector ReadData INFO Hit x = 26.9145 y = 52.2238 z = 44.9265 detector = DummyHitDetector ReadData INFO Hit x = 30.1245 y = 46.5449 z = 43.831 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18602 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18595 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #0, run #1 51 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 0 @@ -2223,8 +2225,8 @@ ReadData INFO Hit x = 120.494 y = 63.5816 z = -51.8642 detector = Du ReadData INFO Hit x = 123.704 y = 57.9027 z = -53.6841 detector = DummyHitDetector ReadData INFO Hit x = 126.915 y = 52.2238 z = -55.0735 detector = DummyHitDetector ReadData INFO Hit x = 130.125 y = 46.5449 z = -56.169 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18602 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18595 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #1, run #1 52 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 0 @@ -2270,8 +2272,8 @@ ReadData INFO Hit x = 220.494 y = 63.5816 z = -151.864 detector = Du ReadData INFO Hit x = 223.704 y = 57.9027 z = -153.684 detector = DummyHitDetector ReadData INFO Hit x = 226.915 y = 52.2238 z = -155.073 detector = DummyHitDetector ReadData INFO Hit x = 230.125 y = 46.5449 z = -156.169 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18602 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18595 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #2, run #1 53 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 0 @@ -2317,8 +2319,8 @@ ReadData INFO Hit x = 320.495 y = 63.5816 z = -251.864 detector = Du ReadData INFO Hit x = 323.705 y = 57.9027 z = -253.684 detector = DummyHitDetector ReadData INFO Hit x = 326.915 y = 52.2238 z = -255.073 detector = DummyHitDetector ReadData INFO Hit x = 330.125 y = 46.5449 z = -256.169 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18602 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18595 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #3, run #1 54 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 0 @@ -2364,8 +2366,8 @@ ReadData INFO Hit x = 420.495 y = 63.5816 z = -351.864 detector = Du ReadData INFO Hit x = 423.705 y = 57.9027 z = -353.684 detector = DummyHitDetector ReadData INFO Hit x = 426.915 y = 52.2238 z = -355.073 detector = DummyHitDetector ReadData INFO Hit x = 430.125 y = 46.5449 z = -356.169 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18602 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18595 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #4, run #1 55 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 0 @@ -2411,8 +2413,8 @@ ReadData INFO Hit x = 520.495 y = 63.5816 z = -451.864 detector = Du ReadData INFO Hit x = 523.705 y = 57.9027 z = -453.684 detector = DummyHitDetector ReadData INFO Hit x = 526.914 y = 52.2238 z = -455.073 detector = DummyHitDetector ReadData INFO Hit x = 530.125 y = 46.5449 z = -456.169 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18602 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18595 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #5, run #1 56 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 0 @@ -2458,8 +2460,8 @@ ReadData INFO Hit x = 620.495 y = 63.5816 z = -551.864 detector = Du ReadData INFO Hit x = 623.705 y = 57.9027 z = -553.684 detector = DummyHitDetector ReadData INFO Hit x = 626.914 y = 52.2238 z = -555.073 detector = DummyHitDetector ReadData INFO Hit x = 630.125 y = 46.5449 z = -556.169 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18602 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18595 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #6, run #1 57 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 0 @@ -2505,8 +2507,8 @@ ReadData INFO Hit x = 720.495 y = 63.5816 z = -651.864 detector = Du ReadData INFO Hit x = 723.705 y = 57.9027 z = -653.684 detector = DummyHitDetector ReadData INFO Hit x = 726.914 y = 52.2238 z = -655.073 detector = DummyHitDetector ReadData INFO Hit x = 730.125 y = 46.5449 z = -656.169 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18602 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18595 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #7, run #1 58 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 0 @@ -2552,8 +2554,8 @@ ReadData INFO Hit x = 820.495 y = 63.5816 z = -751.864 detector = Du ReadData INFO Hit x = 823.705 y = 57.9027 z = -753.684 detector = DummyHitDetector ReadData INFO Hit x = 826.914 y = 52.2238 z = -755.073 detector = DummyHitDetector ReadData INFO Hit x = 830.125 y = 46.5449 z = -756.169 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18602 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18595 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #8, run #1 59 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 0 @@ -2599,8 +2601,8 @@ ReadData INFO Hit x = 920.495 y = 63.5816 z = -851.864 detector = Du ReadData INFO Hit x = 923.705 y = 57.9027 z = -853.684 detector = DummyHitDetector ReadData INFO Hit x = 926.914 y = 52.2238 z = -855.073 detector = DummyHitDetector ReadData INFO Hit x = 930.125 y = 46.5449 z = -856.169 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18602 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18595 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #9, run #1 60 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 0 @@ -2646,8 +2648,8 @@ ReadData INFO Hit x = 1020.49 y = 63.5816 z = -951.864 detector = Du ReadData INFO Hit x = 1023.7 y = 57.9027 z = -953.684 detector = DummyHitDetector ReadData INFO Hit x = 1026.91 y = 52.2238 z = -955.073 detector = DummyHitDetector ReadData INFO Hit x = 1030.12 y = 46.5449 z = -956.169 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18602 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18595 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #10, run #1 61 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 0 @@ -2693,8 +2695,8 @@ ReadData INFO Hit x = 1120.49 y = 63.5816 z = -1051.86 detector = Du ReadData INFO Hit x = 1123.7 y = 57.9027 z = -1053.68 detector = DummyHitDetector ReadData INFO Hit x = 1126.91 y = 52.2238 z = -1055.07 detector = DummyHitDetector ReadData INFO Hit x = 1130.12 y = 46.5449 z = -1056.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18602 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18595 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #11, run #1 62 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 0 @@ -2740,8 +2742,8 @@ ReadData INFO Hit x = 1220.49 y = 63.5816 z = -1151.86 detector = Du ReadData INFO Hit x = 1223.7 y = 57.9027 z = -1153.68 detector = DummyHitDetector ReadData INFO Hit x = 1226.91 y = 52.2238 z = -1155.07 detector = DummyHitDetector ReadData INFO Hit x = 1230.12 y = 46.5449 z = -1156.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18602 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18595 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #12, run #1 63 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 0 @@ -2787,8 +2789,8 @@ ReadData INFO Hit x = 1320.49 y = 63.5816 z = -1251.86 detector = Du ReadData INFO Hit x = 1323.7 y = 57.9027 z = -1253.68 detector = DummyHitDetector ReadData INFO Hit x = 1326.91 y = 52.2238 z = -1255.07 detector = DummyHitDetector ReadData INFO Hit x = 1330.12 y = 46.5449 z = -1256.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18602 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18595 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #13, run #1 64 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 0 @@ -2834,8 +2836,8 @@ ReadData INFO Hit x = 1420.49 y = 63.5816 z = -1351.86 detector = Du ReadData INFO Hit x = 1423.7 y = 57.9027 z = -1353.68 detector = DummyHitDetector ReadData INFO Hit x = 1426.91 y = 52.2238 z = -1355.07 detector = DummyHitDetector ReadData INFO Hit x = 1430.12 y = 46.5449 z = -1356.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18602 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18595 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #14, run #1 65 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 0 @@ -2881,8 +2883,8 @@ ReadData INFO Hit x = 1520.49 y = 63.5816 z = -1451.86 detector = Du ReadData INFO Hit x = 1523.7 y = 57.9027 z = -1453.68 detector = DummyHitDetector ReadData INFO Hit x = 1526.91 y = 52.2238 z = -1455.07 detector = DummyHitDetector ReadData INFO Hit x = 1530.12 y = 46.5449 z = -1456.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18602 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18595 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #15, run #1 66 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 0 @@ -2928,8 +2930,8 @@ ReadData INFO Hit x = 1620.49 y = 63.5816 z = -1551.86 detector = Du ReadData INFO Hit x = 1623.7 y = 57.9027 z = -1553.68 detector = DummyHitDetector ReadData INFO Hit x = 1626.91 y = 52.2238 z = -1555.07 detector = DummyHitDetector ReadData INFO Hit x = 1630.12 y = 46.5449 z = -1556.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18602 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18595 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #16, run #1 67 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 0 @@ -2975,8 +2977,8 @@ ReadData INFO Hit x = 1720.49 y = 63.5816 z = -1651.86 detector = Du ReadData INFO Hit x = 1723.7 y = 57.9027 z = -1653.68 detector = DummyHitDetector ReadData INFO Hit x = 1726.91 y = 52.2238 z = -1655.07 detector = DummyHitDetector ReadData INFO Hit x = 1730.12 y = 46.5449 z = -1656.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18602 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18595 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #17, run #1 68 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 0 @@ -3022,8 +3024,8 @@ ReadData INFO Hit x = 1820.49 y = 63.5816 z = -1751.86 detector = Du ReadData INFO Hit x = 1823.7 y = 57.9027 z = -1753.68 detector = DummyHitDetector ReadData INFO Hit x = 1826.91 y = 52.2238 z = -1755.07 detector = DummyHitDetector ReadData INFO Hit x = 1830.12 y = 46.5449 z = -1756.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18602 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18595 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #18, run #1 69 events processed so far <<<=== EventSelector DEBUG Get AttributeList from the collection EventSelector DEBUG AttributeList size 0 @@ -3069,11 +3071,12 @@ ReadData INFO Hit x = 1920.49 y = 63.5816 z = -1851.86 detector = Du ReadData INFO Hit x = 1923.7 y = 57.9027 z = -1853.68 detector = DummyHitDetector ReadData INFO Hit x = 1926.91 y = 52.2238 z = -1855.07 detector = DummyHitDetector ReadData INFO Hit x = 1930.12 y = 46.5449 z = -1856.17 detector = DummyHitDetector -PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18602 -PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 22 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18595 +PoolSvc INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21 AthenaEventLoopMgr INFO ===>>> done processing event #19, run #1 70 events processed so far <<<=== Domain[ROOT_All] INFO -> Deaccess DbDatabase READ [ROOT_All] ???? MetaDataSvc DEBUG handle() EndInputFile for FID:???? +EventSelector INFO Disconnecting input sourceID: ???? MetaDataSvc DEBUG handle() LastInputFile for end AthenaEventLoopMgr INFO No more events in event selection MetaDataSvc DEBUG calling metaDataStop for ToolSvc.IOVDbMetaDataTool @@ -3088,9 +3091,9 @@ ToolSvc INFO Removing all tools created by ToolSvc *****Chrono***** INFO **************************************************************************************************** *****Chrono***** INFO The Final CPU consumption ( Chrono ) Table (ordered) *****Chrono***** INFO **************************************************************************************************** -cObjR_ALL INFO Time User : Tot= 40 [ms] Ave/Min/Max=0.147(+- 1.91)/ 0/ 30 [ms] #=272 -cObj_ALL INFO Time User : Tot= 80 [ms] Ave/Min/Max=0.362(+- 3.13)/ 0/ 40 [ms] #=221 -ChronoStatSvc INFO Time User : Tot= 1.23 [s] #= 1 +cObjR_ALL INFO Time User : Tot= 40 [ms] Ave/Min/Max=0.147(+- 1.48)/ 0/ 20 [ms] #=272 +cObj_ALL INFO Time User : Tot= 130 [ms] Ave/Min/Max=0.588(+- 4.05)/ 0/ 50 [ms] #=221 +ChronoStatSvc INFO Time User : Tot= 1.9 [s] #= 1 *****Chrono***** INFO **************************************************************************************************** ChronoStatSvc.f... INFO Service finalized successfully ApplicationMgr INFO Application Manager Finalized successfully diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleData/AthenaPoolExampleData/ExampleClass.h b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleData/AthenaPoolExampleData/ExampleClass.h index 4c390cf5d561dce7476c11f42fd3c2678da8a0cb..50fc8b5eb31c1d3fb79ce33a3b11bc82fd1637c6 100755 --- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleData/AthenaPoolExampleData/ExampleClass.h +++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleData/AthenaPoolExampleData/ExampleClass.h @@ -51,6 +51,6 @@ private: int m_event; std::string m_text; }; -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" CLASS_DEF(ExampleClass, 67289510, 1) #endif diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleData/AthenaPoolExampleData/ExampleHitContainer.h b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleData/AthenaPoolExampleData/ExampleHitContainer.h index 4cc05d96318e64a947a7d13b4970c32a1f8358eb..504f58ab197a213f93b9b709563c51cf40fe1eab 100755 --- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleData/AthenaPoolExampleData/ExampleHitContainer.h +++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleData/AthenaPoolExampleData/ExampleHitContainer.h @@ -25,6 +25,6 @@ public: // Constructor and Destructor /// Destructor virtual ~ExampleHitContainer() {}; }; -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" CLASS_DEF(ExampleHitContainer, 9102, 1) #endif diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleData/AthenaPoolExampleData/ExampleTrackContainer.h b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleData/AthenaPoolExampleData/ExampleTrackContainer.h index ad480a9228e504006370768b42998994495e0cb5..53df80539c5dd3731a50dea0fe050b2c32a860ca 100755 --- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleData/AthenaPoolExampleData/ExampleTrackContainer.h +++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleData/AthenaPoolExampleData/ExampleTrackContainer.h @@ -25,6 +25,6 @@ public: // Constructor and Destructor /// Destructor virtual ~ExampleTrackContainer() {}; }; -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" CLASS_DEF(ExampleTrackContainer, 9103, 1) #endif diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleData/CMakeLists.txt b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleData/CMakeLists.txt index f9e983dbd0cb253dee212234dd08c6c5f6fcd2e0..93920abb38001b5a13324fe5ea0035e428915666 100644 --- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleData/CMakeLists.txt +++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleData/CMakeLists.txt @@ -9,9 +9,8 @@ atlas_subdir( AthenaPoolExampleData ) atlas_depends_on_subdirs( PUBLIC Control/AthContainers Control/AthLinks - Control/CLIDSvc + Control/AthenaKernel Control/Navigation - Control/SGTools GaudiKernel ) # External dependencies: @@ -25,13 +24,13 @@ atlas_add_library( AthenaPoolExampleData INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} DEFINITIONS ${CLHEP_DEFINITIONS} - LINK_LIBRARIES ${CLHEP_LIBRARIES} AthContainers AthLinks Navigation SGTools GaudiKernel + LINK_LIBRARIES ${CLHEP_LIBRARIES} AthContainers AthLinks Navigation GaudiKernel PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} ) atlas_add_dictionary( AthenaPoolExampleDataDict AthenaPoolExampleData/AthenaPoolExampleDataDict.h AthenaPoolExampleData/selection.xml INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthContainers AthLinks Navigation SGTools GaudiKernel AthenaPoolExampleData + LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthContainers AthLinks Navigation GaudiKernel AthenaPoolExampleData NAVIGABLES ExampleHitContainer ) diff --git a/Database/CondDBObjects/CMakeLists.txt b/Database/CondDBObjects/CMakeLists.txt index 3a72213d54d0d9b3feee06541c1d2e2ef9356f27..ca3b434aa4aa15de4f7ca0c753b1f4cfaa17c77c 100644 --- a/Database/CondDBObjects/CMakeLists.txt +++ b/Database/CondDBObjects/CMakeLists.txt @@ -7,13 +7,12 @@ atlas_subdir( CondDBObjects ) # Declare the package's dependencies: atlas_depends_on_subdirs( PUBLIC - Control/CLIDSvc - Control/SGTools + Control/AthenaKernel GaudiKernel ) # Component(s) in the package: atlas_add_library( CondDBObjects src/*.cxx PUBLIC_HEADERS CondDBObjects - LINK_LIBRARIES SGTools GaudiKernel ) + LINK_LIBRARIES GaudiKernel ) diff --git a/Database/CondDBObjects/CondDBObjects/GenericDbTableClassDef.h b/Database/CondDBObjects/CondDBObjects/GenericDbTableClassDef.h index 1ed8138cc93b9921a8a1d59813d60515c0c731d3..5d2de6ae22a7838af4ca0b4a5efbae7be03bdad4 100755 --- a/Database/CondDBObjects/CondDBObjects/GenericDbTableClassDef.h +++ b/Database/CondDBObjects/CondDBObjects/GenericDbTableClassDef.h @@ -5,7 +5,7 @@ #ifndef CONDDBOBJECTS_GENERICDBTABLE_CLASSDEF_H #define CONDDBOBJECTS_GENERICDBTABLE_CLASSDEF_H -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "CondDBObjects/GenericDbTable.h" CLASS_DEF(GenericDbTable, 94049889, 1) diff --git a/Database/CoralDB/src/ccdb-migrate.cxx b/Database/CoralDB/src/ccdb-migrate.cxx index e73283a6eadb7f6e24211f90107b7f78f73f5088..be8570485a67a227781d91cd098307bfa1983c0c 100644 --- a/Database/CoralDB/src/ccdb-migrate.cxx +++ b/Database/CoralDB/src/ccdb-migrate.cxx @@ -20,8 +20,18 @@ #include <ctime> +// Suppress a gcc8 warning from boost. +// (Binaries apparently include boost with -I rather than -isystem.) +// Fixed in boost 1.68 (see https://github.com/boostorg/mpl/issues/31) +#ifdef __GNUC__ +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wparentheses" +#endif #include "boost/program_options.hpp" namespace po = boost::program_options; +#ifdef __GNUC__ +# pragma GCC diagnostic pop +#endif #include "CoralDB/CoralDB.h" #include "CoralDB/Connection.h" diff --git a/Database/IOVDbDataModel/CMakeLists.txt b/Database/IOVDbDataModel/CMakeLists.txt index 9216ee1c22b484a7819595b088d6fe0fcc19b506..32a53f4c395779654f914266c288be2c201c8d9b 100644 --- a/Database/IOVDbDataModel/CMakeLists.txt +++ b/Database/IOVDbDataModel/CMakeLists.txt @@ -8,8 +8,6 @@ atlas_subdir( IOVDbDataModel ) # Declare the package's dependencies: atlas_depends_on_subdirs( PUBLIC Control/AthenaKernel - Control/CLIDSvc - Control/SGTools Database/AthenaPOOL/AthenaPoolUtilities GaudiKernel PRIVATE @@ -23,12 +21,12 @@ atlas_add_library( IOVDbDataModel src/*.cxx PUBLIC_HEADERS IOVDbDataModel PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES AthenaKernel SGTools AthenaPoolUtilities GaudiKernel RootUtilsPyROOT + LINK_LIBRARIES AthenaKernel AthenaPoolUtilities GaudiKernel RootUtilsPyROOT PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} RootUtils ) atlas_add_dictionary( IOVDbDataModelDict IOVDbDataModel/IOVDbDataModelDict.h IOVDbDataModel/selection.xml INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaKernel SGTools AthenaPoolUtilities GaudiKernel RootUtils RootUtilsPyROOT IOVDbDataModel ) + LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaKernel AthenaPoolUtilities GaudiKernel RootUtils RootUtilsPyROOT IOVDbDataModel ) diff --git a/Database/IOVDbDataModel/IOVDbDataModel/IOVMetaDataContainer.h b/Database/IOVDbDataModel/IOVDbDataModel/IOVMetaDataContainer.h index 5ab0d17f1f674a553f9ee4ae6f616f097de037e2..366ff7750579bc01c895d315992eb0903cd0458c 100755 --- a/Database/IOVDbDataModel/IOVDbDataModel/IOVMetaDataContainer.h +++ b/Database/IOVDbDataModel/IOVDbDataModel/IOVMetaDataContainer.h @@ -158,9 +158,7 @@ IOVMetaDataContainer::setFolderDescription(const std::string& description) m_folderDescription = description; } -#ifndef CLIDSVC_CLASSDEF_H -# include "CLIDSvc/CLASS_DEF.h" -#endif +#include "AthenaKernel/CLASS_DEF.h" CLASS_DEF( IOVMetaDataContainer , 1316383046 , 1 ) diff --git a/Database/IOVDbSvc/python/IOVDbSvcConfig.py b/Database/IOVDbSvc/python/IOVDbSvcConfig.py index df76c44879bfccc56d43cbcc2df8c77721a2b77b..adf3fcf265ac1b668681193307a95040c77df44f 100644 --- a/Database/IOVDbSvc/python/IOVDbSvcConfig.py +++ b/Database/IOVDbSvc/python/IOVDbSvcConfig.py @@ -92,8 +92,12 @@ def addFolders(configFlags,folderstrings,detDb=None,className=None): loadFolders.append((className, _extractFolder(fs))); result.getCondAlgo("CondInputLoader").Load+=loadFolders #result.addCondAlgo(CondInputLoader(Load=loadFolders)) - + from AthenaPoolCnvSvc.AthenaPoolCnvSvcConf import AthenaPoolCnvSvc + apcs=AthenaPoolCnvSvc() + result.addService(apcs) + from GaudiSvc.GaudiSvcConf import EvtPersistencySvc + result.addService(EvtPersistencySvc("EventPersistencySvc",CnvServices=[apcs.getFullJobOptName(),])) if detDb is not None: diff --git a/DetectorDescription/AtlasDetDescr/AtlasDetDescr/AtlasDetectorID.h b/DetectorDescription/AtlasDetDescr/AtlasDetDescr/AtlasDetectorID.h index 4e1eac43b63787d02abdef37626db05cea105e54..81b5c03ac5395beaafa13cf741e8d4638160def3 100755 --- a/DetectorDescription/AtlasDetDescr/AtlasDetDescr/AtlasDetectorID.h +++ b/DetectorDescription/AtlasDetDescr/AtlasDetDescr/AtlasDetectorID.h @@ -28,7 +28,7 @@ #include "Identifier/Range.h" #include "IdDict/IdDictFieldImplementation.h" #include "AtlasDetTechnology.h" -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include <string> #include <vector> diff --git a/DetectorDescription/AtlasDetDescr/CMakeLists.txt b/DetectorDescription/AtlasDetDescr/CMakeLists.txt index 41a75fb95fe073b3f48bd1a48d6cc4b766de21c7..56b098975cea5358642f74da480d24115b0aa454 100644 --- a/DetectorDescription/AtlasDetDescr/CMakeLists.txt +++ b/DetectorDescription/AtlasDetDescr/CMakeLists.txt @@ -7,8 +7,7 @@ atlas_subdir( AtlasDetDescr ) # Declare the package's dependencies: atlas_depends_on_subdirs( PUBLIC - Control/CLIDSvc - Control/SGTools + Control/AthenaKernel DetectorDescription/IdDict DetectorDescription/Identifier PRIVATE @@ -24,12 +23,12 @@ atlas_add_library( AtlasDetDescr src/AtlasRegionHelper.cxx PUBLIC_HEADERS AtlasDetDescr INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} SGTools IdDict Identifier + LINK_LIBRARIES ${ROOT_LIBRARIES} IdDict Identifier AthenaKernel PRIVATE_LINK_LIBRARIES GaudiKernel ) atlas_add_dictionary( AtlasDetDescrDict AtlasDetDescr/AtlasDetDescrDict.h AtlasDetDescr/selection.xml INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} SGTools IdDict Identifier GaudiKernel AtlasDetDescr ) + LINK_LIBRARIES ${ROOT_LIBRARIES} IdDict Identifier GaudiKernel AtlasDetDescr ) diff --git a/DetectorDescription/DetDescrCond/DetDescrCondExample/src/CoolHistExample.cxx b/DetectorDescription/DetDescrCond/DetDescrCondExample/src/CoolHistExample.cxx index dbf298e02ec0e8350f6f9050d8c855adb114dae9..50b355198f918a136e54b157458902f645379504 100755 --- a/DetectorDescription/DetDescrCond/DetDescrCondExample/src/CoolHistExample.cxx +++ b/DetectorDescription/DetDescrCond/DetDescrCondExample/src/CoolHistExample.cxx @@ -24,7 +24,10 @@ CoolHistExample::CoolHistExample(const std::string& name, m_objname("fileGUID"), m_dirname("DefTag"), m_channel(10), - m_retrievedir(false) + m_retrievedir(false), + m_histptr(nullptr), + m_objptr(nullptr), + m_dirptr(nullptr) { // declare properties declareProperty("RetrieveDir",m_retrievedir); diff --git a/DetectorDescription/DetDescrCond/DetDescrCondExample/src/ReadAlignTrans.cxx b/DetectorDescription/DetDescrCond/DetDescrCondExample/src/ReadAlignTrans.cxx index 96befaa26fe140c2315d27afd5780629419b28d3..ad971284387b516906b99919a649ca8887b1681e 100755 --- a/DetectorDescription/DetDescrCond/DetDescrCondExample/src/ReadAlignTrans.cxx +++ b/DetectorDescription/DetDescrCond/DetDescrCondExample/src/ReadAlignTrans.cxx @@ -18,7 +18,8 @@ ReadAlignTrans::ReadAlignTrans(const std::string& name, ISvcLocator* pSvcLocator) :AthAlgorithm(name,pSvcLocator), - p_geomodelsvc(0) + p_geomodelsvc(0), + m_sidetman() {} ReadAlignTrans::~ReadAlignTrans(void) diff --git a/DetectorDescription/GeoModel/GeoModelExamples/CMakeLists.txt b/DetectorDescription/GeoModel/GeoModelExamples/CMakeLists.txt index 89cf640b843ab1db648d5404385f28ca5ab762c3..4453e6da32d821f53c6dab1c53e3cdac42fb9453 100644 --- a/DetectorDescription/GeoModel/GeoModelExamples/CMakeLists.txt +++ b/DetectorDescription/GeoModel/GeoModelExamples/CMakeLists.txt @@ -7,8 +7,7 @@ atlas_subdir( GeoModelExamples ) # Declare the package's dependencies: atlas_depends_on_subdirs( PUBLIC - Control/CLIDSvc - Control/SGTools + Control/AthenaKernel DetectorDescription/GeoModel/GeoModelKernel DetectorDescription/GeoModel/GeoModelUtilities PRIVATE @@ -26,11 +25,11 @@ atlas_add_library( GeoModelExamplesLib PUBLIC_HEADERS GeoModelExamples PRIVATE_INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} PRIVATE_DEFINITIONS ${CLHEP_DEFINITIONS} - LINK_LIBRARIES SGTools GeoModelKernel GeoModelUtilities StoreGateLib SGtests + LINK_LIBRARIES GeoModelKernel GeoModelUtilities StoreGateLib SGtests PRIVATE_LINK_LIBRARIES ${CLHEP_LIBRARIES} Identifier GaudiKernel ) atlas_add_component( GeoModelExamples src/components/*.cxx INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${CLHEP_LIBRARIES} SGTools GeoModelKernel GeoModelUtilities StoreGateLib SGtests Identifier GaudiKernel GeoModelExamplesLib ) + LINK_LIBRARIES ${CLHEP_LIBRARIES} GeoModelKernel GeoModelUtilities StoreGateLib SGtests Identifier GaudiKernel GeoModelExamplesLib ) diff --git a/DetectorDescription/GeoModel/GeoModelExamples/GeoModelExamples/ToyDetectorManager.h b/DetectorDescription/GeoModel/GeoModelExamples/GeoModelExamples/ToyDetectorManager.h index 96e985e7b30996b93dbc89db44b16aafdd46c787..18a2f2c4d2321f94554b6387086fdfe9e69f81bd 100755 --- a/DetectorDescription/GeoModel/GeoModelExamples/GeoModelExamples/ToyDetectorManager.h +++ b/DetectorDescription/GeoModel/GeoModelExamples/GeoModelExamples/ToyDetectorManager.h @@ -62,7 +62,7 @@ class ToyDetectorManager : public GeoVDetectorManager { // Class ToyDetectorManager #ifndef GAUDI_NEUTRAL -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" CLASS_DEF(ToyDetectorManager, 9876, 1) #endif diff --git a/DetectorDescription/GeoModel/GeoModelExamples/src/ToyDetectorTool.cxx b/DetectorDescription/GeoModel/GeoModelExamples/src/ToyDetectorTool.cxx index 2f8276783c50d467e10a2bfb73e71a68c413a345..b3aa18ce1a8cf7d0fa27fe14d14aa3ec7c1c245a 100755 --- a/DetectorDescription/GeoModel/GeoModelExamples/src/ToyDetectorTool.cxx +++ b/DetectorDescription/GeoModel/GeoModelExamples/src/ToyDetectorTool.cxx @@ -60,7 +60,7 @@ ToyDetectorTool::create() // GeoPhysVol *world=&*theExpt->getPhysVol(); theToyFactory.create(world); - } catch (std::bad_alloc) { + } catch (const std::bad_alloc&) { log << MSG::FATAL << "Could not create new ToyDetectorNode!" << endmsg; return StatusCode::FAILURE; } diff --git a/DetectorDescription/GeoModel/GeoModelInterfaces/CMakeLists.txt b/DetectorDescription/GeoModel/GeoModelInterfaces/CMakeLists.txt index fa5a15f10bc28e3c6b0ea5fcb9981042a4fc5a22..9240ff541a90bd70cb5f6787745c187af2ae6e50 100644 --- a/DetectorDescription/GeoModel/GeoModelInterfaces/CMakeLists.txt +++ b/DetectorDescription/GeoModel/GeoModelInterfaces/CMakeLists.txt @@ -8,8 +8,6 @@ atlas_subdir( GeoModelInterfaces ) # Declare the package's dependencies: atlas_depends_on_subdirs( PUBLIC Control/AthenaKernel - Control/CLIDSvc - Control/SGTools GaudiKernel ) # Install files from the package: diff --git a/DetectorDescription/GeoModel/GeoModelInterfaces/GeoModelInterfaces/StoredMaterialManager.h b/DetectorDescription/GeoModel/GeoModelInterfaces/GeoModelInterfaces/StoredMaterialManager.h index 949484f24bd5aca97b1fdd8f3559959eaaffdfdb..f988dacd2aa970502408fb39dfa3e31224987042 100755 --- a/DetectorDescription/GeoModel/GeoModelInterfaces/GeoModelInterfaces/StoredMaterialManager.h +++ b/DetectorDescription/GeoModel/GeoModelInterfaces/GeoModelInterfaces/StoredMaterialManager.h @@ -2,8 +2,8 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -#ifndef _STOREDMATERIALMANAGER_H_ -#define _STOREDMATERIALMANAGER_H_ +#ifndef GEOMODELINTERFACES_STOREDMATERIALMANAGER_H +#define GEOMODELINTERFACES_STOREDMATERIALMANAGER_H //---------------------------------------------------------// // // // class StoredMaterialManager This class hold one or more// @@ -14,7 +14,7 @@ // // //---------------------------------------------------------// #include "GeoModelInterfaces/AbsMaterialManager.h" -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include <map> class StoredMaterialManager:public AbsMaterialManager { diff --git a/DetectorDescription/GeoModel/GeoModelUtilities/CMakeLists.txt b/DetectorDescription/GeoModel/GeoModelUtilities/CMakeLists.txt index f85461ce3a4948757eea21353c9e3a7eb2b59ea5..af571f9f7145a7a70eeadcc86fd1f3eb3b4b6606 100644 --- a/DetectorDescription/GeoModel/GeoModelUtilities/CMakeLists.txt +++ b/DetectorDescription/GeoModel/GeoModelUtilities/CMakeLists.txt @@ -8,8 +8,7 @@ atlas_subdir( GeoModelUtilities ) # Declare the package's dependencies: atlas_depends_on_subdirs( PUBLIC Control/AthenaBaseComps - Control/CLIDSvc - Control/SGTools + Control/AthenaKernel Database/RDBAccessSvc DetectorDescription/GeoModel/GeoModelInterfaces DetectorDescription/GeoModel/GeoModelKernel @@ -27,6 +26,6 @@ atlas_add_library( GeoModelUtilities PUBLIC_HEADERS GeoModelUtilities INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} DEFINITIONS ${CLHEP_DEFINITIONS} - LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps SGTools GeoModelKernel + LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps GeoModelKernel PRIVATE_LINK_LIBRARIES GaudiKernel ) diff --git a/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoAlignmentStore.h b/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoAlignmentStore.h index 8e58ffb8e09dad96bfd6fbb9d635368c58d3e014..6dbba6cc450931a52b51c0cd31c6e2cc2dd96654 100755 --- a/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoAlignmentStore.h +++ b/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoAlignmentStore.h @@ -7,7 +7,7 @@ #include "GeoModelKernel/GeoVAlignmentStore.h" #include "GeoModelUtilities/TransformMap.h" -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "AthenaKernel/CondCont.h" #include "CLHEP/Geometry/Transform3D.h" #include <stdexcept> diff --git a/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoBorderSurfaceContainer.h b/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoBorderSurfaceContainer.h index 8b675f87b06b0e62c9a35e517126a06d198409fa..d67ec70f8ddf13b245bdd6eb2ff879cc0680de29 100644 --- a/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoBorderSurfaceContainer.h +++ b/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoBorderSurfaceContainer.h @@ -6,7 +6,7 @@ #define GeoBorderSurfaceContainer_h 1 #include "GeoModelUtilities/GeoBorderSurface.h" -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include <vector> typedef std::vector< GeoBorderSurface > GeoBorderSurfaceContainer; diff --git a/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoModelExperiment.h b/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoModelExperiment.h index a900e95d8b49152f3f7c36f098b42339ee4edf4c..be4267a9d50fa00c551abf45350a733d658dbae6 100755 --- a/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoModelExperiment.h +++ b/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoModelExperiment.h @@ -15,7 +15,7 @@ #ifndef GEOMODELSVC_GEOMODELEXPERIMENT_H #define GEOMODELSVC_GEOMODELEXPERIMENT_H #include "GeoModelKernel/GeoVPhysVol.h" -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include <set> #include <string> #include <vector> diff --git a/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/StoredAlignX.h b/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/StoredAlignX.h index c2799bad0715698c485a2224a7a430e94961cfc7..694e33744182c8b6f5c8534b2c5f391f6dbd7a86 100755 --- a/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/StoredAlignX.h +++ b/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/StoredAlignX.h @@ -12,7 +12,7 @@ #ifndef STOREDALIGNX_H #define STOREDALIGNX_H -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include <set> #include <string> diff --git a/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/StoredPhysVol.h b/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/StoredPhysVol.h index 8b69d1633fc10fb18a22d9751d1938d69a29e732..a647e202b12e724d3dbaa8661a9153b0a155516d 100755 --- a/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/StoredPhysVol.h +++ b/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/StoredPhysVol.h @@ -13,7 +13,7 @@ #ifndef STOREDPHYSVOL_H #define STOREDPHYSVOL_H #include "GeoModelKernel/GeoVPhysVol.h" -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include <set> #include <string> diff --git a/DetectorDescription/IdDictDetDescr/CMakeLists.txt b/DetectorDescription/IdDictDetDescr/CMakeLists.txt index 754a8fe9bf954e090a5511be01ae96ec67bffd28..0ab2617d32f14eccfd8f411051077c5041719417 100644 --- a/DetectorDescription/IdDictDetDescr/CMakeLists.txt +++ b/DetectorDescription/IdDictDetDescr/CMakeLists.txt @@ -7,8 +7,7 @@ atlas_subdir( IdDictDetDescr ) # Declare the package's dependencies: atlas_depends_on_subdirs( PUBLIC - Control/CLIDSvc - Control/SGTools + Control/AthenaKernel DetectorDescription/IdDict PRIVATE DetectorDescription/Identifier ) @@ -17,6 +16,5 @@ atlas_depends_on_subdirs( PUBLIC atlas_add_library( IdDictDetDescr src/IdDictManager.cxx PUBLIC_HEADERS IdDictDetDescr - LINK_LIBRARIES SGTools IdDict - PRIVATE_LINK_LIBRARIES Identifier ) - + LINK_LIBRARIES IdDict + PRIVATE_LINK_LIBRARIES AthenaKernel Identifier ) diff --git a/DetectorDescription/IdDictDetDescr/IdDictDetDescr/IdDictManager.h b/DetectorDescription/IdDictDetDescr/IdDictDetDescr/IdDictManager.h index 4100bb9c3bd375d145291044e7125a2033e02897..640ce26213cb87b406b3de0c9ac1a57f349e2553 100755 --- a/DetectorDescription/IdDictDetDescr/IdDictDetDescr/IdDictManager.h +++ b/DetectorDescription/IdDictDetDescr/IdDictDetDescr/IdDictManager.h @@ -16,7 +16,7 @@ //<<<<<< INCLUDES >>>>>> #include "IdDict/IdDictDefs.h" -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" //<<<<<< PUBLIC TYPES >>>>>> diff --git a/Event/ByteStreamCnvSvc/test/AtlFindBSEvent.cxx b/Event/ByteStreamCnvSvc/test/AtlFindBSEvent.cxx index e36d0bc7ee3027a65c58d23d373c86a40b51c811..a4f30216f9841a757cb29387e353bb5d5e1e9282 100644 --- a/Event/ByteStreamCnvSvc/test/AtlFindBSEvent.cxx +++ b/Event/ByteStreamCnvSvc/test/AtlFindBSEvent.cxx @@ -24,6 +24,7 @@ #ifdef __GNUC__ # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wunused-parameter" +# pragma GCC diagnostic ignored "-Wparentheses" #endif #include "eformat/eformat.h" #ifdef __GNUC__ diff --git a/Event/ByteStreamCnvSvc/test/AtlListBSEvents.cxx b/Event/ByteStreamCnvSvc/test/AtlListBSEvents.cxx index 4b382fe3c0556eb2ca004b4f010f6dd7c68a95df..f38a1d04cec56e58fef2fede492a487ba86189de 100644 --- a/Event/ByteStreamCnvSvc/test/AtlListBSEvents.cxx +++ b/Event/ByteStreamCnvSvc/test/AtlListBSEvents.cxx @@ -24,6 +24,7 @@ #ifdef __GNUC__ # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wunused-parameter" +# pragma GCC diagnostic ignored "-Wparentheses" #endif #include "eformat/eformat.h" #ifdef __GNUC__ diff --git a/Event/ByteStreamCnvSvcBase/ByteStreamCnvSvcBase/CollectionByteStreamCnv.icc b/Event/ByteStreamCnvSvcBase/ByteStreamCnvSvcBase/CollectionByteStreamCnv.icc index a647bb807aaf774e7c641eba8a6e0586218dc9cc..bbf4ac7f8ffb854cc77d63bb10fbc43495899bfd 100755 --- a/Event/ByteStreamCnvSvcBase/ByteStreamCnvSvcBase/CollectionByteStreamCnv.icc +++ b/Event/ByteStreamCnvSvcBase/ByteStreamCnvSvcBase/CollectionByteStreamCnv.icc @@ -13,7 +13,7 @@ #include "GaudiKernel/IToolSvc.h" #include "StoreGate/StoreGateSvc.h" -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include <algorithm> template< typename TOOL> diff --git a/Event/ByteStreamCnvSvcBase/CMakeLists.txt b/Event/ByteStreamCnvSvcBase/CMakeLists.txt index 9d254867e8ee4cad616cb65daff5a5c198e3cb70..cec0ade0db7f6d2adde2150922b6c6a79ed6e84b 100644 --- a/Event/ByteStreamCnvSvcBase/CMakeLists.txt +++ b/Event/ByteStreamCnvSvcBase/CMakeLists.txt @@ -9,7 +9,6 @@ atlas_subdir( ByteStreamCnvSvcBase ) atlas_depends_on_subdirs( PUBLIC Control/AthenaBaseComps Control/AthenaKernel - Control/CLIDSvc Control/StoreGate Event/ByteStreamData GaudiKernel diff --git a/Event/EventContainers/CMakeLists.txt b/Event/EventContainers/CMakeLists.txt index ba2c3049bfe5d6900d92a09109da64b3ae322c59..c65a935b9a0890f2d58a3d8f3a7ef5bca1786840 100644 --- a/Event/EventContainers/CMakeLists.txt +++ b/Event/EventContainers/CMakeLists.txt @@ -10,28 +10,27 @@ atlas_depends_on_subdirs( PUBLIC DetectorDescription/Identifier GaudiKernel PRIVATE - Control/CLIDSvc - Control/SGTools ) + Control/AthenaKernel ) # Install files from the package: atlas_add_library( EventContainers src/*.cxx PUBLIC_HEADERS EventContainers - LINK_LIBRARIES GaudiKernel SGTools ) + LINK_LIBRARIES AthenaKernel GaudiKernel ) atlas_add_test( IdCont SOURCES test/ID_ContainerTest.cxx INCLUDE_DIRS src test EventContainers - LINK_LIBRARIES Identifier GaudiKernel SGTools EventContainers + LINK_LIBRARIES Identifier AthenaKernel GaudiKernel EventContainers EXTRA_PATTERNS "elapsed" ) atlas_add_test( IdMTCont SOURCES test/IDMT_ContainerTest.cxx INCLUDE_DIRS src test EventContainers - LINK_LIBRARIES Identifier GaudiKernel SGTools EventContainers + LINK_LIBRARIES Identifier AthenaKernel GaudiKernel EventContainers EXTRA_PATTERNS "elapsed" ) atlas_add_test( IDStressTest SOURCES test/IDC_Realistic_Test.cxx INCLUDE_DIRS src test EventContainers - LINK_LIBRARIES Identifier GaudiKernel SGTools EventContainers + LINK_LIBRARIES Identifier AthenaKernel GaudiKernel EventContainers EXTRA_PATTERNS "elapsed|^no lock time|^deleted|^countHit|^lock time" ) diff --git a/Event/EventContainers/test/IDMT_ContainerTest.cxx b/Event/EventContainers/test/IDMT_ContainerTest.cxx index c7e1837e637f5d3b327d44d9686f95343619efa3..f778288a5272a389a1f0181fd435b2fb680e8748 100644 --- a/Event/EventContainers/test/IDMT_ContainerTest.cxx +++ b/Event/EventContainers/test/IDMT_ContainerTest.cxx @@ -9,7 +9,7 @@ #include "EventContainers/IdentifiableContTemp.h" #include "ID_ContainerTest.h" #include "GaudiKernel/System.h" -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" // define a bunch of fake data classes using namespace std; diff --git a/Event/EventContainers/test/ID_ContainerTest.cxx b/Event/EventContainers/test/ID_ContainerTest.cxx index a0c30e97d3ef47b3c3a6fd450c67b1579c18ae01..8cdc688d646cbdc6b983717651c7ff16c2852277 100644 --- a/Event/EventContainers/test/ID_ContainerTest.cxx +++ b/Event/EventContainers/test/ID_ContainerTest.cxx @@ -9,7 +9,7 @@ #include "EventContainers/SelectAllObject.h" #include "ID_ContainerTest.h" #include "GaudiKernel/System.h" -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" // define a bunch of fake data classes using namespace std; diff --git a/Event/EventOverlay/EventOverlayJobTransforms/python/OverlayPoolReadMetaData.py b/Event/EventOverlay/EventOverlayJobTransforms/python/OverlayPoolReadMetaData.py new file mode 100644 index 0000000000000000000000000000000000000000..1f85bffd76eb017726336a1f4ae91f65042982c6 --- /dev/null +++ b/Event/EventOverlay/EventOverlayJobTransforms/python/OverlayPoolReadMetaData.py @@ -0,0 +1,458 @@ +# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + +from AthenaCommon.Logging import logging +logOverlayPoolReadMetadata = logging.getLogger( 'OverlayPoolReadMetadata' ) + +def hitColls2SimulatedDetectors(inputlist): + """Build a dictionary from the list of containers in the metadata""" + simulatedDetectors = [] + simulatedDictionary = {'PixelHits': 'pixel', 'SCT_Hits': 'SCT', 'TRTUncompressedHits': 'TRT', + 'BCMHits': 'BCM', 'LucidSimHitsVector': 'Lucid', 'LArHitEMB': 'LAr', + 'LArHitEMEC': 'LAr', 'LArHitFCAL': 'LAr', 'LArHitHEC': 'LAr', + 'MBTSHits': 'Tile', 'TileHitVec': 'Tile', 'MDT_Hits': 'MDT', + 'MicromegasSensitiveDetector': 'Micromegas', + 'sTGCSensitiveDetector': 'sTGC', + 'CSC_Hits': 'CSC', 'TGC_Hits': 'TGC', 'RPC_Hits': 'RPC', + 'TruthEvent': 'Truth'} #'': 'ALFA', '': 'ZDC', + for entry in inputlist: + if entry[1] in simulatedDictionary.keys(): + if simulatedDictionary[entry[1]] not in simulatedDetectors: + simulatedDetectors += [simulatedDictionary[entry[1]]] + return simulatedDetectors + +def checkTileCalibrationHitFormat(inputlist): + """Check the Tile CaloCalibrationHit format""" + oldnames = ["TileCalibrationCellHitCnt","TileCalibrationDMHitCnt"] + newnames = ["TileCalibHitActiveCell","TileCalibHitInactiveCell","TileCalibHitDeadMaterial"] + nold = 0 + nnew = 0 + for entry in inputlist: + if entry[1] in oldnames: + logOverlayPoolReadMetadata.debug("found %s in oldnames", entry[1]) + nold+=1 + if entry[1] in newnames: + logOverlayPoolReadMetadata.debug("found %s in newnames", entry[1]) + nnew+=1 + if nold > 0 and nnew > 0: + raise SystemExit("Input file contains both old and new style TileCaloCalibrationHit containers, please check your g4sim job.") + elif nold > 0: + from Digitization.DigitizationFlags import digitizationFlags + digitizationFlags.experimentalDigi += ['OldTileCalibHitContainers'] + logOverlayPoolReadMetadata.info("Input file uses old TileCalibHitContainers names: %s", oldnames); + elif nnew > 0: + logOverlayPoolReadMetadata.info("Input file uses new TileCalibHitContainers names: %s", newnames); + return + +## Helper functions +def skipCheck(key): + """This check is not required""" + from Digitization.DigitizationFlags import digitizationFlags + if key in digitizationFlags.overrideMetadata.get_Value(): + return True + return False + +def skipPileUpCheck(key, pileuptype): + """This check is not required""" + if skipCheck(key): + return True + pileupkey='%s_%s' %(pileuptype,key) + return skipCheck(pileupkey) + +def doMC_channel_number(f,pileUpType): + print "doMC_channel_number for %s", pileUpType + if "mc_channel_number" in f.infos.keys(): + params = dict() + from Digitization.DigitizationFlags import digitizationFlags + if digitizationFlags.pileupDSID.statusOn: + params = digitizationFlags.pileupDSID.get_Value() + print "MC channel number from AthFile %s", f.infos["mc_channel_number"] + params[pileUpType]= f.infos["mc_channel_number"] + digitizationFlags.pileupDSID = params + del params + return + +def doSpecialConfiguration(f): + #safety checks before trying to access metadata + if "tag_info" in f.infos.keys(): + if "specialConfiguration" in f.infos["tag_info"]: + item = f.infos["tag_info"]["specialConfiguration"] + logOverlayPoolReadMetadata.info("specialConfiguration directive: %s" % item) + spcitems = item.split(";") + preIncludes=[] + params = {} + from Digitization.DigitizationFlags import digitizationFlags + if digitizationFlags.specialConfiguration.statusOn: + logOverlayPoolReadMetadata.info("some spcialConfiguration metadata already exists: %s", str(params)) + params = digitizationFlags.specialConfiguration.get_Value() + for spcitem in spcitems: + ## Ignore empty (e.g. from consecutive or trailing semicolons) or "NONE" substrings + if not spcitem or spcitem == "NONE": + continue + ## If not in key=value format, treat as v, with k="preInclude" + if "=" not in spcitem: + spcitem = "preInclude=" + spcitem + ## Handle k=v directives + k, v = spcitem.split("=") + logOverlayPoolReadMetadata.info("specialConfiguration metadata item: %s => %s" % (k, v)) + ## Store preIncludes for including later. + if k == "preInclude": + incfiles = v.split(",") + preIncludes+=incfiles + else: + params[k] = v + digitizationFlags.specialConfiguration = params + ## Now that we've looked at and stored all the evgen metadata keys, we should do any requested preIncludes + from AthenaCommon.Include import include + for incfile in preIncludes: + logOverlayPoolReadMetadata.info("Including %s as instructed by specialConfiguration metadata" % incfile) + include(incfile) + del preIncludes + del params + +def buildDict(inputtype, inputfile): + """Build a dictionary of KEY:VALUE pairs""" + import re + import PyUtils.AthFile as af + try: + f = af.fopen(inputfile) + except AssertionError: + logOverlayPoolReadMetadata.error("Failed to open input file: %s", inputfile) + return dict(),False + #check evt_type of input file + if 'evt_type' in f.infos.keys(): + if not re.match(str(f.infos['evt_type'][0]), 'IS_SIMULATION') : + logOverlayPoolReadMetadata.error('This input file has incorrect evt_type: %s',str(f.infos['evt_type'])) + logOverlayPoolReadMetadata.info('Please make sure you have set input file metadata correctly.') + logOverlayPoolReadMetadata.info('Consider using the job transforms for earlier steps if you aren\'t already.') + #then exit gracefully + raise SystemExit("Input file evt_type is incorrect, please check your g4sim and evgen jobs.") + else : + logOverlayPoolReadMetadata.warning('Could not find \'evt_type\' key in athfile.infos. Unable to that check evt_type is correct.') + + ## Not part of building the metadata dictionary, but this is the + ## most convenient time to access this information. + doSpecialConfiguration(f) + #doMC_channel_number(f,inputtype) #FIXME commented out for now until mc_channel_number is filled properly by AthFile. + + metadatadict = dict() + taginfometadata = dict() + #safety checks before trying to access metadata + if 'metadata' in f.infos.keys(): + ##if '/TagInfo' in f.infos['metadata'].keys(): + ## taginfometadata=f.infos['metadata']['/TagInfo'] + ## assert taginfometadata['beam_energy'] is not None + ## print "beamEnergy=%s"%taginfometadata['beam_energy'] + if '/Simulation/Parameters' in f.infos['metadata'].keys(): + metadatadict = f.infos['metadata']['/Simulation/Parameters'] + if isinstance(metadatadict, list): + logOverlayPoolReadMetadata.warning("%s inputfile: %s contained %s sets of Simulation Metadata. Using the final set in the list.",inputtype,inputfile,len(metadatadict)) + metadatadict=metadatadict[-1] + ##Get IOVDbGlobalTag + if 'IOVDbGlobalTag' not in metadatadict.keys(): + try: + assert f.fileinfos['metadata']['/TagInfo']['IOVDbGlobalTag'] is not None + metadatadict['IOVDbGlobalTag'] = f.fileinfos['metadata']['/TagInfo']['IOVDbGlobalTag'] + except: + try: + assert f.fileinfos['conditions_tag'] is not None + metadatadict['IOVDbGlobalTag'] = f.fileinfos['conditions_tag'] + except: + logOverlayPoolReadMetadata.warning("Failed to find IOVDbGlobalTag.") + return metadatadict,taginfometadata,False + if '/Digitization/Parameters' in f.infos['metadata'].keys(): + ## We have the RDO file here: + if len(f.run_numbers)>0 : + logOverlayPoolReadMetadata.info("Setting digitizationFlags.dataRunNumber to %i, to match the pre-mixed RDO File", f.run_numbers[0]) + from Digitization.DigitizationFlags import digitizationFlags + digitizationFlags.dataRunNumber = f.run_numbers[0] + ##Do useful things with Digi MetaData + digimetadatadict = f.infos['metadata']['/Digitization/Parameters'] + logOverlayPoolReadMetadata.debug("Keys in /Digitization/Parameters MetaData:") + logOverlayPoolReadMetadata.debug(digimetadatadict.keys()) + + if 'IOVDbGlobalTag' in digimetadatadict.keys(): + if 'IOVDbGlobalTag' in metadatadict.keys(): + if not re.match(metadatadict['IOVDbGlobalTag'], digimetadatadict['IOVDbGlobalTag']): + logOverlayPoolReadMetadata.info("Overriding original SimDict['IOVDbGlobalTag']", metadatadict['IOVDbGlobalTag']) + logOverlayPoolReadMetadata.debug("with RDODict['IOVDbGlobalTag']", digimetadatadict['IOVDbGlobalTag']) + metadatadict['IOVDbGlobalTag'] = digimetadatadict['IOVDbGlobalTag'] + logOverlayPoolReadMetadata.debug("Updated SimDict['IOVDbGlobalTag']", metadatadict['IOVDbGlobalTag']) + if 'DigitizedDetectors' in digimetadatadict.keys(): + if 'DigitizedDetectors' in metadatadict.keys(): + logOverlayPoolReadMetadata.debug("Overriding original SimDict['SimulatedDetectors']", metadatadict['SimulatedDetectors']) + logOverlayPoolReadMetadata.debug("with RDODict['DigitizedDetectors']", digimetadatadict['DigitizedDetectors']) + metadatadict['SimulatedDetectors'] = digimetadatadict['DigitizedDetectors'] + logOverlayPoolReadMetadata.debug("Updated SimDict['SimulatedDetectors']", metadatadict['SimulatedDetectors']) + pass + if '/TagInfo' in f.infos['metadata'].keys(): + taginfometadata=f.infos['metadata']['/TagInfo'] + pass + Nkvp = len(metadatadict) + ## Dictionary should not be empty + if Nkvp==0 : + logOverlayPoolReadMetadata.error("Found %s KEY:VALUE pairs in %s Simulation MetaData." , Nkvp,inputtype) + return metadatadict,taginfometadata,False + else: + ##Patch for older hit files + if 'hitFileMagicNumber' not in metadatadict.keys(): + metadatadict['hitFileMagicNumber'] = 0 + logOverlayPoolReadMetadata.debug("hitFileMagicNumber key missing from %s Simulation MetaData Dictionary. Adding dummy entry.",inputtype) + if 'SimulatedDetectors' not in metadatadict.keys(): + if 'eventdata_items' in f.infos.keys(): + metadatadict['SimulatedDetectors'] = hitColls2SimulatedDetectors(f.infos['eventdata_items']) + else : + metadatadict['SimulatedDetectors'] = ['pixel','SCT','TRT','BCM','Lucid','LAr','Tile','MDT','CSC','TGC','RPC','Truth'] + ## Check whether we should use the old names for the Tile CaloCalibrationHit containers + if 'eventdata_items' in f.infos.keys(): + checkTileCalibrationHitFormat(f.infos['eventdata_items']) + else : + from Digitization.DigitizationFlags import digitizationFlags + digitizationFlags.experimentalDigi += ['OldTileCalibHitContainers'] + + ##End of Patch for older hit files + logOverlayPoolReadMetadata.debug("%s Simulation MetaData Dictionary Successfully Created.",inputtype) + logOverlayPoolReadMetadata.debug("Found %s KEY:VALUE pairs in %s Simulation MetaData." , Nkvp,inputtype) + logOverlayPoolReadMetadata.debug("KEYS FOUND: %s", metadatadict.keys()) + return metadatadict,taginfometadata,True + +def signalMetaDataCheck(metadatadict): + import re + simkeys = metadatadict.keys() + logOverlayPoolReadMetadata.info("Checking Digitization properties against Signal Simulation MetaData...") + ## Check the PhysicsList set agrees with that used in the simulation + if not skipCheck('PhysicsList'): + if 'PhysicsList' in simkeys: + from Digitization.DigitizationFlags import digitizationFlags + if re.match(metadatadict['PhysicsList'], digitizationFlags.physicsList.get_Value()): + logOverlayPoolReadMetadata.debug("Digitization properties matches Signal Simulation MetaData. [PhysicsList = %s]", metadatadict['PhysicsList']) + else: + logOverlayPoolReadMetadata.warning("Digitization properties PhysicsList does not match the PhysicsList used in the Simulation step! Assume the PhysicsList from the Simulation step is correct!") + digitizationFlags.physicsList = metadatadict['PhysicsList'] + logOverlayPoolReadMetadata.info("Set digitizationFlags.physicsList = %s", digitizationFlags.physicsList.get_Value()) + else: + logOverlayPoolReadMetadata.error("PhysicsList key not found in Simulation MetaData!") + + ## Check the DetDescrVersion set agrees with that used in the simulation + if not skipCheck('SimLayout'): + if 'SimLayout' in simkeys: + from AthenaCommon.GlobalFlags import globalflags + if re.match(metadatadict['SimLayout'], globalflags.DetDescrVersion.get_Value()): + logOverlayPoolReadMetadata.debug("Digitization properties matches Signal Simulation MetaData. [DetDescrVersion = %s]", + globalflags.DetDescrVersion.get_Value()) + else: + logOverlayPoolReadMetadata.warning("Input DetDescrVersion does not match the value used in the Simulation step!") + from AthenaCommon.AppMgr import ServiceMgr + ## FIXME - should not be relying on GeoModelSvc being initialized at this point. + if hasattr( ServiceMgr, "GeoModelSvc") and ServiceMgr.GeoModelSvc.IgnoreTagDifference==True: + logOverlayPoolReadMetadata.warning("Global jobproperties: [DetDescrVersion = %s], Signal Simulation MetaData: [SimLayout = %s]", + globalflags.DetDescrVersion.get_Value(), metadatadict['SimLayout']) + logOverlayPoolReadMetadata.warning("Ignore Tag Difference Requested - doing nothing.") + else: + logOverlayPoolReadMetadata.warning("Assume the value from the Simulation step is correct!") + ## needs to be done this way as Digi_tf locks it + if globalflags.DetDescrVersion.is_locked() : + globalflags.DetDescrVersion.unlock() + globalflags.DetDescrVersion.set_Value_and_Lock( metadatadict['SimLayout'] ) + logOverlayPoolReadMetadata.warning("Set globalflags.DetDescrVersion = %s",globalflags.DetDescrVersion.get_Value()) + else: + logOverlayPoolReadMetadata.error("SimLayout key not found in Simulation MetaData!") + + ## Check the Conditions Tag set against that used in the simulation + if not skipCheck('IOVDbGlobalTag'): + if 'IOVDbGlobalTag' in simkeys: + from Digitization.DigitizationFlags import digitizationFlags + if (digitizationFlags.IOVDbGlobalTag.statusOn): + logOverlayPoolReadMetadata.info("Digitization properties: [IOVDbGlobalTag = %s], Signal Simulation MetaData: [IOVDbGlobalTag = %s]", + digitizationFlags.IOVDbGlobalTag.get_Value(), metadatadict['IOVDbGlobalTag']) + else: + digitizationFlags.IOVDbGlobalTag = metadatadict['IOVDbGlobalTag'] + logOverlayPoolReadMetadata.debug("Set Digitization properties to match Signal Simulation Metadata: [IOVDbGlobalTag = %s]", + digitizationFlags.IOVDbGlobalTag.get_Value()) + else: + logOverlayPoolReadMetadata.error("IOVDbGlobalTag key not found in Simulation MetaData!") + + ## Set the TRTRangeCut digitizationFlag based on what was used during the simulation. + if not skipCheck('TRTRangeCut'): + if 'TRTRangeCut' in simkeys: + from Digitization.DigitizationFlags import digitizationFlags + if hasattr( digitizationFlags, 'TRTRangeCut'): + digitizationFlags.TRTRangeCut = metadatadict['TRTRangeCut'] + logOverlayPoolReadMetadata.debug("Set Digitization properties to match Signal Simulation Metadata: [TRTRangeCut = %s]", + digitizationFlags.TRTRangeCut.get_Value()) + else: + logOverlayPoolReadMetadata.warning("TRTRangeCut key not found in Simulation MetaData!") + + ## Record the G4Version used in the simulation, so that Digitization Algorithms can use this information + if not skipCheck('G4Version'): + if 'G4Version' in simkeys: + from Digitization.DigitizationFlags import digitizationFlags + digitizationFlags.SimG4VersionUsed = metadatadict['G4Version'] + logOverlayPoolReadMetadata.debug("digitizationFlags.SimG4VersionUsed = Value from Sim Metadata = %s ", digitizationFlags.SimG4VersionUsed.get_Value()) + else: + logOverlayPoolReadMetadata.error("G4Version key not found in Simulation MetaData!") + + ## Check which sub-detectors were simulated + + ## Digitization will only digitize detectors which have been simulated. + ## If users want to digitize an un simulated detector this will be an expert + ## action which will require hacking the python code. + from AthenaCommon.DetFlags import DetFlags + if not skipCheck('SimulatedDetectors'): + if 'SimulatedDetectors' in simkeys: + logOverlayPoolReadMetadata.debug("Switching off subdetectors which were not simulated") + possibleSubDetectors=['pixel','SCT','TRT','BCM','Lucid','ZDC','ALFA','AFP','FwdRegion','LAr','HGTD','Tile','MDT','CSC','TGC','RPC','Micromegas','sTGC','Truth'] + switchedOffSubDetectors=[] + for subdet in possibleSubDetectors: + if not subdet in metadatadict['SimulatedDetectors']: + attrname = subdet+"_setOff" + checkfn = getattr(DetFlags, attrname, None) + if checkfn is not None: + cmd='DetFlags.%s_setOff()' % subdet + logOverlayPoolReadMetadata.debug(cmd) + checkfn() + switchedOffSubDetectors+=[subdet] + if switchedOffSubDetectors: + logOverlayPoolReadMetadata.info("Ensured %s sub-detectors which were not simulated were switched off: %s", len(switchedOffSubDetectors), switchedOffSubDetectors) + else: + logOverlayPoolReadMetadata.info("All sub-detectors were simulated, so none needed to be switched off in digitization.") + DetFlags.Print() + + ## Any other checks here + logOverlayPoolReadMetadata.info("Completed checks of Digitization properties against Signal Simulation MetaData.") + +def pileupMetaDataCheck(sigsimdict,pileupsimdict): + """Check the metadata for pre-mixed pileup RDO File""" + result = True + import re + pileupkeys = pileupsimdict.keys() + sigkeys = sigsimdict.keys() + pileuptype = "PreMixed" + longpileuptype = "Pre-Mixed Pile-up RDO File" + ##Loop over MetaData keys which must have matching values + SigkeysToCheck = [ 'PhysicsList', 'SimLayout', 'MagneticField','hitFileMagicNumber' ]#, 'WorldZRange' ] + for o in SigkeysToCheck: + if skipPileUpCheck(o, pileuptype): + continue + try: + assert o in pileupkeys + except AssertionError: + logOverlayPoolReadMetadata.error("%s key missing from %s Simulation MetaData!", o, longpileuptype) + raise AssertionError("Simulation MetaData key not found") + try: + assert o in sigkeys + except AssertionError: + logOverlayPoolReadMetadata.error("%s key missing from Signal Simulation MetaData!", o) + raise AssertionError("Simulation MetaData key not found") + try: + if not isinstance(pileupsimdict[o],type(sigsimdict[o])): + assert re.match(str(pileupsimdict[o]), str(sigsimdict[o])) + else: + if isinstance(pileupsimdict[o],str): + assert re.match(pileupsimdict[o], sigsimdict[o]) + elif isinstance(pileupsimdict[o],int): + assert (pileupsimdict[o]==sigsimdict[o]) + else: + assert re.match(str(pileupsimdict[o]), str(sigsimdict[o])) + except AssertionError: + logOverlayPoolReadMetadata.error("Simulation MetaData mismatch! %s: [%s = %s] Signal: [%s = %s]", longpileuptype, o, pileupsimdict[o], o, sigsimdict[o]) + raise AssertionError("Simulation MetaData mismatch") + logOverlayPoolReadMetadata.debug("%s Sim MetaData matches Signal Sim MetaData. [%s = %s]", longpileuptype, o, sigsimdict[o]) + ##Ideally these keys would have matching values, but it should be OK if not. + WarningKeys = [ 'IOVDbGlobalTag', 'G4Version' ] + for o in WarningKeys: + if skipPileUpCheck(o, pileuptype): + continue + try: + assert o in pileupkeys + except AssertionError: + logOverlayPoolReadMetadata.error("%s key missing from %s Simulation MetaData!", o, longpileuptype) + raise AssertionError("Simulation MetaData key not found") + try: + assert o in sigkeys + except AssertionError: + logOverlayPoolReadMetadata.error("%s key missing from Signal Simulation MetaData!", o, longpileuptype) + raise AssertionError("Simulation MetaData key not found") + if not re.match(pileupsimdict[o], sigsimdict[o]): + logOverlayPoolReadMetadata.warning("Simulation MetaData mismatch! %s: [%s = %s] Signal: [%s = %s]", longpileuptype, o, pileupsimdict[o], o, sigsimdict[o]) + else: + logOverlayPoolReadMetadata.debug("%s Sim MetaData matches Signal Sim MetaData. [%s = %s]", longpileuptype, o, sigsimdict[o]) + + ## Check that the same sub-detectors were simulated in signal and background inputs + if (not skipPileUpCheck('SimulatedDetectors', pileuptype)) and ('SimulatedDetectors' in sigkeys): + switchedOffSubDetectors=[] + for subdet in sigsimdict['SimulatedDetectors']: + if not subdet in pileupsimdict['SimulatedDetectors']: + switchedOffSubDetectors+=[subdet] + if switchedOffSubDetectors: + logOverlayPoolReadMetadata.error("%s sub-detectors were sinmulated in the signal sample, but not in the %s background sample: %s", len(switchedOffSubDetectors), longpileuptype, switchedOffSubDetectors) + raise AssertionError("Some simulated sub-detectors from signal sample are missing in the background samples.") + else: + logOverlayPoolReadMetadata.debug("All sub-detectors simulated in the signal sample were also simulated in the %s background sample.", longpileuptype) + + return result + + +def tagInfoMetaDataCheck(sigtaginfodict,pileuptaginfodict): + result = True + """Check the metadata for pre-mixed pileup RDO File""" + pileupkeys = pileuptaginfodict.keys() + logOverlayPoolReadMetadata.debug("Signal /TagInfo ", sigtaginfodict) + logOverlayPoolReadMetadata.debug("Pileup /TagInfo ", pileuptaginfodict) + sigkeys = sigtaginfodict.keys() + pileupType = "PreMixed" + sigOnlyDict = dict() + sigOnlyKeySet = set(sigkeys).difference(set(pileupkeys)) + logOverlayPoolReadMetadata.debug("The following keys only appear in Signal /TagInfo MetaData:") + logOverlayPoolReadMetadata.debug(sigOnlyKeySet) + for key in sigOnlyKeySet: + sigOnlyDict[key] = sigtaginfodict[key] + logOverlayPoolReadMetadata.debug("key: ", key, "value: ", sigtaginfodict[key]) + pass + from OverlayCommonAlgs.OverlayFlags import overlayFlags + overlayFlags.extraTagInfoPairs = sigOnlyDict + keysToCompareSet = set(sigkeys).intersection(set(pileupkeys)) + logOverlayPoolReadMetadata.debug("The following keys appear in Signal and PreMixed /TagInfo MetaData:") + logOverlayPoolReadMetadata.debug(keysToCompareSet) + return result + +def readInputFileMetadata(): + logOverlayPoolReadMetadata.info("Checking for Signal Simulation MetaData...") + import re + import PyUtils.AthFile as af + af.server.load_cache('digitization-afcache.ascii') + + #-------------------------------------------------- + # Check for the Run Number in the first Input file + #-------------------------------------------------- + from AthenaCommon.AthenaCommonFlags import athenaCommonFlags + from Digitization.DigitizationFlags import digitizationFlags + digitizationFlags.simRunNumber = int(digitizationFlags.getHitFileRunNumber(athenaCommonFlags.PoolHitsInput.get_Value()[0])) + + sigsimdict,sigtaginfodict,result = buildDict("Signal", athenaCommonFlags.PoolHitsInput.get_Value()[0]) + if result : + signalMetaDataCheck(sigsimdict) + + ## Check Pileup Simulation Parameters match those used for signal files + result = True + longpileuptype= "pre-mixed pile-up" + logOverlayPoolReadMetadata.info("Checking %s MetaData against Signal Simulation MetaData...", longpileuptype) + pileupsimdict,pileuptaginfodict,result = buildDict(longpileuptype, athenaCommonFlags.PoolRDOInput.get_Value()[0]) + if not result: + logOverlayPoolReadMetadata.warning("Failed to Create %s Simulation MetaData Dictionary from file %s.", longpileuptype, pileupfile) + else: + if pileupMetaDataCheck(sigsimdict,pileupsimdict): + logOverlayPoolReadMetadata.info("Pre-mixed RDO File Simulation MetaData matches Signal Simulation MetaData.") + if tagInfoMetaDataCheck(sigtaginfodict,pileuptaginfodict): + logOverlayPoolReadMetadata.info("Pre-mixed RDO File TagInfo MetaData matches Signal TagInfo MetaData.") + ## All checks completed here + logOverlayPoolReadMetadata.info("Completed all checks against Signal Simulation MetaData.") + else: + logOverlayPoolReadMetadata.info("Failed to Create Signal MetaData Dictionaries from file %s", athenaCommonFlags.PoolHitsInput.get_Value()[0]) + + ## control where metadata can be used + del sigsimdict + del sigtaginfodict + del pileupsimdict + del pileuptaginfodict + + #raise SystemExit("Testing") diff --git a/Event/EventOverlay/EventOverlayJobTransforms/share/skeleton.OverlayPool_tf.py b/Event/EventOverlay/EventOverlayJobTransforms/share/skeleton.OverlayPool_tf.py index 0791ca31d52eb760c81acdea7ee0132ad5e3a8df..d56747483a85c5dc873cf8ae764710700d79c7cc 100644 --- a/Event/EventOverlay/EventOverlayJobTransforms/share/skeleton.OverlayPool_tf.py +++ b/Event/EventOverlay/EventOverlayJobTransforms/share/skeleton.OverlayPool_tf.py @@ -69,32 +69,6 @@ rec.projectName = 'IS_SIMULATION' DataInputCollections=runArgs.inputRDO_BKGFile athenaCommonFlags.PoolRDOInput=runArgs.inputRDO_BKGFile -import MagFieldServices.SetupField - -from IOVDbSvc.CondDB import conddb - -if hasattr(runArgs, 'conditionsTag') and runArgs.conditionsTag!='NONE' and runArgs.conditionsTag!='': - globalflags.ConditionsTag=runArgs.conditionsTag - if len(globalflags.ConditionsTag())!=0: - conddb.setGlobalTag(globalflags.ConditionsTag()) - -# LVL1 Trigger Menu -if hasattr(runArgs, "triggerConfig") and runArgs.triggerConfig!="NONE": - # LVL1 Trigger Menu - # PJB 9/2/2009 Setup the new triggerConfig flags here - from TriggerJobOpts.TriggerFlags import TriggerFlags - triggerArg = runArgs.triggerConfig - #if not prefixed with LVL1: add it here - Args = triggerArg.split(":") - if Args[0] != "LVL1": - TriggerFlags.triggerConfig ="LVL1:"+triggerArg - else: - TriggerFlags.triggerConfig =triggerArg - overlaylog.info( 'triggerConfig argument is: %s ', TriggerFlags.triggerConfig.get_Value() ) - from TriggerJobOpts.TriggerConfigGetter import TriggerConfigGetter - cfg = TriggerConfigGetter("HIT2RDO") - - print "================ DetFlags ================ " if 'DetFlags' in dir(): overlaylog.warning("DetFlags already defined! This means DetFlags should have been fully configured already..") @@ -120,6 +94,40 @@ DetFlags.Print() globalflags.DataSource.set_Value_and_Lock('geant4') +#-------------------------------------------------------------- +# Read Simulation MetaData (unless override flag set to True) +#-------------------------------------------------------------- +if 'ALL' in digitizationFlags.overrideMetadata.get_Value(): + overlaylog.info("Skipping input file MetaData check.") +else : + from EventOverlayJobTransforms.OverlayPoolReadMetaData import readInputFileMetadata + readInputFileMetadata() + +import MagFieldServices.SetupField + +from IOVDbSvc.CondDB import conddb + +if hasattr(runArgs, 'conditionsTag') and runArgs.conditionsTag!='NONE' and runArgs.conditionsTag!='': + globalflags.ConditionsTag=runArgs.conditionsTag + if len(globalflags.ConditionsTag())!=0: + conddb.setGlobalTag(globalflags.ConditionsTag()) + +# LVL1 Trigger Menu +if hasattr(runArgs, "triggerConfig") and runArgs.triggerConfig!="NONE": + # LVL1 Trigger Menu + # PJB 9/2/2009 Setup the new triggerConfig flags here + from TriggerJobOpts.TriggerFlags import TriggerFlags + triggerArg = runArgs.triggerConfig + #if not prefixed with LVL1: add it here + Args = triggerArg.split(":") + if Args[0] != "LVL1": + TriggerFlags.triggerConfig ="LVL1:"+triggerArg + else: + TriggerFlags.triggerConfig =triggerArg + overlaylog.info( 'triggerConfig argument is: %s ', TriggerFlags.triggerConfig.get_Value() ) + from TriggerJobOpts.TriggerConfigGetter import TriggerConfigGetter + cfg = TriggerConfigGetter("HIT2RDO") + print "================ Start ================= " from AthenaCommon.AlgSequence import AlgSequence @@ -144,6 +152,8 @@ if hasattr( runArgs, 'maxEvents'): include ( "EventOverlayJobTransforms/ConfiguredOverlay_jobOptions.py" ) +include("Digitization/RunNumberOverride.py") + if DetFlags.overlay.Truth_on(): include ( "EventOverlayJobTransforms/TruthOverlay_jobOptions.py" ) @@ -196,5 +206,15 @@ if hasattr(runArgs, "postExec") and runArgs.postExec != 'NONE': for cmd in runArgs.postExec: exec(cmd) +from AthenaCommon.AppMgr import ServiceMgr + +#Patch /TagInfo metadata container +from OverlayCommonAlgs.OverlayFlags import overlayFlags +for key in overlayFlags.extraTagInfoPairs.get_Value().keys(): + ServiceMgr.TagInfoMgr.ExtraTagValuePairs += [str(key), str(overlayFlags.extraTagInfoPairs.get_Value()[key])] +if hasattr(runArgs, 'AMITag'): + if runArgs.AMITag != "NONE": + ServiceMgr.TagInfoMgr.ExtraTagValuePairs += ["AMITag", runArgs.AMITag] + #print "OverlayPool_tf.py: at the end. job=\n", job print "\nOverlayPool_tf.py: at the end. ServiceMgr=\n", ServiceMgr diff --git a/Event/EventOverlay/OverlayCommonAlgs/python/OverlayFlags.py b/Event/EventOverlay/OverlayCommonAlgs/python/OverlayFlags.py index 5e4a0daf3641a57a8416baa765b4f481656fef01..b8c62e29e6dd359aca6858a1ccc1bcf44c885f0e 100644 --- a/Event/EventOverlay/OverlayCommonAlgs/python/OverlayFlags.py +++ b/Event/EventOverlay/OverlayCommonAlgs/python/OverlayFlags.py @@ -57,6 +57,13 @@ class outputStore(JobProperty): allowedTypes=['str'] StoredValue = 'StoreGateSvc' +class extraTagInfoPairs(JobProperty): + """ workaround to correctly populate the /TagInfo metadata container + """ + statusOn=False + allowedTypes=['dict'] + StoredValue=dict() + ## Definition and registration of the simulation flag container class Overlay_Flags(JobPropertyContainer): diff --git a/Event/NavFourMom/CMakeLists.txt b/Event/NavFourMom/CMakeLists.txt index ce444189e1bc4bf5897ded917fb7a11e7990d9f8..d4bd6eb616fd33bf307e80a30f8101704addb2db 100644 --- a/Event/NavFourMom/CMakeLists.txt +++ b/Event/NavFourMom/CMakeLists.txt @@ -7,11 +7,10 @@ atlas_subdir( NavFourMom ) # Declare the package's dependencies: atlas_depends_on_subdirs( PUBLIC - Control/CLIDSvc + Control/AthenaKernel Control/AthLinks Control/AthContainers Control/Navigation - Control/SGTools Event/EventKernel PRIVATE Event/FourMom ) @@ -27,14 +26,14 @@ atlas_add_library( NavFourMom INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} DEFINITIONS ${CLHEP_DEFINITIONS} - LINK_LIBRARIES ${CLHEP_LIBRARIES} AthLinks AthContainers Navigation SGTools EventKernel + LINK_LIBRARIES ${CLHEP_LIBRARIES} AthLinks AthContainers Navigation EventKernel PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} FourMom ) atlas_add_dictionary( NavFourMomDict NavFourMom/NavFourMomDict.h NavFourMom/selection.xml INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthLinks AthContainers Navigation SGTools EventKernel FourMom NavFourMom + LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthLinks AthContainers Navigation EventKernel FourMom NavFourMom NAVIGABLES DataVector<INavigable4Momentum> DataVector<IParticle> DATA_LINKS INav4MomAssocs ELEMENT_LINKS DataVector<I4Momentum> ) diff --git a/Event/NavFourMom/NavFourMom/I4MomentumContainer.h b/Event/NavFourMom/NavFourMom/I4MomentumContainer.h index 736bdc2cf719bfa7c5483580a2b38fe0a6437c13..0277588caff568d23259027cec7cd98f228eff4f 100644 --- a/Event/NavFourMom/NavFourMom/I4MomentumContainer.h +++ b/Event/NavFourMom/NavFourMom/I4MomentumContainer.h @@ -16,7 +16,7 @@ // HepMC / CLHEP includes // Framework includes -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "AthContainers/DataVector.h" // EventKernel includes diff --git a/Event/NavFourMom/NavFourMom/INav4MomLinkContainer.h b/Event/NavFourMom/NavFourMom/INav4MomLinkContainer.h index ad920bce8a3ae99d87eb52ec5ace98a001013db5..690061f8c3e21acc2d7fea1ff52def3ea64f1e51 100644 --- a/Event/NavFourMom/NavFourMom/INav4MomLinkContainer.h +++ b/Event/NavFourMom/NavFourMom/INav4MomLinkContainer.h @@ -17,7 +17,7 @@ #include <vector> #include "AthLinks/ElementLink.h" -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "NavFourMom/INav4MomLink.h" #include "EventKernel/INavigable4Momentum.h" #include "NavFourMom/INavigable4MomentumCollection.h" diff --git a/Event/NavFourMom/NavFourMom/INavigable4MomentumCollection.h b/Event/NavFourMom/NavFourMom/INavigable4MomentumCollection.h index 0f99c65756bed4f7f3bb7a6bd1839a08ae32dc11..8139e4710aa1c459c937532c898916a35ce5c14c 100644 --- a/Event/NavFourMom/NavFourMom/INavigable4MomentumCollection.h +++ b/Event/NavFourMom/NavFourMom/INavigable4MomentumCollection.h @@ -10,7 +10,7 @@ // // /////////////////////////////////////////////////////////////////////////////// -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "AthContainers/DataVector.h" diff --git a/Event/NavFourMom/NavFourMom/IParticleContainer.h b/Event/NavFourMom/NavFourMom/IParticleContainer.h index 03c2aa6e7151bfbc21ab2f0acbdf839ac544ce58..bab97ea79041dc730e920bce44eed48f458bad07 100644 --- a/Event/NavFourMom/NavFourMom/IParticleContainer.h +++ b/Event/NavFourMom/NavFourMom/IParticleContainer.h @@ -20,7 +20,7 @@ PURPOSE: This is a data object, containing a collection of IParticle Objects. // INCLUDE HEADER FILES: #include "AthContainers/DataVector.h" -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "EventKernel/IParticle.h" #include "NavFourMom/INavigable4MomentumCollection.h" diff --git a/Event/NavFourMom/NavFourMom/IParticleLinkContainer.h b/Event/NavFourMom/NavFourMom/IParticleLinkContainer.h index 88962af8745a1f98b3e6f174c21f81e46e63d7ce..f58f5ef844a249733e8c61b19aa5149a7d400014 100644 --- a/Event/NavFourMom/NavFourMom/IParticleLinkContainer.h +++ b/Event/NavFourMom/NavFourMom/IParticleLinkContainer.h @@ -17,7 +17,7 @@ #include <vector> #include "AthLinks/ElementLink.h" -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" #include "EventKernel/IParticle.h" #include "NavFourMom/IParticleLink.h" #include "NavFourMom/IParticleContainer.h" diff --git a/Event/xAOD/xAODTrigger/Root/TrigDecision_v1.cxx b/Event/xAOD/xAODTrigger/Root/TrigDecision_v1.cxx index d5ffef4e1966382dce83f14488db58f3ad851565..0855fa74a82039765cde7f0036a4363862802eb6 100644 --- a/Event/xAOD/xAODTrigger/Root/TrigDecision_v1.cxx +++ b/Event/xAOD/xAODTrigger/Root/TrigDecision_v1.cxx @@ -177,6 +177,9 @@ void writeBits(std::ostream& s, const std::vector< uint32_t >& input) { s << std::endl; } + +namespace xAOD { + std::ostream& operator<<(std::ostream& s, const xAOD::TrigDecision_v1& td) { s << "xAODTrigDecision Object: SMK=" << td.smk() << " BGCode=" << (size_t)td.bgCode() << std::endl; s << " L1 Before Prescale: "; @@ -223,3 +226,7 @@ std::ostream& operator<<(std::ostream& s, const xAOD::TrigDecision_v1& td) { } return s; } + + +} // namespace xAOD + diff --git a/Event/xAOD/xAODTrigger/xAODTrigger/versions/TrigDecision_v1.h b/Event/xAOD/xAODTrigger/xAODTrigger/versions/TrigDecision_v1.h index ee7d98d836060c0d449e1af1ea269b3443559ee6..b4b542765448837d84bfe300105d79a8fe55b85e 100644 --- a/Event/xAOD/xAODTrigger/xAODTrigger/versions/TrigDecision_v1.h +++ b/Event/xAOD/xAODTrigger/xAODTrigger/versions/TrigDecision_v1.h @@ -188,9 +188,9 @@ namespace xAOD { }; // class TrigDecision_v1 -} // namespace xAOD + std::ostream& operator<<(std::ostream& s, const xAOD::TrigDecision_v1& td); -std::ostream& operator<<(std::ostream& s, const xAOD::TrigDecision_v1& td); +} // namespace xAOD // Declare the inheritance of the type: #include "xAODCore/BaseInfo.h" diff --git a/ForwardDetectors/AFP/AFP_GeoModel/AFP_GeoModel/AFP_GeoModelManager.h b/ForwardDetectors/AFP/AFP_GeoModel/AFP_GeoModel/AFP_GeoModelManager.h index b830ae4f94cfd78f34ab82dcda5f94264cc0545b..924e2556cc162865409a08fe73b0a7bbae5194fe 100755 --- a/ForwardDetectors/AFP/AFP_GeoModel/AFP_GeoModel/AFP_GeoModelManager.h +++ b/ForwardDetectors/AFP/AFP_GeoModel/AFP_GeoModel/AFP_GeoModelManager.h @@ -39,7 +39,7 @@ class AFP_GeoModelManager : public GeoVDetectorManager { // Class AFP_GeoModelManager #ifndef GAUDI_NEUTRAL -#include "CLIDSvc/CLASS_DEF.h" +#include "AthenaKernel/CLASS_DEF.h" CLASS_DEF(AFP_GeoModelManager, 156328970, 1) #endif diff --git a/ForwardDetectors/AFP/AFP_GeoModel/CMakeLists.txt b/ForwardDetectors/AFP/AFP_GeoModel/CMakeLists.txt index b6a7d7f7728b559fdc38fdd3abc559ae46f5cdf3..fb580b2f694ea713919f93a3102128ec7f69292e 100644 --- a/ForwardDetectors/AFP/AFP_GeoModel/CMakeLists.txt +++ b/ForwardDetectors/AFP/AFP_GeoModel/CMakeLists.txt @@ -8,8 +8,6 @@ atlas_subdir( AFP_GeoModel ) # Declare the package's dependencies: atlas_depends_on_subdirs( PUBLIC Control/AthenaKernel - Control/CLIDSvc - Control/SGTools DetectorDescription/GeoModel/GeoModelKernel DetectorDescription/GeoModel/GeoModelUtilities ForwardDetectors/AFP/AFP_Geometry @@ -28,11 +26,11 @@ atlas_add_library( AFP_GeoModelLib PUBLIC_HEADERS AFP_GeoModel PRIVATE_INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} PRIVATE_DEFINITIONS ${CLHEP_DEFINITIONS} - LINK_LIBRARIES AthenaKernel SGTools GeoModelKernel GeoModelUtilities AFP_Geometry StoreGateLib SGtests + LINK_LIBRARIES AthenaKernel GeoModelKernel GeoModelUtilities AFP_Geometry StoreGateLib SGtests PRIVATE_LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaPoolUtilities GaudiKernel ) atlas_add_component( AFP_GeoModel src/components/*.cxx INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaKernel SGTools GeoModelKernel GeoModelUtilities AFP_Geometry StoreGateLib SGtests AthenaPoolUtilities GaudiKernel AFP_GeoModelLib ) + LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaKernel GeoModelKernel GeoModelUtilities AFP_Geometry StoreGateLib SGtests AthenaPoolUtilities GaudiKernel AFP_GeoModelLib ) diff --git a/Generators/McEventSelector/CMakeLists.txt b/Generators/McEventSelector/CMakeLists.txt index 1e541ef2c5b9c172a6e142cf6ce44f4755860209..e449260af0eec27b69e6b57c8c2a61ee1fd98e05 100644 --- a/Generators/McEventSelector/CMakeLists.txt +++ b/Generators/McEventSelector/CMakeLists.txt @@ -25,4 +25,4 @@ atlas_add_component( McEventSelector # Install files from the package: atlas_install_headers( McEventSelector ) - +atlas_install_python_modules( python/*.py ) diff --git a/Generators/McEventSelector/python/McEventSelectorConfig.py b/Generators/McEventSelector/python/McEventSelectorConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..31bc0b299c899b26bbb91161d2c45fadf3a535fd --- /dev/null +++ b/Generators/McEventSelector/python/McEventSelectorConfig.py @@ -0,0 +1,25 @@ +# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + +# https://twiki.cern.ch/twiki/bin/viewauth/AtlasComputing/AthenaJobConfigRun3 + +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator + +def McEventSelectorCfg(configFlags): + cfg=ComponentAccumulator() + + from AthenaCommon import AtlasUnixStandardJob + + from McEventSelector.McEventSelectorConf import McCnvSvc + mcCnvSvc = McCnvSvc() + cfg.addService(mcCnvSvc) + from GaudiSvc.GaudiSvcConf import EvtPersistencySvc + cfg.addService(EvtPersistencySvc("EventPersistencySvc",CnvServices=[mcCnvSvc.getFullJobOptName(),])) + + from McEventSelector.McEventSelectorConf import McEventSelector + evSel=McEventSelector("EventSelector") + evSel.RunNumber = configFlags.Input.RunNumber + evSel.InitialTimeStamp = configFlags.Input.InitialTimeStamp + cfg.addService(evSel) + cfg.setAppProperty("EvtSel",evSel.getFullJobOptName()) + + return cfg diff --git a/Generators/McEventSelector/python/__init__.py b/Generators/McEventSelector/python/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/InnerDetector/InDetConditions/PixelConditionsTools/CMakeLists.txt b/InnerDetector/InDetConditions/PixelConditionsTools/CMakeLists.txt index 6d368e8db9e3d7a8e9ed2bdfdecabdd0cdf555ed..d94e2b640ee838336a646f8042e59d5127ed39b2 100644 --- a/InnerDetector/InDetConditions/PixelConditionsTools/CMakeLists.txt +++ b/InnerDetector/InDetConditions/PixelConditionsTools/CMakeLists.txt @@ -30,7 +30,6 @@ atlas_depends_on_subdirs( PUBLIC DetectorDescription/GeoModel/GeoModelUtilities InnerDetector/InDetConditions/PixelConditionsData InnerDetector/InDetConditions/PixelCoralClientUtils - InnerDetector/InDetConditions/PixelConditionsServices InnerDetector/InDetDetDescr/InDetIdentifier InnerDetector/InDetDetDescr/InDetReadoutGeometry TestPolicy diff --git a/InnerDetector/InDetConditions/PixelConditionsTools/src/PixelConditionsSummaryTool.cxx b/InnerDetector/InDetConditions/PixelConditionsTools/src/PixelConditionsSummaryTool.cxx index 137d3e01c3377b0d24ea8c385fb2c9b21a21ca4a..92095d2c267273e6c79b0988e8176abf70abeb3d 100644 --- a/InnerDetector/InDetConditions/PixelConditionsTools/src/PixelConditionsSummaryTool.cxx +++ b/InnerDetector/InDetConditions/PixelConditionsTools/src/PixelConditionsSummaryTool.cxx @@ -9,8 +9,8 @@ #include "InDetIdentifier/PixelID.h" -#include "PixelConditionsServices/IPixelByteStreamErrorsSvc.h" -#include "PixelConditionsServices/ISpecialPixelMapSvc.h" +#include "PixelConditionsTools/IPixelByteStreamErrorsSvc.h" +#include "PixelConditionsTools/ISpecialPixelMapSvc.h" #include "PixelConditionsData/SpecialPixelMap.h" #include "PixelConditionsTools/IPixelTDAQSvc.h" diff --git a/InnerDetector/InDetDetDescr/InDetIdentifier/test/test_indet_id.cxx b/InnerDetector/InDetDetDescr/InDetIdentifier/test/test_indet_id.cxx index c0a1ee0ba58c27fca4822b5ec445dcf4ba41f5d2..1e6376c0050a9559a240f6f01cbf2d3c66ff612d 100755 --- a/InnerDetector/InDetDetDescr/InDetIdentifier/test/test_indet_id.cxx +++ b/InnerDetector/InDetDetDescr/InDetIdentifier/test/test_indet_id.cxx @@ -812,7 +812,7 @@ check_pixel_timing(IdDictMgr& idd) eta_index = pixel_id.eta_index(pixid); wafer_id = pixel_id.wafer_id(pixid); n += eta_index + phi_index + pixid.get_compact() + wafer_id.get_compact() + - pixel_id.pixel_id(wafer_id, eta_index, phi_index).get_compact(); + pixel_id.pixel_id(wafer_id, phi_index, eta_index).get_compact(); } } @@ -2070,7 +2070,7 @@ check_trt_timing(IdDictMgr& idd) phi_module = trt_id.phi_module(layer_id); straw_layer = trt_id.straw_layer(layer_id); n += barrel_ec + layer_or_wheel + straw_layer + phi_module + - trt_id.layer_id(barrel_ec, layer_or_wheel, phi_module, straw_layer).get_compact(); + trt_id.layer_id(barrel_ec, phi_module, layer_or_wheel, straw_layer).get_compact(); } } diff --git a/InnerDetector/InDetDetDescr/SCT_Cabling/CMakeLists.txt b/InnerDetector/InDetDetDescr/SCT_Cabling/CMakeLists.txt index 2c26680ffc24e703b533fbd89dff898e68dfac96..ffbfc52ab5c40e52dad9cce09f440c0725fc7160 100644 --- a/InnerDetector/InDetDetDescr/SCT_Cabling/CMakeLists.txt +++ b/InnerDetector/InDetDetDescr/SCT_Cabling/CMakeLists.txt @@ -36,7 +36,12 @@ atlas_add_component( SCT_Cabling INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} LINK_LIBRARIES ${COOL_LIBRARIES} ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} AthenaBaseComps Identifier GaudiKernel StoreGateLib SGtests AthenaPoolUtilities CoraCool EventInfo InDetIdentifier PathResolver SCT_CablingLib ) +atlas_add_test( TestSCT_CablingCfg + SCRIPT share/TestSCT_CablingCfg.sh + ENVIRONMENT THREADS=2 ) + # Install files from the package: atlas_install_joboptions( share/*.py ) atlas_install_runtime( share/*.dat ) +atlas_install_scripts( share/*.sh ) atlas_install_python_modules( python/*.py ) diff --git a/InnerDetector/InDetDetDescr/SCT_Cabling/python/SCT_CablingConfig.py b/InnerDetector/InDetDetDescr/SCT_Cabling/python/SCT_CablingConfig.py index 7b287d3402455b42e5c466cb7de1f8634adfb39d..20978477038e5a22c1a92ae8549f49c862963755 100644 --- a/InnerDetector/InDetDetDescr/SCT_Cabling/python/SCT_CablingConfig.py +++ b/InnerDetector/InDetDetDescr/SCT_Cabling/python/SCT_CablingConfig.py @@ -71,3 +71,30 @@ def getSCT_FillCablingFromCoraCool(name="SCT_FillCablingFromCoraCool", **kwargs) from SCT_Cabling.SCT_CablingConf import SCT_FillCablingFromCoraCool return CfgMgr.SCT_FillCablingFromCoraCool(name, **kwargs) + +# https://twiki.cern.ch/twiki/bin/viewauth/AtlasComputing/AthenaJobConfigRun3 + +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator + +def SCT_CablingFoldersCfg(configFlags): + cfg=ComponentAccumulator() + path="/SCT/DAQ/Config/" + if configFlags.IOVDb.DatabaseInstance == "COMP200": + path="/SCT/DAQ/Configuration/" + instance="SCT" + if configFlags.Input.isMC: + instance="SCT_OFL" + from IOVDbSvc.IOVDbSvcConfig import addFolders, IOVDbSvcCfg + cfg.merge(addFolders(configFlags, [path+"ROD", path+"RODMUR", path+"MUR", path+"Geog"], instance, className="CondAttrListVec")[0]) + return cfg, path + +def SCT_CablingCondAlgCfg(configFlags): + cfg=ComponentAccumulator() + foldersCfg,path=SCT_CablingFoldersCfg(configFlags) + cfg.merge(foldersCfg) + from SCT_Cabling.SCT_CablingConf import SCT_CablingCondAlgFromCoraCool + cfg.addCondAlgo(SCT_CablingCondAlgFromCoraCool(ReadKeyRod=path+"ROD", + ReadKeyRodMur=path+"RODMUR", + ReadKeyMur=path+"MUR", + ReadKeyGeo=path+"Geog")) + return cfg diff --git a/InnerDetector/InDetDetDescr/SCT_Cabling/share/TestSCT_CablingCfg.py b/InnerDetector/InDetDetDescr/SCT_Cabling/share/TestSCT_CablingCfg.py new file mode 100644 index 0000000000000000000000000000000000000000..ef158360aa29b32c3bd43bcd54af371f95a8019b --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_Cabling/share/TestSCT_CablingCfg.py @@ -0,0 +1,58 @@ +# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + +# https://twiki.cern.ch/twiki/bin/viewauth/AtlasComputing/AthenaJobConfigRun3 + +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator + + +def SCT_TestCablingAlgCfg(configFlags): + cfg=ComponentAccumulator() + + from SCT_Cabling.SCT_CablingConfig import SCT_CablingCondAlgCfg + cfg.merge(SCT_CablingCondAlgCfg(configFlags)) + + from AtlasGeoModel.GeoModelConfig import GeoModelCfg + geoCfg,gms=GeoModelCfg(configFlags) + cfg.merge(geoCfg) + + from AthenaCommon.Constants import INFO + from AthenaCommon.CfgGetter import getPrivateTool + SCT_CablingTool = getPrivateTool("SCT_CablingTool") + SCT_CablingTool.DataSource = "COOLVECTOR" + SCT_CablingTool.OutputLevel = INFO + + from SCT_Cabling.SCT_CablingConf import SCT_TestCablingAlg + testAlg = SCT_TestCablingAlg(SCT_CablingTool = SCT_CablingTool, + OutputLevel = INFO) + cfg.addEventAlgo(testAlg) + + return cfg + + +if __name__=="__main__": + from AthenaCommon.Logging import log + from AthenaCommon.Constants import DEBUG + log.setLevel(DEBUG) + + from AthenaCommon.Configurable import Configurable + Configurable.configurableRun3Behavior=1 + + from AthenaConfiguration.AllConfigFlags import ConfigFlags + ConfigFlags.Input.isMC = True + ConfigFlags.Input.RunNumber = 300000 + ConfigFlags.addFlag("Input.InitialTimeStamp", 1500000000) + # https://twiki.cern.ch/twiki/bin/viewauth/AtlasComputing/ConditionsRun1RunNumbers + ConfigFlags.IOVDb.GlobalTag = "OFLCOND-RUN12-SDR-25" + ConfigFlags.GeoModel.AtlasVersion = "ATLAS-R2-2015-03-01-00" + ConfigFlags.lock() + + cfg=ComponentAccumulator() + + from McEventSelector.McEventSelectorConfig import McEventSelectorCfg + cfg.merge(McEventSelectorCfg(ConfigFlags)) + + cfg.merge(SCT_TestCablingAlgCfg(ConfigFlags)) + + f=open("TestSCT_CablingCfg.pkl","w") + cfg.store(f) + f.close() diff --git a/InnerDetector/InDetDetDescr/SCT_Cabling/share/TestSCT_CablingCfg.sh b/InnerDetector/InDetDetDescr/SCT_Cabling/share/TestSCT_CablingCfg.sh new file mode 100755 index 0000000000000000000000000000000000000000..64a170078fbdd0ab5eda1d403b6d0ce77cea4a3d --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_Cabling/share/TestSCT_CablingCfg.sh @@ -0,0 +1,28 @@ +#!/bin/sh + +rm -rf TestSCT_CablingCfg.py bootstrap.pkl bootstrap.py + +# this is a hack to pre-confgure scheduler and other MT services, +#will be taken away once NEW system has better means to influence the bootstrap content +cat <<EOF >> bootstrap.py +from AthenaCommon.AppMgr import theApp, ServiceMgr as svcMgr +svcMgr.AvalancheSchedulerSvc.ShowControlFlow=True +svcMgr.AvalancheSchedulerSvc.ShowDataDependencies=True +EOF + +athena --threads=2 --config-only=bootstrap.pkl bootstrap.py + +get_files -jo SCT_Cabling/TestSCT_CablingCfg.py + +python TestSCT_CablingCfg.py # generate pickle +status=$? +if [ ${status} -ne 0 ] +then + echo "ERROR in configuration generation stage, stopping" + exit -1 +else + echo + echo "JOs reading stage finished, launching Athena from pickle file" + echo + athena --evtMax=2 TestSCT_CablingCfg.pkl +fi diff --git a/InnerDetector/InDetDetDescr/SCT_Cabling/share/TestSCT_CablingSimple.py b/InnerDetector/InDetDetDescr/SCT_Cabling/share/TestSCT_CablingSimple.py new file mode 100644 index 0000000000000000000000000000000000000000..85875c9dc690f51c57fa20e0fd967313a07e2065 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_Cabling/share/TestSCT_CablingSimple.py @@ -0,0 +1,99 @@ +################################################################################ +# Job options file to test the Cabling +################################################################################ + +from AthenaCommon.AppMgr import theApp +theApp.EvtMax = 1 +theApp.AuditAlgorithms = True + +from AthenaCommon.AppMgr import ServiceMgr + +#-------------------------------------------------------------- +# Set output lvl (VERBOSE, DEBUG, INFO, WARNING, ERROR, FATAL) +#-------------------------------------------------------------- +ServiceMgr.MessageSvc.OutputLevel = INFO +ServiceMgr.MessageSvc.infoLimit = 100000 + +#-------------------------------------------------------------- +# Event selector settings. Use McEventSelector +#-------------------------------------------------------------- +import AthenaCommon.AtlasUnixGeneratorJob +ServiceMgr.EventSelector.RunNumber = 310809 +# initial time stamp - this is number of seconds since 1st Jan 1970 GMT +# run 310809 Recording start/end 2016-Oct-17 21:39:18 / 2016-Oct-18 16:45:23 UTC +ServiceMgr.EventSelector.InitialTimeStamp = 1476741326 # LB 18 of run 310809, 10/17/2016 @ 9:55pm (UTC) + +#-------------------------------------------------------------- +# Load IOVDbSvc +#-------------------------------------------------------------- +from IOVDbSvc.CondDB import conddb +ServiceMgr.IOVDbSvc.GlobalTag = "OFLCOND-RUN12-SDR-25" +ServiceMgr.IOVDbSvc.OutputLevel = DEBUG + +#-------------------------------------------------------------- +# use auditors +#-------------------------------------------------------------- +from GaudiSvc.GaudiSvcConf import AuditorSvc +ServiceMgr += AuditorSvc() +ServiceMgr.AuditorSvc.Auditors += [ "ChronoAuditor"] +ServiceMgr.AuditorSvc.Auditors += [ "MemStatAuditor" ] + +#-------------------------------------------------------------- +# Load Geometry +#-------------------------------------------------------------- +from AthenaCommon.GlobalFlags import globalflags +globalflags.DetDescrVersion = "ATLAS-R2-2015-03-01-00" +globalflags.DetGeo="atlas" +globalflags.InputFormat="pool" +globalflags.DataSource="geant4" + +#-------------------------------------------------------------- +# Set Detector setup +#-------------------------------------------------------------- +# --- switch on InnerDetector +from AthenaCommon.DetFlags import DetFlags +DetFlags.ID_setOn() +DetFlags.Calo_setOff() +DetFlags.Muon_setOff() +DetFlags.Truth_setOff() +DetFlags.LVL1_setOff() +DetFlags.SCT_setOn() +DetFlags.pixel_setOff() +DetFlags.TRT_setOff() + +# ---- switch parts of ID off/on as follows +#switch off tasks +DetFlags.pileup.all_setOff() +DetFlags.simulate.all_setOff() +DetFlags.makeRIO.all_setOff() +DetFlags.writeBS.all_setOff() +DetFlags.readRDOBS.all_setOff() +DetFlags.readRIOBS.all_setOff() +DetFlags.readRIOPool.all_setOff() +DetFlags.writeRIOPool.all_setOff() + +import AtlasGeoModel.SetGeometryVersion +import AtlasGeoModel.GeoModelInit + +#-------------------------------------------------------------- +# Load CondAlg, Tool and TestAlg +#-------------------------------------------------------------- +from AthenaCommon.AlgSequence import AthSequencer +condSeq = AthSequencer("AthCondSeq") +condAlgName = "SCT_CablingCondAlgFromCoraCool" +if not hasattr(condSeq, condAlgName): + from AthenaCommon.CfgGetter import getAlgorithm + SCT_CablingCondAlgFromCoraCool = getAlgorithm(condAlgName) + condSeq += SCT_CablingCondAlgFromCoraCool + +from AthenaCommon.CfgGetter import getPrivateTool +SCT_CablingTool = getPrivateTool("SCT_CablingTool") +SCT_CablingTool.DataSource = "COOLVECTOR" +SCT_CablingTool.OutputLevel = INFO + +from AthenaCommon.AlgSequence import AlgSequence +topSequence = AlgSequence() +from SCT_Cabling.SCT_CablingConf import SCT_TestCablingAlg +topSequence += SCT_TestCablingAlg(SCT_CablingTool=SCT_CablingTool, + OutputLevel = INFO) + diff --git a/InnerDetector/InDetDigitization/FastSiDigitization/src/SiSmearedDigitizationTool.cxx b/InnerDetector/InDetDigitization/FastSiDigitization/src/SiSmearedDigitizationTool.cxx index a4cc1845a9d290ed18bd2987e4371c189b5f6f39..4afd4454b305ce409508878427f1fac8b91516e3 100644 --- a/InnerDetector/InDetDigitization/FastSiDigitization/src/SiSmearedDigitizationTool.cxx +++ b/InnerDetector/InDetDigitization/FastSiDigitization/src/SiSmearedDigitizationTool.cxx @@ -766,21 +766,6 @@ StatusCode SiSmearedDigitizationTool::mergeClusters(Pixel_detElement_RIO_map * c } } - // i = cluster_map->begin(); - // e = cluster_map->end(); - - // for (; i != e; i = cluster_map->upper_bound(i->first)){ - // IdentifierHash current_id = i->first; - // // Check if clusters with current_id have been already considered - - // ATH_MSG_DEBUG( "--- AFTER MERGING SiSmearedDigitizationTool: " << cluster_map->count(current_id) << "elements with key " << current_id ); - - // std::pair <Pixel_detElement_RIO_map::iterator, Pixel_detElement_RIO_map::iterator> range = cluster_map->equal_range(current_id); - // for ( Pixel_detElement_RIO_map::iterator iter = range.first; iter != range.second; ++iter){ - // ATH_MSG_DEBUG( "--- AFTER MERGING SiSmearedDigitizationTool: Planar Cluster = " << *((*iter).second) ); - // } - // } - return StatusCode::SUCCESS; } @@ -849,21 +834,6 @@ StatusCode SiSmearedDigitizationTool::mergeClusters(SCT_detElement_RIO_map * clu } } - // i = cluster_map->begin(); - // e = cluster_map->end(); - - // for (; i != e; i = cluster_map->upper_bound(i->first)){ - // IdentifierHash current_id = i->first; - // // Check if clusters with current_id have been already considered - - // ATH_MSG_DEBUG( "--- AFTER MERGING SiSmearedDigitizationTool: " << cluster_map->count(current_id) << "elements with key " << current_id ); - - // std::pair <SCT_detElement_RIO_map::iterator, SCT_detElement_RIO_map::iterator> range = cluster_map->equal_range(current_id); - // for ( SCT_detElement_RIO_map::iterator iter = range.first; iter != range.second; ++iter){ - // ATH_MSG_DEBUG( "--- AFTER MERGING SiSmearedDigitizationTool: Pixel Cluster = " << *((*iter).second) ); - // } - // } - return StatusCode::SUCCESS; } @@ -938,20 +908,6 @@ StatusCode SiSmearedDigitizationTool::mergeClusters(Planar_detElement_RIO_map * } } - // i = cluster_map->begin(); - // e = cluster_map->end(); - - // for (; i != e; i = cluster_map->upper_bound(i->first)){ - // IdentifierHash current_id = i->first; - // // Check if clusters with current_id have been already considered - - // ATH_MSG_DEBUG( "--- AFTER MERGING SiSmearedDigitizationTool: " << cluster_map->count(current_id) << "elements with key " << current_id ); - // std::pair <Planar_detElement_RIO_map::iterator, Planar_detElement_RIO_map::iterator> range = cluster_map->equal_range(current_id); - // for ( Planar_detElement_RIO_map::iterator iter = range.first; iter != range.second; ++iter){ - // ATH_MSG_DEBUG( "--- AFTER MERGING SiSmearedDigitizationTool: Planar Cluster = " << *((*iter).second) ); - // } - // } - return StatusCode::SUCCESS; } @@ -1183,8 +1139,8 @@ StatusCode SiSmearedDigitizationTool::digitize() if (hitSurface->type() == Trk::Surface::Disc) { m_useDiscSurface = true; const Trk::DiscSurface* disc = dynamic_cast<const Trk::DiscSurface*>(hitSurface); - Amg::Vector2D polLocalEntry = *(disc->localCartesianToPolar(Amg::Vector2D(localEntry.x(), localEntry.y()))); - Amg::Vector2D polLocalExit = *(disc->localCartesianToPolar(Amg::Vector2D(localExit.x(), localExit.y()))); + Amg::Vector2D polLocalEntry {disc->localCartesianToPolarValue(Amg::Vector2D(localEntry.x(), localEntry.y()))}; + Amg::Vector2D polLocalExit {disc->localCartesianToPolarValue(Amg::Vector2D(localExit.x(), localExit.y()))}; sct_localStartPosition = HepGeom::Point3D<double>( polLocalEntry.x(), polLocalEntry.y(), localEntry.z()); sct_localEndPosition = HepGeom::Point3D<double>( polLocalExit.x(), polLocalExit.y(), localExit.z()); } @@ -1198,8 +1154,8 @@ StatusCode SiSmearedDigitizationTool::digitize() localExitZ = sct_localEndPosition.z(); } - double distX = fabs(fabs(localExitX)-fabs(localEntryX)); - double distY = fabs(fabs(localExitY)-fabs(localEntryY)); + double distX = std::fabs(std::fabs(localExitX)-std::fabs(localEntryX)); + double distY = std::fabs(std::fabs(localExitY)-std::fabs(localEntryY)); if(m_SmearPixel){ // Smear Pixel ATH_MSG_DEBUG( "--- SiSmearedDigitizationTool: pixel start position --- " << localEntryX << ", " << localEntryY << ", " << localEntryZ ); diff --git a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/PixelClusterContainerCnv_p2.cxx b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/PixelClusterContainerCnv_p2.cxx index bc16bbd366c526ef1fb00c2f82a9de1f2397b5a6..9cbadbfe5fd4baf912d6b0059da2b2d231f52553 100644 --- a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/PixelClusterContainerCnv_p2.cxx +++ b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/PixelClusterContainerCnv_p2.cxx @@ -161,12 +161,15 @@ void PixelClusterContainerCnv_p2::persToTrans(const InDet::PixelClusterContaine //================================================================ InDet::PixelClusterContainer* PixelClusterContainerCnv_p2::createTransient(const InDet::PixelClusterContainer_p2* persObj, MsgStream& log) { - // if (log.level() <= MSG::DEBUG) log << MSG::DEBUG << "PixelClusterContainerCnv_p2::createTransient called " << endmsg; if(!m_isInitialized) { if (this->initialize(log) != StatusCode::SUCCESS) { log << MSG::FATAL << "Could not initialize PixelClusterContainerCnv_p2 " << endmsg; } } + if (not m_pixId) { + log << MSG::FATAL << "nullptr for m_pixId in PixelClusterContainerCnv_p2::createTransient" << endmsg; + return nullptr; + } std::auto_ptr<InDet::PixelClusterContainer> trans(new InDet::PixelClusterContainer(m_pixId->wafer_hash_max())); persToTrans(persObj, trans.get(), log); return(trans.release()); diff --git a/InnerDetector/InDetExample/InDetAlignExample/share/ElectronEoverPTracking.py b/InnerDetector/InDetExample/InDetAlignExample/share/ElectronEoverPTracking.py index 83083ddcf3278618a6326c2a9cd1d030a71e2996..e8fcde204bfe9782014ef50627904f53493c8157 100755 --- a/InnerDetector/InDetExample/InDetAlignExample/share/ElectronEoverPTracking.py +++ b/InnerDetector/InDetExample/InDetAlignExample/share/ElectronEoverPTracking.py @@ -168,14 +168,6 @@ GsfExtrapolator = Trk__GsfExtrapolator(name = 'GsfExtra ToolSvc += GsfExtrapolator -from TrkGaussianSumFilter.TrkGaussianSumFilterConf import Trk__BremFind -BremFind = Trk__BremFind(name = 'BremFind', - UseCalibration = True, - ValidationMode = True ) - - -ToolSvc += BremFind - from TrkGaussianSumFilter.TrkGaussianSumFilterConf import Trk__GaussianSumFitter GSFTrackFitter = Trk__GaussianSumFitter(name = 'GSFTrackFitter', ToolForExtrapolation = GsfExtrapolator, @@ -186,8 +178,6 @@ GSFTrackFitter = Trk__GaussianSumFitter(name = 'GSFTrackFitte RefitOnMeasurementBase = True, DoHitSorting = True, ValidationMode = False, - BremFind = BremFind, - runBremFinder = False, OutputLevel = 3) # --- end of fitter loading ToolSvc += GSFTrackFitter diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/EventAnalysis.h b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/EventAnalysis.h index 38ccc56f6f5706df3ed51e777ff00a7defe6c858..540737b1124f22eb36e80c4b6c64b7b43c49f0fe 100644 --- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/EventAnalysis.h +++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/EventAnalysis.h @@ -9,10 +9,6 @@ #ifndef IDPERFMON_EVENTANALYSIS_H #define IDPERFMON_EVENTANALYSIS_H -#include "TH1.h" -#include "TH2.h" -#include "TProfile.h" -#include "TProfile2D.h" // Crap that may stay or go #include "CLHEP/Vector/LorentzVector.h" @@ -20,6 +16,11 @@ #include <map> #include <vector> +class TH1F; +class TH2F; +class TProfile; +class TProfile2D; + namespace EAna { const float g_fMuonMass = 0.1056f; @@ -36,10 +37,12 @@ class EventAnalysis // Overridden functions. virtual void Init(); virtual bool Reco(); + static constexpr float invalidAnswer{-999.9f}; // Static Util. function declarations. Defined below class. Can use if no inheritance struct. + template<class T> static CLHEP::Hep3Vector calculateMomentum(const T * pP); template<class T> static float EvalInvMass( const T* pxP1, const T* pxP2, - float fMass1, float fMass2 = -999.9 ); + float fMass1, float fMass2 = invalidAnswer ); template<class T> static float EvalDiMuInvMass( const T* pxP1, const T* pxP2 ); template<class T> static float EvaluateAngle( const T* pxP1, const T* pxP2 ); template<class T> static float EvalPtDiff( const T* pxP1, const T* pxP2 ); @@ -52,14 +55,15 @@ class EventAnalysis template<class T> static float EvalCharge( const T* pxP1, const T* pxP2 ); template<class T> static float EvalTransverseMass( const T* pxP1,float fMETx, float fMETy, - float fMass1, float fMass2 = -999.9); + float fMass1, float fMass2 = invalidAnswer); template<class T> static float EvalTransverseMass( const T* pxP1, float fMETx, float fMETy ); template<class T> static float EvalTransverseMass( const T* pxP1, const T* pxP2, float fMETx, float fMETy, - float fMass1, float fMass2 = -999.9); + float fMass1, float fMass2 = invalidAnswer); template<class T> static float EvalTransverseMass( const T* pxP1, const T* pxP2, float fMETx, float fMETy ); + protected: @@ -75,23 +79,23 @@ class EventAnalysis private: void Register(); // Register the histograms. - - void Register_1DHistos(); - void Register_2DHistos(); - void Register_1DProfHistos(); - void Register_2DProfHistos(); - }; //============================================================================= // Useful static functions defined here //============================================================================= +template<class T> CLHEP::Hep3Vector +EventAnalysis::calculateMomentum(const T * pP){ + const auto & p4(pP->p4()); + return CLHEP::Hep3Vector(p4.Px() * EAna::CGeV , p4.Py() * EAna::CGeV, p4.Pz() * EAna::CGeV); +} + // 2 Particle Invariant Mass template<class T> float EventAnalysis::EvalDiMuInvMass( const T* pxP1, const T* pxP2 ) { // Check integrity of inputs. - if ( !pxP1 || !pxP2 ) return -999.9f; + if ( !pxP1 || !pxP2 ) return invalidAnswer; // Evaluate Di-mu invariant mass. return EvalInvMass( pxP1, pxP2, EAna::g_fMuonMass ); @@ -101,19 +105,15 @@ template<class T> float EventAnalysis::EvalInvMass( const T* pxP1, const T* pxP2 float fMass1, float fMass2 /* = -999.9 */ ) { // Check integrity of inputs.No tachyons. - if ( fMass1 < 0.0f ) return -999.9f; - if ( !pxP1 || !pxP2 ) return -999.9f; - + if ( fMass1 < 0.0f ) return invalidAnswer; + if ( !pxP1 || !pxP2 ) return invalidAnswer; // Set masses equal if required by user fMass2 = ( fMass2 < 0.0f ) ? fMass1 : fMass2; - // Evaluate invariant mass. - CLHEP::Hep3Vector xTmp1 = CLHEP::Hep3Vector( pxP1->p4().Px() * EAna::CGeV, pxP1->p4().Py() * EAna::CGeV, pxP1->p4().Pz() * EAna::CGeV ); - CLHEP::Hep3Vector xTmp2 = CLHEP::Hep3Vector( pxP2->p4().Px() * EAna::CGeV, pxP2->p4().Py() * EAna::CGeV, pxP2->p4().Pz() * EAna::CGeV ); - + CLHEP::Hep3Vector xTmp1 = calculateMomentum(pxP1); + CLHEP::Hep3Vector xTmp2 = calculateMomentum(pxP2); CLHEP::HepLorentzVector xLVec1; xLVec1.setVectM( xTmp1, fMass1 ); CLHEP::HepLorentzVector xLVec2; xLVec2.setVectM( xTmp2, fMass2 ); - return static_cast<float>( xLVec1.invariantMass( xLVec2 ) ); } @@ -121,21 +121,17 @@ template<class T> float EventAnalysis::EvalInvMass( const T* pxP1, const T* pxP2 template<class T> float EventAnalysis::EvaluateAngle( const T* pxP1, const T* pxP2 ) { // Check integrity of inputs. - if ( !pxP1 || !pxP2 ) return -999.9f; - + if ( !pxP1 || !pxP2 ) return invalidAnswer; // Evaluate the angle. - CLHEP::Hep3Vector xTmp1 = CLHEP::Hep3Vector( pxP1->p4().Px() * EAna::CGeV, pxP1->p4().Py() * EAna::CGeV, pxP1->p4().Pz() * EAna::CGeV ); - CLHEP::Hep3Vector xTmp2 = CLHEP::Hep3Vector( pxP2->p4().Px() * EAna::CGeV, pxP2->p4().Py() * EAna::CGeV, pxP2->p4().Pz() * EAna::CGeV ); - - + CLHEP::Hep3Vector xTmp1 = calculateMomentum(pxP1); + CLHEP::Hep3Vector xTmp2 = calculateMomentum(pxP2); return static_cast<float>( xTmp1.angle(xTmp2) ); } template<class T> float EventAnalysis::EvalPtDiff( const T* pxP1, const T* pxP2 ) { // Check integrity of inputs. - if ( !pxP1 || !pxP2 ) return -999.9f; - + if ( !pxP1 || !pxP2 ) return invalidAnswer; // Evaluate the difference between the momenta. Signed using positive - negative if appropriate. if ( pxP1->charge() > 0.5f ) { @@ -152,12 +148,10 @@ template<class T> float EventAnalysis::EvalPtDiff( const T* pxP1, const T* pxP2 template<class T> float EventAnalysis::EvalPhiDiff( const T* pxP1, const T* pxP2 ) { // Check integrity of inputs. - if ( !pxP1 || !pxP2 ) return -999.9f; - + if ( !pxP1 || !pxP2 ) return invalidAnswer; // Evaluate the angle. - CLHEP::Hep3Vector xTmp1 = CLHEP::Hep3Vector( pxP1->p4().Px() * EAna::CGeV, pxP1->p4().Py() * EAna::CGeV, pxP1->p4().Pz() * EAna::CGeV ); - CLHEP::Hep3Vector xTmp2 = CLHEP::Hep3Vector( pxP2->p4().Px() * EAna::CGeV, pxP2->p4().Py() * EAna::CGeV, pxP2->p4().Pz() * EAna::CGeV ); - + CLHEP::Hep3Vector xTmp1 = calculateMomentum(pxP1); + CLHEP::Hep3Vector xTmp2 = calculateMomentum(pxP2); return static_cast<float>( xTmp1.deltaPhi(xTmp2) ); } @@ -165,53 +159,44 @@ template<class T> float EventAnalysis::EvalPhiDiff( const T* pxP1, const T* pxP2 template<class T> float EventAnalysis::EvalEtaDiff( const T* pxP1, const T* pxP2 ) { // Check integrity of inputs. - if ( !pxP1 || !pxP2 ) return -999.9f; - + if ( !pxP1 || !pxP2 ) return invalidAnswer; // Evaluate the angle. - CLHEP::Hep3Vector xTmp1 = CLHEP::Hep3Vector( pxP1->p4().Px() * EAna::CGeV, pxP1->p4().Py() * EAna::CGeV, pxP1->p4().Pz() * EAna::CGeV ); - CLHEP::Hep3Vector xTmp2 = CLHEP::Hep3Vector( pxP2->p4().Px() * EAna::CGeV, pxP2->p4().Py() * EAna::CGeV, pxP2->p4().Pz() * EAna::CGeV ); - + CLHEP::Hep3Vector xTmp1 = calculateMomentum(pxP1); + CLHEP::Hep3Vector xTmp2 = calculateMomentum(pxP2); return static_cast<float>( xTmp1.polarAngle(xTmp2) ); } template<class T> float EventAnalysis::EvalPt( const T* pxP1, const T* pxP2 ) { // Check integrity of inputs. - if ( !pxP1 || !pxP2 ) return -999.9f; - - CLHEP::Hep3Vector xTmp1 = CLHEP::Hep3Vector( pxP1->p4().Px() * EAna::CGeV, pxP1->p4().Py() * EAna::CGeV, pxP1->p4().Pz() * EAna::CGeV ); - CLHEP::Hep3Vector xTmp2 = CLHEP::Hep3Vector( pxP2->p4().Px() * EAna::CGeV, pxP2->p4().Py() * EAna::CGeV, pxP2->p4().Pz() * EAna::CGeV ); - + if ( !pxP1 || !pxP2 ) return invalidAnswer; + CLHEP::Hep3Vector xTmp1 = calculateMomentum(pxP1); + CLHEP::Hep3Vector xTmp2 = calculateMomentum(pxP2); return static_cast<float>( (xTmp1 + xTmp2).perp() ); } template<class T> float EventAnalysis::EvalPhi( const T* pxP1, const T* pxP2 ) { // Check integrity of inputs. - if ( !pxP1 || !pxP2 ) return -999.9f; - - CLHEP::Hep3Vector xTmp1 = CLHEP::Hep3Vector( pxP1->p4().Px() * EAna::CGeV, pxP1->p4().Py() * EAna::CGeV, pxP1->p4().Pz() * EAna::CGeV ); - CLHEP::Hep3Vector xTmp2 = CLHEP::Hep3Vector( pxP2->p4().Px() * EAna::CGeV, pxP2->p4().Py() * EAna::CGeV, pxP2->p4().Pz() * EAna::CGeV ); - + if ( !pxP1 || !pxP2 ) return invalidAnswer; + CLHEP::Hep3Vector xTmp1 = calculateMomentum(pxP1); + CLHEP::Hep3Vector xTmp2 = calculateMomentum(pxP2); return static_cast<float>( (xTmp1 + xTmp2).phi() ); } template<class T> float EventAnalysis::EvalEta( const T* pxP1, const T* pxP2 ) { // Check integrity of inputs. - if ( !pxP1 || !pxP2 ) return -999.9f; - - CLHEP::Hep3Vector xTmp1 = CLHEP::Hep3Vector( pxP1->p4().Px() * EAna::CGeV, pxP1->p4().Py() * EAna::CGeV, pxP1->p4().Pz() * EAna::CGeV ); - CLHEP::Hep3Vector xTmp2 = CLHEP::Hep3Vector( pxP2->p4().Px() * EAna::CGeV, pxP2->p4().Py() * EAna::CGeV, pxP2->p4().Pz() * EAna::CGeV ); - + if ( !pxP1 || !pxP2 ) return invalidAnswer; + CLHEP::Hep3Vector xTmp1 = calculateMomentum(pxP1); + CLHEP::Hep3Vector xTmp2 = calculateMomentum(pxP2); return static_cast<float>( (xTmp1 + xTmp2).pseudoRapidity() ); } template<class T> float EventAnalysis::EvalCharge( const T* pxP1, const T* pxP2 ) { // Check integrity of inputs. - if ( !pxP1 || !pxP2 ) return -999.9f; - + if ( !pxP1 || !pxP2 ) return invalidAnswer; return static_cast<float>( pxP1->charge() + pxP2->charge() ); } @@ -219,8 +204,7 @@ template<class T> float EventAnalysis::EvalCharge( const T* pxP1, const T* pxP2 template<class T> float EventAnalysis::EvalTransverseMass( const T* pxP1, float fMETx, float fMETy ) { // Check integrity of inputs. - if ( !pxP1 ) return -999.9f; - + if ( !pxP1 ) return invalidAnswer; // Evaluate Di-mu invariant mass. return EvalInvMass( pxP1, fMETx, fMETy, EAna::g_fMuonMass ); } @@ -229,19 +213,15 @@ template<class T> float EventAnalysis::EvalTransverseMass( const T* pxP1, float float fMass1, float fMass2 /* = -999.9 */ ) { // Check integrity of inputs.No tachyons. - if ( fMass1 < 0.0f ) return -999.9f; - if ( !pxP1 ) return -999.9f; - + if ( fMass1 < 0.0f ) return invalidAnswer; + if ( !pxP1 ) return invalidAnswer; // Set masses equal if required by user. fMass2 = ( fMass2 < 0.0f ) ? fMass1 : fMass2; - // Evaluate invariant mass. CLHEP::Hep3Vector xTmp1 = CLHEP::Hep3Vector( pxP1->p4().Px() * EAna::CGeV, pxP1->p4().Py() * EAna::CGeV, 0.0f ); CLHEP::Hep3Vector xTmp2 = CLHEP::Hep3Vector( fMETx, fMETy, 0.0f ); - CLHEP::HepLorentzVector xLVec1; xLVec1.setVectM( xTmp1, fMass1 ); CLHEP::HepLorentzVector xLVec2; xLVec2.setVectM( xTmp2, 0.0f ); - return static_cast<float>( xLVec1.invariantMass( xLVec2 ) ); } @@ -249,8 +229,7 @@ template<class T> float EventAnalysis::EvalTransverseMass( const T* pxP1, float template<class T> float EventAnalysis::EvalTransverseMass( const T* pxP1, const T* pxP2, float fMETx, float fMETy ) { // Check integrity of inputs. - if ( !pxP1 || !pxP2 ) return -999.9f; - + if ( !pxP1 || !pxP2 ) return invalidAnswer; // Evaluate Di-mu invariant mass. return EvalTransverseMass( pxP1, pxP2, fMETx, fMETy, EAna::g_fMuonMass ); } @@ -259,21 +238,17 @@ template<class T> float EventAnalysis::EvalTransverseMass( const T* pxP1, const float fMass1, float fMass2 /* = -999.9 */ ) { // Check integrity of inputs.No tachyons. - if ( fMass1 < 0.0f ) return -999.9f; - if ( !pxP1 || !pxP2 ) return -999.9f; - + if ( fMass1 < 0.0f ) return invalidAnswer; + if ( !pxP1 || !pxP2 ) return invalidAnswer; // Set masses equal if required by user. fMass2 = ( fMass2 < 0.0f ) ? fMass1 : fMass2; - // Evaluate invariant mass. CLHEP::Hep3Vector xTmp1 = CLHEP::Hep3Vector( pxP1->p4().Px() * EAna::CGeV, pxP1->p4().Py() * EAna::CGeV, 0.0f ); CLHEP::Hep3Vector xTmp2 = CLHEP::Hep3Vector( pxP2->p4().Px() * EAna::CGeV, pxP2->p4().Py() * EAna::CGeV, 0.0f ); CLHEP::Hep3Vector xTmp12 = xTmp1 + xTmp2; CLHEP::Hep3Vector xTmp3 = CLHEP::Hep3Vector( fMETx, fMETy, 0.0f ); - CLHEP::HepLorentzVector xLVec1; xLVec1.setVectM( xTmp12, fMass1 ); CLHEP::HepLorentzVector xLVec2; xLVec2.setVectM( xTmp3, 0.0f ); - return static_cast<float>( xLVec1.invariantMass( xLVec2 ) ); } diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/IDPerfMonKshort.h b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/IDPerfMonKshort.h index 77d221ac0680329213d8df49fdbeb9eeef399dec..fe3a36b7d5629be888e7b094eee9f5c324971b54 100755 --- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/IDPerfMonKshort.h +++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/IDPerfMonKshort.h @@ -9,7 +9,6 @@ // IDPerfMonKshort.cxx // AUTHORS: Beate Heinemann, Tobias Golling // ********************************************************************** -#include "GaudiKernel/StatusCode.h" #include "AthenaMonitoring/ManagedMonitorToolBase.h" diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/IDPerfMonWenu.h b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/IDPerfMonWenu.h index 7cad734190fd729366e45c69ba9d28f8899c1e14..6516cfa0d87a11dd0c1f2967012f8e2f84bd35da 100755 --- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/IDPerfMonWenu.h +++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/IDPerfMonWenu.h @@ -12,25 +12,21 @@ #include <vector> #include <memory> -#include "GaudiKernel/StatusCode.h" -#include "GaudiKernel/SystemOfUnits.h" -#include "GaudiKernel/PhysicalConstants.h" -#include "AthenaMonitoring/AthenaMonManager.h" + +//#include "AthenaMonitoring/AthenaMonManager.h" #include "AthenaMonitoring/ManagedMonitorToolBase.h" -#include "xAODEgamma/Electron.h" #include "xAODEgamma/ElectronContainer.h" -#include "xAODEgamma/Egamma.h" + #include "xAODEgamma/EgammaContainer.h" -#include "xAODEgamma/Photon.h" + #include "xAODEgamma/PhotonContainer.h" -#include "xAODCaloEvent/CaloCluster.h" + #include "xAODCaloEvent/CaloClusterContainer.h" #include "ElectronPhotonSelectorTools/AsgElectronLikelihoodTool.h" class TH1; - class TH1F; class TH2; class TH2F; diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/IDPerfMonZee.h b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/IDPerfMonZee.h index 00dbc5b312aa0d41a2297be28e901e37a81b9905..aa352c460d40c0ffd8bc147738e5b62339aa49c0 100755 --- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/IDPerfMonZee.h +++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/IDPerfMonZee.h @@ -12,12 +12,9 @@ #include <vector> -#include "GaudiKernel/StatusCode.h" - -#include "AthenaMonitoring/AthenaMonManager.h" #include "AthenaMonitoring/ManagedMonitorToolBase.h" -//typdefs, cannot be fwd declared +//typedefs, cannot be fwd declared #include "xAODEgamma/Electron.h" #include "xAODEgamma/ElectronContainer.h" #include "xAODEgamma/Photon.h" diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/IDPerfMonZmumu.h b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/IDPerfMonZmumu.h index 583d314d0f29cf30b51551a5707978ace6c56201..1723b0138fddba4f868e02b3694ba9de9ae51842 100755 --- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/IDPerfMonZmumu.h +++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/IDPerfMonZmumu.h @@ -8,28 +8,16 @@ //============================================================================== // Include files... //============================================================================== -#include "AthenaMonitoring/ManagedMonitorToolBase.h" #include "InDetPerformanceMonitoring/ZmumuEvent.h" - -#include "xAODTruth/TruthVertex.h" #include "xAODTruth/TruthParticle.h" -#include "xAODTruth/TruthParticleContainer.h" #include "ITrackToVertex/ITrackToVertex.h" - - -#include "GeneratorObjects/xAODTruthParticleLink.h" -#include "xAODTracking/TrackParticleContainer.h" -#include "xAODEgamma/Electron.h" #include "xAODEgamma/EgammaTruthxAODHelpers.h" - #include "AthenaBaseComps/AthAlgorithm.h" - #include "GaudiKernel/ToolHandle.h" class TTree; class IegammaTrkRefitterTool; - class IDPerfMonZmumu : public AthAlgorithm { public: @@ -50,7 +38,6 @@ class IDPerfMonZmumu : public AthAlgorithm // Private class member functions. void RegisterHistograms(); void FillRecParameters(const Trk::Track* track, double charge); - //void FillRecParameters(const xAOD::TrackParticle* trackparticle, double charge); StatusCode FillTruthParameters(const xAOD::TrackParticle* track); const xAOD::TruthParticle* getTruthParticle( const xAOD::IParticle& p ); diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/IDPerfMuonRefitter.h b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/IDPerfMuonRefitter.h index 3c4221286696c6f7d113d8faae620f27d83ea6e6..5f07ba2ae619ec5a86a12c77ca69f07b90b02464 100755 --- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/IDPerfMuonRefitter.h +++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/IDPerfMuonRefitter.h @@ -8,16 +8,12 @@ //============================================================================== // Include files... //============================================================================== -#include "AthenaMonitoring/ManagedMonitorToolBase.h" #include "AthenaBaseComps/AthAlgorithm.h" #include "GaudiKernel/ToolHandle.h" #include "InDetPerformanceMonitoring/PerfMonServices.h" - - -class IegammaTrkRefitterTool; - +#include "egammaInterfaces/IegammaTrkRefitterTool.h" class IDPerfMuonRefitter : public AthAlgorithm { diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/MuonSelector.h b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/MuonSelector.h index efc419a7152a55b6c2913d89bc80b806965053a4..4b3b7287f9119e8a16ba3079b3ea1abef189d662 100644 --- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/MuonSelector.h +++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/MuonSelector.h @@ -9,10 +9,6 @@ // Include files... //============================================================================== #include "InDetPerformanceMonitoring/EventAnalysis.h" - -#include <map> -#include "TH1.h" - #include "xAODMuon/Muon.h" #include "xAODTracking/Vertex.h" #include "xAODTracking/VertexContainer.h" @@ -58,7 +54,6 @@ class MuonSelector : public EventAnalysis // TrackIsolationTool* m_isolationTool; double m_coneSize; - // Cut variables. To go into a struct. unsigned char m_ucJMuon_Cut; double m_IsoCut; @@ -86,7 +81,6 @@ class MuonSelector : public EventAnalysis bool m_doPtSelection; bool m_doIPSelection; - // Lock cut selection after first muon. bool m_bLock; diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/PerfMonServices.h b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/PerfMonServices.h index 0116f8cfcc92adf754bc4f3576a66b9d75a547e9..779d8ec649fa7eebd0021aade378c173111df328 100644 --- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/PerfMonServices.h +++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/PerfMonServices.h @@ -6,7 +6,6 @@ #ifndef IDPERFMON_SERVICES_H #define IDPERFMON_SERVICES_H -#include "AthenaKernel/IAtRndmGenSvc.h" #include "GaudiKernel/INTupleSvc.h" #include "GaudiKernel/ITHistSvc.h" #include "GaudiKernel/Algorithm.h" @@ -14,6 +13,8 @@ #include "StoreGate/StoreGateSvc.h" #include "StoreGate/StoreGate.h" +class IAtRndmGenSvc; + class PerfMonServices { public: @@ -29,7 +30,6 @@ class PerfMonServices static IMessageSvc* getMessagingService() { return s_pxMessageSvc; } static INTupleSvc* getRootTupleService() { return s_pxNtupleSvc; } static ITHistSvc* getHistogramService() { return s_pxTHistSvc; } - //static IAtRndmGenSvc* getRandomNumberService() { return s_pxAtRndmGenSvc; } enum CONTAINERS { @@ -67,7 +67,7 @@ class PerfMonServices template <class T> static const T* getContainer( CONTAINERS eContainer ) { - const T* pxContainer = NULL; + const T* pxContainer{}; const std::string sContainerName = PerfMonServices::getContainerName( eContainer ); if ( s_pxStoreGateSvc ) @@ -77,18 +77,8 @@ class PerfMonServices { return pxContainer; } - else - { // if that failed then try the Atlfast types. - //pxContainer = NULL; - //const std::string sAtlfastContainerName = Services::getAtlfastContainerName( eContainer ); - - //if ( CheckServiceInit( xStatus, !pxContainer, sAtlfastContainerName ) ) - //{ - // return pxContainer; - //} - } } - return NULL; + return nullptr; } protected: diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/TRT_Electron_Monitoring_Tool.h b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/TRT_Electron_Monitoring_Tool.h index 4449876d681a3c1f35120721311581e251dcefda..0c974e8c61dd7c4e84566ac4b9e135f38e327969 100644 --- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/TRT_Electron_Monitoring_Tool.h +++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/TRT_Electron_Monitoring_Tool.h @@ -8,29 +8,27 @@ #include "GaudiKernel/StatusCode.h" #include "AthenaMonitoring/AthenaMonManager.h" #include "AthenaMonitoring/ManagedMonitorToolBase.h" -#include "InDetReadoutGeometry/TRT_DetectorManager.h" -#include "InDetRIO_OnTrack/TRT_DriftCircleOnTrack.h" -#include "TrkTrack/TrackStateOnSurface.h" #include "xAODTracking/Vertex.h" #include "xAODTracking/VertexContainer.h" -#include "TrkParticleBase/LinkToTrackParticleBase.h" - #include "xAODMuon/Muon.h" -#include "xAODMuon/MuonContainer.h" #include "xAODEgamma/Electron.h" +#include "xAODMuon/MuonContainer.h" #include "xAODEgamma/ElectronContainer.h" #include <vector> #include <string> +namespace InDetDD{ + class TRT_DetectorManager; +} class TH1F_LW; class TH2F_LW; class TProfile_LW; - +class TRT_ID; enum myIsEMType { ISEMLOOSE , ISEMMEDIUM , ISEMTIGHT }; @@ -107,7 +105,6 @@ public: void bookPCandHistograms( MonGroup &monGroup, lw_partcand_hists_t &hists, const std::string& name); void loopOverConversions(std::vector<Trk::Track*> &v_usedTrks); - // const Trk::Track* getTrackFromTrackAtVertex(Trk::VxTrackAtVertex * VxTrkTag); bool conversionQualityCuts(const xAOD::TrackParticle* trkTag, const xAOD::TrackParticle* trkProbe); void loopOverRecElectrons(std::vector<Trk::Track*> &v_usedTrks); diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/ElectronEoverPTracking.py b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/ElectronEoverPTracking.py index 9de3dd15492b83c611bf3e21069c5764f60dab59..50868637b9b5649fc379fbf7683f801fd721cbea 100755 --- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/ElectronEoverPTracking.py +++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/ElectronEoverPTracking.py @@ -170,14 +170,6 @@ GsfExtrapolator = Trk__GsfExtrapolator(name = 'GsfExtra ToolSvc += GsfExtrapolator -from TrkGaussianSumFilter.TrkGaussianSumFilterConf import Trk__BremFind -BremFind = Trk__BremFind(name = 'BremFind', - UseCalibration = True, - ValidationMode = True ) - - -ToolSvc += BremFind - from TrkGaussianSumFilter.TrkGaussianSumFilterConf import Trk__GaussianSumFitter GSFTrackFitter = Trk__GaussianSumFitter(name = 'GSFTrackFitter', ToolForExtrapolation = GsfExtrapolator, @@ -188,8 +180,6 @@ GSFTrackFitter = Trk__GaussianSumFitter(name = 'GSFTrackFitte RefitOnMeasurementBase = True, DoHitSorting = True, ValidationMode = False, - BremFind = BremFind, - runBremFinder = False, OutputLevel = 3) # --- end of fitter loading ToolSvc += GSFTrackFitter diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/EventAnalysis.cxx b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/EventAnalysis.cxx index 7cc4812386a43071f3568fd762a08726f96391a9..d98cb4c66e24ff97100963c44e981404dfa03b7a 100644 --- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/EventAnalysis.cxx +++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/EventAnalysis.cxx @@ -4,8 +4,23 @@ #include "InDetPerformanceMonitoring/EventAnalysis.h" #include "InDetPerformanceMonitoring/PerfMonServices.h" - -#include <sstream> +#include "TH1.h" +#include "TH2.h" +#include "TProfile.h" +#include "TProfile2D.h" + + +namespace{ + template <class HistoArrayType> + void registerHistogramType(const HistoArrayType & h, const std::string &sampleName, const std::string & suffix){ + unsigned int u = 1; + const std::string titleRoot{"/ESD/" + sampleName + suffix}; + for ( auto & thisHisto:h ){ + PerfMonServices::getHistogramService()->regHist( titleRoot + std::to_string(u), thisHisto.second ); + ++u; + } + } +} //============================================================================= // Constructors & Destructors @@ -50,67 +65,13 @@ void EventAnalysis::BookHistograms() //============================================================================= void EventAnalysis::Register() { - // Go off and does whatever the hell Athena does to histograms. - Register_1DHistos(); - Register_2DHistos(); - - Register_1DProfHistos(); - Register_2DProfHistos(); -} - -void EventAnalysis::Register_1DHistos() -{ - // Iterate over all the 1D Histograms - unsigned int u = 1; - std::map<unsigned int, TH1F*>::iterator xIter = m_x1DHistograms.begin(); - - while ( xIter != m_x1DHistograms.end() ) - { - // Set up an appropriate string & cycle the u_int counter. - std::stringstream xTmp; xTmp << u; ++u; - PerfMonServices::getHistogramService()->regHist( "/ESD/" + m_xSampleName + "/1dhisto_" + xTmp.str(), xIter->second ); - xIter++; - } -} - -void EventAnalysis::Register_2DHistos() -{ - // Iterate over all the 2D Histograms - unsigned int u = 1; - std::map<unsigned int, TH2F*>::iterator xIter = m_x2DHistograms.begin(); + // Register histograms in monitoring tool + registerHistogramType(m_x1DHistograms, m_xSampleName, "/1dhisto_"); + registerHistogramType(m_x2DHistograms, m_xSampleName, "/2dhisto_"); - while ( xIter != m_x2DHistograms.end() ) - { - std::stringstream xTmp; xTmp << u; ++u; - PerfMonServices::getHistogramService()->regHist( "/ESD/" + m_xSampleName + "/2dhisto_"+ xTmp.str(), xIter->second ); - xIter++; - } + registerHistogramType(m_x1DProfHistograms, m_xSampleName, "/1dprof_"); + registerHistogramType(m_x2DProfHistograms, m_xSampleName, "/2dprof_"); } -void EventAnalysis::Register_1DProfHistos() -{ - unsigned int u = 1; - std::map<unsigned int, TProfile*>::iterator xIter = m_x1DProfHistograms.begin(); - - while ( xIter != m_x1DProfHistograms.end() ) - { - std::stringstream xTmp; xTmp << u; ++u; - PerfMonServices::getHistogramService()->regHist( "/ESD/" + m_xSampleName + "/1dprof_"+ xTmp.str(), xIter->second ); - xIter++; - } -} - -void EventAnalysis::Register_2DProfHistos() -{ - unsigned int u = 1; - std::map<unsigned int, TProfile2D*>::iterator xIter = m_x2DProfHistograms.begin(); - - while ( xIter != m_x2DProfHistograms.end() ) - { - std::stringstream xTmp; xTmp << u; ++u; - PerfMonServices::getHistogramService()->regHist( "/ESD/" + m_xSampleName + "/2dprof_"+ xTmp.str(), xIter->second ); - xIter++; - } -} //============================================================================= diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonEoverP.cxx b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonEoverP.cxx index f315e20d587b4e17ee2aa28866f687988cebdd0a..8744d24988b77aa251115c2867982ccdf546b812 100755 --- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonEoverP.cxx +++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonEoverP.cxx @@ -1,4 +1,4 @@ -/* + /* Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ @@ -185,86 +185,81 @@ StatusCode IDPerfMonEoverP::initialize() // Electron PID Variables // // Following are of ShowerShapeType - m_PID_ShowerType_Names.push_back( std::make_pair( xAOD::EgammaParameters::f1, "f1")); //0 - m_PID_ShowerType_Names.push_back( std::make_pair( xAOD::EgammaParameters::f1core,"f1core")); //1 - m_PID_ShowerType_Names.push_back( std::make_pair( xAOD::EgammaParameters::emins1,"Emins1")); //2 - m_PID_ShowerType_Names.push_back( std::make_pair( xAOD::EgammaParameters::fracs1,"fside")); //3 - m_PID_ShowerType_Names.push_back( std::make_pair( xAOD::EgammaParameters::e2tsts1,"Emax2"));//4 - m_PID_ShowerType_Names.push_back( std::make_pair( xAOD::EgammaParameters::weta1,"ws3")); //5 - m_PID_ShowerType_Names.push_back( std::make_pair( xAOD::EgammaParameters::wtots1,"wstot"));//6 - m_PID_ShowerType_Names.push_back( std::make_pair( xAOD::EgammaParameters::emaxs1,"emaxs1"));//7 - m_PID_ShowerType_Names.push_back( std::make_pair( xAOD::EgammaParameters::e233,"E233")); //8 - m_PID_ShowerType_Names.push_back( std::make_pair( xAOD::EgammaParameters::e237,"E237")); //9 - m_PID_ShowerType_Names.push_back( std::make_pair( xAOD::EgammaParameters::e277,"E277"));//10 - m_PID_ShowerType_Names.push_back( std::make_pair( xAOD::EgammaParameters::weta2,"weta2"));//11 - m_PID_ShowerType_Names.push_back( std::make_pair( xAOD::EgammaParameters::f3,"f3"));//12 - m_PID_ShowerType_Names.push_back( std::make_pair( xAOD::EgammaParameters::f3core,"f3core"));//13 + namespace xEgamma = xAOD::EgammaParameters; + namespace xIso = xAOD::Iso; + m_PID_ShowerType_Names = { + {xEgamma::f1, "f1"}, + {xEgamma::emins1, "f1core"}, + {xEgamma::fracs1, "fside"}, + {xEgamma::e2tsts1, "Emax2"}, + {xEgamma::weta1, "ws3"}, + {xEgamma::wtots1, "wstot"}, + {xEgamma::emaxs1,"emaxs1"}, + {xEgamma::e233,"E233"}, + {xEgamma::e237,"E237"}, + {xEgamma::e277,"E277"}, + {xEgamma::weta2,"weta2"}, + {xEgamma::f3,"f3"}, + {xEgamma::f3core,"f3core"} + }; // Following are of isolation type - // m_PID_IsolationType_Names.push_back( std::make_pair( xAOD::Iso::etcone45,"Etcone45"));//14 - m_PID_IsolationType_Names.push_back( std::make_pair( xAOD::Iso::etcone20,"Etcone20"));//15 - m_PID_IsolationType_Names.push_back( std::make_pair( xAOD::Iso::etcone30,"Etcone30"));//16 - m_PID_IsolationType_Names.push_back( std::make_pair( xAOD::Iso::etcone40,"Etcone40"));//17 - m_PID_IsolationType_Names.push_back( std::make_pair( xAOD::Iso::ptcone30,"ptcone30")); //18 + m_PID_IsolationType_Names = { + {xIso::etcone20,"Etcone20"}, + {xIso::etcone30,"Etcone30"}, + {xIso::etcone40,"Etcone40"}, + {xIso::ptcone30,"ptcone30"} + }; // Following are of trackcalomatch type - m_PID_TrackCaloMatchType_Names.push_back( std::make_pair( xAOD::EgammaParameters::deltaEta1,"deltaeta1"));//19 - m_PID_TrackCaloMatchType_Names.push_back( std::make_pair( xAOD::EgammaParameters::deltaEta2,"deltaeta2"));//20 - m_PID_TrackCaloMatchType_Names.push_back( std::make_pair( xAOD::EgammaParameters::deltaPhi2,"deltaphi2"));//21 - // m_PID_TrackCaloMatchType_Names.push_back( std::make_pair( xAOD::EgammaParameters::deltaPhiRescaled,"deltaphiRescaled"));//22 - // Following are of summary type - // m_PID_SummaryType_Names.push_back( std::make_pair(xAOD::expectInnermostPixelLayerHit,"expectHitInBLayer"));//23 // throwing an error for some reason - + m_PID_TrackCaloMatchType_Names = { + {xEgamma::deltaEta1,"deltaeta1"}, + {xEgamma::deltaEta2,"deltaeta2"}, + {xEgamma::deltaPhi2,"deltaphi2"} + }; + + // // Trigger // - m_triggerNames.push_back("L1_MBTS_1"); - m_triggerNames.push_back("L1_EM2"); - m_triggerNames.push_back("L1_2EM2"); - m_triggerNames.push_back("L1_2EM4"); - m_triggerNames.push_back("L1_2EM5"); - m_triggerNames.push_back("L1_EM3"); - m_triggerNames.push_back("L1_EM4"); - m_triggerNames.push_back("L1_EM5"); - m_triggerNames.push_back("L1_EM10"); - m_triggerNames.push_back("L1_EM10I"); - m_triggerNames.push_back("L1_EM14"); - m_triggerNames.push_back("L1_EM18"); - m_triggerNames.push_back("L1_EM18I"); - m_triggerNames.push_back("L1_EM23I"); - m_triggerNames.push_back("L1_EM100"); - m_triggerNames.push_back("EF_2e5_medium"); - m_triggerNames.push_back("EF_e10_medium"); - m_triggerNames.push_back("EF_e20_loose"); - m_triggerNames.push_back("EF_em105_passHLT"); - m_triggerNames.push_back("EF_g20_loose"); - m_triggerNames.push_back("EF_e20_medium"); - m_triggerNames.push_back("EF_e22_medium"); - // run 2 test - m_triggerNames.push_back("HLT_e24_lhmedium_idperf_L1EM20VH"); - m_triggerNames.push_back("HLT_e24_medium_L1EM18VH"); - m_triggerNames.push_back("e5_vloose"); - m_triggerNames.push_back("ALL"); - m_triggerNames.push_back("HLT_ALL"); - - + m_triggerNames = { + "L1_MBTS_1", + "L1_EM2", + "L1_2EM2", + "L1_2EM4", + "L1_EM5", + "L1_EM10", + "L1_EM10I", + "L1_EM14", + "L1_EM18", + "L1_EM18I", + "L1_EM23I", + "L1_EM100", + "EF_2e5_medium", + "EF_e10_medium", + "EF_e20_loose", + "EF_em105_passHLT", + "EF_g20_loose", + "EF_e20_medium", + "EF_e22_medium", + //run 2 test + "HLT_e24_lhmedium_idperf_L1EM20VH", + "HLT_e24_medium_L1EM18VH", + "e5_vloose", + "ALL", + "HLT_ALL" + }; + // If the validation nuptle has been requested Setup the ntuple if (m_validationMode){ - if (m_validationTree == 0 ){ // create the new Tree m_validationTree = new TTree(m_validationTreeName.c_str(), m_validationTreeDescription.c_str()); - std::string FitterNames[3] = {"GX2","Refitted1","Refitted2"}; - - m_validationTree->Branch("runNumber" , &m_runNumber, "runNumber/I"); m_validationTree->Branch("eventNumber" , &m_evtNumber, "eventNumber/I"); m_validationTree->Branch("lumi_block" , &m_lumi_block, "lumi_block/I"); - - // counter for number of electrons m_validationTree->Branch("nElectrons" , &m_nelectrons, "nElectrons/I"); - // Track fitter information for(int fitter(0); fitter < 3; ++fitter){ m_validationTree->Branch(std::string(FitterNames[fitter]+"_Theta").c_str() , m_electronTheta[fitter], std::string(FitterNames[fitter]+"_Theta0[nElectrons]/F").c_str() ); @@ -360,8 +355,6 @@ StatusCode IDPerfMonEoverP::initialize() m_smallValidationTree->Branch("ClusterEta" ,&m_smallClusterEta,"ClusterEta/D"); m_smallValidationTree->Branch("ClusterPhi" ,&m_smallClusterPhi,"ClusterPhi/D"); m_smallValidationTree->Branch("TrackTheta" ,&m_smallTrackTheta,"TrackTheta/D"); - //m_smallValidationTree->Branch("d0" ,&m_smalld0,"d0/D"); - //m_smallValidationTree->Branch("z0" ,&m_smallz0,"z0/D"); } // now register the Tree @@ -382,7 +375,6 @@ StatusCode IDPerfMonEoverP::initialize() delete m_smallValidationTree; m_smallValidationTree = 0; m_validationMode = false; } else { - m_ZeeLooseMassOS_Cluster = new TH1F("ZeeMassLooseOS","ZeeMassLooseOS", 120, 60000 ,120000); m_ZeeLooseMassSS_Cluster = new TH1F("ZeeMassLooseSS","ZeeMassLooseSS", 120, 60000 ,120000); m_ZeeMediumMassOS_Cluster = new TH1F("ZeeMassMediumOS","ZeeMassMediumOS", 120, 60000 ,120000); @@ -397,34 +389,23 @@ StatusCode IDPerfMonEoverP::initialize() m_ZeeMediumOS_ClusterPtEta = new TH2F("ZeeMediumOS_ClusterPtEta", "ZeeMediumOS_ClusterPtEta",100,20000,120000,50,-2.5,2.5); m_WenuTightElectron_PTEtaPos = new TH2F("WenuTightElectron_PTEtaPos", "WenuTightElectron_PTEtaPos",100,20000,120000,50,-2.5,2.5); m_WenuTightElectron_PTEtaNeg = new TH2F("WenuTightElectron_PTEtaNeg", "WenuTightElectron_PTEtaNeg",100,20000,120000,50,-2.5,2.5); - - if ( (tHistSvc->regHist(m_smallValidationTreeFolder + "/ZeeMassLooseOS",m_ZeeLooseMassOS_Cluster )).isFailure() ) - ATH_MSG_ERROR("initialize() Could not register histogram "); - if ( (tHistSvc->regHist(m_smallValidationTreeFolder + "/ZeeMassLooseSS",m_ZeeLooseMassSS_Cluster )).isFailure() ) - ATH_MSG_ERROR("initialize() Could not register histogram "); - if ( (tHistSvc->regHist(m_smallValidationTreeFolder + "/ZeeMassMediumOS",m_ZeeMediumMassOS_Cluster )).isFailure() ) - ATH_MSG_ERROR("initialize() Could not register histogram "); - if ( (tHistSvc->regHist(m_smallValidationTreeFolder + "/ZeeMassMediumSS",m_ZeeMediumMassSS_Cluster )).isFailure() ) - ATH_MSG_ERROR("initialize() Could not register histogram "); - if ( (tHistSvc->regHist(m_smallValidationTreeFolder + "/WenuLooseElectronET",m_WenuLooseElectronET )).isFailure() ) - ATH_MSG_ERROR("initialize() Could not register histogram "); - if ( (tHistSvc->regHist(m_smallValidationTreeFolder + "/WenuTight_Met",m_WenuTight_Met )).isFailure() ) - ATH_MSG_ERROR("initialize() Could not register histogram "); - if ( (tHistSvc->regHist(m_smallValidationTreeFolder + "/WenuTight_MT",m_WenuTight_MT )).isFailure() ) - ATH_MSG_ERROR("initialize() Could not register histogram "); - if ( (tHistSvc->regHist(m_smallValidationTreeFolder + "/WenuTightMet_MT",m_WenuTightMet_MT )).isFailure() ) - ATH_MSG_ERROR("initialize() Could not register histogram "); - if ( (tHistSvc->regHist(m_smallValidationTreeFolder + "/WenuTightElectronET",m_WenuTightElectronET )).isFailure() ) - ATH_MSG_ERROR("initialize() Could not register histogram "); - if ( (tHistSvc->regHist(m_smallValidationTreeFolder + "/WenuTightW_PT",m_WenuTightW_PT )).isFailure() ) - ATH_MSG_ERROR("initialize() Could not register histogram "); - if ( (tHistSvc->regHist(m_smallValidationTreeFolder + "/ZeeMediumOS_ClusterPtEta",m_ZeeMediumOS_ClusterPtEta )).isFailure() ) - ATH_MSG_ERROR("initialize() Could not register histogram "); - if ( (tHistSvc->regHist(m_smallValidationTreeFolder + "/WenuTightElectron_PTEtaPos",m_WenuTightElectron_PTEtaPos )).isFailure() ) - ATH_MSG_ERROR("initialize() Could not register histogram "); - if ( (tHistSvc->regHist(m_smallValidationTreeFolder + "/WenuTightElectron_PTEtaNeg",m_WenuTightElectron_PTEtaNeg )).isFailure() ) - ATH_MSG_ERROR("initialize() Could not register histogram "); - + + bool somethingFailed{}; + somethingFailed |= ( (tHistSvc->regHist(m_smallValidationTreeFolder + "/ZeeMassLooseOS",m_ZeeLooseMassOS_Cluster )).isFailure() ); + somethingFailed |=( (tHistSvc->regHist(m_smallValidationTreeFolder + "/ZeeMassLooseSS",m_ZeeLooseMassSS_Cluster )).isFailure() ); + somethingFailed |=( (tHistSvc->regHist(m_smallValidationTreeFolder + "/ZeeMassMediumOS",m_ZeeMediumMassOS_Cluster )).isFailure() ); + somethingFailed |=( (tHistSvc->regHist(m_smallValidationTreeFolder + "/ZeeMassMediumSS",m_ZeeMediumMassSS_Cluster )).isFailure() ); + somethingFailed |=( (tHistSvc->regHist(m_smallValidationTreeFolder + "/WenuLooseElectronET",m_WenuLooseElectronET )).isFailure() ); + somethingFailed |=( (tHistSvc->regHist(m_smallValidationTreeFolder + "/WenuTight_Met",m_WenuTight_Met )).isFailure() ); + somethingFailed |=( (tHistSvc->regHist(m_smallValidationTreeFolder + "/WenuTight_MT",m_WenuTight_MT )).isFailure() ); + somethingFailed |=( (tHistSvc->regHist(m_smallValidationTreeFolder + "/WenuTightMet_MT",m_WenuTightMet_MT )).isFailure() ); + somethingFailed |=( (tHistSvc->regHist(m_smallValidationTreeFolder + "/WenuTightElectronET",m_WenuTightElectronET )).isFailure() ); + somethingFailed |=( (tHistSvc->regHist(m_smallValidationTreeFolder + "/WenuTightW_PT",m_WenuTightW_PT )).isFailure() ); + somethingFailed |=( (tHistSvc->regHist(m_smallValidationTreeFolder + "/ZeeMediumOS_ClusterPtEta",m_ZeeMediumOS_ClusterPtEta )).isFailure() ); + somethingFailed |=( (tHistSvc->regHist(m_smallValidationTreeFolder + "/WenuTightElectron_PTEtaPos",m_WenuTightElectron_PTEtaPos )).isFailure() ); + somethingFailed |=( (tHistSvc->regHist(m_smallValidationTreeFolder + "/WenuTightElectron_PTEtaNeg",m_WenuTightElectron_PTEtaNeg )).isFailure() ); + if (somethingFailed) ATH_MSG_ERROR("initialize() Could not register histogram "); + ATH_MSG_INFO("Booked Small Tree add histograms"); } @@ -467,7 +448,6 @@ StatusCode IDPerfMonEoverP::initialize() StatusCode lht = m_LHToolTight2015->initialize(); if(lht.isFailure()) ATH_MSG_WARNING("Tight electron likelihood tool initialize() failed!"); - ATH_MSG_INFO( "Initialization completed successfully"); return StatusCode::SUCCESS; @@ -477,7 +457,6 @@ StatusCode IDPerfMonEoverP::initialize() StatusCode IDPerfMonEoverP::finalize() { - return StatusCode::SUCCESS; } @@ -486,14 +465,12 @@ StatusCode IDPerfMonEoverP::finalize() StatusCode IDPerfMonEoverP::execute() { ATH_MSG_DEBUG( "Executing IDPerfMonEoverP" ); - StatusCode sc(StatusCode::SUCCESS); - m_trackParticleVertexMap.clear(); m_primaryVertexFirstCandidate = 0; - - if (m_validationMode) clearValidationNtuple(); - else{ + if (m_validationMode){ + clearValidationNtuple(); + }else{ ATH_MSG_WARNING( " Validation Mode has been turned off ALG will do not fill Ntuples" ); return sc; } @@ -511,7 +488,6 @@ StatusCode IDPerfMonEoverP::execute() ATH_MSG_DEBUG("Retrieved Trigger info."); fillTriggerInformation(); - if ( fillVertexInformation() ){ ATH_MSG_DEBUG("Retrieved Primary Vertex info."); } else { @@ -521,10 +497,6 @@ StatusCode IDPerfMonEoverP::execute() ATH_MSG_DEBUG("MET info.being stored"); if( storeMETinformation() ) ATH_MSG_DEBUG("MET info. stored"); - - - - // Get the electron AOD container const xAOD::ElectronContainer* ElectronInput_container; @@ -536,7 +508,7 @@ StatusCode IDPerfMonEoverP::execute() } - if (ElectronInput_container->size() < 1 ){ + if (ElectronInput_container->empty() ){ deleteAction(); return StatusCode::SUCCESS; } @@ -551,50 +523,48 @@ StatusCode IDPerfMonEoverP::execute() // Loop over the Electrons ATH_MSG_DEBUG("Electron info. being stored"); - //std::cout << "No Electrons: " << ElectronInput_container->size() <<std::endl; for(; iter != iterEnd ; iter++) { - if (m_electronCounter >= NOS_ELECTRONS) break; - - //if ((*iter)->author() == 8) continue; - const xAOD::Electron *ELE = (*iter); - m_author[m_electronCounter] = ELE->author(xAOD::EgammaParameters::AuthorElectron); + const xAOD::Electron *pThisElectron = (*iter); + m_author[m_electronCounter] = pThisElectron->author(xAOD::EgammaParameters::AuthorElectron); // Cluster Info - fillElectronInfo ( ELE ); + fillElectronInfo ( pThisElectron ); // Fill General info - fillGeneral( ELE ); + fillGeneral( pThisElectron ); // Fill IsEm info - fillIsEM( ELE ); + fillIsEM( pThisElectron ); //Get the track particle const xAOD::TrackParticle* mytp = (*iter)->trackParticle(); + if(mytp){ uint8_t dummy(-1); - m_nTRT[m_electronCounter] = mytp->summaryValue( dummy , xAOD::numberOfTRTHits )? dummy :-1; - m_nSCT[m_electronCounter] = mytp->summaryValue( dummy , xAOD::numberOfSCTHits )? dummy :-1; - m_nPIX[m_electronCounter] = mytp->summaryValue( dummy , xAOD::numberOfPixelHits )? dummy :-1; - m_nBLayer[m_electronCounter] = mytp->summaryValue( dummy , xAOD::numberOfInnermostPixelLayerHits)? dummy :-1; - m_nTRTout[m_electronCounter] = mytp->summaryValue( dummy , xAOD::numberOfTRTOutliers)? dummy :-1; - m_nSCTout[m_electronCounter] = mytp->summaryValue( dummy , xAOD::numberOfSCTOutliers)? dummy :-1; - m_nTRTHT[m_electronCounter] = mytp->summaryValue( dummy , xAOD::numberOfTRTHighThresholdHits)? dummy :-1; - m_nTRTHTout[m_electronCounter] = mytp->summaryValue( dummy , xAOD::numberOfTRTHighThresholdOutliers)? dummy :-1; + auto summaryByDetector=[&mytp,&dummy]( const xAOD::SummaryType & t){ + return mytp->summaryValue(dummy, t) ? (dummy) : (-1); + }; + m_nTRT[m_electronCounter] = summaryByDetector( xAOD::numberOfTRTHits ); + m_nSCT[m_electronCounter] = summaryByDetector( xAOD::numberOfSCTHits ); + m_nPIX[m_electronCounter] = summaryByDetector( xAOD::numberOfPixelHits ); + m_nBLayer[m_electronCounter] = summaryByDetector( xAOD::numberOfInnermostPixelLayerHits); + m_nTRTout[m_electronCounter] = summaryByDetector( xAOD::numberOfTRTOutliers); + m_nSCTout[m_electronCounter] = summaryByDetector( xAOD::numberOfSCTOutliers); + m_nTRTHT[m_electronCounter] = summaryByDetector( xAOD::numberOfTRTHighThresholdHits); + m_nTRTHTout[m_electronCounter] = summaryByDetector( xAOD::numberOfTRTHighThresholdOutliers); } else{ ATH_MSG_DEBUG("Electron with no track particle?? Possibly Forward"); continue; } //Find which if any vertex the electron track is associated to - VxPos myVxPos = findAssociatedVertex( (*iter) ); + VxPos myVxPos = findAssociatedVertex( pThisElectron ); m_associatedToVtx[m_electronCounter] = myVxPos.second; - - if( mytp->track() ){ const Trk::Track* oTrkTrack = mytp->track(); if (oTrkTrack){ const Trk::Perigee* oMeasPer = oTrkTrack->perigeeParameters() ; - if (oMeasPer) addToValidationNtuple( oMeasPer, (*iter)->caloCluster(), 0 ); + if (oMeasPer) addToValidationNtuple( oMeasPer, pThisElectron->caloCluster(), 0 ); fillLastMeasurement( oTrkTrack , 0 ); } } @@ -602,59 +572,51 @@ StatusCode IDPerfMonEoverP::execute() if(m_refitEverything) { // First Refitter................ - ATH_MSG_DEBUG( "Refitting the track" ); + IegammaTrkRefitterTool::Cache cache1{}; - StatusCode sc = m_TrackRefitter->refitElectronTrack( (*iter),cache1); + StatusCode sc = m_TrackRefitter->refitElectronTrack( pThisElectron,cache1); if (sc == StatusCode::SUCCESS){ Trk::Track* trkTrack= cache1.refittedTrack.release(); m_refittedTracks_no1->push_back(trkTrack); - addToValidationNtuple( cache1.refittedTrackPerigee ,(*iter)->caloCluster(), 1 ); + addToValidationNtuple( cache1.refittedTrackPerigee ,pThisElectron->caloCluster(), 1 ); fillLastMeasurement(trkTrack, 1 ); } else { ATH_MSG_DEBUG( "Track Refit Failed" ); } - - //******************************************************// // Refit tracks using the second refitter if it is present //******************************************************// ATH_MSG_DEBUG( "Refitting the track again" ); IegammaTrkRefitterTool::Cache cache2{}; - sc = m_TrackRefitter_no2->refitElectronTrack( (*iter),cache2 ); - + sc = m_TrackRefitter_no2->refitElectronTrack( pThisElectron,cache2 ); if (sc == StatusCode::SUCCESS){ Trk::Track* trkTrack= cache2.refittedTrack.release(); //Add the refitted track to the TrackCollection m_refittedTracks_no2->push_back( trkTrack ); //Add data to the trkRefitterNtuple - addToValidationNtuple( cache2.refittedTrackPerigee ,(*iter)->caloCluster(), 2 ); + + addToValidationNtuple( cache2.refittedTrackPerigee ,pThisElectron->caloCluster(), 2 ); fillLastMeasurement( trkTrack, 2 ); } else { ATH_MSG_DEBUG( "Track Refit Failed" ); } } else { - ATH_MSG_DEBUG( "Not Refitting the track -- DO NOTHING" ); - }//End if >6 silicon hits; //Increment the electron counter for the validation nutple ++m_electronCounter; } - // Commit Data to Ntuple; if( m_validationMode ) validationAction(); - // Fill much smaller tree std::vector<int> goodElectrons = FillSimpleTree(); - - TrackCollection* selectedElectrons = new TrackCollection; - for( unsigned int i(0); i < goodElectrons.size(); ++i){ + for( const auto & thisGoodElectron: goodElectrons){ IegammaTrkRefitterTool::Cache cache{}; - StatusCode sc = m_TrackRefitter->refitElectronTrack( (*ElectronInput_container)[goodElectrons[i]],cache ); + StatusCode sc = m_TrackRefitter->refitElectronTrack( (*ElectronInput_container)[thisGoodElectron],cache ); if (sc == StatusCode::SUCCESS){ Trk::Track* trkTrack= cache.refittedTrack.release(); selectedElectrons->push_back(trkTrack); @@ -672,7 +634,7 @@ StatusCode IDPerfMonEoverP::execute() delete selectedElectrons; return (StatusCode::FAILURE); } - + // sc = evtStore()->record( m_refittedTracks_no2, m_OutputTrackCollectionName_no2, false ); if (sc.isFailure()) { @@ -680,7 +642,7 @@ StatusCode IDPerfMonEoverP::execute() delete selectedElectrons; return (StatusCode::FAILURE); } - + // sc = evtStore()->record( selectedElectrons, m_OutputTrackCollectionName_no1 + "Selected", false ); if (sc.isFailure()) { @@ -688,10 +650,7 @@ StatusCode IDPerfMonEoverP::execute() delete selectedElectrons; return (StatusCode::FAILURE); } - - ATH_MSG_DEBUG( "execute completed successfully"); - return StatusCode::SUCCESS; } @@ -699,21 +658,19 @@ void IDPerfMonEoverP::addToValidationNtuple(const Trk::Perigee* perigee,const xA if (perigee){ ATH_MSG_DEBUG( "Adding data to ntuple" ); if (isOriginal >= 0 && isOriginal <3){ - m_electrond0[isOriginal][m_electronCounter] = perigee->parameters()[Trk::d0]; m_electronz0[isOriginal][m_electronCounter] = perigee->parameters()[Trk::z0]; m_electronPhi[isOriginal][m_electronCounter] = perigee->parameters()[Trk::phi0]; m_electronTheta[isOriginal][m_electronCounter]= perigee->parameters()[Trk::theta]; m_electronQoverP[isOriginal][m_electronCounter]= perigee->parameters()[Trk::qOverP]; - - + // const AmgSymMatrix(5)* matrix = perigee->covariance(); if (matrix){ - m_electronErrd0[isOriginal][m_electronCounter] =sqrt( (*matrix)(Trk::d0,Trk::d0) ); - m_electronErrz0[isOriginal][m_electronCounter] = sqrt( (*matrix)(Trk::z0,Trk::z0) ); - m_electronErrPhi[isOriginal][m_electronCounter] = sqrt( (*matrix)(Trk::phi0,Trk::phi0) ); - m_electronErrTheta[isOriginal][m_electronCounter]= sqrt( (*matrix)(Trk::theta,Trk::theta) ); - m_electronErrQoverP[isOriginal][m_electronCounter]= sqrt( (*matrix)(Trk::qOverP,Trk::qOverP) ); + m_electronErrd0[isOriginal][m_electronCounter] =std::sqrt( (*matrix)(Trk::d0,Trk::d0) ); + m_electronErrz0[isOriginal][m_electronCounter] = std::sqrt( (*matrix)(Trk::z0,Trk::z0) ); + m_electronErrPhi[isOriginal][m_electronCounter] = std::sqrt( (*matrix)(Trk::phi0,Trk::phi0) ); + m_electronErrTheta[isOriginal][m_electronCounter]= std::sqrt( (*matrix)(Trk::theta,Trk::theta) ); + m_electronErrQoverP[isOriginal][m_electronCounter]= std::sqrt( (*matrix)(Trk::qOverP,Trk::qOverP) ); } } } else { @@ -729,36 +686,27 @@ void IDPerfMonEoverP::addToValidationNtuple(const Trk::Perigee* perigee,const xA void IDPerfMonEoverP::fillIsEM(const xAOD::Electron *eg) const { - ATH_MSG_DEBUG( "fillIsEM" ); int el_goodOQ = (int)eg->isGoodOQ(xAOD::EgammaParameters::BADCLUSELECTRON); - m_isGoodOQ[m_electronCounter] = el_goodOQ; - // check loose LH bool val_loose = (bool) m_LHToolLoose2015->accept(eg); ATH_MSG_DEBUG( "Loose value : " << val_loose); - //if(eg->passSelection(val_loose, "Loose")) { if(val_loose){ - //ATH_MSG_DEBUG( "Loose selection exists"); m_IsEMLoose[m_electronCounter] = val_loose; }//else{ATH_MSG_DEBUG("Loose electron not defined !");} // check medium LH bool val_med = (bool) m_LHToolMedium2015->accept(eg); ATH_MSG_DEBUG( "Medium value : " << val_med ); - //if(eg->passSelection(val_med, "Medium")) { if(val_med){ - //ATH_MSG_DEBUG( "Medium selection exists"); m_IsEMMedium[m_electronCounter] = val_med; }//else{ATH_MSG_DEBUG("Mediu, electron not defined !");} // check tight LH bool val_tight = (bool) m_LHToolTight2015->accept(eg); ATH_MSG_DEBUG( "Tight value : " << val_tight); - //if(eg->passSelection(val_tight, "Tight")) { if(val_tight){ - //ATH_MSG_DEBUG( "Tight selection exists"); m_IsEMTight[m_electronCounter] = val_tight; }//else{ATH_MSG_DEBUG("Tight electron not defined !");} return; @@ -782,7 +730,6 @@ void IDPerfMonEoverP::fillGeneral(const xAOD::Electron *eg) const void IDPerfMonEoverP::clearValidationNtuple() { ATH_MSG_DEBUG( "clearValidationNtuple" ); - for (int i = 0 ; i < NOS_ELECTRONS ; ++i){ for (int j = 0 ; j <3 ; ++j){ m_electrond0[j][i] = 0; @@ -896,18 +843,13 @@ bool IDPerfMonEoverP::storeMETinformation() const bool IDPerfMonEoverP::passMETCleaningCuts() const { - - - const xAOD::JetContainer* jetTDS = 0; - + const xAOD::JetContainer* jetTDS = nullptr; StatusCode sc= evtStore()->retrieve( jetTDS, m_jetContainerName); if( sc.isFailure() || !jetTDS ) { ATH_MSG_WARNING("No " << m_jetContainerName << " jet container found in TDS"); return false; } - - if (jetTDS->size() == 0) return true; - + if (jetTDS->empty()) return true; bool cleanJet = true; for(const auto* jet_elem : *jetTDS ) { if(!m_jetCleaningTool->keep( *jet_elem )) cleanJet=false; @@ -916,70 +858,6 @@ bool IDPerfMonEoverP::passMETCleaningCuts() const return cleanJet; } - - -// bool badMET = false; - -// xAOD::JetContainer::const_iterator jetItr = jetTDS->begin(); -//xAOD::JetContainer::const_iterator jetItrE = jetTDS->end(); - - -//for(; jetItr != jetItrE; ++jetItr) -// { -// double jetpt= (*jetItr)->pt(P4SignalState::JETFINAL); -// if (jetpt<=20000) continue; -// if (JetCaloQualityUtils::isBad( (*jetItr), false ) ) badMET =true; -// if (badMET) break; -// } -//return !badMET; -// } - - // ATH_MSG_WARNING("Need to reimplement MET CLeaning for xAOD "); - // return true; - //MET cleaning - // bool isBad = false; - // const xAOD::JetContainer *jetTDS(0); - //// bool printedErrorJetCollection = false; - //if (evtStore()->contains<xAOD::JetContainer>(m_jetContainerName)) { - //StatusCode sc= evtStore()->retrieve( jetTDS, m_jetContainerName); - //if( sc.isFailure() || !jetTDS ) { - // ATH_MSG_WARNING("No " <<m_jetContainerName << " jet container found in TDS"); - // isBad=true; - // return false; - //} - - //if (jetTDS->size() == 0) return true; - //// else{ - //// ATH_MSG_WARNING("Could not find JetContainer"); - //// if (!printedErrorJetCollection) ATH_MSG_WARNING( "No jet collection found in TDS" ); - //// printedErrorJetCollection = true; - //// isBad = true; - //// return StatusCode::SUCCESS; - //// } - //ATH_MSG_DEBUG( "JetCollection successfully retrieved" ); - //return true; - //} - //else{ - //return true; - //} - //} - -// bool badMET = false; - -// JetCollection::const_iterator jetItr = jetTDS->begin(); -// JetCollection::const_iterator jetItrE = jetTDS->end(); -// for(const auto* jet_elem : *jetTDS ) { -// for(; jetItr != jetItrE; ++jetItr) -// { -// const xAOD::Jet *jet = jet_elem; -// double jetpt= jet->pt(P4SignalState::JETFINAL); -// if (jetpt<=20000) continue; -// if (JetCaloQualityUtils::isBad( jet, false ) ) badMET =true; -// if (badMET) break; -//} -//return !badMET; -//} - bool IDPerfMonEoverP::fillVertexInformation() const { ATH_MSG_DEBUG( "fillVertexInformation()" ); @@ -1002,7 +880,7 @@ bool IDPerfMonEoverP::fillVertexInformation() const int nbtk = 0; const std::vector< ElementLink< xAOD::TrackParticleContainer > > tpLinks = vxI->trackParticleLinks(); float sumpt = 0.; - if(tpLinks.size() > 0) { + if(not tpLinks.empty()) { nbtk = tpLinks.size(); for(const auto& tp_elem : tpLinks ){ const xAOD::TrackParticle* trk = *tp_elem; @@ -1031,12 +909,7 @@ bool IDPerfMonEoverP::fillVertexInformation() const m_pvx[npv] = primaryVertex->position().x(); m_pvy[npv] = primaryVertex->position().y(); m_pvz[npv] = primaryVertex->position().z(); - //m_errpvx[npv] = sqrt( (primaryVertex->covariancePosition())(Trk::x,Trk::x)); - //m_errpvy[npv] = sqrt( (primaryVertex->covariancePosition())(Trk::y,Trk::y)); - //m_errpvz[npv] = sqrt( (primaryVertex->covariancePosition())(Trk::z,Trk::z)); - //m_covpvxpvy[npv] = (primaryVertex->covariancePosition())(Trk::x,Trk::y); - //m_covpvypvz[npv] = (primaryVertex->covariancePosition())(Trk::y,Trk::z); - //m_covpvzpvx[npv] = (primaryVertex->covariancePosition())(Trk::z,Trk::x); + } ++npv; } else { @@ -1058,11 +931,8 @@ bool IDPerfMonEoverP::fillVertexInformation() const VxPos IDPerfMonEoverP::findAssociatedVertex(const xAOD::Electron* eg) const { ATH_MSG_VERBOSE("In findAssociatedVertex()"); - std::map<const xAOD::TrackParticle*, VxPos>::iterator tpVx = m_trackParticleVertexMap.find(eg->trackParticle()); - - if (tpVx == m_trackParticleVertexMap.end() ){ return std::make_pair( m_primaryVertexFirstCandidate,-1 ); } else @@ -1070,60 +940,15 @@ VxPos IDPerfMonEoverP::findAssociatedVertex(const xAOD::Electron* eg) const } -///////////////////////////////////////////////////////////////// -///////////////////////////////////////////////////////////////// -//get the TrackParticleBase, TrackParticleBase points back to the original track on ESD for all hypos and this has the original tracks, not the ones modified by the vertex fit -///////////////////////////////////////////////////////////////// -///////////////////////////////////////////////////////////////// -//const xAOD::TrackParticle* IDPerfMonEoverP::getTrackParticle(const Trk::VxTrackAtVertex *trkAtVx)const -// { - -// //find the link to the TrackParticleBase -// const Trk::ITrackLink* trkLink = trkAtVx->trackOrParticleLink(); -// const Trk::TrackParticleBase* trkPB(0); -// if(0!= trkLink){ -// const Trk::LinkToTrackParticleBase* linktrkPB = dynamic_cast<const Trk::LinkToTrackParticleBase *>(trkLink); -// if(0!= linktrkPB){ -// if(linktrkPB->isValid()) trkPB = linktrkPB->cachedElement(); -// }//end of dynamic_cast check -// }//end of ITrackLink existance check - -// //cast to TrackParticle -// if(trkPB){ -// const xAOD::TrackParticle* trkP = dynamic_cast<const xAOD::TrackParticle*>(trkPB); -// return trkP; -// }else{ -// return 0; -// } -// } - void IDPerfMonEoverP::fillTriggerInformation() const { ATH_MSG_VERBOSE("In fillTriggerInformation()"); - - //std::cout << "Filling Trigger Info!" << std::endl; ATH_MSG_DEBUG( "Pass state All = " << m_trigDec->isPassed( ".*" ) ); ATH_MSG_DEBUG( "Pass state L1 = " << m_trigDec->isPassed( "L1_.*" ) ); ATH_MSG_DEBUG( "Pass state L2 = " << m_trigDec->isPassed( "L2_.*" ) ); ATH_MSG_DEBUG( "Pass state EF = " << m_trigDec->isPassed( "EF_.*" ) ); ATH_MSG_DEBUG("HLT_.* is passed: " << m_trigDec->isPassed("HLT_.*")); - - /// - // auto cg = m_trigDec->getChainGroup("HLT_.*"); - //auto feat = cg->features(); - - //std::vector<Trig::Feature<xAOD::TrigElectronContainer> > el_feats = feat.get<xAOD::TrigElectronContainer>(); - //ATH_MSG_INFO("found " << el_feats.size() << " el features"); - - //for(auto& feat : el_feats){ - // cout << " -> TrigElectronContainer: " << feat.label() << endl; - // for(auto e : *feat.cptr()){ - // ATH_MSG_INFO("feature pointing to: " << feat.cptr() << " pt: " << e->pt()); - // } - //} - /// - for (unsigned int i=0; i < m_triggerNames.size(); ++i){ if(m_triggerNames[i] == "ALL") m_trigger[i] = m_trigDec->isPassed(".*"); @@ -1142,10 +967,6 @@ void IDPerfMonEoverP::fillElectronInfo (const xAOD::Electron *p) const float dummy(-1); m_ePID_ShowerType[i][m_electronCounter] = static_cast<float> (p->showerShapeValue( dummy, m_PID_ShowerType_Names[i].first ))? dummy :-1; } - // for (size_t i = 0; i < m_PID_IsolationType_Names.size(); i++) { - // float dummy(-1); - // m_ePID_IsolationType[i][m_electronCounter] = static_cast<float> (p.isolationValue( dummy, m_PID_IsolationType_Names[i].first ))? dummy :-1; - // } for (size_t i = 0; i < m_PID_TrackCaloMatchType_Names.size(); i++) { float dummy(-1); m_ePID_TrackCaloMatchType[i][m_electronCounter] = static_cast<float> (p->trackCaloMatchValue( dummy, m_PID_TrackCaloMatchType_Names[i].first ))? dummy :-1; @@ -1217,16 +1038,15 @@ bool IDPerfMonEoverP::passZeeSelection(std::vector<int>& electrons) //Loose electron selection std::vector<int> goodLooseElectrons; - // std::cout << " N electrons " << m_nelectrons <<std::endl; for(int ele=0; ele<m_nelectrons; ele++){ //Loose electron selection if (!m_IsEMLoose[ele]) continue; //Pt - double clusterEt = cosh( m_ClusterEta[ele] ) != 0 ? m_ClusterEnergy[ele] / cosh( m_ClusterEta[ele] ) : 0.; + double clusterEt = cosh( m_ClusterEta[ele] ) != 0 ? m_ClusterEnergy[ele] / std::cosh( m_ClusterEta[ele] ) : 0.; if (clusterEt <= 25000) continue; //Range - double absEta = fabs(m_ClusterEta[ele]); + double absEta = std::fabs(m_ClusterEta[ele]); if (absEta >= 2.47 || ( absEta >= 1.37 && absEta <= 1.52 )) continue; //OTx ... @@ -1318,10 +1138,10 @@ bool IDPerfMonEoverP::passWenuSelection(std::vector<int>& electrons) //Loose electron selection if (!m_IsEMLoose[ele]) continue; //Pt - double clusterEt = cosh( m_ClusterEta[ele] ) != 0 ? m_ClusterEnergy[ele] / cosh( m_ClusterEta[ele] ) : 0.; + double clusterEt = cosh( m_ClusterEta[ele] ) != 0 ? m_ClusterEnergy[ele] / std::cosh( m_ClusterEta[ele] ) : 0.; if (clusterEt <= 25000) continue; //Range - double absEta = fabs(m_ClusterEta[ele]); + double absEta = std::fabs(m_ClusterEta[ele]); if (absEta >= 2.47 || ( absEta >= 1.37 && absEta <= 1.52 ) ) continue; //OTx ... if(!m_isGoodOQ[ele]) continue; @@ -1358,11 +1178,11 @@ bool IDPerfMonEoverP::passWenuSelection(std::vector<int>& electrons) return false; double metphi = atan2(m_missingEty,m_missingEtx); - double trackEt = m_ClusterEnergy[tightElectron]*sin(m_electronTheta[0][tightElectron]); - double clusterEt = cosh( m_ClusterEta[tightElectron] ) !=0 ? m_ClusterEnergy[tightElectron] / cosh( m_ClusterEta[tightElectron] ) : 0.; + double trackEt = m_ClusterEnergy[tightElectron]*std::sin(m_electronTheta[0][tightElectron]); + double clusterEt = std::cosh( m_ClusterEta[tightElectron] ) !=0 ? m_ClusterEnergy[tightElectron] / std::cosh( m_ClusterEta[tightElectron] ) : 0.; double massT = 2*m_missingEt*trackEt*(1-cos(m_electronPhi[0][tightElectron]-metphi)); - if(massT > 0) massT =sqrt(massT); + if(massT > 0) massT =std::sqrt(massT); else massT = 0; @@ -1376,11 +1196,11 @@ bool IDPerfMonEoverP::passWenuSelection(std::vector<int>& electrons) m_WenuTightElectronET->Fill(clusterEt); - double sumpx = m_ClusterEnergy[tightElectron]*sin( m_electronPhi[0][tightElectron] ) * sin(m_electronTheta[0][tightElectron]) + m_missingEtx; - double sumpy = m_ClusterEnergy[tightElectron]*cos( m_electronPhi[0][tightElectron] ) * sin(m_electronTheta[0][tightElectron]) + m_missingEty; + double sumpx = m_ClusterEnergy[tightElectron]*std::sin( m_electronPhi[0][tightElectron] ) * std::sin(m_electronTheta[0][tightElectron]) + m_missingEtx; + double sumpy = m_ClusterEnergy[tightElectron]*std::cos( m_electronPhi[0][tightElectron] ) * std::sin(m_electronTheta[0][tightElectron]) + m_missingEty; double wpt = sumpx*sumpx +sumpy*sumpy - massT*massT; - if(wpt > 0) wpt =sqrt(wpt); + if(wpt > 0) wpt =std::sqrt(wpt); else wpt = 0; m_WenuTightW_PT->Fill(wpt); @@ -1401,25 +1221,14 @@ double IDPerfMonEoverP::getMassCluster(int el1, int el2) { ATH_MSG_VERBOSE("In getMassCluster()"); double ELECTRON_MASS = 0.5109989; //MeV - - TLorentzVector v0,v1; - - double pt1 = m_ClusterEnergy[el1]*sin(m_electronTheta[0][el1]); - double pt2 = m_ClusterEnergy[el2]*sin(m_electronTheta[0][el2]); - - double eta1 = -log( tan(m_electronTheta[0][el1] /2) ); - double eta2 = -log( tan(m_electronTheta[0][el2] /2) ); - - v0.SetPtEtaPhiM(pt1, - eta1, - m_electronPhi[0][el1], ELECTRON_MASS); - v1.SetPtEtaPhiM(pt2, - eta2, - m_electronPhi[0][el2], ELECTRON_MASS); - + double pt1 = m_ClusterEnergy[el1]*std::sin(m_electronTheta[0][el1]); + double pt2 = m_ClusterEnergy[el2]*std::sin(m_electronTheta[0][el2]); + double eta1 = -std::log( std::tan(m_electronTheta[0][el1] * 0.5) ); + double eta2 = -std::log( std::tan(m_electronTheta[0][el2] * 0.5) ); + v0.SetPtEtaPhiM(pt1,eta1,m_electronPhi[0][el1], ELECTRON_MASS); + v1.SetPtEtaPhiM(pt2,eta2,m_electronPhi[0][el2], ELECTRON_MASS); double mass = (v0+v1).M(); - return mass; } @@ -1427,33 +1236,25 @@ double IDPerfMonEoverP::getMassCluster(int el1, int el2) std::vector<int> IDPerfMonEoverP::FillSimpleTree() { ATH_MSG_VERBOSE("In fillSimpleTree()"); - std::vector<int> electronsZee; std::vector<int> electronsWenu; - passZeeSelection(electronsZee); passWenuSelection(electronsWenu); - std::vector<int> allInterestingElectrons; - for(int i(0); i < (int)electronsZee.size(); ++i){ int ele = electronsZee[i]; if ( std::find(allInterestingElectrons.begin(), allInterestingElectrons.end(), ele)==allInterestingElectrons.end() ){ allInterestingElectrons.push_back(ele); } } - for(int i(0); i < (int)electronsWenu.size(); ++i){ int ele = electronsWenu[i]; if ( std::find(allInterestingElectrons.begin(), allInterestingElectrons.end(), ele)==allInterestingElectrons.end() ){ allInterestingElectrons.push_back(ele); } } - ATH_MSG_DEBUG(" SimpleTreeElectrons " << allInterestingElectrons.size() ); - for(int i(0); i < (int)allInterestingElectrons.size(); ++i){ - int ele = allInterestingElectrons[i]; if (m_electronQoverP[0][ele] > 0 ) m_smallCharge = 1.; diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonKshort.cxx b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonKshort.cxx index 3332ce49c5ae5173195259a282eb61125d8e602b..7d3da9da100ca5de3af3e2cbd0fee0d84fa8cb81 100755 --- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonKshort.cxx +++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonKshort.cxx @@ -9,6 +9,7 @@ #include <cmath> #include <vector> +#include <algorithm> #include "TH1.h" #include "TProfile.h" @@ -46,6 +47,34 @@ #include "InDetPerformanceMonitoring/IDPerfMonKshort.h" +namespace{ //utility functions + //fill a container with a sequence of values + template <typename ForwardIterator, typename T> + void + sequentialFill(ForwardIterator beg, const ForwardIterator stop, T value, const T inc){ + while (beg!=stop){ + *beg++ = value; + value +=inc; + }; + return; + } + + //find index in sorted array where the given value lies just above the indexed value + template <typename Iterator, typename T, typename Compare=std::less<T>> + long + findLevel(const Iterator beg, const Iterator stop, T value, Compare op=std::less<T>()){ + auto place = std::lower_bound(beg, stop, value, op); + return std::distance(beg, place ); + } + //in range? + template <typename T> + bool + inRange(const T &v, const T &lo, const T &hi){ + return (v >= lo) and (v<=hi); + } + +} + // ********************************************************************* // Public Methods // ********************************************************************* @@ -62,7 +91,6 @@ IDPerfMonKshort::IDPerfMonKshort( const std::string & type, const std::string & declareProperty("triggerChainName",m_triggerChainName); declareProperty("VxContainerName",m_VxContainerName="V0UnconstrVertices"); declareProperty("VxPrimContainerName",m_VxPrimContainerName="PrimaryVertices"); - } IDPerfMonKshort::~IDPerfMonKshort() { } @@ -70,20 +98,12 @@ IDPerfMonKshort::~IDPerfMonKshort() { } StatusCode IDPerfMonKshort::initialize() { - if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "IDPerfMonKshort initialize() started"<< endmsg; - - m_histosBooked = 0; - - - - if (m_tracksName.empty()) if(msgLvl(MSG::ERROR)) msg(MSG::ERROR) << " no track collection given"<<endmsg; - + ATH_MSG_DEBUG( "IDPerfMonKshort initialize() started"); + m_histosBooked = 0; + if (m_tracksName.empty()) ATH_MSG_ERROR( " no track collection given"); StatusCode sc; sc = ManagedMonitorToolBase::initialize(); - if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "IDPerfMonKshort initialize() finished"<< endmsg; - if(!sc.isSuccess()) return StatusCode::SUCCESS; - - + ATH_MSG_DEBUG( "IDPerfMonKshort initialize() finished"); return StatusCode::SUCCESS; } @@ -91,9 +111,6 @@ StatusCode IDPerfMonKshort::initialize() StatusCode IDPerfMonKshort::bookHistograms() { if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "IDPerfMonKshort bookHistograms() started"<< endmsg; - - Double_t myPi = TMath::Pi(); - MonGroup al_kshort_mon ( this, "IDPerfMon/Kshort/" + m_triggerChainName, run); @@ -121,19 +138,12 @@ StatusCode IDPerfMonKshort::bookHistograms() Double_t ptBins[m_nFittedBinsPt] = {1.05,1.85,2.45,3.35,4.5}; Double_t radiusBins[m_nFittedBinsRadius] = {15.,35.,50.,70.,90.,120.,185.}; - Double_t phiBins[10] = { (-4.5*myPi / 5) , - (-3.5*myPi / 5) , - (-2.5*myPi / 5) , - (-1.5*myPi / 5) , - (-0.5*myPi / 5) , - (0.5*myPi / 5) , - (1.5*myPi / 5) , - (2.5*myPi / 5) , - (3.5*myPi / 5) , - (4.5*myPi / 5) }; - Double_t etaBins[10] = {-2.25,-1.75,-1.25,-0.75,-0.25,0.25,0.75,1.25,1.75,2.25}; - Double_t curvatureDiffBins[6] = {-0.0010,-0.0006,-0.0002,0.0002,0.0006,0.0010}; - + Double_t phiBins[10]{}; + Double_t etaBins[10]{}; + Double_t curvatureDiffBins[6]{}; + sequentialFill(phiBins, std::end(phiBins), (-4.5*M_PI/5.), (M_PI/5.)); + sequentialFill(etaBins, std::end(etaBins),-2.25, 0.5); + sequentialFill(curvatureDiffBins, std::end(curvatureDiffBins), -0.001,0.0004); m_mass = new TH1F("ks_mass", "Invariant mass of K^{0}_{S} candidate", 60, 0.45, 0.55); m_mass->SetYTitle("K^{0}_{S} Candidates"); m_mass->SetXTitle("Mass (Gev / c^{2})"); @@ -147,16 +157,11 @@ StatusCode IDPerfMonKshort::bookHistograms() m_mass_scaled->SetMinimum(0.); RegisterHisto(al_kshort_mon,m_mass_scaled) ; - - m_massVsPhi = new TH2F("ks_massVsPhi", "Invariant mass - world average of K^{0}_{S} candidate", 10, (-1.0* myPi), myPi, 50, -.5, .5); + m_massVsPhi = new TH2F("ks_massVsPhi", "Invariant mass - world average of K^{0}_{S} candidate", 10, (-1.0* M_PI), M_PI, 50, -.5, .5); m_massVsPhi->SetXTitle("#phi"); m_massVsPhi->SetYTitle("Mass (Gev / c^{2}) - World Average [MeV]"); RegisterHisto(al_kshort_mon,m_massVsPhi) ; - - - - m_pt = new TH1F("ks_pt", "p_{T} of K^{0}_{S} candidate", 100, 0., 10.); m_pt->SetYTitle("K^{0}_{S} Candidates"); m_pt->SetXTitle("p_{T} (Gev / c)"); @@ -169,30 +174,24 @@ StatusCode IDPerfMonKshort::bookHistograms() m_YVsX_secVertex = new TH2F("secVertex_YVsX", "all sec. vertices (reco);x [mm];y [mm]",200, -150.,150., 200, -150., 150.); RegisterHisto(al_kshort_mon,m_YVsX_secVertex) ; - m_radiusVsZ_secVertex_sel = new TH2F("secVertex_radiusVsZ_sel", "all sec.vertices (reco);z [mm];Decay radius [mm]",180, -600., 600.,180.,0.,180.); RegisterHisto(al_kshort_mon,m_radiusVsZ_secVertex_sel) ; m_YVsX_secVertex_sel = new TH2F("secVertex_YVsX_sel", "all sec. vertices (reco);x [mm];y [mm]",200, -150.,150., 200, -150., 150.); RegisterHisto(al_kshort_mon,m_YVsX_secVertex_sel) ; - - m_radiusVsZ_secVertex_Ks = new TH2F("secVertex_radiusVsZ_Ks", "sec.vertices (reco) of K^{0}_{S} candidates;z [mm];Decay radius [mm]",180, -600., 600.,180.,0.,180.); RegisterHisto(al_kshort_mon,m_radiusVsZ_secVertex_Ks) ; m_YVsX_secVertex_Ks = new TH2F("secVertex_YVsX_Ks", "sec. vertices (reco) of K^{0}_{S} candidates;x [mm];y [mm]",200, -150.,150., 200, -150., 150.); RegisterHisto(al_kshort_mon,m_YVsX_secVertex_Ks) ; - m_radius_secVertices = new TH1F("radius_secVertices", "Decay radius of secondary vertices", 600, 0., 300.); RegisterHisto(al_kshort_mon,m_radius_secVertices) ; m_radius_secVertices_sel = new TH1F("radius_secVertices_sel", "Decay radius of secondary vertices", 600, 0., 300.); RegisterHisto(al_kshort_mon,m_radius_secVertices_sel) ; - - m_YVsX_primVertex = new TH2F("primVertex_YVsX", "all primary vertices (reco);PV x [mm];PV y [mm]",300, -1.5,1.5, 300, -1.5, 1.5); RegisterHisto(al_kshort_mon,m_YVsX_primVertex) ; @@ -223,11 +222,20 @@ StatusCode IDPerfMonKshort::bookHistograms() m_eta->SetXTitle("#eta"); m_eta->SetMarkerStyle(20); RegisterHisto(al_kshort_mon,m_eta) ; - m_phi = new TH1F("ks_phi", "#phi of K^{0}_{S} candidate", 10, (-1.0* myPi), myPi); + m_phi = new TH1F("ks_phi", "#phi of K^{0}_{S} candidate", 10, (-1.0* M_PI), M_PI); m_phi->SetYTitle("K^{0}_{S} Candidates"); m_phi->SetXTitle("#phi"); m_phi->SetMarkerStyle(20); RegisterHisto(al_kshort_mon,m_phi) ; + // + //lamda for use below + auto quickSet=[](TH1F * h){ + h->SetXTitle("Mass (Gev / c^{2})"); + h->SetYTitle("K^{0}_{S} Candidates"); + h->SetMarkerStyle(20); + h->SetMinimum(0.); + }; + // for(int quickInit=0;quickInit<m_nBinsPt;quickInit++) { TString tempName = "MassVptBin"; TString tempTitle = "Mass, p_{T} = "; @@ -235,10 +243,8 @@ StatusCode IDPerfMonKshort::bookHistograms() tempTitle += ((Double_t)((quickInit*100)+500))/1000; tempTitle += " GeV"; m_massVPtBinHistos[quickInit] = new TH1F(tempName.Data(),tempTitle.Data(),50,0.445,0.555); - m_massVPtBinHistos[quickInit]->SetXTitle("Mass (Gev / c^{2})"); - m_massVPtBinHistos[quickInit]->SetYTitle("K^{0}_{S} Candidates"); - m_massVPtBinHistos[quickInit]->SetMarkerStyle(20); - m_massVPtBinHistos[quickInit]->SetMinimum(0.); + quickSet(m_massVPtBinHistos[quickInit]); + RegisterHisto(al_kshort_mon,m_massVPtBinHistos[quickInit]) ; } for(int quickInit=0;quickInit<m_nFittedBinsPt;quickInit++) { @@ -248,10 +254,7 @@ StatusCode IDPerfMonKshort::bookHistograms() tempTitle += ptBins[quickInit]; tempTitle += " GeV"; m_massVPtBinFittedHistos[quickInit] = new TH1F(tempName.Data(),tempTitle.Data(),50,0.445,0.555); - m_massVPtBinFittedHistos[quickInit]->SetXTitle("Mass (Gev / c^{2})"); - m_massVPtBinFittedHistos[quickInit]->SetYTitle("K^{0}_{S} Candidates"); - m_massVPtBinFittedHistos[quickInit]->SetMarkerStyle(20); - m_massVPtBinFittedHistos[quickInit]->SetMinimum(0.); + quickSet(m_massVPtBinFittedHistos[quickInit]); RegisterHisto(al_kshort_mon,m_massVPtBinFittedHistos[quickInit]) ; } for(int quickInit=0;quickInit<m_nBinsRadius;quickInit++) { @@ -261,10 +264,7 @@ StatusCode IDPerfMonKshort::bookHistograms() tempTitle += quickInit*10; tempTitle += " mm"; m_massVRadiusBinHistos[quickInit] = new TH1F(tempName.Data(),tempTitle.Data(),50,0.445,0.555); - m_massVRadiusBinHistos[quickInit]->SetXTitle("Mass (Gev / c^{2})"); - m_massVRadiusBinHistos[quickInit]->SetYTitle("K^{0}_{S} Candidates"); - m_massVRadiusBinHistos[quickInit]->SetMarkerStyle(20); - m_massVRadiusBinHistos[quickInit]->SetMinimum(0.); + quickSet(m_massVRadiusBinHistos[quickInit]); RegisterHisto(al_kshort_mon,m_massVRadiusBinHistos[quickInit]) ; } for(int quickInit=0;quickInit<m_nFittedBinsRadius;quickInit++) { @@ -274,10 +274,7 @@ StatusCode IDPerfMonKshort::bookHistograms() tempTitle += radiusBins[quickInit]; tempTitle += " mm"; m_massVRadiusBinFittedHistos[quickInit] = new TH1F(tempName.Data(),tempTitle.Data(),50,0.445,0.555); - m_massVRadiusBinFittedHistos[quickInit]->SetXTitle("Mass (Gev / c^{2})"); - m_massVRadiusBinFittedHistos[quickInit]->SetYTitle("K^{0}_{S} Candidates"); - m_massVRadiusBinFittedHistos[quickInit]->SetMarkerStyle(20); - m_massVRadiusBinFittedHistos[quickInit]->SetMinimum(0.); + quickSet(m_massVRadiusBinFittedHistos[quickInit]); RegisterHisto(al_kshort_mon,m_massVRadiusBinFittedHistos[quickInit]) ; } for(int quickInit=0;quickInit<10;quickInit++) { @@ -286,10 +283,7 @@ StatusCode IDPerfMonKshort::bookHistograms() tempName += quickInit; tempTitle += etaBins[quickInit]; m_massVEtaBinHistos[quickInit] = new TH1F(tempName.Data(),tempTitle.Data(),50,0.445,0.555); - m_massVEtaBinHistos[quickInit]->SetXTitle("Mass (Gev / c^{2})"); - m_massVEtaBinHistos[quickInit]->SetYTitle("K^{0}_{S} Candidates"); - m_massVEtaBinHistos[quickInit]->SetMarkerStyle(20); - m_massVEtaBinHistos[quickInit]->SetMinimum(0.); + quickSet(m_massVEtaBinHistos[quickInit]) ; RegisterHisto(al_kshort_mon,m_massVEtaBinHistos[quickInit]) ; tempName = "MassVPhiBin"; @@ -297,10 +291,7 @@ StatusCode IDPerfMonKshort::bookHistograms() tempName += quickInit; tempTitle += ((Double_t)((Int_t)(phiBins[quickInit]*100)))/100; m_massVPhiBinHistos[quickInit] = new TH1F(tempName.Data(),tempTitle.Data(),50,0.445,0.555); - m_massVPhiBinHistos[quickInit]->SetXTitle("Mass (Gev / c^{2})"); - m_massVPhiBinHistos[quickInit]->SetYTitle("K^{0}_{S} Candidates"); - m_massVPhiBinHistos[quickInit]->SetMarkerStyle(20); - m_massVPhiBinHistos[quickInit]->SetMinimum(0.); + quickSet(m_massVPhiBinHistos[quickInit]); RegisterHisto(al_kshort_mon,m_massVPhiBinHistos[quickInit]) ; } @@ -310,10 +301,7 @@ StatusCode IDPerfMonKshort::bookHistograms() tempName += quickInit; tempTitle += curvatureDiffBins[quickInit]; m_massVCurvatureDiffBinHistos[quickInit] = new TH1F(tempName.Data(),tempTitle.Data(),50,0.445,0.555); - m_massVCurvatureDiffBinHistos[quickInit]->SetXTitle("Mass (Gev / c^{2})"); - m_massVCurvatureDiffBinHistos[quickInit]->SetYTitle("K^{0}_{S} Candidates"); - m_massVCurvatureDiffBinHistos[quickInit]->SetMarkerStyle(20); - m_massVCurvatureDiffBinHistos[quickInit]->SetMinimum(0.); + quickSet(m_massVCurvatureDiffBinHistos[quickInit]); RegisterHisto(al_kshort_mon,m_massVCurvatureDiffBinHistos[quickInit]) ; } @@ -342,7 +330,7 @@ StatusCode IDPerfMonKshort::bookHistograms() m_Nevents = new TH1F("Nevents","Number of events processed",1,-.5,.5); RegisterHisto(al_kshort_mon,m_Nevents); - if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "IDPerfMonKshort bookHistograms done"<< endmsg; + ATH_MSG_DEBUG( "IDPerfMonKshort bookHistograms done"); m_histosBooked++; @@ -354,46 +342,41 @@ StatusCode IDPerfMonKshort::bookHistograms() } void IDPerfMonKshort::RegisterHisto(MonGroup& mon, TH1* histo) { - if(msgLvl(MSG::VERBOSE)) msg(MSG::VERBOSE) << "IDPerfMonKshort RegisterHisto() started"<< endmsg; - + ATH_MSG_VERBOSE( "IDPerfMonKshort RegisterHisto() started"); histo->Sumw2(); StatusCode sc = mon.regHist(histo); if (sc.isFailure() ) { - if (msgLvl(MSG::ERROR)) msg(MSG::ERROR) << "Cannot book TH1 Histogram:" << endmsg; + ATH_MSG_ERROR( "Cannot book TH1 Histogram:" ); } } void IDPerfMonKshort::RegisterHisto(MonGroup& mon, TProfile* histo) { - if(msgLvl(MSG::VERBOSE)) msg(MSG::VERBOSE) << "IDPerfMonKshort RegisterHisto() started"<< endmsg; - + ATH_MSG_VERBOSE( "IDPerfMonKshort RegisterHisto() started"); StatusCode sc = mon.regHist(histo); if (sc.isFailure() ) { - if (msgLvl(MSG::ERROR)) msg(MSG::ERROR) << "Cannot book TProfile Histogram:" << endmsg; + ATH_MSG_ERROR( "Cannot book TProfile Histogram:" ); } } void IDPerfMonKshort::RegisterHisto(MonGroup& mon, TGraph* graph) { - if(msgLvl(MSG::VERBOSE)) msg(MSG::VERBOSE) << "IDPerfMonKshort RegisterHisto() started"<< endmsg; - + ATH_MSG_VERBOSE( "IDPerfMonKshort RegisterHisto() started"); StatusCode sc = mon.regGraph(graph); if (sc.isFailure() ) { - if (msgLvl(MSG::ERROR)) msg(MSG::ERROR) << "Cannot book TGraph:" << endmsg; + ATH_MSG_ERROR( "Cannot book TGraph:" ); } } StatusCode IDPerfMonKshort::fillHistograms() { - if(msgLvl(MSG::VERBOSE)) msg(MSG::VERBOSE) << "IDPerfMonKshort fillHistogram() started"<< endmsg; - - Double_t myPi = TMath::Pi(); + ATH_MSG_VERBOSE( "IDPerfMonKshort fillHistogram() started"); const xAOD::TrackParticleContainer* tracks(0); StatusCode sc = evtStore()->retrieve(tracks,m_tracksName); if (sc.isFailure()) { - if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "No Collection with name "<<m_tracksName<<" found in StoreGate" << endmsg; + ATH_MSG_DEBUG( "No Collection with name "<<m_tracksName<<" found in StoreGate" ); return StatusCode::SUCCESS; } else { - if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Collection with name "<<m_tracksName<<" found in StoreGate" << endmsg; + ATH_MSG_DEBUG( "Collection with name "<<m_tracksName<<" found in StoreGate" ); } const xAOD::VertexContainer* PrimVxContainer(0); @@ -411,7 +394,7 @@ StatusCode IDPerfMonKshort::fillHistograms() } const xAOD::Vertex *primaryVertex= std::begin(*PrimVxContainer)[0]; -const xAOD::VertexContainer* SecVxContainer(0); + const xAOD::VertexContainer* SecVxContainer(0); if(evtStore()->contains<xAOD::VertexContainer>(m_VxContainerName)){ if (evtStore()->retrieve(SecVxContainer,m_VxContainerName).isFailure()) { ATH_MSG_DEBUG("Could not retrieve collection with name "<<m_VxContainerName<<" found in StoreGate"); @@ -426,14 +409,24 @@ const xAOD::VertexContainer* SecVxContainer(0); } m_Nevents->Fill(0.); - - - double ksMassPDG = 497.648; ATH_MSG_DEBUG("@todo : masspdf" <<ksMassPDG ); ATH_MSG_DEBUG("@todo Looping over SecVxContainer name : "<< m_VxContainerName); ATH_MSG_DEBUG("@todo >> V0UnconstrVerices container size >> " << SecVxContainer->size()); - + //bin curvature from -0.0008 to 0.0008 in bins of 0.0004 + std::array<float, 5> curvatureBinning{}; + sequentialFill(curvatureBinning.begin(), curvatureBinning.end(),-0.0008, 0.0004); + //bin phi from -pi to pi in bins of pi/5 + std::array<double,10> ksPhiBinning{}; + sequentialFill(ksPhiBinning.begin(), ksPhiBinning.end(), -M_PI, M_PI * 0.2); + //bin ksEta from -2.5 to 2.5 in bins of 0.5 + std::array<double,10> ksEtaBinning{}; + sequentialFill(ksEtaBinning.begin(), ksEtaBinning.end(),-2.5, 0.5); + //bin ksPt, variable bins + std::array<double,4> ksPtBinning{1600,2100, 2800,3900}; + //bin radius, variable binning + std::array<double,6> radiusBinning{30,40, 60,80,100,140}; + // for (const auto* secVx_elem : *SecVxContainer) { ATH_MSG_DEBUG("Looping over SecVxContainer name : "<< m_VxContainerName); double ksMass = secVx_elem->auxdata< float >("Kshort_mass"); @@ -446,12 +439,14 @@ const xAOD::VertexContainer* SecVxContainer(0); double ksMomentum = ksMomentumVector.mag(); double transverseFlightDistance, totalFlightDistance; Amg::Vector3D flightVector; - if(primaryVertex!=NULL) { + const auto & secVxPosition(secVx_elem->position()); + if(primaryVertex) { if(primaryVertex->nTrackParticles() > 3){ ATH_MSG_DEBUG("NTrk of primary vertices : "<< primaryVertex->nTrackParticles()); - m_YVsX_primVertex->Fill(primaryVertex->position().x(),primaryVertex->position().y()); - m_XVsZ_primVertex->Fill(primaryVertex->position().z(),primaryVertex->position().x()); - m_YVsZ_primVertex->Fill(primaryVertex->position().z(),primaryVertex->position().y()); + const auto & position (primaryVertex->position()); + m_YVsX_primVertex->Fill(position.x(),position.y()); + m_XVsZ_primVertex->Fill(position.z(),position.x()); + m_YVsZ_primVertex->Fill(position.z(),position.y()); } auto vert = secVx_elem->position()-primaryVertex->position(); double dx = vert.x(); @@ -459,14 +454,14 @@ const xAOD::VertexContainer* SecVxContainer(0); Amg::Vector3D mom(ksPx,ksPy,ksPz); double dxy = (mom.x()*dx + mom.y()*dy)/mom.perp(); transverseFlightDistance =dxy; - Amg::Vector3D vertex(secVx_elem->position().x(),secVx_elem->position().y(),secVx_elem->position().z()); + Amg::Vector3D vertex(secVxPosition.x(),secVxPosition.y(),secVxPosition.z()); totalFlightDistance = (vertex-primaryVertex->position()).mag(); flightVector = vertex-primaryVertex->position(); ATH_MSG_DEBUG("dx : "<<dx<<" dy: "<<dy<<" dxy: "<<dxy<< "flight distance (total): "<<totalFlightDistance); } else { - transverseFlightDistance = secVx_elem->position().perp(); - Amg::Vector3D vertex(secVx_elem->position().x(),secVx_elem->position().y(),secVx_elem->position().z()); + transverseFlightDistance = secVxPosition.perp(); + Amg::Vector3D vertex(secVxPosition.x(),secVxPosition.y(),secVxPosition.z()); totalFlightDistance = vertex.mag(); flightVector = vertex; } @@ -475,7 +470,7 @@ const xAOD::VertexContainer* SecVxContainer(0); double flightX = flightVector.x(); double flightY = flightVector.y(); - double cosThetaPointing = (ksPx*flightX+ksPy*flightY)/sqrt(ksPx*ksPx+ksPy*ksPy)/sqrt(flightX*flightX+flightY*flightY); + double cosThetaPointing = (ksPx*flightX+ksPy*flightY)/std::sqrt(ksPx*ksPx+ksPy*ksPy)/std::sqrt(flightX*flightX+flightY*flightY); int trackPos_nSVTHits = 0; int trackNeg_nSVTHits = 0; double trackPos_d0 = 0; @@ -504,17 +499,14 @@ const xAOD::VertexContainer* SecVxContainer(0); } }//trackparticles }//ntrk - - if(trackPos!=0) { uint8_t dummy(-1); trackPos_nSVTHits = trackPos->summaryValue( dummy , xAOD::numberOfSCTHits )? dummy :-1; trackPos_d0 = trackPos->d0(); - trackPos_d0_wrtPV = trackPos->d0() - (primaryVertex->position().y()*cos(trackPos->phi0()) - primaryVertex->position().x()*sin(trackPos->phi0())); + trackPos_d0_wrtPV = trackPos->d0() - (primaryVertex->position().y()*std::cos(trackPos->phi0()) - primaryVertex->position().x()*std::sin(trackPos->phi0())); } - - std::cout <<"@todo : check (2) " << std::endl; + //std::cout <<"@todo : check (2) " << std::endl; if(trackNeg!=0) { uint8_t dummy(-1); @@ -522,37 +514,30 @@ const xAOD::VertexContainer* SecVxContainer(0); trackNeg_d0 = trackNeg->d0(); trackNeg_d0_wrtPV = trackNeg->d0() - (primaryVertex->position().y()*cos(trackNeg->phi0()) - primaryVertex->position().x()*sin(trackNeg->phi0())); } - int selectorValue = 0; - - if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "ksTau = " << properDecayTime << " Lxy = " <<transverseFlightDistance<< " cosTheta = " << cosThetaPointing <<endmsg; - if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "trackPos nSVThits = " << trackPos_nSVTHits << " trackNeg nSVThits = " << trackNeg_nSVTHits <<endmsg; - - if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "ksPt = " << ksPt <<endmsg; - - + ATH_MSG_DEBUG( "ksTau = " << properDecayTime << " Lxy = " <<transverseFlightDistance<< " cosTheta = " << cosThetaPointing ); + ATH_MSG_DEBUG( "trackPos nSVThits = " << trackPos_nSVTHits << " trackNeg nSVThits = " << trackNeg_nSVTHits ); + ATH_MSG_DEBUG( "ksPt = " << ksPt ); double secVertex_radius = secVx_elem->auxdata< float >("Rxy"); ATH_MSG_DEBUG("secondary vertex radius : " << secVertex_radius); - m_radius_secVertices->Fill(secVertex_radius); - m_radiusVsZ_secVertex->Fill(secVx_elem->position().z(),secVertex_radius); - m_YVsX_secVertex->Fill(secVx_elem->position().x(),secVx_elem->position().y()); - // } - - ATH_MSG_DEBUG("trackneg d0 : " << trackNeg_d0 << " trackpos d0 : "<< trackPos_d0); - ATH_MSG_DEBUG("trackneg d0 (PV): " << trackNeg_d0_wrtPV << " trackpos d0 (PV) : "<< trackPos_d0_wrtPV); - - if(secVx_elem->chiSquared()/secVx_elem->numberDoF() < 4.5 - && ksPt > 300. - && abs(trackNeg_d0_wrtPV) > 5. - && abs(trackPos_d0_wrtPV) > 5. - && trackPos_nSVTHits > 2 - && trackNeg_nSVTHits > 2 - && secVertex_radius > 20. - ){ - m_radius_secVertices_sel->Fill(secVertex_radius); - m_radiusVsZ_secVertex_sel->Fill(secVx_elem->position().z(),secVertex_radius); - m_YVsX_secVertex_sel->Fill(secVx_elem->position().x(),secVx_elem->position().y()); - } + m_radius_secVertices->Fill(secVertex_radius); + m_radiusVsZ_secVertex->Fill(secVxPosition.z(),secVertex_radius); + m_YVsX_secVertex->Fill(secVxPosition.x(),secVxPosition.y()); + // } + ATH_MSG_DEBUG("trackneg d0 : " << trackNeg_d0 << " trackpos d0 : "<< trackPos_d0); + ATH_MSG_DEBUG("trackneg d0 (PV): " << trackNeg_d0_wrtPV << " trackpos d0 (PV) : "<< trackPos_d0_wrtPV); + if(secVx_elem->chiSquared()/secVx_elem->numberDoF() < 4.5 + && ksPt > 300. + && abs(trackNeg_d0_wrtPV) > 5. + && abs(trackPos_d0_wrtPV) > 5. + && trackPos_nSVTHits > 2 + && trackNeg_nSVTHits > 2 + && secVertex_radius > 20. + ){ + m_radius_secVertices_sel->Fill(secVertex_radius); + m_radiusVsZ_secVertex_sel->Fill(secVxPosition.z(),secVertex_radius); + m_YVsX_secVertex_sel->Fill(secVxPosition.x(),secVxPosition.y()); + } @@ -564,117 +549,67 @@ const xAOD::VertexContainer* SecVxContainer(0); && trackPos_nSVTHits > 2 && trackNeg_nSVTHits > 2 ) selectorValue = 1; if(selectorValue != 1) continue; - std::cout <<"@todo : check (3) " << std::endl; - - - m_radiusVsZ_secVertex_Ks->Fill(secVx_elem->position().z(),secVertex_radius); - m_YVsX_secVertex_Ks->Fill(secVx_elem->position().x(),secVx_elem->position().y()); - + m_radiusVsZ_secVertex_Ks->Fill(secVxPosition.z(),secVertex_radius); + m_YVsX_secVertex_Ks->Fill(secVxPosition.x(),secVxPosition.y()); m_YVsX_primVertex_Ks->Fill(primaryVertex->position().x(),primaryVertex->position().y()); m_XVsZ_primVertex_Ks->Fill(primaryVertex->position().z(),primaryVertex->position().x()); m_YVsZ_primVertex_Ks->Fill(primaryVertex->position().z(),primaryVertex->position().y()); - - m_mass->Fill(ksMass/1000.); - - - + m_mass->Fill(ksMass*0.001); double ksEta = ksMomentumVector.pseudoRapidity(); double ksPhi = ksMomentumVector.phi(); - std::cout <<"@todo : check (4) " << std::endl; double piPlusPt = trackPos->p4().Perp(); - std::cout <<"@todo : check (5) " << std::endl; double piMinusPt = trackNeg->p4().Perp(); - std::cout <<"@todo : check (6) " << std::endl; - - m_massVsPhi->Fill(ksPhi,ksMass-ksMassPDG); - m_pt->Fill(ksPt/1000.); + m_pt->Fill(ksPt*0.001); m_eta->Fill(ksEta); m_phi->Fill(ksPhi); - Float_t curvatureDiff = (1./(piPlusPt)) - (1./(piMinusPt)); + const auto fillValue(ksMass*0.001); + auto curvatureIdx = findLevel(curvatureBinning.begin(), curvatureBinning.end(),curvatureDiff); + m_massVCurvatureDiffBinHistos[curvatureIdx]->Fill(fillValue); + if (ksPhi>=-M_PI and ksPhi<M_PI){ + auto ksPhiIdx = findLevel(ksPhiBinning.begin(), ksPhiBinning.end(), ksPhi, std::less_equal<double>()); + m_massVPhiBinHistos[ksPhiIdx]->Fill(fillValue); + } + if (ksEta>=-2.5 and ksEta<2.5){ + auto ksEtaIdx = findLevel(ksEtaBinning.begin(), ksEtaBinning.end(), ksEta, std::less_equal<double>()); + m_massVEtaBinHistos[ksEtaIdx]->Fill(fillValue); + } + if (ksPt>=0.){ + auto ksPtIdx = findLevel(ksPtBinning.begin(), ksPtBinning.end(), ksPt, std::less_equal<double>()); + m_massVPtBinFittedHistos[ksPtIdx]->Fill(fillValue); + } - if( curvatureDiff <= -0.0008) m_massVCurvatureDiffBinHistos[0]->Fill(ksMass/1000.); - if( curvatureDiff > -0.0008 && curvatureDiff <= -0.0004) m_massVCurvatureDiffBinHistos[1]->Fill(ksMass/1000.); - if( curvatureDiff > -0.0004 && curvatureDiff <= 0.0000) m_massVCurvatureDiffBinHistos[2]->Fill(ksMass/1000.); - if( curvatureDiff > 0.0000 && curvatureDiff <= 0.0004) m_massVCurvatureDiffBinHistos[3]->Fill(ksMass/1000.); - if( curvatureDiff > 0.0004 && curvatureDiff <= 0.0008) m_massVCurvatureDiffBinHistos[4]->Fill(ksMass/1000.); - if( curvatureDiff > 0.0008 ) m_massVCurvatureDiffBinHistos[5]->Fill(ksMass/1000.); - - if( ksPhi>=(-5.0*myPi / 5)&&ksPhi<(-4.0*myPi / 5) ) m_massVPhiBinHistos[0]->Fill(ksMass/1000.); - if( ksPhi>=(-4.0*myPi / 5)&&ksPhi<(-3.0*myPi / 5) ) m_massVPhiBinHistos[1]->Fill(ksMass/1000.); - if( ksPhi>=(-3.0*myPi / 5)&&ksPhi<(-2.0*myPi / 5) ) m_massVPhiBinHistos[2]->Fill(ksMass/1000.); - if( ksPhi>=(-2.0*myPi / 5)&&ksPhi<(-1.0*myPi / 5) ) m_massVPhiBinHistos[3]->Fill(ksMass/1000.); - if( ksPhi>=(-1.0*myPi / 5)&&ksPhi<(0.0*myPi / 5) ) m_massVPhiBinHistos[4]->Fill(ksMass/1000.); - if( ksPhi>=(0.0*myPi / 5)&&ksPhi<(1.0*myPi / 5) ) m_massVPhiBinHistos[5]->Fill(ksMass/1000.); - if( ksPhi>=(1.0*myPi / 5)&&ksPhi<(2.0*myPi / 5) ) m_massVPhiBinHistos[6]->Fill(ksMass/1000.); - if( ksPhi>=(2.0*myPi / 5)&&ksPhi<(3.0*myPi / 5) ) m_massVPhiBinHistos[7]->Fill(ksMass/1000.); - if( ksPhi>=(3.0*myPi / 5)&&ksPhi<(4.0*myPi / 5) ) m_massVPhiBinHistos[8]->Fill(ksMass/1000.); - if( ksPhi>=(4.0*myPi / 5)&&ksPhi<(5.0*myPi / 5) ) m_massVPhiBinHistos[9]->Fill(ksMass/1000.); - if(ksEta>=-2.5&&ksEta<-2.0) m_massVEtaBinHistos[0]->Fill(ksMass/1000.); - if(ksEta>=-2.0&&ksEta<-1.5) m_massVEtaBinHistos[1]->Fill(ksMass/1000.); - if(ksEta>=-1.5&&ksEta<-1.0) m_massVEtaBinHistos[2]->Fill(ksMass/1000.); - if(ksEta>=-1.0&&ksEta<-0.5) m_massVEtaBinHistos[3]->Fill(ksMass/1000.); - if(ksEta>=-0.5&&ksEta<0.0) m_massVEtaBinHistos[4]->Fill(ksMass/1000.); - if(ksEta>=0.0&&ksEta<0.5) m_massVEtaBinHistos[5]->Fill(ksMass/1000.); - if(ksEta>=0.5&&ksEta<1.0) m_massVEtaBinHistos[6]->Fill(ksMass/1000.); - if(ksEta>=1.0&&ksEta<1.5) m_massVEtaBinHistos[7]->Fill(ksMass/1000.); - if(ksEta>=1.5&&ksEta<2.0) m_massVEtaBinHistos[8]->Fill(ksMass/1000.); - if(ksEta>=2.0&&ksEta<2.5) m_massVEtaBinHistos[9]->Fill(ksMass/1000.); - - if(ksPt>=0 && ksPt<1600) m_massVPtBinFittedHistos[0]->Fill(ksMass/1000.); - if(ksPt>=1600 && ksPt<2100) m_massVPtBinFittedHistos[1]->Fill(ksMass/1000.); - if(ksPt>=2100 && ksPt<2800) m_massVPtBinFittedHistos[2]->Fill(ksMass/1000.); - if(ksPt>=2800 && ksPt<3900) m_massVPtBinFittedHistos[3]->Fill(ksMass/1000.); - if(ksPt>=3900) m_massVPtBinFittedHistos[4]->Fill(ksMass/1000.); - - if (ksPt > 5000) ksPt = 5000; - if(ksPt < 500) ksPt = 500; + if (ksPt<500) ksPt = 500; + if (ksPt>5000) ksPt=5000; Int_t quickBin = (Int_t)ksPt; quickBin -= quickBin%100; quickBin -= 500; quickBin /= 100; - m_massVPtBinHistos[quickBin]->Fill(ksMass/1000.); - + m_massVPtBinHistos[quickBin]->Fill(fillValue); double radius = secVx_elem->auxdata< float >("Rxy"); - m_radius->Fill(radius); - - if(radius>=0 && radius<30) m_massVRadiusBinFittedHistos[0]->Fill(ksMass/1000.); - if(radius>=30 && radius<40) m_massVRadiusBinFittedHistos[1]->Fill(ksMass/1000.); - if(radius>=40 && radius<60) m_massVRadiusBinFittedHistos[2]->Fill(ksMass/1000.); - if(radius>=60 && radius<80) m_massVRadiusBinFittedHistos[3]->Fill(ksMass/1000.); - if(radius>=80 && radius<100) m_massVRadiusBinFittedHistos[4]->Fill(ksMass/1000.); - if(radius>=100 && radius<140) m_massVRadiusBinFittedHistos[5]->Fill(ksMass/1000.); - if(radius>=140) m_massVRadiusBinFittedHistos[6]->Fill(ksMass/1000.); - + if (radius>=0.){ + auto radiusIdx = findLevel(radiusBinning.begin(), radiusBinning.end(), radius, std::less_equal<double>()); + m_massVRadiusBinFittedHistos[radiusIdx]->Fill(fillValue); + } if(radius>700) radius = 700; Int_t radiusTemp = (Int_t)radius; radiusTemp -= radiusTemp%10; m_massVRadiusBinHistos[(Int_t)radiusTemp/10]->Fill(ksMass/1000.); - - } - - - return StatusCode::SUCCESS; } StatusCode IDPerfMonKshort::procHistograms() { - if(msgLvl(MSG::VERBOSE)) msg(MSG::VERBOSE) << "IDPerfMonKshort procHistograms() started"<< endmsg; - - Double_t myPi = TMath::Pi(); - + ATH_MSG_VERBOSE( "IDPerfMonKshort procHistograms() started"); if( endOfRunFlag() ) { - MonGroup al_kshort_mon ( this, "IDPerfMon/Kshort/" + m_triggerChainName, run); //CHECK ATTRIB MANAGED MonGroup al_kshort_mon_average ( this, "IDPerfMon/Kshort/" + m_triggerChainName, run, ATTRIB_MANAGED, "", "weightedAverage" ); TF1 *func = new TF1("func","gaus(0)+expo(3)",0.450,0.550); - func->SetLineColor(4); func->SetParameters(10.,0.500,0.010,2.,-.001); func->SetParLimits(0,0.,10000.); @@ -683,8 +618,6 @@ StatusCode IDPerfMonKshort::procHistograms() func->SetParLimits(3,0.,10000.); func->SetParLimits(4,-1000.,0.); func->SetParNames("Constant","Mean","Width","Constant","Slope"); - - Double_t massBins[m_nFittedBinsPt], massErrorBins[m_nFittedBinsPt], widthBins[m_nFittedBinsPt], widthErrorBins[m_nFittedBinsPt]; const Int_t nPtBinsHisto = m_nFittedBinsPt+1; Double_t ptBins[nPtBinsHisto] = {0.5,1.6,2.1,2.8,3.9,5.1}; @@ -694,45 +627,47 @@ StatusCode IDPerfMonKshort::procHistograms() widthBins[binFill] = func->GetParameter(2); widthErrorBins[binFill] = func->GetParError(2); } - const Double_t* ptBinsFinal = ptBins; const Double_t* massBinsFinal = massBins; const Double_t* massErrorBinsFinal = massErrorBins; const Double_t* widthBinsFinal = widthBins; const Double_t* widthErrorBinsFinal = widthErrorBins; - + //lamda utilities for repetitive code + auto setYTitleAndMarker =[](TH1F * theHist,const bool mass){ + if (mass){ + theHist->SetYTitle("Mass (Gev / c^{2})"); + }else { + theHist->SetYTitle("Width (Gev / c^{2})"); + }; + theHist->SetMarkerStyle(20); + }; + // + auto fillFromSource = [](const double * source, const double * uncertainty, TH1F * target, unsigned int nbins){ + for(unsigned int bin=0;bin<nbins;bin++) { + double binContent = source[bin]; + double binError = uncertainty[bin]; + target->SetBinContent(bin+1, binContent); + target->SetBinError(bin+1,binError); + } + }; + constexpr bool massTitle{true}; + constexpr bool widthTitle{false}; if(m_nFittedBinsPt) { m_massVersusPt = new TH1F("KsMassVersusPt","",m_nFittedBinsPt,ptBinsFinal); RegisterHisto(al_kshort_mon_average,m_massVersusPt); m_massVersusPt->SetXTitle("p_{T} (Gev / c)"); - m_massVersusPt->SetYTitle("Mass (Gev / c^{2})"); - m_massVersusPt->SetMarkerStyle(20); - for(int binFill=0;binFill<m_nFittedBinsPt;binFill++) { - Double_t binContent = massBinsFinal[binFill]; - Double_t binError = massErrorBinsFinal[binFill]; - m_massVersusPt->SetBinContent(binFill+1,binContent); - m_massVersusPt->SetBinError(binFill+1,binError); - } - + setYTitleAndMarker(m_massVersusPt, massTitle); + fillFromSource(massBinsFinal, massErrorBinsFinal, m_massVersusPt, m_nFittedBinsPt); m_widthVersusPt = new TH1F("KsWidthVersusPt","",m_nFittedBinsPt,ptBinsFinal); RegisterHisto(al_kshort_mon_average,m_widthVersusPt); - // m_widthVersusPt->SetErrorOption("s"); m_widthVersusPt->SetXTitle("p_{T} (Gev / c)"); - m_widthVersusPt->SetYTitle("Width (Gev / c^{2})"); - m_widthVersusPt->SetMarkerStyle(20); - for(int binFill=0;binFill<m_nFittedBinsPt;binFill++) { - Double_t binContent = widthBinsFinal[binFill]; - Double_t binError = widthErrorBinsFinal[binFill]; - m_widthVersusPt->SetBinContent(binFill+1,binContent); - m_widthVersusPt->SetBinError(binFill+1,binError); - } - + setYTitleAndMarker(m_widthVersusPt, widthTitle); + fillFromSource(widthBinsFinal, widthErrorBinsFinal, m_widthVersusPt, m_nFittedBinsPt); } Double_t massVradiusBins[m_nFittedBinsRadius], massVradiusErrorBins[m_nFittedBinsRadius], widthVradiusBins[m_nFittedBinsRadius], widthVradiusErrorBins[m_nFittedBinsRadius]; const Int_t nRadiusBinsHisto = m_nFittedBinsRadius+1; Double_t radiusBins[nRadiusBinsHisto] = {0.,30.,40.,60.,80.,100.,140.,230}; - for(int binFill=0;binFill<m_nFittedBinsRadius;binFill++) { massVradiusBins[binFill] = func->GetParameter(1); massVradiusErrorBins[binFill] = func->GetParError(1); @@ -750,31 +685,16 @@ StatusCode IDPerfMonKshort::procHistograms() m_massVersusRadius = new TH1F("KsMassVersusRadius","",m_nFittedBinsRadius,radiusBinsFinal); RegisterHisto(al_kshort_mon_average,m_massVersusRadius); m_massVersusRadius->SetXTitle("Decay Radius (mm)"); - m_massVersusRadius->SetYTitle("Mass (Gev / c^{2})"); - m_massVersusRadius->SetMarkerStyle(20); - for(int binFill=0;binFill<m_nFittedBinsRadius;binFill++) { - Double_t binContent = massVradiusBinsFinal[binFill]; - Double_t binError = massVradiusErrorBinsFinal[binFill]; - m_massVersusRadius->SetBinContent(binFill+1,binContent); - m_massVersusRadius->SetBinError(binFill+1,binError); - } + setYTitleAndMarker(m_massVersusRadius, massTitle); + fillFromSource(massVradiusBinsFinal, massVradiusErrorBinsFinal, m_massVersusRadius, m_nFittedBinsRadius); m_widthVersusRadius = new TH1F("KsWidthVersusRadius","",m_nFittedBinsRadius,radiusBinsFinal); RegisterHisto(al_kshort_mon_average,m_widthVersusRadius); m_widthVersusRadius->SetXTitle("Decay Radius (mm)"); - m_widthVersusRadius->SetYTitle("Width (Gev / c^{2})"); - m_widthVersusRadius->SetMarkerStyle(20); - for(int binFill=0;binFill<m_nFittedBinsRadius;binFill++) { - Double_t binContent = widthVradiusBinsFinal[binFill]; - Double_t binError = widthVradiusErrorBinsFinal[binFill]; - m_widthVersusRadius->SetBinContent(binFill+1,binContent); - m_widthVersusRadius->SetBinError(binFill+1,binError); - } - - + setYTitleAndMarker(m_widthVersusRadius, widthTitle); + fillFromSource(widthVradiusBinsFinal, widthVradiusErrorBinsFinal, m_widthVersusRadius, m_nFittedBinsRadius); } Double_t etaBins[11] = {-2.5,-2.0,-1.5,-1.0,-0.5,0.0,0.5,1.0,1.5,2.0,2.5}; - Double_t massVetaBins[10], massVetaErrorBins[10], widthVetaBins[10], widthVetaErrorBins[10]; for(int binFill=0;binFill<10;binFill++) { massVetaBins[binFill] = func->GetParameter(1); @@ -785,43 +705,17 @@ StatusCode IDPerfMonKshort::procHistograms() m_massVersusEta = new TH1F("KsMassVersusEta","",10,etaBins); RegisterHisto(al_kshort_mon_average,m_massVersusEta); m_massVersusEta->SetXTitle("#eta"); - m_massVersusEta->SetYTitle("Mass (Gev / c^{2})"); - m_massVersusEta->SetMarkerStyle(20); - for(int binFill=0;binFill<10;binFill++) { - Double_t binContent = massVetaBins[binFill]; - Double_t binError = massVetaErrorBins[binFill]; - m_massVersusEta->SetBinContent(binFill+1,binContent); - m_massVersusEta->SetBinError(binFill+1,binError); - } + setYTitleAndMarker(m_massVersusEta, massTitle); + fillFromSource(massVetaBins, massVetaErrorBins, m_massVersusEta, 10); m_widthVersusEta = new TH1F("KsWidthVersusEta","",10,etaBins); RegisterHisto(al_kshort_mon_average,m_widthVersusEta); - // m_widthVersusEta->SetErrorOption("s"); m_widthVersusEta->SetXTitle("#eta"); - m_widthVersusEta->SetYTitle("Width (Gev / c^{2})"); - m_widthVersusEta->SetMarkerStyle(20); - for(int binFill=0;binFill<10;binFill++) { - Double_t binContent = widthVetaBins[binFill]; - Double_t binError = widthVetaErrorBins[binFill]; - m_widthVersusEta->SetBinContent(binFill+1,binContent); - m_widthVersusEta->SetBinError(binFill+1,binError); - } - - - Double_t phiBins[11] = { (-5.0*myPi / 5) , - (-4.0*myPi / 5) , - (-3.0*myPi / 5) , - (-2.0*myPi / 5) , - (-1.0*myPi / 5) , - (0.0*myPi / 5) , - (1.0*myPi / 5) , - (2.0*myPi / 5) , - (3.0*myPi / 5) , - (4.0*myPi / 5) , - (5.0*myPi / 5) }; - + setYTitleAndMarker(m_massVersusEta, widthTitle); + fillFromSource(widthVetaBins, widthVetaErrorBins, m_widthVersusEta, 10); + Double_t phiBins[11]{}; + sequentialFill(phiBins, phiBins+11, -M_PI, M_PI/5.); Double_t massVphiBins[10], massVphiErrorBins[10], widthVphiBins[10], widthVphiErrorBins[10]; for(int binFill=0;binFill<10;binFill++) { - // if (m_massVPhiBinHistos[binFill]->GetEntries()>=MinStat) m_massVPhiBinHistos[binFill]->Fit(func,"lmhqn"); massVphiBins[binFill] = func->GetParameter(1); massVphiErrorBins[binFill] = func->GetParError(1); widthVphiBins[binFill] = func->GetParameter(2); @@ -829,29 +723,14 @@ StatusCode IDPerfMonKshort::procHistograms() } m_massVersusPhi = new TH1F("KsMassVersusPhi","",10,phiBins); RegisterHisto(al_kshort_mon_average,m_massVersusPhi); - // m_massVersusPhi->SetErrorOption("s"); m_massVersusPhi->SetXTitle("#phi"); - m_massVersusPhi->SetYTitle("Mass (Gev / c^{2})"); - m_massVersusPhi->SetMarkerStyle(20); - for(int binFill=0;binFill<10;binFill++) { - Double_t binContent = massVphiBins[binFill]; - Double_t binError = massVphiErrorBins[binFill]; - m_massVersusPhi->SetBinContent(binFill+1,binContent); - m_massVersusPhi->SetBinError(binFill+1,binError); - } + setYTitleAndMarker(m_massVersusPhi, massTitle); + fillFromSource(massVphiBins, massVphiErrorBins, m_massVersusPhi, 10); m_widthVersusPhi = new TH1F("KsWidthVersusPhi","",10,phiBins); RegisterHisto(al_kshort_mon_average,m_widthVersusPhi); m_widthVersusPhi->SetXTitle("#phi"); - m_widthVersusPhi->SetYTitle("Width (Gev / c^{2})"); - m_widthVersusPhi->SetMarkerStyle(20); - for(int binFill=0;binFill<10;binFill++) { - Double_t binContent = widthVphiBins[binFill]; - Double_t binError = widthVphiErrorBins[binFill]; - m_widthVersusPhi->SetBinContent(binFill+1,binContent); - m_widthVersusPhi->SetBinError(binFill+1,binError); - } - - + setYTitleAndMarker(m_widthVersusPhi, widthTitle); + fillFromSource(widthVphiBins, widthVphiErrorBins, m_widthVersusPhi, 10); Double_t curvatureDiffBins[7] = {-0.0012,-0.0008,-0.0004,0.0000,0.0004,0.0008,0.0012}; Double_t massVcurvatureDiffBins[6], massVcurvatureDiffErrorBins[6], widthVcurvatureDiffBins[6], widthVcurvatureDiffErrorBins[6]; for(int binFill=0;binFill<6;binFill++) { @@ -863,25 +742,13 @@ StatusCode IDPerfMonKshort::procHistograms() m_massVersusCurvatureDiff = new TH1F("KsMassVersusCurvatureDiff","",6,curvatureDiffBins); RegisterHisto(al_kshort_mon_average,m_massVersusCurvatureDiff); m_massVersusCurvatureDiff->SetXTitle("1/p_{T}(#pi^{+}) - 1/p_{T}(#pi^{-}) [GeV^{-1}]"); - m_massVersusCurvatureDiff->SetYTitle("Mass (Gev / c^{2})"); - m_massVersusCurvatureDiff->SetMarkerStyle(20); - for(int binFill=0;binFill<6;binFill++) { - Double_t binContent = massVcurvatureDiffBins[binFill]; - Double_t binError = massVcurvatureDiffErrorBins[binFill]; - m_massVersusCurvatureDiff->SetBinContent(binFill+1,binContent); - m_massVersusCurvatureDiff->SetBinError(binFill+1,binError); - } + setYTitleAndMarker(m_massVersusCurvatureDiff, massTitle); + fillFromSource(massVcurvatureDiffBins, massVcurvatureDiffErrorBins, m_massVersusCurvatureDiff, 6); m_widthVersusCurvatureDiff = new TH1F("KsWidthVersusCurvatureDiff","",6,curvatureDiffBins); RegisterHisto(al_kshort_mon_average,m_widthVersusCurvatureDiff); m_widthVersusCurvatureDiff->SetXTitle("1/p_{T}(#pi^{+}) - 1/p_{T}(#pi^{-}) [GeV^{-1}]"); - m_widthVersusCurvatureDiff->SetYTitle("Width (Gev / c^{2})"); - m_widthVersusCurvatureDiff->SetMarkerStyle(20); - for(int binFill=0;binFill<6;binFill++) { - Double_t binContent = widthVcurvatureDiffBins[binFill]; - Double_t binError = widthVcurvatureDiffErrorBins[binFill]; - m_widthVersusCurvatureDiff->SetBinContent(binFill+1,binContent); - m_widthVersusCurvatureDiff->SetBinError(binFill+1,binError); - } + setYTitleAndMarker(m_widthVersusCurvatureDiff, widthTitle); + fillFromSource(widthVcurvatureDiffBins, widthVcurvatureDiffErrorBins, m_widthVersusCurvatureDiff, 6); } return StatusCode::SUCCESS; diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonWenu.cxx b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonWenu.cxx index 4c43b8d5420aa59869eb0e80d669a8c958609db5..94ee9ba6809ed50844e292eac447ee424b62b61a 100755 --- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonWenu.cxx +++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonWenu.cxx @@ -13,7 +13,7 @@ #include "TH1F.h" #include "TH2F.h" #include "TProfile.h" -#include "TMath.h" +//#include "TMath.h" #include "TLorentzVector.h" #include "GaudiKernel/IJobOptionsSvc.h" @@ -36,21 +36,42 @@ #include "egammaEvent/egammaParamDefs.h" #include "egammaEvent/egammaPIDdefsObs.h" - +#include "xAODEgamma/Electron.h" +#include "xAODEgamma/Egamma.h" +#include "xAODEgamma/Photon.h" +#include "xAODCaloEvent/CaloCluster.h" #include "xAODMissingET/MissingET.h" #include "xAODMissingET/MissingETContainer.h" #include "AthenaMonitoring/AthenaMonManager.h" #include "InDetPerformanceMonitoring/IDPerfMonWenu.h" + +#include "GaudiKernel/SystemOfUnits.h" +#include "GaudiKernel/PhysicalConstants.h" + #include <stdexcept> // ********************************************************************* // Public Methods // ********************************************************************* +namespace{ +template <class T> + T * + getCollectionWithCheck(const ServiceHandle<StoreGateSvc> & evtStore,const std::string &contName){ + T * container{}; + if (evtStore->contains<T>(contName)){ + //retrieve + if(evtStore->retrieve(container,contName).isFailure()) return nullptr; + } + return container; + } +} + IDPerfMonWenu::IDPerfMonWenu( const std::string & type, const std::string & name, const IInterface* parent ) :ManagedMonitorToolBase( type, name, parent ), + m_region_strings{"incl", "barrel", "eca", "ecc"}, m_triggerChainName("NoTriggerSelection") { declareProperty("tracksName",m_tracksName); @@ -68,51 +89,41 @@ IDPerfMonWenu::IDPerfMonWenu( const std::string & type, const std::string & name declareProperty("triggerChainName",m_triggerChainName); declareProperty("rejectSecondCluster",m_rejectSecondCluster = true); declareProperty("electronIDLevel",m_electronIDLevel = "Tight"); - - m_region_strings.push_back("incl"); - m_region_strings.push_back("barrel"); - m_region_strings.push_back("eca"); - m_region_strings.push_back("ecc"); - } - IDPerfMonWenu::~IDPerfMonWenu() { } - -StatusCode IDPerfMonWenu::initialize() -{ - +StatusCode IDPerfMonWenu::initialize(){ m_histosBooked = 0; - - if (m_tracksName.empty() && msgLvl(MSG::WARNING)) msg(MSG::WARNING) << " no track collection given" << endmsg; - + if (m_tracksName.empty() ){ + ATH_MSG_WARNING( " no track collection given" ); + } StatusCode sc = ManagedMonitorToolBase::initialize(); - if (sc.isFailure() && msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "Could not initialize ManagedMonitorToolBase" << endmsg; - + if (sc.isFailure()){ + ATH_MSG_WARNING( "Could not initialize ManagedMonitorToolBase" ); + } //---Electron Likelihood tool--- - ATH_MSG_INFO("IDPerfMonWenu::Initialize() -- Setting up electron LH tool."); + ATH_MSG_DEBUG("IDPerfMonWenu::Initialize() -- Setting up electron LH tool."); m_LHTool2015=std::make_unique<AsgElectronLikelihoodTool> ("m_LHTool2015"); - if((m_LHTool2015->setProperty("primaryVertexContainer",m_VxPrimContainerName)).isFailure()) + if((m_LHTool2015->setProperty("primaryVertexContainer",m_VxPrimContainerName)).isFailure()){ ATH_MSG_WARNING("Failure setting primary vertex container " << m_VxPrimContainerName << "in electron likelihood tool"); - + } //Set up electron LH level m_doIDCuts = true; std::string confDir = "ElectronPhotonSelectorTools/offline/mc15_20150712/"; - if(m_electronIDLevel == ""){ + if(m_electronIDLevel .empty()){ ATH_MSG_WARNING("electronIDLevel is set to empty! No electron ID cuts will be applied."); m_doIDCuts = false; - } - else{ + } else { if((m_electronIDLevel != "Loose") && (m_electronIDLevel != "Medium") && (m_electronIDLevel != "Tight")){ ATH_MSG_WARNING("Unknown electronIDLevel!! (Accepted values: Loose, Medium, Tight)"); m_doIDCuts = false; - } - else{ + } else { std::string configFile = confDir+"ElectronLikelihood"+m_electronIDLevel+"OfflineConfig2015.conf"; ATH_MSG_INFO("Likelihood configuration file: " << configFile); - if((m_LHTool2015->setProperty("ConfigFile",configFile)).isFailure()) - ATH_MSG_WARNING("Failure loading ConfigFile in electron likelihood tool."); + if((m_LHTool2015->setProperty("ConfigFile",configFile)).isFailure()){ + ATH_MSG_WARNING("Failure loading ConfigFile in electron likelihood tool."); + } } } StatusCode lh = m_LHTool2015->initialize(); @@ -120,26 +131,13 @@ StatusCode IDPerfMonWenu::initialize() ATH_MSG_WARNING("Electron likelihood tool initialize() failed! Turning off electron LH cuts!"); m_doIDCuts = false; } - return StatusCode::SUCCESS; } StatusCode IDPerfMonWenu::bookHistograms() { MonGroup al_Wenu_mon ( this, "IDPerfMon/Wenu/" + m_triggerChainName, run); - - if ( AthenaMonManager::environment() == AthenaMonManager::online ) { - // book histograms that are only made in the online environment... - } - - if ( AthenaMonManager::dataType() == AthenaMonManager::cosmics ) { - // book histograms that are only relevant for cosmics data... - } - - - if( newRunFlag() ) { - //if user environment specified we don't want to book new histograms at every run boundary //we instead want one histogram per job if(m_histosBooked!=0 && AthenaMonManager::environment()==AthenaMonManager::user) return StatusCode::SUCCESS; @@ -150,7 +148,6 @@ StatusCode IDPerfMonWenu::bookHistograms() m_Nevents = new TH1F("Nevents", "Number of events processed", 1, -.5, 0.5); RegisterHisto(al_Wenu_mon,m_Nevents); - m_Wenu_met_sel = new TH1F("Wenu_met_sel","met", 50, 0., 100.); RegisterHisto(al_Wenu_mon,m_Wenu_met_sel); m_Wenu_transmass_sel = new TH1F("Wenu_transmass_sel","Transverse mass of the leading em cluster and the met", 90, 0., 180.); @@ -235,18 +232,12 @@ StatusCode IDPerfMonWenu::bookHistograms() name = "Wenu_Eop_" + m_region_strings[region]; title = "E/p for Wenu EM-clusters in " + m_region_strings[region]; m_Wenu_Eop.push_back(new TH1F(name.c_str(),title.c_str(), 60, 0., 10.)); - /** original code: what was intended here? - if (region==incl) RegisterHisto(al_Wenu_mon,m_Wenu_Eop[region]); - else RegisterHisto(al_Wenu_mon,m_Wenu_Eop[region]); - **/ + RegisterHisto(al_Wenu_mon,m_Wenu_Eop[region]); name = "Wenu_Eopdiff_" + m_region_strings[region]; title = "E/p difference (pos-neg) for Wenu EM-clusters in " + m_region_strings[region]; m_Wenu_Eopdiff.push_back(new TH1F(name.c_str(),title.c_str(), 10, 0., 2.)); - /** original code: what was intended here? - if (region==incl) RegisterHisto(al_Wenu_mon,m_Wenu_Eopdiff[region],true); - else RegisterHisto(al_Wenu_mon,m_Wenu_Eopdiff[region],true); - **/ + RegisterHisto(al_Wenu_mon,m_Wenu_Eopdiff[region],true); name = "Wenu_Eop_plus_" + m_region_strings[region]; title = "E/p for pos. charged Wenu EM-clusters in " + m_region_strings[region]; @@ -390,118 +381,74 @@ StatusCode IDPerfMonWenu::bookHistograms() } void IDPerfMonWenu::RegisterHisto(MonGroup& mon, TH1* histo, bool doSumw2) { - if (doSumw2) histo->Sumw2(); StatusCode sc = mon.regHist(histo); if (sc.isFailure() ) { - if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Cannot book TH1 Histogram:" << endmsg; + ATH_MSG_DEBUG( "Cannot book TH1 Histogram:" ); } } void IDPerfMonWenu::RegisterHisto(MonGroup& mon, TProfile* histo) { - - StatusCode sc = mon.regHist(histo); - if (sc.isFailure() ) { - if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Cannot book TProfile Histogram:" << endmsg; + if (mon.regHist(histo).isFailure() ) { + ATH_MSG_DEBUG( "Cannot book TProfile Histogram:" ); } } void IDPerfMonWenu::RegisterHisto(MonGroup& mon, TH2* histo, bool doSumw2) { - if (doSumw2) histo->Sumw2(); - StatusCode sc = mon.regHist(histo); - if (sc.isFailure() ) { - if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Cannot book TH2 Histogram:" << endmsg; + if (mon.regHist(histo).isFailure() ) { + ATH_MSG_WARNING( "Cannot book TH2 Histogram:" ); } } StatusCode IDPerfMonWenu::fillHistograms() { - int nevents = (int) m_Nevents->GetEntries(); - + const bool firstEvent{nevents == 1}; // get electron container from storegate - const xAOD::ElectronContainer* electrons = 0; - if (!evtStore()->contains<xAOD::ElectronContainer>(m_electronsName)) { - if (nevents == 1 && msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "No Collection with name " << m_electronsName << " found in StoreGate" << endmsg; - else if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "No Collection with name " << m_electronsName << " found in StoreGate" << endmsg; - return StatusCode::SUCCESS; - } - else { - StatusCode sc = evtStore()->retrieve(electrons,m_electronsName); - if (sc.isFailure()) { - if(nevents == 1 && msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "Could not retrieve Collection " << m_electronsName << " from StoreGate" << endmsg; - else if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Could not retrieve Collection " << m_electronsName << " from StoreGate" << endmsg; - return StatusCode::SUCCESS; - } + auto formErrorMessage = [] (const std::string & contName)->std::string { + return std::string(std::string("No Collection with name ") + contName + std::string(" found in StoreGate")); + }; + const xAOD::ElectronContainer* electrons=getCollectionWithCheck<xAOD::ElectronContainer>(evtStore(),m_electronsName); + if (not electrons){ + const std::string & errMsg=formErrorMessage(m_electronsName); + if (firstEvent) ATH_MSG_WARNING( errMsg ); + else ATH_MSG_DEBUG(errMsg); + return StatusCode::RECOVERABLE; } - // get photon container from storegate - const xAOD::PhotonContainer* photons = 0; - if (!evtStore()->contains<xAOD::PhotonContainer>(m_photonsName)) { - if (nevents == 1 && msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "No Collection with name " << m_photonsName << " found in StoreGate" << endmsg; - else if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "No Collection with name " << m_photonsName << " found in StoreGate" << endmsg; - return StatusCode::SUCCESS; + const xAOD::PhotonContainer* photons = getCollectionWithCheck<xAOD::PhotonContainer>(evtStore(),m_photonsName); + if (not photons){ + const std::string & errMsg = formErrorMessage(m_photonsName); + if (firstEvent) ATH_MSG_WARNING( errMsg ); + else ATH_MSG_DEBUG(errMsg); + return StatusCode::RECOVERABLE; } - else { - StatusCode sc = evtStore()->retrieve(photons,m_photonsName); - if (sc.isFailure()) { - if(nevents == 1 && msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "Could not retrieve Collection " << m_photonsName << " from StoreGate" << endmsg; - else if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Could not retrieve Collection " << m_photonsName << " from StoreGate" << endmsg; - return StatusCode::SUCCESS; - } - } - // get emcluster container from storegate - const xAOD::CaloClusterContainer* emclusters = 0; - if (!evtStore()->contains<xAOD::CaloClusterContainer>(m_emclustersName)) { - if (nevents == 1 && msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "No Collection with name " << m_emclustersName << " found in StoreGate" << endmsg; - else if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "No Collection with name " << m_emclustersName << " found in StoreGate" << endmsg; - return StatusCode::SUCCESS; - } - else { - StatusCode sc = evtStore()->retrieve(emclusters,m_emclustersName); - if (sc.isFailure()) { - if(nevents == 1 && msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "Could not retrieve Collection " << m_emclustersName << " from StoreGate" << endmsg; - else if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Could not retrieve Collection " << m_emclustersName << " from StoreGate" << endmsg; - return StatusCode::SUCCESS; - } + const xAOD::CaloClusterContainer* emclusters = getCollectionWithCheck<xAOD::CaloClusterContainer>(evtStore(),m_emclustersName); + if (not emclusters){ + const std::string & errMsg = formErrorMessage(m_emclustersName); + if (firstEvent) ATH_MSG_WARNING( errMsg ); + else ATH_MSG_DEBUG(errMsg); + return StatusCode::RECOVERABLE; } - // get track container from storegate - const xAOD::TrackParticleContainer* tracks = 0; - if (!evtStore()->contains<xAOD::TrackParticleContainer>(m_tracksName)) { - if (nevents == 1 && msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "No Collection with name " << m_tracksName << " found in StoreGate" << endmsg; - else if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "No Collection with name " << m_tracksName << " found in StoreGate" << endmsg; - return StatusCode::SUCCESS; - } - else { - StatusCode sc = evtStore()->retrieve(tracks,m_tracksName); - if (sc.isFailure()) { - if(nevents == 1 && msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "Could not retrieve Collection " << m_tracksName << " from StoreGate" << endmsg; - else if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Could not retrieve Collection " << m_tracksName << " from StoreGate" << endmsg; - return StatusCode::SUCCESS; - } + const xAOD::TrackParticleContainer* tracks = getCollectionWithCheck<xAOD::TrackParticleContainer>(evtStore(),m_tracksName); + if (not tracks){ + const std::string & errMsg = formErrorMessage(m_tracksName); + if (firstEvent) ATH_MSG_WARNING( errMsg ); + else ATH_MSG_DEBUG(errMsg); + return StatusCode::RECOVERABLE; } - // get met container from storegate - const xAOD::MissingETContainer* final_met = 0; - if (!evtStore()->contains<xAOD::MissingETContainer>(m_metName)) { - if (nevents == 1 && msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "No Collection with name " << m_metName << " found in StoreGate" << endmsg; - else if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "No Collection with name " << m_metName << " found in StoreGate" << endmsg; - return StatusCode::SUCCESS; - } - else { - StatusCode sc = evtStore()->retrieve(final_met,m_metName); - if (sc.isFailure()) { - if(nevents == 1 && msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "Could not retrieve Collection " << m_metName << " from StoreGate" << endmsg; - else if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Could not retrieve Collection " << m_metName << " from StoreGate" << endmsg; - return StatusCode::SUCCESS; - } + const xAOD::MissingETContainer* final_met = getCollectionWithCheck<xAOD::MissingETContainer>(evtStore(),m_metName); + if (not final_met){ + const std::string & errMsg = formErrorMessage(m_metName); + if (firstEvent) ATH_MSG_WARNING( errMsg ); + else ATH_MSG_DEBUG(errMsg); + return StatusCode::RECOVERABLE; } - m_Nevents->Fill(0.); - // ****************** // Get the missing ET // ****************** @@ -512,18 +459,15 @@ StatusCode IDPerfMonWenu::fillHistograms() // ******************* // Look at EM clusters // ******************* - const xAOD::CaloCluster* LeadingEMcluster = getLeadingEMcluster(photons, electrons); const xAOD::CaloCluster* SecondLeadingEMcluster = getLeadingEMcluster(photons, electrons, LeadingEMcluster); - if (LeadingEMcluster != 0) { + if (LeadingEMcluster) { int leading_eta_region = etaRegion(LeadingEMcluster->eta()); double leading_dPhi = electronTrackMatchEta(tracks,LeadingEMcluster); double leading_dEta = electronTrackMatchPhi(tracks,LeadingEMcluster); const xAOD::TrackParticle* track_leading_emcluster = electronTrackMatch(tracks,LeadingEMcluster); - int selected = isWenu(LeadingEMcluster, SecondLeadingEMcluster, met); if (selected == 0) { - // ********************* // Fill event histograms // ********************* @@ -532,48 +476,28 @@ StatusCode IDPerfMonWenu::fillHistograms() double cluster_met_transmass = TransMass(LeadingEMcluster,MET); if (cluster_met_transmass > 0.) m_Wenu_transmass_sel->Fill(cluster_met_transmass); double track_met_transmass = 0.; - if (track_leading_emcluster != 0) { - track_met_transmass = TransMass(track_leading_emcluster,MET); - if (track_met_transmass > 0.) m_Wenu_trk_transmass_sel->Fill(track_met_transmass); + if (track_leading_emcluster ) { + track_met_transmass = TransMass(track_leading_emcluster,MET); + if (track_met_transmass > 0.) m_Wenu_trk_transmass_sel->Fill(track_met_transmass); } - // *********************** // Fill cluster histograms // *********************** FillHistosPerCluster(LeadingEMcluster, track_leading_emcluster, leading_eta_region, leading_dEta, leading_dPhi); FillHistosPerCluster(LeadingEMcluster, track_leading_emcluster, incl, leading_dEta, leading_dPhi); - } - } - return StatusCode::SUCCESS; } void IDPerfMonWenu::makeEffHisto(TH1F* h_num, TH1F* h_denom, TH1F* h_eff) { h_eff->Divide(h_num,h_denom,1.,1.,"B"); - // int Nbins; - // Nbins = h_num->GetNbinsX(); - // for (int bin=0; bin!=Nbins; ++bin) { - // int Npass = int(h_num->GetBinContent(bin+1)); - // int Nfail = int(h_denom->GetBinContent(bin+1)) - Npass; - // double x = h_denom->GetBinCenter(bin+1); - // for (int pass=0; pass!=Npass; ++pass) { - // h_eff->Fill(x,1.); - // } - // for (int fail=0; fail!=Nfail; ++fail) { - // h_eff->Fill(x,0.); - // } - // } } StatusCode IDPerfMonWenu::procHistograms() { - if( endOfRunFlag() ) { - // PostProcess Wenu histograms - for (int region=0; region!=1; ++region) { makeEffHisto(m_Wenu_trackmatched_eta[region],m_Wenu_eta[region],m_Wenu_trackmatch_eff_vs_eta[region]); makeEffHisto(m_Wenu_trackmatched_phi[region],m_Wenu_phi[region],m_Wenu_trackmatch_eff_vs_phi[region]); @@ -581,7 +505,6 @@ StatusCode IDPerfMonWenu::procHistograms() makeEffHisto(m_Wenu_trackmatched_Eopmatched_phi[region],m_Wenu_trackmatched_phi[region],m_Wenu_Eopmatch_eff_vs_phi[region]); makeEffHisto(m_Wenu_trackmatched_tightEopmatched_eta[region],m_Wenu_trackmatched_eta[region],m_Wenu_tightEopmatch_eff_vs_eta[region]); makeEffHisto(m_Wenu_trackmatched_tightEopmatched_phi[region],m_Wenu_trackmatched_phi[region],m_Wenu_tightEopmatch_eff_vs_phi[region]); - // commented out for some reason? m_Wenu_Eopdiff[region]->Add(m_Wenu_Eop_plus[region],m_Wenu_Eop_minus[region],1.,-1); m_Wenu_Eopdiff_vs_p[region]->Add(m_Wenu_meanEop_vs_p_plus[region],m_Wenu_meanEop_vs_p_minus[region],1.,-1); @@ -589,29 +512,22 @@ StatusCode IDPerfMonWenu::procHistograms() m_Wenu_Eopdiff_vs_E[region]->Add(m_Wenu_meanEop_vs_E_plus[region],m_Wenu_meanEop_vs_E_minus[region],1.,-1); m_Wenu_Eopdiff_vs_phi[region]->Add(m_Wenu_meanEop_vs_phi_plus[region],m_Wenu_meanEop_vs_phi_minus[region],1.,-1); m_Wenu_Eopdiff_vs_eta[region]->Add(m_Wenu_meanEop_vs_eta_plus[region],m_Wenu_meanEop_vs_eta_minus[region],1.,-1); - + // makeEffHisto(m_Wenu_Eop_lt1_vs_eta[region],m_Wenu_eta[region],m_Wenu_frac_Eop_lt1_vs_eta[region]); makeEffHisto(m_Wenu_Eop_lt1_vs_phi[region],m_Wenu_phi[region],m_Wenu_frac_Eop_lt1_vs_phi[region]); makeEffHisto(m_Wenu_Eop_15_25[region],m_Wenu_Eop_05_25[region],m_Wenu_frac_Eop_05_25_15_25[region]); } - } return StatusCode::SUCCESS; } const xAOD::CaloCluster* IDPerfMonWenu::getLeadingEMcluster(const xAOD::CaloClusterContainer* clusters, const xAOD::CaloCluster* omitCluster) const { - // iterators over the emcluster container - xAOD::CaloClusterContainer::const_iterator Itr = clusters->begin(); - xAOD::CaloClusterContainer::const_iterator ItrEnd = clusters->end(); - - const xAOD::CaloCluster* leading_emcluster = 0; - + const xAOD::CaloCluster* leading_emcluster{nullptr}; float max_pt = 0.; - for (; Itr != ItrEnd; ++Itr) { - const xAOD::CaloCluster* cl = (*Itr); + for (const auto & cl: *clusters) { if (cl == omitCluster) continue; - double deltaR = sqrt(pow(fabs(cl->phi() - omitCluster->phi()),2) + pow(fabs(cl->eta() - omitCluster->eta()),2)); + double deltaR = std::sqrt(std::pow(std::fabs(cl->phi() - omitCluster->phi()),2) + std::pow(std::fabs(cl->eta() - omitCluster->eta()),2)); if(deltaR < 0.005) continue; if (cl->pt()/Gaudi::Units::GeV < 10.) continue; if (cl->pt() > max_pt) { @@ -620,22 +536,13 @@ const xAOD::CaloCluster* IDPerfMonWenu::getLeadingEMcluster(const xAOD::CaloClus } } return leading_emcluster; - } const xAOD::CaloCluster* IDPerfMonWenu::getLeadingEMcluster(const xAOD::PhotonContainer* /*photons*/, const xAOD::ElectronContainer* electrons, const xAOD::CaloCluster* omitCluster) const { - - // iterators over the electron container - xAOD::ElectronContainer::const_iterator electronItr = electrons->begin(); - xAOD::ElectronContainer::const_iterator electronItrEnd = electrons->end(); - const xAOD::CaloCluster* leading_emcluster = 0; bool LHSel; float max_pt = 0.; - - for (; electronItr != electronItrEnd; ++electronItr) { - const xAOD::Electron* em = (*electronItr); - + for (const auto & em: *electrons) { // check ID if(m_doIDCuts){ LHSel = false; @@ -643,16 +550,6 @@ const xAOD::CaloCluster* IDPerfMonWenu::getLeadingEMcluster(const xAOD::PhotonCo if(!LHSel) continue; ATH_MSG_DEBUG("Electron passes " << m_electronIDLevel << " likelihood selection"); } - - // check isolation - //float iso; - //if(em->isolationValue(iso,xAOD::Iso::ptcone20)){ - // if( (iso/em->pt()) > 0.12 ) - //continue; - //} - //else - // ATH_MSG_WARNING("Isolation information not found! Will skip this cut!!"); - const xAOD::CaloCluster* cl = em->caloCluster(); if (cl == omitCluster) continue; if (cl->pt()/Gaudi::Units::GeV < 10.) continue; @@ -660,96 +557,65 @@ const xAOD::CaloCluster* IDPerfMonWenu::getLeadingEMcluster(const xAOD::PhotonCo leading_emcluster = cl; max_pt = cl->pt(); } - } - return leading_emcluster; } const xAOD::TrackParticle* IDPerfMonWenu::electronTrackMatch(const xAOD::TrackParticleContainer* tracks, const xAOD::CaloCluster* cluster, double dEta, double dPhi) const { - - // iterators over the track container - xAOD::TrackParticleContainer::const_iterator Itr = tracks->begin(); - xAOD::TrackParticleContainer::const_iterator ItrEnd = tracks->end(); - const xAOD::TrackParticle* matched_track = 0; double min_dR = 1.0e+20; - - for (; Itr!=ItrEnd; ++Itr) { - const xAOD::TrackParticle* track = (*Itr); + for (const auto & track: *tracks) { double deta = cluster->eta()-track->eta(); double dphi = cluster->phi()-track->phi(); - double dr = TMath::Sqrt(deta*deta + dphi*dphi); - if (dr < min_dR && TMath::Abs(deta) < dEta && TMath::Abs(dphi) < dPhi) { + double dr = std::sqrt(deta*deta + dphi*dphi); + if (dr < min_dR && std::fabs(deta) < dEta && std::fabs(dphi) < dPhi) { min_dR = dr; matched_track = track; } } - return matched_track; - } double IDPerfMonWenu::electronTrackMatchEta(const xAOD::TrackParticleContainer* tracks, const xAOD::CaloCluster* cluster, double dEta) const { - - // iterators over the track container - xAOD::TrackParticleContainer::const_iterator Itr = tracks->begin(); - xAOD::TrackParticleContainer::const_iterator ItrEnd = tracks->end(); - const xAOD::TrackParticle* matched_track = 0; double min_dEta = 1.0e+20; - - for (; Itr!=ItrEnd; ++Itr) { - const xAOD::TrackParticle* track = (*Itr); - double deta = TMath::Abs(cluster->eta()-track->eta()); + for (const auto & track: *tracks) { + double deta = std::fabs(cluster->eta()-track->eta()); if (deta < min_dEta && deta < dEta) { min_dEta = deta; matched_track = track; } } - double dPhi = 1.0e+20; if (matched_track != 0) dPhi = signedDeltaPhi(cluster->phi(),matched_track->phi()); - return dPhi; - } double IDPerfMonWenu::electronTrackMatchPhi(const xAOD::TrackParticleContainer* tracks, const xAOD::CaloCluster* cluster, double dPhi) const { - // iterators over the track container xAOD::TrackParticleContainer::const_iterator Itr = tracks->begin(); xAOD::TrackParticleContainer::const_iterator ItrEnd = tracks->end(); - const xAOD::TrackParticle* matched_track = 0; double min_dPhi = 1.0e+20; - - for (; Itr!=ItrEnd; ++Itr) { - const xAOD::TrackParticle* track = (*Itr); - double dphi = TMath::Abs(signedDeltaPhi(cluster->phi(),track->phi())); + for (const auto & track : *tracks) { + double dphi = std::abs(signedDeltaPhi(cluster->phi(),track->phi())); if (dphi < min_dPhi && dphi < dPhi) { min_dPhi = dphi; matched_track = track; } } - double dEta = 1.0e+20; if (matched_track != 0) dEta = cluster->eta()-matched_track->eta(); - return dEta; } int IDPerfMonWenu::isWenu(const xAOD::CaloCluster* em, const xAOD::CaloCluster* em2, double met) const { - int selected = 2; - if(em->pt()/Gaudi::Units::GeV > 25.) --selected; if(met/Gaudi::Units::GeV > 20.) --selected; // was at 0 for some reason? - if(!m_rejectSecondCluster) return selected; - // else check 2nd EM cluster veto if(em2 != 0){ if(em2->pt()/Gaudi::Units::GeV > 25.){ @@ -757,15 +623,11 @@ int IDPerfMonWenu::isWenu(const xAOD::CaloCluster* em, const xAOD::CaloCluster* selected++; } } - return selected; - } double IDPerfMonWenu::InvMass(const xAOD::CaloCluster* EM1, const xAOD::CaloCluster* EM2) const { - if (EM1 == 0 || EM2 == 0) return -99.; - double invmass = 0.; if (EM1->pt() != 0 && EM2->pt() != 0.) { TLorentzVector particle1; @@ -774,16 +636,11 @@ double IDPerfMonWenu::InvMass(const xAOD::CaloCluster* EM1, const xAOD::CaloClus particle2.SetPtEtaPhiE(EM2->pt()/Gaudi::Units::GeV,EM2->eta(),EM2->phi(),EM2->e()/Gaudi::Units::GeV); invmass = (particle1+particle2).Mag(); } - return invmass; - } double IDPerfMonWenu::InvMass(const xAOD::TrackParticle* trk1, const xAOD::TrackParticle* trk2) const { - if (trk1 == 0 || trk2 == 0) return -99.; - - double invmass = 0.; if (trk1->pt() != 0 && trk2->pt() != 0.) { TLorentzVector particle1; @@ -792,45 +649,33 @@ double IDPerfMonWenu::InvMass(const xAOD::TrackParticle* trk1, const xAOD::Track particle2.SetPtEtaPhiE(trk2->pt()/Gaudi::Units::GeV,trk2->eta(),trk2->phi(),trk2->e()/Gaudi::Units::GeV); invmass = (particle1+particle2).Mag(); } - return invmass; - } double IDPerfMonWenu::TransMass(const xAOD::CaloCluster* EM, const xAOD::MissingET* met) const { - if (EM == 0 || met == 0) return -99.; - double transmass = 0.; float dphi = signedDeltaPhi(EM->phi(),met->phi()); - transmass = TMath::Sqrt(2.*EM->et()*met->met()*(1.-TMath::Cos(dphi))); - + transmass = std::sqrt(2.*EM->et()*met->met()*(1.-std::cos(dphi))); return transmass/Gaudi::Units::GeV; } double IDPerfMonWenu::TransMass(const xAOD::TrackParticle* track, const xAOD::MissingET* met) const { - if (track == 0 || met == 0) return -99.; - double transmass = 0.; float dphi = signedDeltaPhi(track->phi(),met->phi()); - transmass = TMath::Sqrt(2.*(track->p4().Et()/Gaudi::Units::GeV)*(met->met()/Gaudi::Units::GeV)*(1.-TMath::Cos(dphi))); - + transmass = std::sqrt(2.*(track->p4().Et()/Gaudi::Units::GeV)*(met->met()/Gaudi::Units::GeV)*(1.-std::cos(dphi))); return transmass; - } double IDPerfMonWenu::deltaR(const xAOD::CaloCluster* cluster, const xAOD::TrackParticle* track) const { double dr =-999.; if (cluster == 0 || track == 0) return dr; - double deta = cluster->eta()-track->eta(); double dphi = cluster->phi()-track->phi(); - if(fabs(dphi) > 3.14159) - dphi = 2*3.14159-fabs(dphi); - dr = TMath::Sqrt(deta*deta + dphi*dphi); - + if(std::fabs(dphi) > M_PI) dphi = 2.*M_PI-std::fabs(dphi); + dr = std::sqrt(deta*deta + dphi*dphi); return dr; } @@ -847,45 +692,40 @@ double IDPerfMonWenu::signedDeltaPhi(double phi1, double phi2) const { } int IDPerfMonWenu::etaRegion(double eta) { - int region = -99; - - if (TMath::Abs(eta) <= 1.) region = barrel; + if (std::fabs(eta) <= 1.) region = barrel; else if (eta > 1.) region = eca; // eca else if (eta < -1.) region = ecc; // ecc - return region; } void IDPerfMonWenu::FillHistosPerCluster(const xAOD::CaloCluster* cluster, const xAOD::TrackParticle* track, int region, float dEta, float dPhi) { - if (cluster == 0) return; + if (not cluster) return; if (region<0){ throw std::out_of_range("Region is negative in IDPerfMonWenu::FillHistosPerCluster"); } // THERE IS A CLUSTER - if (region == incl) { // inclusive only - m_Wenu_eta[region]->Fill(cluster->eta()); m_Wenu_phi[region]->Fill(cluster->phi()); // match in eta and phi separately and make dEta and dPhi plots if (dEta < 1.0e+20) { m_Wenu_deta[region]->Fill(dEta); - if (TMath::Abs(dEta < 0.05)) { // calculate mean only for those in matching window - m_Wenu_deta_vs_eta[region]->Fill(cluster->eta(),dEta); - m_Wenu_deta_vs_phi[region]->Fill(cluster->phi(),dEta); - m_Wenu_absdeta_vs_eta[region]->Fill(cluster->eta(),TMath::Abs(dEta)); - m_Wenu_absdeta_vs_phi[region]->Fill(cluster->phi(),TMath::Abs(dEta)); + if (std::fabs(dEta < 0.05)) { // calculate mean only for those in matching window + m_Wenu_deta_vs_eta[region]->Fill(cluster->eta(),dEta); + m_Wenu_deta_vs_phi[region]->Fill(cluster->phi(),dEta); + m_Wenu_absdeta_vs_eta[region]->Fill(cluster->eta(),std::fabs(dEta)); + m_Wenu_absdeta_vs_phi[region]->Fill(cluster->phi(),std::fabs(dEta)); } } if (dPhi < 1.0e+20) { m_Wenu_dphi[region]->Fill(dPhi); - if (TMath::Abs(dPhi < 0.1)) { // calculate mean only for those in matching window - m_Wenu_dphi_vs_eta[region]->Fill(cluster->eta(),dPhi); - m_Wenu_dphi_vs_phi[region]->Fill(cluster->phi(),dPhi); - m_Wenu_absdphi_vs_eta[region]->Fill(cluster->eta(),TMath::Abs(dPhi)); - m_Wenu_absdphi_vs_phi[region]->Fill(cluster->phi(),TMath::Abs(dPhi)); + if (std::fabs(dPhi < 0.1)) { // calculate mean only for those in matching window + m_Wenu_dphi_vs_eta[region]->Fill(cluster->eta(),dPhi); + m_Wenu_dphi_vs_phi[region]->Fill(cluster->phi(),dPhi); + m_Wenu_absdphi_vs_eta[region]->Fill(cluster->eta(),std::fabs(dPhi)); + m_Wenu_absdphi_vs_phi[region]->Fill(cluster->phi(),std::fabs(dPhi)); } } @@ -893,22 +733,17 @@ void IDPerfMonWenu::FillHistosPerCluster(const xAOD::CaloCluster* cluster, const if (track == 0) return; // TRACK-MATCHED - float eoverp = 0.; - float track_p = track->pt()*cosh(track->eta()); + float track_p = track->pt()*std::cosh(track->eta()); if (track_p != 0.) eoverp = cluster->e()/track_p; - m_Wenu_Eop[region]->Fill(eoverp); - if (track->charge() == 1.) { m_Wenu_Eop_plus[region]->Fill(eoverp); } else if (track->charge() == -1.) { m_Wenu_Eop_minus[region]->Fill(eoverp); } - if (region == incl) { // inclusive only - m_Wenu_trackmatched_eta[region]->Fill(cluster->eta()); m_Wenu_trackmatched_phi[region]->Fill(cluster->phi()); if (eoverp > m_eoverp_tight_min && eoverp < m_eoverp_tight_max) { @@ -922,20 +757,20 @@ void IDPerfMonWenu::FillHistosPerCluster(const xAOD::CaloCluster* cluster, const } if (track->charge() == 1.) { if (eoverp > m_eoverp_tight_min && eoverp < m_eoverp_tight_max) { - m_Wenu_meanEop_vs_p_plus[region]->Fill(track_p/Gaudi::Units::GeV,eoverp); - m_Wenu_meanEop_vs_invp_plus[region]->Fill(1./(track_p/Gaudi::Units::GeV),eoverp); - m_Wenu_meanEop_vs_E_plus[region]->Fill(cluster->e()/Gaudi::Units::GeV,eoverp); - m_Wenu_meanEop_vs_phi_plus[region]->Fill(track->phi(),eoverp); - m_Wenu_meanEop_vs_eta_plus[region]->Fill(track->eta(),eoverp); + m_Wenu_meanEop_vs_p_plus[region]->Fill(track_p/Gaudi::Units::GeV,eoverp); + m_Wenu_meanEop_vs_invp_plus[region]->Fill(1./(track_p/Gaudi::Units::GeV),eoverp); + m_Wenu_meanEop_vs_E_plus[region]->Fill(cluster->e()/Gaudi::Units::GeV,eoverp); + m_Wenu_meanEop_vs_phi_plus[region]->Fill(track->phi(),eoverp); + m_Wenu_meanEop_vs_eta_plus[region]->Fill(track->eta(),eoverp); } } else if (track->charge() == -1.) { if (eoverp > m_eoverp_tight_min && eoverp < m_eoverp_tight_max) { - m_Wenu_meanEop_vs_p_minus[region]->Fill(track_p/Gaudi::Units::GeV,eoverp); - m_Wenu_meanEop_vs_invp_minus[region]->Fill(1./(track_p/Gaudi::Units::GeV),eoverp); - m_Wenu_meanEop_vs_E_minus[region]->Fill(cluster->e()/Gaudi::Units::GeV,eoverp); - m_Wenu_meanEop_vs_phi_minus[region]->Fill(track->phi(),eoverp); - m_Wenu_meanEop_vs_eta_minus[region]->Fill(track->eta(),eoverp); + m_Wenu_meanEop_vs_p_minus[region]->Fill(track_p/Gaudi::Units::GeV,eoverp); + m_Wenu_meanEop_vs_invp_minus[region]->Fill(1./(track_p/Gaudi::Units::GeV),eoverp); + m_Wenu_meanEop_vs_E_minus[region]->Fill(cluster->e()/Gaudi::Units::GeV,eoverp); + m_Wenu_meanEop_vs_phi_minus[region]->Fill(track->phi(),eoverp); + m_Wenu_meanEop_vs_eta_minus[region]->Fill(track->eta(),eoverp); } } if (eoverp < m_eoverp_standard_max && eoverp > m_eoverp_standard_min) { diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonZee.cxx b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonZee.cxx index b5316fdd5faa641933eb64d3173ea8df0e6b41f1..8cf0ffcbdb7f259d9aa4d3a86d33ea3f085eb550 100755 --- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonZee.cxx +++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonZee.cxx @@ -13,10 +13,8 @@ #include "TH1F.h" #include "TH2F.h" #include "TProfile.h" -#include "TMath.h" #include "TLorentzVector.h" - #include "GaudiKernel/IJobOptionsSvc.h" #include "StoreGate/StoreGateSvc.h" @@ -31,20 +29,15 @@ #include "InDetRIO_OnTrack/SiClusterOnTrack.h" #include "InDetPrepRawData/SiCluster.h" - #include "TrkEventPrimitives/FitQuality.h" #include "TrkEventPrimitives/LocalParameters.h" #include "GaudiKernel/SystemOfUnits.h" #include "GaudiKernel/PhysicalConstants.h" - - - #include "egammaEvent/egammaParamDefs.h" #include "egammaEvent/egammaPIDdefsObs.h" - #include "xAODMissingET/MissingET.h" #include "xAODMissingET/MissingETContainer.h" @@ -52,6 +45,19 @@ #include "InDetPerformanceMonitoring/IDPerfMonZee.h" #include <stdexcept> +namespace{ +template <class T> + T * + getCollectionWithCheck(const ServiceHandle<StoreGateSvc> & evtStore,const std::string &contName){ + T * container{}; + if (evtStore->contains<T>(contName)){ + //retrieve + if(evtStore->retrieve(container,contName).isFailure()) return nullptr; + } + return container; + } +} + // ********************************************************************* // Public Methods // ********************************************************************* @@ -88,14 +94,10 @@ IDPerfMonZee::~IDPerfMonZee() { } StatusCode IDPerfMonZee::initialize() { - m_histosBooked = 0; - - if (m_tracksName.empty() && msgLvl(MSG::WARNING)) msg(MSG::WARNING) << " no track collection given" << endmsg; - + if (m_tracksName.empty()) ATH_MSG_WARNING( " no track collection given" ); StatusCode sc = ManagedMonitorToolBase::initialize(); - if (sc.isFailure() && msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "Could not initialize ManagedMonitorToolBase" << endmsg; - + if (sc.isFailure()) ATH_MSG_WARNING( "Could not initialize ManagedMonitorToolBase" ); //---Electron Likelihood tool--- m_doIDCuts = true; ATH_MSG_INFO("IDPerfMonWenu::Initialize() -- Setting up electron LH tool."); @@ -105,7 +107,7 @@ StatusCode IDPerfMonZee::initialize() //Set up electron LH level std::string confDir = "ElectronPhotonSelectorTools/offline/mc15_20150712/"; - if(m_electronIDLevel == ""){ + if(m_electronIDLevel.empty()){ ATH_MSG_WARNING("electronIDLevel is set to empty! No electron ID cuts will be applied."); m_doIDCuts = false; } @@ -117,8 +119,7 @@ StatusCode IDPerfMonZee::initialize() else{ std::string configFile = confDir+"ElectronLikelihood"+m_electronIDLevel+"OfflineConfig2015.conf"; ATH_MSG_INFO("Likelihood configuration file: " << configFile); - if((m_LHTool2015->setProperty("ConfigFile",configFile)).isFailure()) - ATH_MSG_WARNING("Failure loading ConfigFile in electron likelihood tool."); + if((m_LHTool2015->setProperty("ConfigFile",configFile)).isFailure()) ATH_MSG_WARNING("Failure loading ConfigFile in electron likelihood tool."); } } StatusCode lh = m_LHTool2015->initialize(); @@ -126,27 +127,12 @@ StatusCode IDPerfMonZee::initialize() ATH_MSG_WARNING("Electron likelihood tool initialize() failed! Turning off electron LH cuts!"); m_doIDCuts = false; } - return StatusCode::SUCCESS; } StatusCode IDPerfMonZee::bookHistograms() { MonGroup al_Zee_mon ( this, "IDPerfMon/Zee/" + m_triggerChainName, run); - - //if ( AthenaMonManager::environment() == AthenaMonManager::online ) { - // // book histograms that are only made in the online environment... - //} - - //if ( AthenaMonManager::dataType() == AthenaMonManager::cosmics ) { - // // book histograms that are only relevant for cosmics data... - //} - - - //if ( newLowStatFlag() || newLumiBlockFlag() ) { - //} - - if( newRunFlag() ) { //if user environment specified we don't want to book new histograms at every run boundary //we instead want one histogram per job @@ -154,10 +140,8 @@ StatusCode IDPerfMonZee::bookHistograms() // *********************** // Book event histograms // *********************** - m_Nevents = new TH1F("Nevents", "Number of events processed", 1, -.5, 0.5); RegisterHisto(al_Zee_mon,m_Nevents); - m_Check = new TH1F("Check","", 4, 0,4); RegisterHisto(al_Zee_mon,m_Check); m_Zee_invmass = new TH1F("Zee_invmass","Invariant mass of the two leading em clusters", 90, 0.,180.); @@ -170,7 +154,6 @@ StatusCode IDPerfMonZee::bookHistograms() RegisterHisto(al_Zee_mon,m_Zee_trk_invmass_scaled); m_Zee_trk_invmass_sel = new TH1F("Zee_trk_invmass_sel","Invariant mass of the two tracks after Zee selection", 90, 0.,180.); RegisterHisto(al_Zee_mon,m_Zee_trk_invmass_sel); - m_Zee_Eopasym_perevent = new TH1F("Zee_Eopasym_perevent", "E/p difference (pos-neg)/(pos+neg) per Z event for Zee EM-clusters", 60, -1.5, 1.5); RegisterHisto(al_Zee_mon,m_Zee_Eopasym_perevent); m_Zee_Eopasym_perevent_central = new TH1F("Zee_Eopasym_perevent_central", "E/p difference (pos-neg)/(pos+neg) per Z event for Zee EM-clusters with E/p between 0.7 and 1.3", 60, -1.5, 1.5); @@ -249,40 +232,27 @@ StatusCode IDPerfMonZee::bookHistograms() for (int region=0; region!=Nregions; ++region) { std::string title; std::string name; - name = "Zee_Eop_" + m_region_strings[region]; title = "E/p for Zee EM-clusters in " + m_region_strings[region]; m_Zee_Eop.push_back(new TH1F(name.c_str(),title.c_str(), 60, 0., 10.)); - /**Original code: what was intended? - if (region==incl) RegisterHisto(al_Zee_mon,m_Zee_Eop[region]); - else RegisterHisto(al_Zee_mon,m_Zee_Eop[region]); - **/ RegisterHisto(al_Zee_mon,m_Zee_Eop[region]); name = "Zee_Eopdiff_" + m_region_strings[region]; title = "E/p difference (pos-neg) for Zee EM-clusters in " + m_region_strings[region]; m_Zee_Eopdiff.push_back(new TH1F(name.c_str(),title.c_str(), 10, 0., 2.)); - /**Original code: what was intended? - if (region==incl) RegisterHisto(al_Zee_mon,m_Zee_Eopdiff[region],true); - else RegisterHisto(al_Zee_mon,m_Zee_Eopdiff[region],true); - **/ RegisterHisto(al_Zee_mon,m_Zee_Eopdiff[region],true); name = "Zee_Eop_plus_" + m_region_strings[region]; title = "E/p for pos. charged Zee EM-clusters in " + m_region_strings[region]; m_Zee_Eop_plus.push_back(new TH1F(name.c_str(),title.c_str(), 10, 0., 2.)); RegisterHisto(al_Zee_mon,m_Zee_Eop_plus[region],true); - name = "Zee_Eop_minus_" + m_region_strings[region]; title = "E/p for neg. charged Zee EM-clusters in " + m_region_strings[region]; m_Zee_Eop_minus.push_back(new TH1F(name.c_str(),title.c_str(), 10, 0., 2.)); RegisterHisto(al_Zee_mon,m_Zee_Eop_minus[region],true); - if (region != incl) continue; - m_Zee_eta.push_back(new TH1F("Zee_eta","Eta of Zee EM-clusters", 15, -3., 3.)); RegisterHisto(al_Zee_mon,m_Zee_eta[region]); m_Zee_phi.push_back(new TH1F("Zee_phi","Phi of Zee EM-clusters", 15, -3.15, 3.15)); RegisterHisto(al_Zee_mon,m_Zee_phi[region]); - m_Zee_deta.push_back(new TH1F("Zee_deta","deltaEta(EM-cluster,track) in Zee events", 50, -0.5, 0.5)); RegisterHisto(al_Zee_mon,m_Zee_deta[region]); m_Zee_deta_vs_eta.push_back(new TProfile("Zee_deta_vs_eta","deltaEta(EM-cluster,track) vs. eta in Zee events", 15, -3., 3.)); @@ -417,28 +387,22 @@ StatusCode IDPerfMonZee::bookHistograms() } void IDPerfMonZee::RegisterHisto(MonGroup& mon, TH1* histo, bool doSumw2) { - if (doSumw2) histo->Sumw2(); - StatusCode sc = mon.regHist(histo); - if (sc.isFailure() ) { - if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Cannot book TH1 Histogram:" << endmsg; + if (mon.regHist(histo).isFailure() ) { + ATH_MSG_DEBUG( "Cannot book TH1 Histogram:" ); } } void IDPerfMonZee::RegisterHisto(MonGroup& mon, TProfile* histo) { - - StatusCode sc = mon.regHist(histo); - if (sc.isFailure() ) { - if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Cannot book TProfile Histogram:" << endmsg; + if (mon.regHist(histo).isFailure() ) { + ATH_MSG_DEBUG( "Cannot book TProfile Histogram:" ); } } void IDPerfMonZee::RegisterHisto(MonGroup& mon, TH2* histo, bool doSumw2) { - if (doSumw2) histo->Sumw2(); - StatusCode sc = mon.regHist(histo); - if (sc.isFailure() ) { - if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Cannot book TH2 Histogram:" << endmsg; + if (mon.regHist(histo).isFailure() ) { + ATH_MSG_DEBUG( "Cannot book TH2 Histogram:" ); } } @@ -446,99 +410,61 @@ StatusCode IDPerfMonZee::fillHistograms() { ATH_MSG_VERBOSE("In fillHistograms()"); int nevents = (int) m_Nevents->GetEntries(); - + const bool firstEvent{nevents == 1}; // get electron container from storegate - const xAOD::ElectronContainer* electrons = 0; - if (!evtStore()->contains<xAOD::ElectronContainer>(m_electronsName)) { - if (nevents == 1 && msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "No Collection with name " << m_electronsName << " found in StoreGate" << endmsg; - else if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "No Collection with name " << m_electronsName << " found in StoreGate" << endmsg; - return StatusCode::SUCCESS; - } - else { - StatusCode sc = evtStore()->retrieve(electrons,m_electronsName); - if (sc.isFailure()) { - if(nevents == 1 && msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "Could not retrieve Collection " << m_electronsName << " from StoreGate" << endmsg; - else if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Could not retrieve Collection " << m_electronsName << " from StoreGate" << endmsg; - return StatusCode::SUCCESS; - } + auto formErrorMessage = [] (const std::string & contName)->std::string { + return std::string(std::string("No Collection with name ") + contName + std::string(" found in StoreGate")); + }; + // get electron container from storegate + const xAOD::ElectronContainer* electrons = getCollectionWithCheck<xAOD::ElectronContainer>(evtStore(), m_electronsName); + if (not electrons){ + const std::string & errMsg=formErrorMessage(m_electronsName); + if (firstEvent) ATH_MSG_WARNING( errMsg ); + else ATH_MSG_DEBUG(errMsg); + return StatusCode::RECOVERABLE; } ATH_MSG_VERBOSE("This event contains " << electrons->size() << " electrons."); // get photon container from storegate - const xAOD::PhotonContainer* photons = 0; - if (!evtStore()->contains<xAOD::PhotonContainer>(m_photonsName)) { - if (nevents == 1 && msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "No Collection with name " << m_photonsName << " found in StoreGate" << endmsg; - else if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "No Collection with name " << m_photonsName << " found in StoreGate" << endmsg; - return StatusCode::SUCCESS; + const xAOD::PhotonContainer* photons = getCollectionWithCheck<xAOD::PhotonContainer>(evtStore(),m_photonsName); + if (not photons){ + const std::string & errMsg = formErrorMessage(m_photonsName); + if (firstEvent) ATH_MSG_WARNING( errMsg ); + else ATH_MSG_DEBUG(errMsg); + return StatusCode::RECOVERABLE; } - else { - StatusCode sc = evtStore()->retrieve(photons,m_photonsName); - if (sc.isFailure()) { - if(nevents == 1 && msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "Could not retrieve Collection " << m_photonsName << " from StoreGate" << endmsg; - else if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Could not retrieve Collection " << m_photonsName << " from StoreGate" << endmsg; - return StatusCode::SUCCESS; - } - } - //ATH_MSG_DEBUG("This event contains " << photons->size() << " photons."); // get emcluster container from storegate - const xAOD::CaloClusterContainer* emclusters = 0; - if (!evtStore()->contains<xAOD::CaloClusterContainer>(m_emclustersName)) { - if (nevents == 1 && msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "No Collection with name " << m_emclustersName << " found in StoreGate" << endmsg; - else if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "No Collection with name " << m_emclustersName << " found in StoreGate" << endmsg; - return StatusCode::SUCCESS; - } - else { - StatusCode sc = evtStore()->retrieve(emclusters,m_emclustersName); - if (sc.isFailure()) { - if(nevents == 1 && msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "Could not retrieve Collection " << m_emclustersName << " from StoreGate" << endmsg; - else if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Could not retrieve Collection " << m_emclustersName << " from StoreGate" << endmsg; - return StatusCode::SUCCESS; - } + const xAOD::CaloClusterContainer* emclusters = getCollectionWithCheck<xAOD::CaloClusterContainer>(evtStore(),m_emclustersName); + if (not emclusters){ + const std::string & errMsg = formErrorMessage(m_emclustersName); + if (firstEvent) ATH_MSG_WARNING( errMsg ); + else ATH_MSG_DEBUG(errMsg); + return StatusCode::RECOVERABLE; } // get track container from storegate - const xAOD::TrackParticleContainer* tracks = 0; - if (!evtStore()->contains<xAOD::TrackParticleContainer>(m_tracksName)) { - if (nevents == 1 && msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "No Collection with name " << m_tracksName << " found in StoreGate" << endmsg; - else if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "No Collection with name " << m_tracksName << " found in StoreGate" << endmsg; - return StatusCode::SUCCESS; - } - else { - StatusCode sc = evtStore()->retrieve(tracks,m_tracksName); - if (sc.isFailure()) { - if(nevents == 1) msg(MSG::WARNING) << "Could not retrieve Collection " << m_tracksName << " from StoreGate" << endmsg; - else if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Could not retrieve Collection " << m_tracksName << " from StoreGate" << endmsg; - return StatusCode::SUCCESS; - } + const xAOD::TrackParticleContainer* tracks = getCollectionWithCheck<xAOD::TrackParticleContainer>(evtStore(),m_tracksName); + if (not tracks){ + const std::string & errMsg = formErrorMessage(m_tracksName); + if (firstEvent) ATH_MSG_WARNING( errMsg ); + else ATH_MSG_DEBUG(errMsg); + return StatusCode::RECOVERABLE; } - // // get met container from storegate - if (msgLvl(MSG::DEBUG)) { - const xAOD::MissingETContainer* final_met = 0; - if (!evtStore()->contains<xAOD::MissingETContainer>(m_metName)) { - if (nevents == 1 && msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "No Collection with name " << m_metName << " found in StoreGate" << endmsg; - else if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "No Collection with name " << m_metName << " found in StoreGate" << endmsg; - return StatusCode::SUCCESS; - } - else { - StatusCode sc = evtStore()->retrieve(final_met,m_metName); - if (sc.isFailure()) { - if(nevents == 1 && msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "Could not retrieve Collection " << m_metName << " from StoreGate" << endmsg; - else if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Could not retrieve Collection " << m_metName << " from StoreGate" << endmsg; - return StatusCode::SUCCESS; - } - } - // ****************** - // Get the missing ET - // ****************** - const xAOD::MissingET *met; - met = (*final_met)[m_metRefFinalName]; - if (met) { - msg(MSG::DEBUG) << "MET = " << met->met() << endmsg; - } + // get met container from storegate + const xAOD::MissingETContainer* final_met = getCollectionWithCheck<xAOD::MissingETContainer>(evtStore(),m_metName); + if (not final_met){ + const std::string & errMsg = formErrorMessage(m_metName); + if (firstEvent) ATH_MSG_WARNING( errMsg ); + else ATH_MSG_DEBUG(errMsg); + return StatusCode::RECOVERABLE; } - + const xAOD::MissingET *met{}; + met = (*final_met)[m_metRefFinalName]; + if (met) { + ATH_MSG_DEBUG( "MET = " << met->met() ); + } m_Nevents->Fill(0.); // ******************* @@ -548,10 +474,10 @@ StatusCode IDPerfMonZee::fillHistograms() const xAOD::CaloCluster* LeadingEMcluster = getLeadingEMcluster(photons, electrons); const xAOD::CaloCluster* SecondLeadingEMcluster = getLeadingEMcluster(photons, electrons, LeadingEMcluster); - if((LeadingEMcluster != 0) && (SecondLeadingEMcluster != 0)) + if((LeadingEMcluster) and (SecondLeadingEMcluster)) ATH_MSG_DEBUG("Event has a leading and second leading EM cluster!"); - if (LeadingEMcluster != 0 && SecondLeadingEMcluster != 0) { + if (LeadingEMcluster and SecondLeadingEMcluster) { int leading_eta_region = etaRegion(LeadingEMcluster->etaBE(2)); int second_leading_eta_region = etaRegion(SecondLeadingEMcluster->etaBE(2)); double leading_dPhi = electronTrackMatchEta(tracks,LeadingEMcluster); @@ -561,63 +487,54 @@ StatusCode IDPerfMonZee::fillHistograms() const xAOD::TrackParticle* track_leading_emcluster = electronTrackMatch(tracks,LeadingEMcluster); const xAOD::TrackParticle* track_second_leading_emcluster = electronTrackMatch(tracks,SecondLeadingEMcluster); - if( (track_leading_emcluster != 0) && (track_second_leading_emcluster != 0) ) - ATH_MSG_DEBUG("Event has a tracks matched to both clusters!"); - + if( track_leading_emcluster and track_second_leading_emcluster) ATH_MSG_DEBUG("Event has a tracks matched to both clusters!"); + // // ********************* // Fill event histograms // ********************* - // get cluster, track invariant masses and fill pre-selection histograms double cluster_invmass = InvMass(LeadingEMcluster,SecondLeadingEMcluster); - ATH_MSG_DEBUG("Cluster invariant mass: " << cluster_invmass); + ATH_MSG_DEBUG("Cluster invariant mass: " << cluster_invmass); if (cluster_invmass > 0.) m_Zee_invmass->Fill(cluster_invmass); double track_invmass = 0.; - if (track_leading_emcluster != 0 && track_second_leading_emcluster != 0) { + if (track_leading_emcluster and track_second_leading_emcluster) { track_invmass = InvMass(track_leading_emcluster,track_second_leading_emcluster); ATH_MSG_DEBUG("Track invariant mass: " << track_invmass); if (track_invmass > 0.) m_Zee_trk_invmass->Fill(track_invmass); } - // does the event pass the Zee selection? int selected = isZee(LeadingEMcluster,SecondLeadingEMcluster,tracks); ATH_MSG_DEBUG("Event passed " << 3-selected << "/3 Zee cuts"); // fill histograms only with selected events if(selected == 0){ - //if ( selected <= 1 ) { ATH_MSG_DEBUG("Event passed selection -- filling histograms"); if (cluster_invmass > 0.) m_Zee_invmass_sel->Fill(cluster_invmass); if (track_invmass > 0.) m_Zee_trk_invmass_sel->Fill(track_invmass); - //} // selected <= 1 loop used to end here - // fill e/p histos from SELECTED Zee events - if (track_leading_emcluster != 0 && track_second_leading_emcluster !=0) { - double eoverp_pos = -99.; - double eoverp_neg = -99.; - double track_leading_emcluster_p = track_leading_emcluster->pt()*cosh(track_leading_emcluster->eta()); - double track_second_leading_emcluster_p = track_second_leading_emcluster->pt()*cosh(track_second_leading_emcluster->eta()); - - if (track_leading_emcluster->charge() == 1. && track_second_leading_emcluster->charge() == -1.) { - eoverp_pos = LeadingEMcluster->e()/track_leading_emcluster_p; - eoverp_neg = SecondLeadingEMcluster->e()/track_second_leading_emcluster_p; - } - else if (track_leading_emcluster->charge() == -1. && track_second_leading_emcluster->charge() == 1.) { - eoverp_neg = LeadingEMcluster->e()/track_leading_emcluster_p; - eoverp_pos = SecondLeadingEMcluster->e()/track_second_leading_emcluster_p; - } - - double eoverpasym = -99.; - if (eoverp_pos+eoverp_neg != 0.) { - eoverpasym = (eoverp_pos-eoverp_neg) / (eoverp_pos+eoverp_neg); - m_Zee_Eopasym_perevent->Fill(eoverpasym); - if ( (eoverp_pos > m_eoverp_tight_min) && (eoverp_pos < m_eoverp_tight_max) && (eoverp_neg > m_eoverp_tight_min) && (eoverp_neg < m_eoverp_tight_max) ) { - m_Zee_Eopasym_perevent_central->Fill(eoverpasym); - } - } + if (track_leading_emcluster && track_second_leading_emcluster) { + double eoverp_pos = -99.; + double eoverp_neg = -99.; + double track_leading_emcluster_p = track_leading_emcluster->pt()*cosh(track_leading_emcluster->eta()); + double track_second_leading_emcluster_p = track_second_leading_emcluster->pt()*std::cosh(track_second_leading_emcluster->eta()); + + if (track_leading_emcluster->charge() == 1. && track_second_leading_emcluster->charge() == -1.) { + eoverp_pos = LeadingEMcluster->e()/track_leading_emcluster_p; + eoverp_neg = SecondLeadingEMcluster->e()/track_second_leading_emcluster_p; + } else if (track_leading_emcluster->charge() == -1. && track_second_leading_emcluster->charge() == 1.) { + eoverp_neg = LeadingEMcluster->e()/track_leading_emcluster_p; + eoverp_pos = SecondLeadingEMcluster->e()/track_second_leading_emcluster_p; + } + double eoverpasym = -99.; + if (eoverp_pos+eoverp_neg != 0.) { + eoverpasym = (eoverp_pos-eoverp_neg) / (eoverp_pos+eoverp_neg); + m_Zee_Eopasym_perevent->Fill(eoverpasym); + if ( (eoverp_pos > m_eoverp_tight_min) && (eoverp_pos < m_eoverp_tight_max) && (eoverp_neg > m_eoverp_tight_min) && (eoverp_neg < m_eoverp_tight_max) ) { + m_Zee_Eopasym_perevent_central->Fill(eoverpasym); + } + } } } - // *********************** // Fill cluster histograms // *********************** @@ -634,38 +551,17 @@ StatusCode IDPerfMonZee::fillHistograms() FillHistosPerCluster(SecondLeadingEMcluster, track_second_leading_emcluster, incl, second_leading_dEta, second_leading_dPhi); } } - return StatusCode::SUCCESS; } void IDPerfMonZee::makeEffHisto(TH1F* h_num, TH1F* h_denom, TH1F* h_eff) { h_eff->Divide(h_num,h_denom,1.,1.,"B"); - // int Nbins; - // Nbins = h_num->GetNbinsX(); - // for (int bin=0; bin!=Nbins; ++bin) { - // int Npass = int(h_num->GetBinContent(bin+1)); - // int Nfail = int(h_denom->GetBinContent(bin+1)) - Npass; - // double x = h_denom->GetBinCenter(bin+1); - // for (int pass=0; pass!=Npass; ++pass) { - // h_eff->Fill(x,1.); - // } - // for (int fail=0; fail!=Nfail; ++fail) { - // h_eff->Fill(x,0.); - // } - // } } StatusCode IDPerfMonZee::procHistograms() { - - //if( endOfLowStatFlag() || endOfLumiBlockFlag() ) { - // - //} - if( endOfRunFlag() ) { - // PostProcess Zee histograms - for (int region=0; region!=1; ++region) { makeEffHisto(m_Zee_trackmatched_eta[region],m_Zee_eta[region],m_Zee_trackmatch_eff_vs_eta[region]); makeEffHisto(m_Zee_trackmatched_phi[region],m_Zee_phi[region],m_Zee_trackmatch_eff_vs_phi[region]); @@ -673,7 +569,6 @@ StatusCode IDPerfMonZee::procHistograms() makeEffHisto(m_Zee_trackmatched_Eopmatched_phi[region],m_Zee_trackmatched_phi[region],m_Zee_Eopmatch_eff_vs_phi[region]); makeEffHisto(m_Zee_trackmatched_tightEopmatched_eta[region],m_Zee_trackmatched_eta[region],m_Zee_tightEopmatch_eff_vs_eta[region]); makeEffHisto(m_Zee_trackmatched_tightEopmatched_phi[region],m_Zee_trackmatched_phi[region],m_Zee_tightEopmatch_eff_vs_phi[region]); - // these were commented out m_Zee_Eopdiff[region]->Add(m_Zee_Eop_plus[region],m_Zee_Eop_minus[region],1.,-1); m_Zee_Eopdiff_vs_p[region]->Add(m_Zee_meanEop_vs_p_plus[region],m_Zee_meanEop_vs_p_minus[region],1.,-1); @@ -693,17 +588,11 @@ StatusCode IDPerfMonZee::procHistograms() const xAOD::CaloCluster* IDPerfMonZee::getLeadingEMcluster(const xAOD::CaloClusterContainer* clusters, const xAOD::CaloCluster* omitCluster) const { - // iterators over the emcluster container - xAOD::CaloClusterContainer::const_iterator Itr = clusters->begin(); - xAOD::CaloClusterContainer::const_iterator ItrEnd = clusters->end(); - - const xAOD::CaloCluster* leading_emcluster = 0; - + const xAOD::CaloCluster* leading_emcluster{}; float max_pt = 0.; - for (; Itr != ItrEnd; ++Itr) { - const xAOD::CaloCluster* cl = (*Itr); + for (const auto &cl: *clusters) { if (cl == omitCluster) continue; - double deltaR = sqrt(pow(fabs(cl->phi() - omitCluster->phi()),2) + pow(fabs(cl->eta() - omitCluster->eta()),2)); + double deltaR = std::sqrt(std::pow(std::fabs(cl->phi() - omitCluster->phi()),2) + std::pow(std::fabs(cl->eta() - omitCluster->eta()),2)); if(deltaR < 0.005) continue; if (cl->pt()/Gaudi::Units::GeV < 10.) continue; if (cl->pt() > max_pt) { @@ -712,22 +601,14 @@ const xAOD::CaloCluster* IDPerfMonZee::getLeadingEMcluster(const xAOD::CaloClust } } return leading_emcluster; - } const xAOD::CaloCluster* IDPerfMonZee::getLeadingEMcluster(const xAOD::PhotonContainer* /*photons*/, const xAOD::ElectronContainer* electrons, const xAOD::CaloCluster* omitCluster) const { - - // iterators over the electron container - xAOD::ElectronContainer::const_iterator electronItr = electrons->begin(); - xAOD::ElectronContainer::const_iterator electronItrEnd = electrons->end(); - - const xAOD::CaloCluster* leading_emcluster = 0; + const xAOD::CaloCluster* leading_emcluster{}; bool LHSel; float max_pt = 0.; - - for (; electronItr != electronItrEnd; ++electronItr) { + for (const auto & em: *electrons) { ATH_MSG_DEBUG("Checking likelihood"); - const xAOD::Electron* em = (*electronItr); // check ID if(m_doIDCuts){ LHSel = false; @@ -735,10 +616,9 @@ const xAOD::CaloCluster* IDPerfMonZee::getLeadingEMcluster(const xAOD::PhotonCon if(!LHSel) continue; ATH_MSG_DEBUG("Electron passes " << m_electronIDLevel << " likelihood selection"); } - const xAOD::CaloCluster* cl = em->caloCluster(); if (cl == omitCluster) continue; - double deltaR = !omitCluster ? 1.0 : sqrt(pow(fabs(cl->phi() - omitCluster->phi()),2) + pow(fabs(cl->eta() - omitCluster->eta()),2)); + double deltaR = !omitCluster ? 1.0 : std::sqrt(std::pow(std::fabs(cl->phi() - omitCluster->phi()),2) + std::pow(std::fabs(cl->eta() - omitCluster->eta()),2)); if(deltaR < 0.005) continue; if (cl->pt()/Gaudi::Units::GeV < 20.) continue; if (cl->pt() > max_pt) { @@ -746,92 +626,58 @@ const xAOD::CaloCluster* IDPerfMonZee::getLeadingEMcluster(const xAOD::PhotonCon max_pt = cl->pt(); } } - ATH_MSG_DEBUG("leading_emcluster: " << leading_emcluster); - return leading_emcluster; - } const xAOD::TrackParticle* IDPerfMonZee::electronTrackMatch(const xAOD::TrackParticleContainer* tracks, const xAOD::CaloCluster* cluster, double dEta, double dPhi) const { - - // iterators over the track container - xAOD::TrackParticleContainer::const_iterator Itr = tracks->begin(); - xAOD::TrackParticleContainer::const_iterator ItrEnd = tracks->end(); - - const xAOD::TrackParticle* matched_track = 0; + const xAOD::TrackParticle* matched_track{}; double min_dR = 1.0e+20; - - for (; Itr!=ItrEnd; ++Itr) { - const xAOD::TrackParticle* track = (*Itr); + for (const auto & track: *tracks){ double deta = cluster->etaBE(2)-track->eta(); double dphi = cluster->phi()-track->phi(); - double dr = TMath::Sqrt(deta*deta + dphi*dphi); - if (dr < min_dR && TMath::Abs(deta) < dEta && TMath::Abs(dphi) < dPhi) { + double dr = std::sqrt(deta*deta + dphi*dphi); + if (dr < min_dR && std::fabs(deta) < dEta && std::fabs(dphi) < dPhi) { min_dR = dr; matched_track = track; } } - return matched_track; - } double IDPerfMonZee::electronTrackMatchEta(const xAOD::TrackParticleContainer* tracks, const xAOD::CaloCluster* cluster, double dEta) const { - - // iterators over the track container - xAOD::TrackParticleContainer::const_iterator Itr = tracks->begin(); - xAOD::TrackParticleContainer::const_iterator ItrEnd = tracks->end(); - - const xAOD::TrackParticle* matched_track = 0; + const xAOD::TrackParticle* matched_track{}; double min_dEta = 1.0e+20; - - for (; Itr!=ItrEnd; ++Itr) { - const xAOD::TrackParticle* track = (*Itr); - double deta = TMath::Abs(cluster->etaBE(2)-track->eta()); + for (const auto & track : *tracks){ + double deta = std::fabs(cluster->etaBE(2)-track->eta()); if (deta < min_dEta && deta < dEta) { min_dEta = deta; matched_track = track; } } - double dPhi = 1.0e+20; if (matched_track != 0) dPhi = signedDeltaPhi(cluster->phi(),matched_track->phi()); - return dPhi; - } double IDPerfMonZee::electronTrackMatchPhi(const xAOD::TrackParticleContainer* tracks, const xAOD::CaloCluster* cluster, double dPhi) const { - - // iterators over the track container - xAOD::TrackParticleContainer::const_iterator Itr = tracks->begin(); - xAOD::TrackParticleContainer::const_iterator ItrEnd = tracks->end(); - - const xAOD::TrackParticle* matched_track = 0; + const xAOD::TrackParticle* matched_track{}; double min_dPhi = 1.0e+20; - - for (; Itr!=ItrEnd; ++Itr) { - const xAOD::TrackParticle* track = (*Itr); - double dphi = TMath::Abs(signedDeltaPhi(cluster->phi(),track->phi())); + for (const auto track : *tracks){ + double dphi = std::fabs(signedDeltaPhi(cluster->phi(),track->phi())); if (dphi < min_dPhi && dphi < dPhi) { min_dPhi = dphi; matched_track = track; } } - double dEta = 1.0e+20; - if (matched_track != 0) dEta = cluster->etaBE(2)-matched_track->eta(); - + if (matched_track ) dEta = cluster->etaBE(2)-matched_track->eta(); return dEta; - } double IDPerfMonZee::InvMass(const xAOD::CaloCluster* EM1, const xAOD::CaloCluster* EM2) const { - if (EM1 == 0 || EM2 == 0) return -99.; - double invmass = 0.; if (EM1->pt() != 0 && EM2->pt() != 0.) { TLorentzVector particle1; @@ -840,16 +686,11 @@ double IDPerfMonZee::InvMass(const xAOD::CaloCluster* EM1, const xAOD::CaloClust particle2.SetPtEtaPhiE(EM2->pt()/Gaudi::Units::GeV,EM2->eta(),EM2->phi(),EM2->e()/Gaudi::Units::GeV); invmass = (particle1+particle2).Mag(); } - return invmass; - } double IDPerfMonZee::InvMass(const xAOD::TrackParticle* trk1, const xAOD::TrackParticle* trk2) const { - if (trk1 == 0 || trk2 == 0) return -99.; - - double invmass = 0.; if (trk1->pt() != 0 && trk2->pt() != 0.) { TLorentzVector particle1; @@ -858,39 +699,28 @@ double IDPerfMonZee::InvMass(const xAOD::TrackParticle* trk1, const xAOD::TrackP particle2.SetPtEtaPhiE(trk2->pt()/Gaudi::Units::GeV,trk2->eta(),trk2->phi(),trk2->e()/Gaudi::Units::GeV); invmass = (particle1+particle2).Mag(); } - return invmass; - } double IDPerfMonZee::TransMass(const xAOD::CaloCluster* EM, const xAOD::MissingET* met) const { - if (EM == 0 || met == 0) return -99.; - double transmass = 0.; float dphi = signedDeltaPhi(EM->phi(),met->phi()); - transmass = TMath::Sqrt(2.*EM->et()*met->met()*(1.-TMath::Cos(dphi))); - + transmass = std::sqrt(2.*EM->et()*met->met()*(1.-std::cos(dphi))); return transmass; - } double IDPerfMonZee::deltaR(const xAOD::CaloCluster* cluster, const xAOD::TrackParticle* track) const { double dr =-999.; if (cluster == 0 || track == 0) return dr; - double deta = cluster->etaBE(2)-track->eta(); double dphi = cluster->phi()-track->phi(); - dr = TMath::Sqrt(deta*deta + dphi*dphi); - + dr = std::sqrt(deta*deta + dphi*dphi); return dr; - } int IDPerfMonZee::isZee(const xAOD::CaloCluster* em1, const xAOD::CaloCluster* em2, const xAOD::TrackParticleContainer* tracks) const { - int selected = 3; - //are the two electrons oppositely charged? const xAOD::TrackParticle* track_leading_emcluster = electronTrackMatch(tracks,em1); const xAOD::TrackParticle* track_second_leading_emcluster = electronTrackMatch(tracks,em2); @@ -900,16 +730,12 @@ int IDPerfMonZee::isZee(const xAOD::CaloCluster* em1, const xAOD::CaloCluster* e } else if(track_leading_emcluster->charge() != track_second_leading_emcluster->charge()) --selected; - double invmass = InvMass(em1,em2); // given in GeV if (em1->pt()/Gaudi::Units::GeV > 20. && em2->pt()/Gaudi::Units::GeV > 20.) --selected; - if (invmass > 70. && invmass < 110.) --selected; - return selected; - } double IDPerfMonZee::signedDeltaPhi(double phi1, double phi2) const { @@ -924,19 +750,15 @@ double IDPerfMonZee::signedDeltaPhi(double phi1, double phi2) const { } int IDPerfMonZee::etaRegion(double eta) { - int region = -99; - - if (TMath::Abs(eta) <= 1.) region = barrel; + if (std::fabs(eta) <= 1.) region = barrel; else if (eta > 1.) region = eca; // eca else if (eta < -1.) region = ecc; // ecc - return region; } void IDPerfMonZee::FillHistosPerCluster(const xAOD::CaloCluster* cluster, const xAOD::TrackParticle* track, int region, float dEta, float dPhi) { - if (cluster == 0) return; if (region<0){ throw(std::out_of_range("Region index has negative value in IDPerfMonZee::FillHistosPerCluster")); @@ -948,47 +770,41 @@ void IDPerfMonZee::FillHistosPerCluster(const xAOD::CaloCluster* cluster, const // match in eta and phi separately and make dEta and dPhi plots if (dEta < 1.0e+20) { m_Zee_deta[region]->Fill(dEta); - if (TMath::Abs(dEta) < 0.05) { // calculate mean only for those in matching window - m_Zee_deta_vs_eta[region]->Fill(cluster->etaBE(2),dEta); - m_Zee_deta_vs_phi[region]->Fill(cluster->phi(),dEta); - m_Zee_deta_vs_eta_2d[region]->Fill(cluster->etaBE(2),dEta); - m_Zee_deta_vs_phi_2d[region]->Fill(cluster->phi(),dEta); - m_Zee_absdeta_vs_eta[region]->Fill(cluster->etaBE(2),TMath::Abs(dEta)); - m_Zee_absdeta_vs_phi[region]->Fill(cluster->phi(),TMath::Abs(dEta)); + if (std::fabs(dEta) < 0.05) { // calculate mean only for those in matching window + m_Zee_deta_vs_eta[region]->Fill(cluster->etaBE(2),dEta); + m_Zee_deta_vs_phi[region]->Fill(cluster->phi(),dEta); + m_Zee_deta_vs_eta_2d[region]->Fill(cluster->etaBE(2),dEta); + m_Zee_deta_vs_phi_2d[region]->Fill(cluster->phi(),dEta); + m_Zee_absdeta_vs_eta[region]->Fill(cluster->etaBE(2),std::fabs(dEta)); + m_Zee_absdeta_vs_phi[region]->Fill(cluster->phi(),std::fabs(dEta)); } } if (dPhi < 1.0e+20) { m_Zee_dphi[region]->Fill(dPhi); - if (TMath::Abs(dPhi) < 0.1) { // calculate mean only for those in matching window - m_Zee_dphi_vs_eta[region]->Fill(cluster->etaBE(2),dPhi); - m_Zee_dphi_vs_phi[region]->Fill(cluster->phi(),dPhi); - m_Zee_dphi_vs_eta_2d[region]->Fill(cluster->etaBE(2),dPhi); - m_Zee_dphi_vs_phi_2d[region]->Fill(cluster->phi(),dPhi); - m_Zee_absdphi_vs_eta[region]->Fill(cluster->etaBE(2),TMath::Abs(dPhi)); - m_Zee_absdphi_vs_phi[region]->Fill(cluster->phi(),TMath::Abs(dPhi)); + if (std::fabs(dPhi) < 0.1) { // calculate mean only for those in matching window + m_Zee_dphi_vs_eta[region]->Fill(cluster->etaBE(2),dPhi); + m_Zee_dphi_vs_phi[region]->Fill(cluster->phi(),dPhi); + m_Zee_dphi_vs_eta_2d[region]->Fill(cluster->etaBE(2),dPhi); + m_Zee_dphi_vs_phi_2d[region]->Fill(cluster->phi(),dPhi); + m_Zee_absdphi_vs_eta[region]->Fill(cluster->etaBE(2),std::fabs(dPhi)); + m_Zee_absdphi_vs_phi[region]->Fill(cluster->phi(),std::fabs(dPhi)); } } } // end inclusive only - - if (track == 0) return; + if (not track) return; // TRACK-MATCHED - float eoverp = 0.; - float track_p = track->pt()*cosh(track->eta()); + float track_p = track->pt()*std::cosh(track->eta()); if (track_p != 0.) eoverp = cluster->e()/track_p; - m_Zee_Eop[region]->Fill(eoverp); - if (track->charge() == 1.) { m_Zee_Eop_plus[region]->Fill(eoverp); } else if (track->charge() == -1.) { m_Zee_Eop_minus[region]->Fill(eoverp); } - if (region == incl) { // inclusive only - m_Zee_trackmatched_eta[region]->Fill(cluster->etaBE(2)); m_Zee_trackmatched_phi[region]->Fill(cluster->phi()); if (eoverp > m_eoverp_tight_min && eoverp < m_eoverp_tight_max) { @@ -1002,20 +818,19 @@ void IDPerfMonZee::FillHistosPerCluster(const xAOD::CaloCluster* cluster, const } if (track->charge() == 1.) { if (eoverp > m_eoverp_tight_min && eoverp < m_eoverp_tight_max) { - m_Zee_meanEop_vs_p_plus[region]->Fill(track_p/Gaudi::Units::GeV,eoverp); - m_Zee_meanEop_vs_invp_plus[region]->Fill(1./(track_p/Gaudi::Units::GeV),eoverp); - m_Zee_meanEop_vs_E_plus[region]->Fill(cluster->e()/Gaudi::Units::GeV,eoverp); - m_Zee_meanEop_vs_phi_plus[region]->Fill(track->phi(),eoverp); - m_Zee_meanEop_vs_eta_plus[region]->Fill(track->eta(),eoverp); + m_Zee_meanEop_vs_p_plus[region]->Fill(track_p/Gaudi::Units::GeV,eoverp); + m_Zee_meanEop_vs_invp_plus[region]->Fill(1./(track_p/Gaudi::Units::GeV),eoverp); + m_Zee_meanEop_vs_E_plus[region]->Fill(cluster->e()/Gaudi::Units::GeV,eoverp); + m_Zee_meanEop_vs_phi_plus[region]->Fill(track->phi(),eoverp); + m_Zee_meanEop_vs_eta_plus[region]->Fill(track->eta(),eoverp); } - } - else if (track->charge() == -1.) { + }else if (track->charge() == -1.) { if (eoverp > m_eoverp_tight_min && eoverp < m_eoverp_tight_max) { - m_Zee_meanEop_vs_p_minus[region]->Fill(track_p/Gaudi::Units::GeV,eoverp); - m_Zee_meanEop_vs_invp_minus[region]->Fill(1./(track_p/Gaudi::Units::GeV),eoverp); - m_Zee_meanEop_vs_E_minus[region]->Fill(cluster->e()/Gaudi::Units::GeV,eoverp); - m_Zee_meanEop_vs_phi_minus[region]->Fill(track->phi(),eoverp); - m_Zee_meanEop_vs_eta_minus[region]->Fill(track->eta(),eoverp); + m_Zee_meanEop_vs_p_minus[region]->Fill(track_p/Gaudi::Units::GeV,eoverp); + m_Zee_meanEop_vs_invp_minus[region]->Fill(1./(track_p/Gaudi::Units::GeV),eoverp); + m_Zee_meanEop_vs_E_minus[region]->Fill(cluster->e()/Gaudi::Units::GeV,eoverp); + m_Zee_meanEop_vs_phi_minus[region]->Fill(track->phi(),eoverp); + m_Zee_meanEop_vs_eta_minus[region]->Fill(track->eta(),eoverp); } } if (eoverp < m_eoverp_standard_max && eoverp > m_eoverp_standard_min) { @@ -1038,7 +853,6 @@ void IDPerfMonZee::FillHistosPerCluster(const xAOD::CaloCluster* cluster, const } if (eoverp > 0.5 && eoverp < 2.5) m_Zee_Eop_05_25[region]->Fill(0.5); if (eoverp > 1.5 && eoverp < 2.5) m_Zee_Eop_15_25[region]->Fill(0.5); - } // end inclusive only } diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonZmumu.cxx b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonZmumu.cxx index f75a9cb01f1ec17a555e89376f503650e53761eb..c481852983fda2cd7529f5a6b92746d36d77f4a4 100755 --- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonZmumu.cxx +++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonZmumu.cxx @@ -18,6 +18,8 @@ #include "InDetPerformanceMonitoring/ZmumuEvent.h" #include "egammaInterfaces/IegammaTrkRefitterTool.h" +#include "xAODTruth/TruthParticleContainer.h" +#include "xAODTruth/TruthVertex.h" #include "EventPrimitives/EventPrimitivesHelpers.h" //For extrapolation @@ -65,27 +67,18 @@ IDPerfMonZmumu::IDPerfMonZmumu(const std::string& name, m_truthTree(0), m_combStacoTree(0), m_combMuidTree(0) - { // Properties that are set from the python scripts. - - declareProperty("triggerChainName", m_sTriggerChainName ); declareProperty("OutputTracksName", m_outputTracksName = "ZmumuTracks"); declareProperty("doIsoSelection", m_doIsoSelection = true ); - declareProperty("ReFitterTool1", m_TrackRefitter1, "ToolHandle for track fitter implementation"); declareProperty("ReFitterTool2", m_TrackRefitter2, "ToolHandle for track fitter implementation"); - declareProperty ("TrackToVertexTool", m_trackToVertexTool); - declareProperty("ValidationMode", m_validationMode); - declareProperty("TrackTruthName", m_truthName="TrackTruthCollection"); declareProperty("TrackParticleName", m_trackParticleName="InDetTrackParticles"); - declareProperty("xAODTruthLinkVector",m_truthLinkVecName="xAODTruthLinks"); - declareProperty("isMC", m_isMC = false); } @@ -101,43 +94,18 @@ StatusCode IDPerfMonZmumu::initialize() // Setup the services ISvcLocator* pxServiceLocator = serviceLocator(); - if ( pxServiceLocator != NULL ) { - StatusCode xSC = PerfMonServices::InitialiseServices( pxServiceLocator ); - if ( !xSC.isSuccess() ) - { - ATH_MSG_FATAL("Problem Initializing PerfMonServices"); - //return PARENT::initialize(); - } + if ( pxServiceLocator ) { + StatusCode xSC = PerfMonServices::InitialiseServices( pxServiceLocator ); + if ( !xSC.isSuccess() ){ + ATH_MSG_FATAL("Problem Initializing PerfMonServices"); + + } } - // Retrieve fitter - if (m_TrackRefitter1.retrieve().isFailure()) { - ATH_MSG_FATAL("Unable to retrieve " << m_TrackRefitter1 ); - return StatusCode::FAILURE; - } else { - ATH_MSG_INFO("Retrieved tool" << m_TrackRefitter1 ); - } - - // Retrieve the second fitter - if (m_TrackRefitter2.retrieve().isFailure()) { - ATH_MSG_FATAL("Unable to retrieve " << m_TrackRefitter2 ); - return StatusCode::FAILURE; - } else { - ATH_MSG_INFO("Retrieved tool" << m_TrackRefitter2 ); - } - - - if (m_trackToVertexTool.retrieve().isFailure()) { - ATH_MSG_FATAL("Unable to retrieve " << m_trackToVertexTool ); - return StatusCode::FAILURE; - } else { - ATH_MSG_INFO("Retrieved tool" << m_trackToVertexTool ); - } - - - + ATH_CHECK(m_TrackRefitter1.retrieve()); + ATH_CHECK(m_TrackRefitter2.retrieve()); + ATH_CHECK(m_trackToVertexTool.retrieve()); if( m_defaultTree == 0){ - m_defaultTree = new TTree(m_defaultTreeName.c_str(), m_ValidationTreeDescription.c_str()); m_defaultTree->Branch("runNumber" , &m_runNumber, "runNumber/I"); @@ -162,7 +130,6 @@ StatusCode IDPerfMonZmumu::initialize() } if( m_refit1Tree == 0){ - m_refit1Tree = new TTree(m_refit1TreeName.c_str(), m_ValidationTreeDescription.c_str()); m_refit1Tree->Branch("runNumber" , &m_runNumber, "runNumber/I"); @@ -177,7 +144,6 @@ StatusCode IDPerfMonZmumu::initialize() m_refit1Tree->Branch("Negative_z0_err", &m_negative_z0_err, "Negative_z0_err/D"); m_refit1Tree->Branch("Negative_d0_err", &m_negative_d0_err, "Negative_d0_err/D"); - m_refit1Tree->Branch("Positive_Px", &m_positive_px, "Positive_Px/D"); m_refit1Tree->Branch("Positive_Py", &m_positive_py, "Positive_Py/D"); m_refit1Tree->Branch("Positive_Pz", &m_positive_pz, "Positive_Pz/D"); @@ -188,7 +154,6 @@ StatusCode IDPerfMonZmumu::initialize() } if( m_refit2Tree == 0){ - m_refit2Tree = new TTree(m_refit2TreeName.c_str(), m_ValidationTreeDescription.c_str()); m_refit2Tree->Branch("runNumber" , &m_runNumber, "runNumber/I"); @@ -203,8 +168,6 @@ StatusCode IDPerfMonZmumu::initialize() m_refit2Tree->Branch("Negative_z0_err", &m_negative_z0_err, "Negative_z0_err/D"); m_refit2Tree->Branch("Negative_d0_err", &m_negative_d0_err, "Negative_d0_err/D"); - - m_refit2Tree->Branch("Positive_Px", &m_positive_px, "Positive_Px/D"); m_refit2Tree->Branch("Positive_Py", &m_positive_py, "Positive_Py/D"); m_refit2Tree->Branch("Positive_Pz", &m_positive_pz, "Positive_Pz/D"); @@ -214,29 +177,7 @@ StatusCode IDPerfMonZmumu::initialize() m_refit2Tree->Branch("Positive_d0_err", &m_positive_d0_err, "Positive_d0_err/D"); } - // if( m_meStacoTree == 0){ - - //m_meStacoTree = new TTree(m_meStacoTreeName.c_str(), m_ValidationTreeDescription.c_str()); - - //m_meStacoTree->Branch("runNumber" , &m_runNumber, "runNumber/I"); - //m_meStacoTree->Branch("eventNumber" , &m_evtNumber, "eventNumber/I"); - //m_meStacoTree->Branch("lumi_block" , &m_lumi_block, "lumi_block/I"); - - //m_meStacoTree->Branch("Negative_Px", &m_negative_px, "Negative_Px/D"); - //m_meStacoTree->Branch("Negative_Py", &m_negative_py, "Negative_Py/D"); - //m_meStacoTree->Branch("Negative_Pz", &m_negative_pz, "Negative_Pz/D"); - //m_meStacoTree->Branch("Negative_z0", &m_negative_z0, "Negative_z0/D"); - //m_meStacoTree->Branch("Negative_d0", &m_negative_d0, "Negative_d0/D"); - - //m_meStacoTree->Branch("Positive_Px", &m_positive_px, "Positive_Px/D"); - //m_meStacoTree->Branch("Positive_Py", &m_positive_py, "Positive_Py/D"); - //m_meStacoTree->Branch("Positive_Pz", &m_positive_pz, "Positive_Pz/D"); - //m_meStacoTree->Branch("Positive_z0", &m_positive_z0, "Positive_z0/D"); - //m_meStacoTree->Branch("Positive_d0", &m_positive_d0, "Positive_d0/D"); - //} - if( m_combStacoTree == 0){ - m_combStacoTree = new TTree(m_combStacoTreeName.c_str(), m_ValidationTreeDescription.c_str()); m_combStacoTree->Branch("runNumber" , &m_runNumber, "runNumber/I"); @@ -251,7 +192,6 @@ StatusCode IDPerfMonZmumu::initialize() m_combStacoTree->Branch("Negative_z0_err", &m_negative_z0_err, "Negative_z0_err/D"); m_combStacoTree->Branch("Negative_d0_err", &m_negative_d0_err, "Negative_d0_err/D"); - m_combStacoTree->Branch("Positive_Px", &m_positive_px, "Positive_Px/D"); m_combStacoTree->Branch("Positive_Py", &m_positive_py, "Positive_Py/D"); m_combStacoTree->Branch("Positive_Pz", &m_positive_pz, "Positive_Pz/D"); @@ -263,7 +203,6 @@ StatusCode IDPerfMonZmumu::initialize() if( m_combMuidTree == 0){ - m_combMuidTree = new TTree(m_combMuidTreeName.c_str(), m_ValidationTreeDescription.c_str()); m_combMuidTree->Branch("runNumber" , &m_runNumber, "runNumber/I"); @@ -278,8 +217,6 @@ StatusCode IDPerfMonZmumu::initialize() m_combMuidTree->Branch("Negative_z0_err", &m_negative_z0_err, "Negative_z0_err/D"); m_combMuidTree->Branch("Negative_d0_err", &m_negative_d0_err, "Negative_d0_err/D"); - - m_combMuidTree->Branch("Positive_Px", &m_positive_px, "Positive_Px/D"); m_combMuidTree->Branch("Positive_Py", &m_positive_py, "Positive_Py/D"); m_combMuidTree->Branch("Positive_Pz", &m_positive_pz, "Positive_Pz/D"); @@ -290,7 +227,6 @@ StatusCode IDPerfMonZmumu::initialize() } if( m_isMC && m_truthTree == 0){ - m_truthTree = new TTree(m_truthTreeName.c_str(), m_ValidationTreeDescription.c_str()); m_truthTree->Branch("runNumber" , &m_runNumber, "runNumber/I"); @@ -317,48 +253,47 @@ StatusCode IDPerfMonZmumu::initialize() // now register the Trees ITHistSvc* tHistSvc = 0; if (service("THistSvc",tHistSvc).isFailure()){ - ATH_MSG_ERROR("initialize() Could not find Hist Service -> Switching ValidationMode Off !"); + ATH_MSG_WARNING("initialize() Could not find Hist Service -> Switching ValidationMode Off !"); m_validationMode = false; } if ((tHistSvc->regTree(m_defaultTreeFolder, m_defaultTree)).isFailure() ) { - ATH_MSG_ERROR("initialize() Could not register the validation Tree -> Switching ValidationMode Off !"); + ATH_MSG_WARNING("initialize() Could not register the validation Tree -> Switching ValidationMode Off !"); delete m_defaultTree; m_defaultTree = 0; m_validationMode = false; } if ((tHistSvc->regTree(m_refit1TreeFolder, m_refit1Tree)).isFailure() ) { - ATH_MSG_ERROR("initialize() Could not register the validation Tree -> Switching ValidationMode Off !"); + ATH_MSG_WARNING("initialize() Could not register the validation Tree -> Switching ValidationMode Off !"); delete m_refit1Tree; m_refit1Tree = 0; m_validationMode = false; } if ((tHistSvc->regTree(m_refit2TreeFolder, m_refit2Tree)).isFailure() ) { - ATH_MSG_ERROR("initialize() Could not register the validation Tree -> Switching ValidationMode Off !"); + ATH_MSG_WARNING("initialize() Could not register the validation Tree -> Switching ValidationMode Off !"); delete m_refit2Tree; m_refit2Tree = 0; m_validationMode = false; } if ((tHistSvc->regTree(m_combStacoTreeFolder, m_combStacoTree)).isFailure() ) { - ATH_MSG_ERROR("initialize() Could not register the validation Tree -> Switching ValidationMode Off !"); + ATH_MSG_WARNING("initialize() Could not register the validation Tree -> Switching ValidationMode Off !"); delete m_combStacoTree; m_combStacoTree = 0; m_validationMode = false; } if ((tHistSvc->regTree(m_combMuidTreeFolder, m_combMuidTree)).isFailure() ) { - ATH_MSG_ERROR("initialize() Could not register the validation Tree -> Switching ValidationMode Off !"); + ATH_MSG_WARNING("initialize() Could not register the validation Tree -> Switching ValidationMode Off !"); delete m_combMuidTree; m_combMuidTree = 0; m_validationMode = false; } if (m_isMC) { - if ((tHistSvc->regTree(m_truthTreeFolder, m_truthTree)).isFailure() ) { - ATH_MSG_ERROR("initialize() Could not register the validation Tree -> Switching ValidationMode Off !"); - delete m_truthTree; m_truthTree = 0; - m_validationMode = false; - } + if ((tHistSvc->regTree(m_truthTreeFolder, m_truthTree)).isFailure() ) { + ATH_MSG_WARNING("initialize() Could not register the validation Tree -> Switching ValidationMode Off !"); + delete m_truthTree; m_truthTree = 0; + m_validationMode = false; + } } - return StatusCode::SUCCESS; } @@ -371,13 +306,11 @@ void IDPerfMonZmumu::RegisterHistograms() StatusCode IDPerfMonZmumu::execute() { - ATH_MSG_DEBUG("Retrieving event info."); const EventInfo * eventInfo; - if (evtStore()->retrieve(eventInfo).isFailure()) + if (evtStore()->retrieve(eventInfo).isFailure()){ ATH_MSG_ERROR("Could not retrieve event info."); - else - { + }else{ m_runNumber = eventInfo->event_ID()->run_number(); m_evtNumber = eventInfo->event_ID()->event_number(); m_lumi_block = eventInfo->event_ID()->lumi_block(); @@ -403,21 +336,14 @@ StatusCode IDPerfMonZmumu::execute() FillRecParameters(p1_comb->track(), p1_comb->charge()); FillRecParameters(p2_comb->track(), p2_comb->charge()); m_combStacoTree->Fill(); - - } - - - if ( !m_xZmm.EventPassed() ) { //failed cuts, continue to next event return StatusCode::SUCCESS; } - TrackCollection* muonTrks = new TrackCollection(SG::OWN_ELEMENTS); TrackCollection* muonTrksRefit1 = new TrackCollection(SG::OWN_ELEMENTS); TrackCollection* muonTrksRefit2 = new TrackCollection(SG::OWN_ELEMENTS); - // changed refitting to combinedparticles since run II DESDM_ZMUMU did not store InDetTrackParticles if (!p1_comb->track() || !p2_comb->track()) { ATH_MSG_WARNING("Track missing! Skipping Event"); @@ -428,19 +354,20 @@ StatusCode IDPerfMonZmumu::execute() } - Trk::Track* defaultMuonTrk1 = 0; - Trk::Track* defaultMuonTrk2 = 0; - Trk::Track* refit1MuonTrk1 = 0; - Trk::Track* refit2MuonTrk1 = 0; - Trk::Track* refit1MuonTrk2 = 0; - Trk::Track* refit2MuonTrk2 = 0; + Trk::Track* defaultMuonTrk1{}; + Trk::Track* defaultMuonTrk2{}; + Trk::Track* refit1MuonTrk1{}; + Trk::Track* refit2MuonTrk1{}; + Trk::Track* refit1MuonTrk2{}; + Trk::Track* refit2MuonTrk2{}; - const xAOD::Electron* egam = 0; + const xAOD::Electron* egam{}; StatusCode fitStatus; //save default and refit track parameters if( p1_comb->track() ) { defaultMuonTrk1 = new Trk::Track(*p1_comb->track()); + IegammaTrkRefitterTool::Cache cache1{}; cache1.electron=egam; fitStatus = m_TrackRefitter1->refitTrack( p1_comb->track(),cache1 ); @@ -455,7 +382,6 @@ StatusCode IDPerfMonZmumu::execute() muonTrksRefit1->push_back(refit1MuonTrk1); ATH_MSG_DEBUG("Successfully refitted (1) track"); } - IegammaTrkRefitterTool::Cache cache2{}; cache2.electron=egam; fitStatus = m_TrackRefitter2->refitTrack( p1_comb->track(),cache2 ); @@ -470,7 +396,6 @@ StatusCode IDPerfMonZmumu::execute() muonTrksRefit2->push_back(refit2MuonTrk1); ATH_MSG_DEBUG("Successfully refitted (2) track"); } - } if( p2_comb->track() ) { @@ -499,43 +424,38 @@ StatusCode IDPerfMonZmumu::execute() ATH_MSG_DEBUG("Successfully refitted (2) track"); } } - //save tracks to storegrate / muonTrks->push_back(defaultMuonTrk1); muonTrks->push_back(defaultMuonTrk2); - StatusCode sc = evtStore()->record(muonTrks, m_outputTracksName, false); if (sc.isFailure()) { - if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "Failed storing " << m_outputTracksName << endmsg; + ATH_MSG_WARNING( "Failed storing " << m_outputTracksName ); } else{ - if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Stored "<< muonTrks->size() << " " << m_outputTracksName <<" into StoreGate" << endmsg; + ATH_MSG_DEBUG( "Stored "<< muonTrks->size() << " " << m_outputTracksName <<" into StoreGate"); } - sc = evtStore()->record(muonTrksRefit1, m_outputTracksName + "Refit1", false); if (sc.isFailure()) { - if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "Failed storing " << m_outputTracksName + "Refit1" << endmsg; + ATH_MSG_WARNING( "Failed storing " << m_outputTracksName + "Refit1"); } else { - if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Stored "<< muonTrksRefit1->size() << " " << m_outputTracksName + "Refit1" <<" into StoreGate" << endmsg; + ATH_MSG_DEBUG( "Stored "<< muonTrksRefit1->size() << " " << m_outputTracksName + "Refit1" <<" into StoreGate"); } sc = evtStore()->record(muonTrksRefit2, m_outputTracksName + "Refit2", false); if (sc.isFailure()) { - if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "Failed storing " << m_outputTracksName +"Refit2" << endmsg; + ATH_MSG_WARNING( "Failed storing " << m_outputTracksName +"Refit2" ); } else { - if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Stored "<< muonTrksRefit2->size() << " " << m_outputTracksName + "Refit2" <<" into StoreGate" << endmsg; + ATH_MSG_DEBUG( "Stored "<< muonTrksRefit2->size() << " " << m_outputTracksName + "Refit2" <<" into StoreGate" ); } - //fill truth first in case no truth match found if (m_isMC) { - if (FillTruthParameters(p1_comb).isFailure()){ ATH_MSG_WARNING("Failed to fill truth parameters - skipping event"); - return StatusCode::SUCCESS; + return StatusCode::SUCCESS; } if (FillTruthParameters(p2_comb).isFailure()){ ATH_MSG_WARNING("Failed to fill truth parameters - skipping event"); - return StatusCode::SUCCESS; + return StatusCode::SUCCESS; } ATH_MSG_DEBUG("fill truthTree with parameters : "); ATH_MSG_DEBUG("###### (negative) ########## "); @@ -552,7 +472,6 @@ StatusCode IDPerfMonZmumu::execute() << "Positive pz: " << m_positive_pz << "\n" << "Positive d0: " << m_positive_d0 << "\n" << "Positive z0: " << m_positive_z0 << "\n"); - m_truthTree->Fill(); } @@ -571,28 +490,24 @@ StatusCode IDPerfMonZmumu::execute() FillRecParameters(refit1MuonTrk1, p1_comb->charge()); FillRecParameters(refit1MuonTrk2, p2_comb->charge()); - ATH_MSG_DEBUG("fill refit1Tree with parameters : "); - ATH_MSG_DEBUG("###### (negative) ########## "); - ATH_MSG_DEBUG("Negative px: " << m_negative_px << "\n" + ATH_MSG_DEBUG("fill refit1Tree with parameters : "); + ATH_MSG_DEBUG("###### (negative) ########## "); + ATH_MSG_DEBUG("Negative px: " << m_negative_px << "\n" << "Negative py: " << m_negative_py << "\n" << "Negative pz: " << m_negative_pz << "\n" << "Negative d0: " << m_negative_d0 << "\n" << "Negative z0: " << m_negative_z0 << "\n"); - ATH_MSG_DEBUG("###### (positive) ########## "); - ATH_MSG_DEBUG( "Positive px: " << m_positive_px << "\n" + ATH_MSG_DEBUG("###### (positive) ########## "); + ATH_MSG_DEBUG( "Positive px: " << m_positive_px << "\n" << "Positive py: " << m_positive_py << "\n" << "Positive pz: " << m_positive_pz << "\n" << "Positive d0: " << m_positive_d0 << "\n" << "Positive z0: " << m_positive_z0 << "\n"); - - - - m_refit1Tree->Fill(); + m_refit1Tree->Fill(); } //fill refit2 ID parameters - if (muonTrksRefit2->size()<2) { ATH_MSG_WARNING("Refit2 muon tracks are missing!"); }else{ @@ -600,35 +515,28 @@ StatusCode IDPerfMonZmumu::execute() FillRecParameters(refit2MuonTrk2, p2_comb->charge()); m_refit2Tree->Fill(); } - FillRecParameters(p1_comb->track(), p1_comb->charge()); FillRecParameters(p2_comb->track(), p2_comb->charge()); m_combMuidTree->Fill(); - - return StatusCode::SUCCESS; } void IDPerfMonZmumu::FillRecParameters(const Trk::Track* track, double charge) { - if (!track){ ATH_MSG_WARNING("Empty Track. Skipping."); return; } const Trk::Perigee* trkPerigee = track->perigeeParameters(); - - - double px = 0; - double py = 0; - double pz = 0; - double d0 = 0; - double z0 = 0; - + double px{}; + double py{}; + double pz{}; + double d0{}; + double z0{}; if(trkPerigee){ double qOverP = trkPerigee->parameters()[Trk::qOverP]; - if (qOverP) { + if (qOverP!=0.) { px = trkPerigee->momentum().x(); py = trkPerigee->momentum().y(); pz = trkPerigee->momentum().z(); @@ -636,10 +544,8 @@ void IDPerfMonZmumu::FillRecParameters(const Trk::Track* track, double charge) z0 = trkPerigee->parameters()[Trk::z0]; } } - const Trk::AtaStraightLine* atBL = dynamic_cast<const Trk::AtaStraightLine*>(m_trackToVertexTool->trackAtBeamline( *track )); - if (atBL){ double qOverP = atBL->parameters()[Trk::qOverP]; if(qOverP){ @@ -651,8 +557,6 @@ void IDPerfMonZmumu::FillRecParameters(const Trk::Track* track, double charge) } } - - if (charge == 1) { m_positive_px = px; m_positive_py = py; @@ -660,7 +564,6 @@ void IDPerfMonZmumu::FillRecParameters(const Trk::Track* track, double charge) m_positive_z0 = z0; m_positive_d0 = d0; ATH_MSG_DEBUG("(Filled charge == 1 ) (reco)-> px : "<< px <<" py: "<<py <<" pz: "<<pz <<" d0: "<<d0<<" z0: "<< z0); - } else if (charge == -1) { m_negative_px = px; m_negative_py = py; @@ -668,98 +571,84 @@ void IDPerfMonZmumu::FillRecParameters(const Trk::Track* track, double charge) m_negative_z0 = z0; m_negative_d0 = d0; ATH_MSG_DEBUG("(Filled charge == -1 ) (reco)-> px : "<< px <<" py: "<<py <<" pz: "<<pz <<" d0: "<<d0<<" z0: "<<z0 ); - } - return; } StatusCode IDPerfMonZmumu::FillTruthParameters(const xAOD::TrackParticle* trackParticle) { + constexpr int muonId(13); double momX(0),momY(0),momZ(0), vtxX(0),vtxY(0),vtxZ(0); - const xAOD::TruthParticle* truthParticle = getTruthParticle( *trackParticle ); - if(truthParticle->hasProdVtx()){ - vtxX = truthParticle->prodVtx()->x(); - vtxY = truthParticle->prodVtx()->y(); - vtxZ = truthParticle->prodVtx()->z(); - momX = truthParticle->px(); - momY = truthParticle->py(); - momZ = truthParticle->pz(); - } + if(truthParticle->hasProdVtx()){ + vtxX = truthParticle->prodVtx()->x(); + vtxY = truthParticle->prodVtx()->y(); + vtxZ = truthParticle->prodVtx()->z(); + momX = truthParticle->px(); + momY = truthParticle->py(); + momZ = truthParticle->pz(); + } Amg::Vector3D pos(vtxX,vtxY,vtxZ); Amg::Vector3D mom(momX,momY,momZ); double charge = 0; - if(truthParticle->pdgId() == 13) charge = -1.; - else if(truthParticle->pdgId() == -13) charge = 1.; + if(truthParticle->pdgId() == muonId) charge = -1.; + else if(truthParticle->pdgId() == -muonId) charge = 1.; Trk::TrackParameters* parameters = new Trk::Perigee(pos,mom,charge,pos); - const Trk::AtaStraightLine* atBLi = dynamic_cast<const Trk::AtaStraightLine*>(m_trackToVertexTool->trackAtBeamline( *parameters )); - if(atBLi){ if (charge == 1) { - double qOverP = atBLi->parameters()[Trk::qOverP]; - if (qOverP) { - m_positive_px = atBLi->momentum().x(); - m_positive_py = atBLi->momentum().y(); - m_positive_pz = atBLi->momentum().z(); - m_positive_z0 = atBLi->parameters()[Trk::z0]; - m_positive_d0 = atBLi->parameters()[Trk::d0]; - - ATH_MSG_DEBUG("cand perig HEP particle (truth) px : "<< atBLi->momentum().x()); - ATH_MSG_DEBUG("cand perig HEP particle (truth) py : "<< atBLi->momentum().y()); - ATH_MSG_DEBUG("cand perig HEP particle (truth) pz : "<< atBLi->momentum().z()); - ATH_MSG_DEBUG("cand perig HEP particle (truth) d0 : "<< atBLi->parameters()[Trk::d0]); - ATH_MSG_DEBUG("cand perig HEP particle (truth) z0 : "<< atBLi->parameters()[Trk::z0]); - ATH_MSG_DEBUG("(Filled charge == 1 ) (truth)-> px : "<< m_positive_px <<" py: "<<m_positive_py <<" pz: "<<m_positive_pz <<" d0: "<<m_positive_d0<<" z0: "<<m_positive_z0); - } + double qOverP = atBLi->parameters()[Trk::qOverP]; + if (qOverP) { + m_positive_px = atBLi->momentum().x(); + m_positive_py = atBLi->momentum().y(); + m_positive_pz = atBLi->momentum().z(); + m_positive_z0 = atBLi->parameters()[Trk::z0]; + m_positive_d0 = atBLi->parameters()[Trk::d0]; + + ATH_MSG_DEBUG("cand perig HEP particle (truth) px : "<< atBLi->momentum().x()); + ATH_MSG_DEBUG("cand perig HEP particle (truth) py : "<< atBLi->momentum().y()); + ATH_MSG_DEBUG("cand perig HEP particle (truth) pz : "<< atBLi->momentum().z()); + ATH_MSG_DEBUG("cand perig HEP particle (truth) d0 : "<< atBLi->parameters()[Trk::d0]); + ATH_MSG_DEBUG("cand perig HEP particle (truth) z0 : "<< atBLi->parameters()[Trk::z0]); + ATH_MSG_DEBUG("(Filled charge == 1 ) (truth)-> px : "<< m_positive_px <<" py: "<<m_positive_py <<" pz: "<<m_positive_pz <<" d0: "<<m_positive_d0<<" z0: "<<m_positive_z0); + } } else if (charge == -1) { - double qOverP = atBLi->parameters()[Trk::qOverP]; - if (qOverP) { - m_negative_px = atBLi->momentum().x(); - m_negative_py = atBLi->momentum().y(); - m_negative_pz = atBLi->momentum().z(); - m_negative_z0 = atBLi->parameters()[Trk::z0]; - m_negative_d0 = atBLi->parameters()[Trk::d0]; - ATH_MSG_DEBUG("cand perig HEP particle (truth) px : "<< atBLi->momentum().x()); - ATH_MSG_DEBUG("cand perig HEP particle (truth) py : "<< atBLi->momentum().y()); - ATH_MSG_DEBUG("cand perig HEP particle (truth) pz : "<< atBLi->momentum().z()); - ATH_MSG_DEBUG("cand perig HEP particle (truth) d0 : "<< atBLi->parameters()[Trk::d0]); - ATH_MSG_DEBUG("cand perig HEP particle (truth) z0 : "<< atBLi->parameters()[Trk::z0]); - ATH_MSG_DEBUG("(Filled charge == -1 ) (truth)-> px : "<< m_negative_px <<" py: "<<m_negative_py <<" pz: "<<m_negative_pz <<" d0: "<<m_negative_d0<<" z0: "<<m_negative_z0); - } + double qOverP = atBLi->parameters()[Trk::qOverP]; + if (qOverP) { + m_negative_px = atBLi->momentum().x(); + m_negative_py = atBLi->momentum().y(); + m_negative_pz = atBLi->momentum().z(); + m_negative_z0 = atBLi->parameters()[Trk::z0]; + m_negative_d0 = atBLi->parameters()[Trk::d0]; + ATH_MSG_DEBUG("cand perig HEP particle (truth) px : "<< atBLi->momentum().x()); + ATH_MSG_DEBUG("cand perig HEP particle (truth) py : "<< atBLi->momentum().y()); + ATH_MSG_DEBUG("cand perig HEP particle (truth) pz : "<< atBLi->momentum().z()); + ATH_MSG_DEBUG("cand perig HEP particle (truth) d0 : "<< atBLi->parameters()[Trk::d0]); + ATH_MSG_DEBUG("cand perig HEP particle (truth) z0 : "<< atBLi->parameters()[Trk::z0]); + ATH_MSG_DEBUG("(Filled charge == -1 ) (truth)-> px : "<< m_negative_px <<" py: "<<m_negative_py <<" pz: "<<m_negative_pz <<" d0: "<<m_negative_d0<<" z0: "<<m_negative_z0); + } } }//atBL - - - return StatusCode::SUCCESS; } const xAOD::TruthParticle* IDPerfMonZmumu::getTruthParticle( const xAOD::IParticle& p ) { - - /// A convenience type declaration typedef ElementLink< xAOD::TruthParticleContainer > Link_t; - /// A static accessor for the information static SG::AuxElement::ConstAccessor< Link_t > acc( "truthParticleLink" ); - // Check if such a link exists on the object: if( ! acc.isAvailable( p ) ) { return 0; } - // Get the link: const Link_t& link = acc( p ); - // Check if the link is valid: if( ! link.isValid() ) { return 0; } - // Everything has passed, let's return the pointer: return *link; } diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMuonRefitter.cxx b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMuonRefitter.cxx index e985a542b9d56a39c550fae199c0926a21266a9c..2b817df78d7b08f2702868a9c4bfb8cc8e59d82c 100755 --- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMuonRefitter.cxx +++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMuonRefitter.cxx @@ -18,7 +18,6 @@ #include "xAODMuon/MuonContainer.h" //Interface Headers -#include "egammaInterfaces/IegammaTrkRefitterTool.h" #include "TrkTrack/TrackCollection.h" // ATLAS headers @@ -26,8 +25,6 @@ #include "StoreGate/StoreGateSvc.h" - - //================================================================================== // Public Methods //================================================================================== @@ -42,38 +39,28 @@ IDPerfMuonRefitter::IDPerfMuonRefitter(const std::string& name, m_container(PerfMonServices::MUON_COLLECTION) { // Properties that are set from the python scripts. - - declareProperty("OutputTracksName", m_outputTracksName = "IDMuonTracks"); - declareProperty("ReFitterTool1", m_TrackRefitter1, "ToolHandle for track fitter implementation"); declareProperty("ReFitterTool2", m_TrackRefitter2, "ToolHandle for track fitter implementation"); } - IDPerfMuonRefitter::~IDPerfMuonRefitter() {} - StatusCode IDPerfMuonRefitter::initialize() { - - // Setup the services ISvcLocator* pxServiceLocator = serviceLocator(); - - if ( pxServiceLocator != NULL ) { + if ( pxServiceLocator ) { StatusCode xSC = PerfMonServices::InitialiseServices( pxServiceLocator ); if ( !xSC.isSuccess() ) { ATH_MSG_FATAL("Problem Initializing PerfMonServices"); } } - - // Retrieve fitter if (m_TrackRefitter1.retrieve().isFailure()) { ATH_MSG_FATAL("Unable to retrieve " << m_TrackRefitter1 ); @@ -81,7 +68,6 @@ StatusCode IDPerfMuonRefitter::initialize() } else { ATH_MSG_INFO("Retrieved tool" << m_TrackRefitter1 ); } - // Retrieve the second fitter if (m_TrackRefitter2.retrieve().isFailure()) { ATH_MSG_FATAL("Unable to retrieve " << m_TrackRefitter2 ); @@ -89,9 +75,6 @@ StatusCode IDPerfMuonRefitter::initialize() } else { ATH_MSG_INFO("Retrieved tool" << m_TrackRefitter2 ); } - - - return StatusCode::SUCCESS; } @@ -100,49 +83,29 @@ StatusCode IDPerfMuonRefitter::initialize() StatusCode IDPerfMuonRefitter::execute() { - const xAOD::MuonContainer* pxMuonContainer = PerfMonServices::getContainer<xAOD::MuonContainer>( m_container ); if (!pxMuonContainer){ ATH_MSG_FATAL("Unable to retrieve the muon collection" ); return StatusCode::FAILURE; } - - TrackCollection* muonTrks = new TrackCollection(SG::OWN_ELEMENTS); TrackCollection* muonTrksRefit1 = new TrackCollection(SG::OWN_ELEMENTS); TrackCollection* muonTrksRefit2 = new TrackCollection(SG::OWN_ELEMENTS); - - - - xAOD::MuonContainer::const_iterator xMuonItr = pxMuonContainer->begin(); - for ( ; xMuonItr != pxMuonContainer->end(); xMuonItr++ ) - { - const xAOD::Muon* muon = *xMuonItr; - + for (const auto & muon : *pxMuonContainer){ if (!muon) { ATH_MSG_WARNING("CB Muons missing!"); continue; } ++m_N_Muons; - - - - //const std::string region = m_xZmm.getRegion(); const xAOD::TrackParticle* idTP = muon->trackParticle(xAOD::Muon::InnerDetectorTrackParticle); - if (!idTP) { ATH_MSG_DEBUG("ID TrackParticles missing! Skipping Muon"); continue; } - - - Trk::Track* defaultMuonTrk = 0; - Trk::Track* refit1MuonTrk = 0; - Trk::Track* refit2MuonTrk = 0; - - const xAOD::Electron* eg = 0; - - + Trk::Track* defaultMuonTrk{}; + Trk::Track* refit1MuonTrk{}; + Trk::Track* refit2MuonTrk{}; + const xAOD::Electron* eg{}; StatusCode fitStatus; //save default and refit track parameters if( idTP->track() ) { @@ -171,38 +134,27 @@ StatusCode IDPerfMuonRefitter::execute() ATH_MSG_DEBUG("Track Refit2 Failed. Skipping Muon"); continue; } - } - - - }// End loop over muons - - - //Store information into storegate StatusCode sc = evtStore()->record(muonTrks, m_outputTracksName, false); if (sc.isFailure()) { - if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "Failed storing " << m_outputTracksName << endmsg; - } - else{ - if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Stored "<< muonTrks->size() << " " << m_outputTracksName <<" into StoreGate" << endmsg; + ATH_MSG_WARNING( "Failed storing " << m_outputTracksName); + } else{ + ATH_MSG_DEBUG( "Stored "<< muonTrks->size() << " " << m_outputTracksName <<" into StoreGate" ); } - sc = evtStore()->record(muonTrksRefit1, m_outputTracksName + "Refit1", false); if (sc.isFailure()) { - if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "Failed storing " << m_outputTracksName + "Refit1" << endmsg; + ATH_MSG_WARNING( "Failed storing " << m_outputTracksName + "Refit1" ); } else { - if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Stored "<< muonTrksRefit1->size() << " " << m_outputTracksName + "Refit1" <<" into StoreGate" << endmsg; + ATH_MSG_DEBUG( "Stored "<< muonTrksRefit1->size() << " " << m_outputTracksName + "Refit1" <<" into StoreGate"); } - sc = evtStore()->record(muonTrksRefit2, m_outputTracksName + "Refit2", false); if (sc.isFailure()) { - if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "Failed storing " << m_outputTracksName +"Refit2" << endmsg; + ATH_MSG_WARNING( "Failed storing " << m_outputTracksName +"Refit2" ); } else { - if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Stored "<< muonTrksRefit2->size() << " " << m_outputTracksName + "Refit2" <<" into StoreGate" << endmsg; + ATH_MSG_DEBUG( "Stored "<< muonTrksRefit2->size() << " " << m_outputTracksName + "Refit2" <<" into StoreGate" ); } - return StatusCode::SUCCESS; } @@ -217,8 +169,5 @@ StatusCode IDPerfMuonRefitter::finalize() ATH_MSG_INFO(m_N_MuonRefitFailures << "\t\t Muons refit failures" ); ATH_MSG_INFO("***************************************************"); ATH_MSG_INFO("***************************************************"); - - - return StatusCode::SUCCESS; } diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/MuonSelector.cxx b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/MuonSelector.cxx index 405fc6565919ad4f8612b1b1d250a4584e15a89d..3284a786125daa7c67a7c8828127af8c941ebb34 100644 --- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/MuonSelector.cxx +++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/MuonSelector.cxx @@ -19,19 +19,16 @@ #include "InDetPerformanceMonitoring/MuonSelector.h" // Package Headers #include "InDetPerformanceMonitoring/PerfMonServices.h" -#include <sstream> // ATLAS headers #include "StoreGate/StoreGateSvc.h" -//#include "muonEvent/MuonParamDefs.h" #include "CLHEP/Random/RandFlat.h" #include "GaudiKernel/IToolSvc.h" #include "xAODMuon/Muon.h" #include "xAODMuon/MuonContainer.h" - - - +#include <vector> +#include <cmath> // Static declarations unsigned int MuonSelector::s_uNumInstances; @@ -43,46 +40,31 @@ unsigned int MuonSelector::s_uNumInstances; MuonSelector::MuonSelector() { ++s_uNumInstances; - - std::stringstream xTmp; xTmp << s_uNumInstances; - m_xSampleName = "MuID_" + xTmp.str(); - - m_pxMuon = NULL; + m_xSampleName = "MuID_" + std::to_string(s_uNumInstances); + m_pxMuon = nullptr; m_bLock = false; - - - m_coneSize = 0.4; m_ucJMuon_Cut = 0; //not used m_IsoCut = 0.2; - m_bCutOnCombKine = false; //not used m_fEtaCut = 2.5; - //m_fEtaCut = 1.9; - m_combPtCut = 15.0*CLHEP::GeV; // GeV/c - // m_combPtCut = .01*CLHEP::GeV; // GeV/c - - //m_ptMSCut = 10.0*CLHEP::GeV; + m_combPtCut = 15.0*CLHEP::GeV; // GeV/c m_ptMSCut = 0.0*CLHEP::GeV; m_diffZCut = 10.0*CLHEP::mm; // mm m_diffPtCut = 15.0*CLHEP::GeV; // not used m_pVZCut = 150.0*CLHEP::mm; // mm - m_fIDPtCut = 0.0; // GeV/c m_fIDChiPerDofCut = 4.0; m_IDSiHitsCut = 8; m_ucID_PIXCut = 1; // Hits m_ucID_SCTCut = 4; // Hits m_ucID_TRTCut = 0; // Hits - m_doDebug = false; m_doQualSelection = true; m_doIsoSelection = false; m_doPtSelection = true; m_doIPSelection = true; - m_msgStream = new MsgStream(PerfMonServices::getMessagingService(), "InDetPerformanceMonitoring" ); - } @@ -93,44 +75,33 @@ MuonSelector::~MuonSelector() delete m_msgStream; } -//bool MuonSelector::passSelection( const Analysis::Muon* pxMuon ) bool MuonSelector::passSelection( const xAOD::Muon* pxMuon ) -{ - - std::vector<bool> passes; - bool pass = true; - if ( pxMuon ) - { - // Save local copy of muon address if it's ok. - m_pxMuon = pxMuon; - // Test muon pass conditions in turn - if(m_doQualSelection){ - pass = passQualCuts(); - passes.push_back(pass); - } - - if (m_doIsoSelection){ - pass = passIsolCuts(); - passes.push_back(pass); - } - - if (m_doPtSelection){ - pass = passPtCuts(); - passes.push_back(pass); - } - - if (m_doIPSelection){ - pass = passIPCuts(); - passes.push_back(pass); - } - - for (int i=0; i < int(passes.size()); i++) - if (false == passes[i]){ - if(m_doDebug) std::cout << " haven't passed the " << i <<"th selection " << std::endl; - return false; - } - +{ + auto issueCutMessage = [this](const std::string & cutName){ + auto msg= std::string("Haven't passed the ")+cutName +std::string(" selection."); + (*m_msgStream)<<MSG::INFO<<msg<<endmsg; + }; + if ( pxMuon ){ + // Save local copy of muon address if it's ok. + m_pxMuon = pxMuon; + // Test muon pass conditions in turn + if(m_doQualSelection and not passQualCuts()){ + issueCutMessage("quality"); + return false; + } + if (m_doIsoSelection and not passIsolCuts()){ + issueCutMessage("isolation"); + return false; + } + if (m_doPtSelection and not passPtCuts()){ + issueCutMessage("pT"); + return false; + } + if (m_doIPSelection and not passIPCuts()){ + issueCutMessage("impact parameter"); + return false; } + } return true; } @@ -141,8 +112,7 @@ void MuonSelector::Init() ISvcLocator* serviceLocator = Gaudi::svcLocator(); IToolSvc* toolSvc; StatusCode sc = serviceLocator->service("ToolSvc", toolSvc, true); - - if ( sc.isFailure() || toolSvc == 0 ) { + if ( sc.isFailure() || toolSvc == nullptr ) { (*m_msgStream) << MSG::ERROR << "Unable to retrieve ToolSvc " << endmsg; return; } @@ -150,7 +120,6 @@ void MuonSelector::Init() } - bool MuonSelector::Reco() { return true; @@ -170,14 +139,11 @@ void MuonSelector::BookHistograms( ) bool MuonSelector::passQualCuts() { // Apply muon hit criteria - // First get the muon track, then the summarys + // First get the muon track, then the summaries const xAOD::TrackParticle* IDTrk = m_pxMuon->trackParticle(xAOD::Muon::InnerDetectorTrackParticle); - - // if ( !m_pxMuon->isCombinedMuon()) return false; - // if ( m_pxMuon->trackParticle(xAOD::Muon::CombinedTrackParticle) ) return false; if( xAOD::Muon::Combined ) return false; if (IDTrk) { - uint8_t dummy(-1); + unsigned char dummy(255); bool eBLhits = IDTrk->summaryValue( dummy, xAOD::expectInnermostPixelLayerHit )? dummy :false; int nBLhits = IDTrk->summaryValue( dummy, xAOD::numberOfInnermostPixelLayerHits )? dummy :-1; @@ -190,7 +156,7 @@ bool MuonSelector::passQualCuts() int nPIXH = IDTrk->summaryValue( dummy, xAOD::numberOfPixelHoles )? dummy :-1; int nSCTH = IDTrk->summaryValue( dummy, xAOD::numberOfSCTHoles )? dummy :-1; - if(m_doDebug) std::cout << " eBLhits: " << eBLhits << " nBLhits: " << nBLhits << " nhitsPIX: " << nhitsPIX << std::endl; + if(m_doDebug) (*m_msgStream)<<MSG::INFO << " eBLhits: " << eBLhits << " nBLhits: " << nBLhits << " nhitsPIX: " << nhitsPIX << endmsg; if ( ((!eBLhits) || (nBLhits > 0)) && (nhitsPIX + nPIXDS > 1 ) @@ -198,37 +164,30 @@ bool MuonSelector::passQualCuts() && (nPIXH + nSCTH < 2 ) ) return true; } - - -if(m_doDebug) std::cout << "this muon not pass the hits number QualCuts: " << std::endl; -return false; + if(m_doDebug) (*m_msgStream)<<MSG::INFO << "this muon not pass the hits number QualCuts: " << endmsg; + return false; } bool MuonSelector::passPtCuts() { - const xAOD::TrackParticle* pxMuonID = m_pxMuon->trackParticle(xAOD::Muon::InnerDetectorTrackParticle); const xAOD::TrackParticle* pxMuonMS = m_pxMuon->trackParticle(xAOD::Muon::MuonSpectrometerTrackParticle); if ( !(pxMuonID && pxMuonMS)){ - if(m_doDebug) std::cout << "NO inDetTrackParticle && muonSpectrometerTrackParticle: " << std::endl; - } - - else { - + if(m_doDebug) (*m_msgStream)<<MSG::INFO << "NO inDetTrackParticle && muonSpectrometerTrackParticle: " << endmsg; + }else { double pt = m_pxMuon->pt(); double ptID = pxMuonID->pt(); double ptMS = pxMuonMS->pt(); double fMEta = fabs( m_pxMuon->eta() ); - if(m_doDebug) std::cout <<" in passPtCuts: "<< " pt: " << pt << " ptID: " << ptID <<" ptMS: " << ptMS << " fMEta: "<< fMEta << std::endl; + if(m_doDebug) (*m_msgStream)<<MSG::INFO <<" in passPtCuts: "<< " pt: " << pt << " ptID: " << ptID <<" ptMS: " << ptMS << " fMEta: "<< fMEta << endmsg; if ( fMEta < m_fEtaCut && pt > m_combPtCut && ptMS > m_ptMSCut - //fabs(ptMS - ptID) < m_diffPtCut ){ - if(m_doDebug) std::cout << " this muon passed the PtCuts:" << std::endl; + if(m_doDebug) (*m_msgStream)<<MSG::INFO << " this muon passed the PtCuts:" << endmsg; return true; } } @@ -244,20 +203,20 @@ bool MuonSelector::passIsolCuts() float iso_pt40(0); if( !m_pxMuon->isolation(iso_pt40, xAOD::Iso::ptcone40) ) { std::cout << "No isolation variable stored on the muon" << std::endl; - if(m_doDebug) std::cout << " this muon did not pass the IsoCuts:" << std::endl; + if(m_doDebug) (*m_msgStream)<<MSG::INFO << " this muon did not pass the IsoCuts:" << endmsg; return false; } else { double pt = m_pxMuon->pt(); double ptSum = xAOD::Iso::ptcone40; - if(m_doDebug) std::cout <<" in passIsolCuts , pt :" << pt <<" ptSum: "<< ptSum << std::endl; + if(m_doDebug) (*m_msgStream)<<MSG::INFO <<" in passIsolCuts , pt :" << pt <<" ptSum: "<< ptSum << endmsg; if (ptSum/pt < m_IsoCut ){ - if(m_doDebug) std::cout << " this muon passed the IsoCuts:" << std::endl; + if(m_doDebug) (*m_msgStream)<<MSG::INFO << " this muon passed the IsoCuts:" << endmsg; return true; } } } - if(m_doDebug) std::cout << " this muon did not pass the IsoCuts:" << std::endl; + if(m_doDebug) (*m_msgStream)<<MSG::INFO << " this muon did not pass the IsoCuts:" << endmsg; return false; } @@ -266,64 +225,35 @@ bool MuonSelector::passIPCuts() { float extd0 = 0.0 ; float extz0 = 0.0 ; - if (m_pxMuon->inDetTrackParticleLink().isValid()) { const xAOD::TrackParticle* IDTrk = m_pxMuon->trackParticle(xAOD::Muon::InnerDetectorTrackParticle); extd0 = IDTrk->d0(); extz0 = IDTrk->z0()+IDTrk->vz(); if(m_doDebug){ - std::cout << " the IDTrack muon d0: " << extd0 << std::endl; - std::cout << " the IDTrack muon z0: " << extz0 << std::endl; + (*m_msgStream)<<MSG::INFO << " the IDTrack muon d0: " << extd0 << endmsg; + (*m_msgStream)<<MSG::INFO << " the IDTrack muon z0: " << extz0 << endmsg; } - //if( IDTrk->track() ) { - // const Trk::Track* IDTrkTrack = IDTrk->track(); - // if(IDTrkTrack) { - // const Trk::Perigee* measPerigee = IDTrkTrack->perigeeParameters(); - // if( measPerigee==0 ){ - // std::cout << "Could not get Trk::MeasuredPerigee " << std::endl; - // } - // else{ - // extd0 = measPerigee->parameters()[Trk::d0]; - // extz0 = measPerigee->parameters()[Trk::z0]; - // if(m_doDebug){ - // std::cout << " the IDTrack muon d0: " << extd0 << std::endl; - // std::cout << " the IDTrack muon z0: " << extz0 << std::endl; - // - // } - // } - // } - // } - - // else - // return false; } else return false; - - // const VxContainer * vxContainer(0); - const xAOD::VertexContainer * vxContainer(0); - //vxContainer = PerfMonServices::getContainer<VxContainer>( PerfMonServices::VTX_COLLECTION ); + const xAOD::VertexContainer * vxContainer{}; vxContainer = PerfMonServices::getContainer<xAOD::VertexContainer>( PerfMonServices::VTX_COLLECTION ); if (!vxContainer){ - if(m_doDebug) std::cout << " NO vertex collection "<< std::endl; + if(m_doDebug) (*m_msgStream)<<MSG::INFO << " NO vertex collection "<< endmsg; return false; } - if ( vxContainer->size()>1 ) { - // const Trk::VxCandidate* PV = (*vxContainer)[0]; const xAOD::Vertex* PV = (*vxContainer)[0]; - //Amg::Vector3D newPos = PV->recVertex().position(); Amg::Vector3D newPos = PV->position(); - if(m_doDebug) std::cout << " the PV of this event: " << newPos << std::endl; + if(m_doDebug) (*m_msgStream)<<MSG::INFO << " the PV of this event: " << newPos << endmsg; if ( PV->nTrackParticles() > 2 && - //If- ( PV->vxTrackAtVertex()->size() > 2 && - fabs(newPos.z()) < m_pVZCut && - fabs(extz0 - newPos.z()) < m_diffZCut ){ - if(m_doDebug) std::cout <<" this muon passed the IPCuts: " << std::endl; + std::fabs(newPos.z()) < m_pVZCut && + std::fabs(extz0 - newPos.z()) < m_diffZCut ){ + if(m_doDebug) (*m_msgStream)<<MSG::INFO <<" this muon passed the IPCuts: " << endmsg; return true; } } - if(m_doDebug) std::cout <<" this muon not passed the IPCuts: " << std::endl; + if(m_doDebug) (*m_msgStream)<<MSG::INFO <<" this muon not passed the IPCuts: " << endmsg; return false; } diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/PerfMonServices.cxx b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/PerfMonServices.cxx index d11a23d082ca9624f87485e187e801b1e896eab6..73511a4f87cc35c8bf63d824fe5d5ede4c3ff4cb 100644 --- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/PerfMonServices.cxx +++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/PerfMonServices.cxx @@ -3,16 +3,18 @@ */ #include "InDetPerformanceMonitoring/PerfMonServices.h" +#include "AthenaKernel/IAtRndmGenSvc.h" + #include "GaudiKernel/MsgStream.h" #include "GaudiKernel/StatusCode.h" -// NULL the static pointers -ISvcLocator* PerfMonServices::s_pxSvcLocator = NULL; -ITHistSvc* PerfMonServices::s_pxTHistSvc = NULL; -IMessageSvc* PerfMonServices::s_pxMessageSvc = NULL; -StoreGateSvc* PerfMonServices::s_pxStoreGateSvc = NULL; -INTupleSvc* PerfMonServices::s_pxNtupleSvc = NULL; -IAtRndmGenSvc* PerfMonServices::s_pxAtRndmGenSvc = NULL; +// nullptr the static pointers +ISvcLocator* PerfMonServices::s_pxSvcLocator = nullptr; +ITHistSvc* PerfMonServices::s_pxTHistSvc = nullptr; +IMessageSvc* PerfMonServices::s_pxMessageSvc = nullptr; +StoreGateSvc* PerfMonServices::s_pxStoreGateSvc = nullptr; +INTupleSvc* PerfMonServices::s_pxNtupleSvc = nullptr; +IAtRndmGenSvc* PerfMonServices::s_pxAtRndmGenSvc = nullptr; // Names of the various containers. const std::string PerfMonServices::s_sContainerNames[NUM_CONTAINERS] = { "MuidMuonCollection", @@ -61,14 +63,6 @@ StatusCode PerfMonServices::InitialiseServices( ISvcLocator* pxSvcLocator ) bRegisterSuccess &= InitialiseHistograms(); bRegisterSuccess &= InitialiseRandom(); - //MsgStream log( s_pxMessageSvc, "Services" ); - if ( !bRegisterSuccess ) - { - //log << MSG::WARNING - //<< "Problem starting at least one of the Athena services : this may be cause problems downstream" - //<< endmsg; - } - return StatusCode::SUCCESS; } @@ -80,50 +74,37 @@ StatusCode PerfMonServices::InitialiseServices( ISvcLocator* pxSvcLocator ) bool PerfMonServices::InitialiseMessaging() { StatusCode xStatus = s_pxSvcLocator->service( "MessageSvc", s_pxMessageSvc ); - return CheckServiceInit( xStatus, !s_pxMessageSvc /* , "messaging" */ ); + return CheckServiceInit( xStatus, !s_pxMessageSvc ); } bool PerfMonServices::InitialiseStoreGate() { StatusCode xStatus = s_pxSvcLocator->service("StoreGateSvc", s_pxStoreGateSvc ); - return CheckServiceInit( xStatus, !s_pxStoreGateSvc /* , "StoreGateSvc" */ ); + return CheckServiceInit( xStatus, !s_pxStoreGateSvc ); } bool PerfMonServices::InitialiseRootTuple() { StatusCode xStatus = s_pxSvcLocator->service( "NTupleSvc", s_pxNtupleSvc ); - return CheckServiceInit( xStatus, !s_pxNtupleSvc /* , "NTuple" */ ); + return CheckServiceInit( xStatus, !s_pxNtupleSvc ); } bool PerfMonServices::InitialiseHistograms() { StatusCode xStatus = s_pxSvcLocator->service("THistSvc", s_pxTHistSvc); - return CheckServiceInit( xStatus, !s_pxTHistSvc /* , "Histogram" */ ); + return CheckServiceInit( xStatus, !s_pxTHistSvc ); } bool PerfMonServices::InitialiseRandom() { StatusCode xStatus = s_pxSvcLocator->service( "AtRndmGenSvc", s_pxAtRndmGenSvc, true); - return CheckServiceInit( xStatus, !s_pxAtRndmGenSvc /* , "random number" */ ); + return CheckServiceInit( xStatus, !s_pxAtRndmGenSvc); } // Small status check utility function for the initialisers above -bool PerfMonServices::CheckServiceInit( const StatusCode& xSC, bool bNullPointer /*, const std::string& sType */ ) +bool PerfMonServices::CheckServiceInit( const StatusCode& xSC, bool bNullPointer ) { - //MsgStream log( s_pxMessageSvc, "Services" ); - if ( !xSC.isSuccess() ) - { - //log << MSG::WARNING - //<< "Problem starting " << sType << " service : Error Code." - //<< endmsg; - } - if ( bNullPointer ) - { - //log << MSG::WARNING - //<< "Problem starting " << sType << " service : NULL pointer." - //<< endmsg; - } - return ( xSC.isSuccess() && !bNullPointer ) ? true : false; + return ( xSC.isSuccess() and not bNullPointer ); } //=========================================================================== diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/TRT_Electron_Monitoring_Tool.cxx b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/TRT_Electron_Monitoring_Tool.cxx index ae3a541cdc1b69a7ecc54a6d327808cf7a99ea5b..6bd2f0360198802cdeba86fa71f24d440ab96f73 100644 --- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/TRT_Electron_Monitoring_Tool.cxx +++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/TRT_Electron_Monitoring_Tool.cxx @@ -13,18 +13,23 @@ #include "LWHists/TH1F_LW.h" #include "LWHists/TH2F_LW.h" #include "LWHists/TProfile_LW.h" - - -const float electron_mass = 0.511 * Gaudi::Units::MeV; -const float muon_mass = 105.66 * Gaudi::Units::MeV; -const float pion_mass = 139.6 * Gaudi::Units::MeV; - -const double profile_x_label_size = 0.03; -const double profile_y_label_size = 0.03; -const double profile_msize = 0.5; -const int profile_mcolor = 2; -const int profile_mstyle = 2; - +#include "InDetReadoutGeometry/TRT_DetectorManager.h" +#include "InDetRIO_OnTrack/TRT_DriftCircleOnTrack.h" +#include "TrkParticleBase/LinkToTrackParticleBase.h" +#include "TrkTrack/TrackStateOnSurface.h" + + +namespace{ +constexpr float electron_mass = 0.511 * Gaudi::Units::MeV; +constexpr float muon_mass = 105.66 * Gaudi::Units::MeV; +constexpr float pion_mass = 139.6 * Gaudi::Units::MeV; + +constexpr double profile_x_label_size = 0.03; +constexpr double profile_y_label_size = 0.03; +constexpr double profile_msize = 0.5; +constexpr int profile_mcolor = 2; +constexpr int profile_mstyle = 2; +} // ********************************************************************* // Public Methods @@ -35,8 +40,8 @@ TRT_Electron_Monitoring_Tool( const std::string & type, const std::string & name, const IInterface* parent ) : ManagedMonitorToolBase( type, name, parent ), - m_pTRTHelper (0), - m_mgr (0) + m_pTRTHelper (nullptr), + m_mgr (nullptr) { declareProperty( "trackName", m_tracksName="InDetTrackParticles" ); declareProperty( "electronName", m_electronsName="Electrons"); @@ -58,11 +63,9 @@ TRT_Electron_Monitoring_Tool( const std::string & type, declareProperty( "useTRTOnly", m_useTRTOnly = false); declareProperty( "NMinTRTHits", m_NMinTRTHits = 0); declareProperty( "pionTRTHitCut",m_PionTRTHitCut = 19); - } -TRT_Electron_Monitoring_Tool:: -~TRT_Electron_Monitoring_Tool() +TRT_Electron_Monitoring_Tool::~TRT_Electron_Monitoring_Tool() { } @@ -70,26 +73,11 @@ StatusCode TRT_Electron_Monitoring_Tool::initialize() { if(ManagedMonitorToolBase::initialize().isFailure()) return StatusCode::FAILURE; - // Get ID helper for TRT to access various detector components // like... straw, straw_layer, layer_or_wheel, phi_module etc... - if (detStore()->retrieve(m_pTRTHelper,"TRT_ID").isFailure()) - { - ATH_MSG_FATAL( "Unable to retrieve pointer to TRT Helper" ); - return StatusCode::FAILURE; - } else { - ATH_MSG_DEBUG( "Retrieved Tool " << m_pTRTHelper ); - } - + ATH_CHECK(detStore()->retrieve(m_pTRTHelper,"TRT_ID")); // Retrieve detector manager - if (detStore()->retrieve(m_mgr, "TRT").isFailure()) - { - ATH_MSG_FATAL("Unable to retrieve pointer to TRT DetectorManager" ); - return StatusCode::FAILURE; - } else { - ATH_MSG_DEBUG( "Retrieved TRT manager" ); - } - + ATH_CHECK (detStore()->retrieve(m_mgr, "TRT")); if(m_isEMFlag=="Loose") m_isEMType = ISEMLOOSE; else if(m_isEMFlag=="Medium") m_isEMType = ISEMMEDIUM; else if(m_isEMFlag=="Tight") m_isEMType = ISEMTIGHT; @@ -99,24 +87,19 @@ TRT_Electron_Monitoring_Tool::initialize() ATH_MSG_WARNING( "Skipping TRT Electron HT Monitoring! " ); m_doElectronMon = false; } - return StatusCode::SUCCESS; } StatusCode -TRT_Electron_Monitoring_Tool:: -finalize() +TRT_Electron_Monitoring_Tool::finalize() { return StatusCode::SUCCESS; } StatusCode -TRT_Electron_Monitoring_Tool:: -bookHistograms() +TRT_Electron_Monitoring_Tool::bookHistograms() { - ATH_MSG_DEBUG( "Booking TRT Electron Histograms" ); - //Check for keys in Store Gate if(!evtStore()->contains<xAOD::TrackParticleContainer>(m_tracksName)) { @@ -144,13 +127,6 @@ bookHistograms() } m_doElectronMon = m_doElectronMon && (m_doRecElectrons || m_doConversions); //Electrons need to be turned on and one of the containers (rec or conv) needs to be available - if( m_environment == AthenaMonManager::online ) { - // book histograms that are only made in the online environmen - } - - if( m_dataType == AthenaMonManager::cosmics ) { - // book histograms that are only relevant for cosmics data... - } try { @@ -195,11 +171,8 @@ bookGeoHistograms( lw_geo_hists_t &hists, const std::string& name) ZRMax = 1020; } MonGroup hl_monGroup_shift ( this, "TRT//HTMonitoring/"+name, run,ATTRIB_MANAGED,"", ""); - //MonGroup hl_monGroup_expert ( this, "TRT//HTMonitoring/"+name, expert, run, "",""); //not yet used but will be - if( newRunFlag() ) { - hists.hNTracks = trtBookHistoLW(hl_monGroup_shift, "hNTracks" ,"Number of Tracks per Event in "+name , 150 , 0, 150 , profile_x_label_size, profile_y_label_size, "Number of Tracks", "Frequency"); hists.hHTFracTrack = trtBookHistoLW(hl_monGroup_shift, "hHTFracTrack" ,"HT Fraction per Track in "+name , 50 , 0, 1 , profile_x_label_size, profile_y_label_size, "HT Fraction", "Frequency"); hists.pHTFracTrackPhi = trtBookHistoLW(hl_monGroup_shift, "pHTFracTrackPhi" ,"HT Fraction per Track vs. Phi in "+name , m_nPhiBins, 0, 360 , 0, 1 , profile_x_label_size, profile_y_label_size, "PHI, degrees", "HT Fraction", profile_msize,profile_mcolor,profile_mstyle); @@ -214,28 +187,16 @@ bookGeoHistograms( lw_geo_hists_t &hists, const std::string& name) } if(m_doElectronMon){ hists.pHTFracGammaEl = trtBookHistoLW(hl_monGroup_shift, "pHTFracGammaEl" ,"HT Fraction per e Candidate vs. Lorentz Gamma Factor in "+name , NGAMMABINS, 0, 5 , 0, 1, profile_x_label_size, profile_y_label_size, "Log10(Lorentz Gamma)" , "HT Fraction", profile_msize,profile_mcolor,profile_mstyle); - //hists.pHTFracGammaPosEl = trtBookHistoLW(hl_monGroup_shift, "pHTFracGammaPosEl" ,"HT Fraction per + e Candidate vs. Lorentz Gamma Factor in "+name , NGAMMABINS, 0, 5 , 0, 1, profile_x_label_size, profile_y_label_size, "Log10(Lorentz Gamma)" , "HT Fraction", profile_msize,profile_mcolor,profile_mstyle); - //hists.pHTFracGammaNegEl = trtBookHistoLW(hl_monGroup_shift, "pHTFracGammaNegEl" ,"HT Fraction per - e Candidate vs. Lorentz Gamma Factor in "+name , NGAMMABINS, 0, 5 , 0, 1, profile_x_label_size, profile_y_label_size, "Log10(Lorentz Gamma)" , "HT Fraction", profile_msize,profile_mcolor,profile_mstyle); } if(m_doMuonMon){ hists.pHTFracGammaMu = trtBookHistoLW(hl_monGroup_shift, "pHTFracGammaMu" ,"HT Fraction per #mu Candidate vs. Lorentz Gamma Factor in "+name , NGAMMABINS, 0, 5 , 0, 1, profile_x_label_size, profile_y_label_size, "Log10(Lorentz Gamma)" , "HT Fraction", profile_msize,profile_mcolor,profile_mstyle); - //hists.pHTFracGammaPosMu = trtBookHistoLW(hl_monGroup_shift, "pHTFracGammaPosMu" ,"HT Fraction per + #mu Candidate vs. Lorentz Gamma Factor in "+name , NGAMMABINS, 0, 5 , 0, 1, profile_x_label_size, profile_y_label_size, "Log10(Lorentz Gamma)" , "HT Fraction", profile_msize,profile_mcolor,profile_mstyle); - //hists.pHTFracGammaNegMu = trtBookHistoLW(hl_monGroup_shift, "pHTFracGammaNegMu" ,"HT Fraction per - #mu Candidate vs. Lorentz Gamma Factor in "+name , NGAMMABINS, 0, 5 , 0, 1, profile_x_label_size, profile_y_label_size, "Log10(Lorentz Gamma)" , "HT Fraction", profile_msize,profile_mcolor,profile_mstyle); } if(m_doTracksMon){ hists.pHTFracGammaPi = trtBookHistoLW(hl_monGroup_shift, "pHTFracGammaPi" ,"HT Fraction per #pi Candidate vs. Lorentz Gamma Factor in "+name , NGAMMABINS, 0, 5 , 0, 1, profile_x_label_size, profile_y_label_size, "Log10(Lorentz Gamma)" , "HT Fraction", profile_msize,profile_mcolor,profile_mstyle); - //hists.pHTFracGammaPosPi = trtBookHistoLW(hl_monGroup_shift, "pHTFracGammaPosPi" ,"HT Fraction per + #pi Candidate vs. Lorentz Gamma Factor in "+name , NGAMMABINS, 0, 5 , 0, 1, profile_x_label_size, profile_y_label_size, "Log10(Lorentz Gamma)" , "HT Fraction", profile_msize,profile_mcolor,profile_mstyle); - //hists.pHTFracGammaNegPi = trtBookHistoLW(hl_monGroup_shift, "pHTFracGammaNegPi" ,"HT Fraction per - #pi Candidate vs. Lorentz Gamma Factor in "+name , NGAMMABINS, 0, 5 , 0, 1, profile_x_label_size, profile_y_label_size, "Log10(Lorentz Gamma)" , "HT Fraction", profile_msize,profile_mcolor,profile_mstyle); } if(m_doElectronMon||m_doMuonMon||m_doTracksMon){ hists.pHTFracGammaAll = trtBookHistoLW(hl_monGroup_shift, "pHTFracGammaAll" ,"HT Fraction per Candidate vs. Lorentz Gamma Factor in "+name , NGAMMABINS, 0, 5 , 0, 1, profile_x_label_size, profile_y_label_size, "Log10(Lorentz Gamma)" , "HT Fraction", profile_msize,profile_mcolor,profile_mstyle); - //hists.pHTFracGammaPosAll = trtBookHistoLW(hl_monGroup_shift, "pHTFracGammaPosAll" ,"HT Fraction per + Candidate vs. Lorentz Gamma Factor in "+name , NGAMMABINS, 0, 5 , 0, 1, profile_x_label_size, profile_y_label_size, "Log10(Lorentz Gamma)" , "HT Fraction", profile_msize,profile_mcolor,profile_mstyle); - //hists.pHTFracGammaNegAll = trtBookHistoLW(hl_monGroup_shift, "pHTFracGammaNegAll" ,"HT Fraction per - Candidate vs. Lorentz Gamma Factor in "+name , NGAMMABINS, 0, 5 , 0, 1, profile_x_label_size, profile_y_label_size, "Log10(Lorentz Gamma)" , "HT Fraction", profile_msize,profile_mcolor,profile_mstyle); } - if(m_doExpert) - { - //Book Expert Histograms - }//if(m_doExpert ) }//if( isNewRun ) return; }//bookGeoHistograms @@ -260,9 +221,7 @@ StatusCode TRT_Electron_Monitoring_Tool:: fillHistograms() { - ATH_MSG_DEBUG("Filling TRT Electron Monitor Histograms"); - m_tBarrelA.N = 0; m_tBarrelC.N = 0; m_tEndCapA.N = 0; @@ -303,7 +262,7 @@ loopOverConversions(std::vector<Trk::Track*> &v_usedTrks) { const xAOD::Vertex* vertex = conv_elem; double chi2 = vertex->numberDoF()>0 ? vertex->chiSquared()/vertex->numberDoF() : 0; - double r = sqrt(pow(vertex->position().x(),2)+pow(vertex->position().y(),2)); + double r = std::sqrt(std::pow(vertex->position().x(),2)+std::pow(vertex->position().y(),2)); const std::vector< ElementLink< xAOD::TrackParticleContainer > > tpLinks = conv_elem->trackParticleLinks(); int i(-1); @@ -335,9 +294,7 @@ loopOverConversions(std::vector<Trk::Track*> &v_usedTrks) }//loop over vertices } else ATH_MSG_WARNING( "Could not retrieve vertex container this event" ); - ATH_MSG_DEBUG( "Leaving loopOverConversions." ); - return; }//loopOverConversions @@ -348,33 +305,22 @@ loopOverRecElectrons(std::vector<Trk::Track*> &v_usedTrks) ATH_MSG_DEBUG( "Entering loopOverRecElectrons." ); if(!m_doRecElectrons) return; if(!evtStore()->retrieve(m_electronContainer, m_electronsName).isFailure()){ - - DataVector<xAOD::Electron>::const_iterator p_Electron = m_electronContainer->begin(); - for(; p_Electron!=m_electronContainer->end(); ++p_Electron) + for(const auto & p_Electron:*m_electronContainer) { - if(!(*p_Electron)) continue; - if(!electronQualityCuts(*p_Electron)) continue; - - const xAOD::TrackParticle* trkP = (*p_Electron)->trackParticle(); + if(not p_Electron) continue; + if(!electronQualityCuts(p_Electron)) continue; + const xAOD::TrackParticle* trkP = p_Electron->trackParticle(); if(!trkP) continue; const Trk::Track *trk = trkP->track(); - std::vector<Trk::Track*>::const_iterator cTrk = v_usedTrks.begin(); - bool matched(false); - for( ; cTrk != v_usedTrks.end() ; ++cTrk ){ - if(trk == (*cTrk)){ - if(msgLvl(MSG::DEBUG)) ATH_MSG_DEBUG( "Track: Found matching track from electrons" ); - matched=true; - } - } + const bool matched = (std::find(v_usedTrks.begin(), v_usedTrks.end(), trk) != v_usedTrks.end()); if(matched) continue; v_usedTrks.push_back( (Trk::Track*)trk ); m_tEl.N++; - if(!fillAllHistograms( (xAOD::TrackParticle*)trkP, electron_mass, PCAND_EL )) - { - ATH_MSG_DEBUG( "fillStructHistograms failed!" ); + if(!fillAllHistograms( (xAOD::TrackParticle*)trkP, electron_mass, PCAND_EL )){ + ATH_MSG_DEBUG( "fillStructHistograms failed!" ); + } else { + ATH_MSG_DEBUG( "fillStructHistograms succeeded!" ); } - else ATH_MSG_DEBUG( "fillStructHistograms succeeded!" ); - }//for(; p_Electron!=m_ElectronCollection->end(); ++p_Electron) } else ATH_MSG_WARNING( "Could not retrieve electron container this event" ); @@ -383,28 +329,23 @@ loopOverRecElectrons(std::vector<Trk::Track*> &v_usedTrks) }//loopOverRecElectrons void -TRT_Electron_Monitoring_Tool:: -loopOverMuons(std::vector<Trk::Track*> &v_usedTrks) +TRT_Electron_Monitoring_Tool::loopOverMuons(std::vector<Trk::Track*> &v_usedTrks) { ATH_MSG_DEBUG( "Entering loopOverMuons." ); if(!m_doMuonMon) return; if(!evtStore()->retrieve(m_muonContainer, m_muonsName).isFailure()) { - - DataVector<xAOD::Muon>::const_iterator p_Muon = m_muonContainer->begin(); - for(; p_Muon!=m_muonContainer->end(); ++p_Muon) + for(const auto & p_Muon:*m_muonContainer) { - if(!(*p_Muon)) continue; - if(!muonQualityCuts(*p_Muon)) continue; - - const xAOD::TrackParticle* trkP = (*p_Muon)->trackParticle(xAOD::Muon::InnerDetectorTrackParticle); + if(!(p_Muon)) continue; + if(!muonQualityCuts(p_Muon)) continue; + const xAOD::TrackParticle* trkP = p_Muon->trackParticle(xAOD::Muon::InnerDetectorTrackParticle); if(!trkP) continue; const Trk::Track *trk = trkP->track(); v_usedTrks.push_back( (Trk::Track*)trk ); m_tMu.N++; - if(!fillAllHistograms( (xAOD::TrackParticle*)trkP, muon_mass, PCAND_MU )) - { - ATH_MSG_DEBUG( "fillStructHistograms failed!" ); + if(!fillAllHistograms( (xAOD::TrackParticle*)trkP, muon_mass, PCAND_MU )){ + ATH_MSG_DEBUG( "fillStructHistograms failed!" ); } else ATH_MSG_DEBUG( "fillStructHistograms succeeded!" ); @@ -416,25 +357,20 @@ loopOverMuons(std::vector<Trk::Track*> &v_usedTrks) }//loopOverMuons void -TRT_Electron_Monitoring_Tool:: -loopOverTracks(std::vector<Trk::Track*> &v_usedTrks) +TRT_Electron_Monitoring_Tool::loopOverTracks(std::vector<Trk::Track*> &v_usedTrks) { ATH_MSG_DEBUG( "Entering loopOverTracks." ); if(!m_doTracksMon) return; if(!evtStore()->retrieve(m_trkpCollection, m_tracksName).isFailure()) { - // DataVector<Trk::Track>::const_iterator p_trk = m_trkpCollection->begin(); for(const auto* tp : *m_trkpCollection) - // for(; p_trk!=m_trkCollection->end(); ++p_trk) { - // if(!(*p_trk)) continue; - // if(!(*tp)) continue; fillAllHistograms((xAOD::TrackParticle*)tp); if(!pionQualityCuts((xAOD::TrackParticle*)tp,v_usedTrks)) continue; m_tPi.N++; if(!fillAllHistograms((xAOD::TrackParticle*)tp, pion_mass, PCAND_PI )) { - ATH_MSG_DEBUG( "fillStructHistograms failed!" ); + ATH_MSG_DEBUG( "fillStructHistograms failed!" ); } else ATH_MSG_DEBUG( "fillStructHistograms succeeded!" ); }//for(; p_trk!=m_trkCollection->end(); ++p_trk) @@ -443,23 +379,9 @@ loopOverTracks(std::vector<Trk::Track*> &v_usedTrks) ATH_MSG_DEBUG( "Leaving loopOverTTracks." ); }//loopOverTracks -//const Trk::Track* -//TRT_Electron_Monitoring_Tool:: -//getTrackFromTrackAtVertex(Trk::VxTrackAtVertex * VxTrkTag) -//{ -// if(!VxTrkTag) return NULL; -// Trk::ITrackLink * origLinkTag = VxTrkTag ->trackOrParticleLink(); -// if(!origLinkTag) return NULL; -// Trk::LinkToTrackParticleBase * tr_partTag = dynamic_cast< Trk::LinkToTrackParticleBase * > ( origLinkTag ); -// if(!tr_partTag) return NULL; -// const Trk::TrackParticleBase * tpbTag = dynamic_cast<const Trk::TrackParticleBase*>(**tr_partTag); -// if(!tpbTag) return NULL; -// return tpbTag ->originalTrack(); -//} bool TRT_Electron_Monitoring_Tool:: -//conversionQualityCuts(const Trk::Track* trkTag, const Trk::Track* trkProbe) conversionQualityCuts(const xAOD::TrackParticle* trkTag, const xAOD::TrackParticle* trkProbe) { const Trk::Perigee* perigeeTag = trkTag->track()->perigeeParameters(); @@ -479,11 +401,9 @@ conversionQualityCuts(const xAOD::TrackParticle* trkTag, const xAOD::TrackPartic return false; } if(chargeTag!=-1*chargeProbe) return false; - - int nPix, nSCT, nTRT, nHT, nTRTOut, nHTOut; double HTRatioOut; - uint8_t dummy(-1); + uint8_t dummy(255); //Check that tag passes cuts nPix = trkTag->summaryValue(dummy,xAOD::numberOfPixelHits)?dummy:-1; nSCT = trkTag->summaryValue(dummy,xAOD::numberOfSCTHits)?dummy:-1; @@ -491,13 +411,10 @@ conversionQualityCuts(const xAOD::TrackParticle* trkTag, const xAOD::TrackPartic nHT = trkTag->summaryValue(dummy,xAOD::numberOfTRTHighThresholdHits)?dummy:-1; nTRTOut = trkTag->summaryValue(dummy,xAOD::numberOfTRTOutliers)?dummy:-1; nHTOut = trkTag->summaryValue(dummy,xAOD::numberOfTRTHighThresholdOutliers)?dummy:-1; - - //HTRatio = nTRT>0 ? double(nHT)/double(nTRT) : 0; HTRatioOut = nTRT+nTRTOut>0 ? double(nHT+nHTOut)/double(nTRT+nTRTOut) : 0; if(!m_useTRTOnly && nPix+nSCT <= 3 ) return false; if(nTRT+nTRTOut <= 19) return false; if(HTRatioOut <= 0.12) return false; - //Check that probe passes cuts nPix = trkProbe->summaryValue(dummy,xAOD::numberOfPixelHits)?dummy:-1; nSCT = trkProbe->summaryValue(dummy,xAOD::numberOfSCTHits)?dummy:-1; @@ -505,17 +422,14 @@ conversionQualityCuts(const xAOD::TrackParticle* trkTag, const xAOD::TrackPartic nHT = trkProbe->summaryValue(dummy,xAOD::numberOfTRTHighThresholdHits)?dummy:-1; nTRTOut = trkProbe->summaryValue(dummy,xAOD::numberOfTRTOutliers)?dummy:-1; nHTOut = trkProbe->summaryValue(dummy,xAOD::numberOfTRTHighThresholdOutliers)?dummy:-1; - - + // if(!m_useTRTOnly && nPix+nSCT <= 3 ) return false; if(nTRT+nTRTOut <= 19) return false; - return true; }//conversionQualityCuts bool -TRT_Electron_Monitoring_Tool:: -electronQualityCuts(const xAOD::Electron *electron) +TRT_Electron_Monitoring_Tool::electronQualityCuts(const xAOD::Electron *electron) { bool val_loose=0; bool val_medium=0; @@ -523,9 +437,6 @@ electronQualityCuts(const xAOD::Electron *electron) if(m_isEMType==ISEMLOOSE && !(electron->passSelection(val_loose, "Loose")==0)) return false; if(m_isEMType==ISEMMEDIUM && !(electron->passSelection(val_medium, "Medium")==0)) return false; if(m_isEMType==ISEMTIGHT && !(electron->passSelection(val_tight, "Tight")==0)) return false; - // if(m_isEMType==ISEMLOOSE && !(electron->isem(egammaPID::ElectronLoose )==0)) return false; - // if(m_isEMType==ISEMMEDIUM && !(electron->isem(egammaPID::ElectronMedium )==0)) return false; - // if(m_isEMType==ISEMTIGHT && !(electron->isem(egammaPID::ALLNOTRT_ELECTRON | egammaPID::TRACKMATCHTIGHT_ELECTRON | egammaPID::CONVMATCH_ELECTRON)==0)) return false; return true; }//electronQualityCuts @@ -536,7 +447,7 @@ muonQualityCuts(const xAOD::Muon *muon) if(!muon) return false; const xAOD::TrackParticle* trkM = muon->trackParticle(xAOD::Muon::InnerDetectorTrackParticle); if(!trkM) return false; - uint8_t dummy(-1); + uint8_t dummy(255); int nTRT = trkM->summaryValue( dummy , xAOD::numberOfTRTHits )? dummy :-1; int nTRTOut = trkM->summaryValue( dummy , xAOD::numberOfTRTOutliers )? dummy :-1; if(nTRT+nTRTOut <= 0) return false; @@ -544,18 +455,10 @@ muonQualityCuts(const xAOD::Muon *muon) }//muonQualityCuts bool -TRT_Electron_Monitoring_Tool:: -pionQualityCuts(xAOD::TrackParticle *trkP,std::vector<Trk::Track*> &v_usedTrks) +TRT_Electron_Monitoring_Tool::pionQualityCuts(xAOD::TrackParticle *trkP,std::vector<Trk::Track*> &v_usedTrks) { - - std::vector<Trk::Track*>::const_iterator cTrk = v_usedTrks.begin(); - for( ; cTrk != v_usedTrks.end() ; ++cTrk ){ - if(trkP->track() == (*cTrk)){ - if(msgLvl(MSG::DEBUG)) ATH_MSG_DEBUG( "Electron: Found matching track from conversions" ); - return false; - } - } - uint8_t dummy(-1); + if (std::find(v_usedTrks.begin(), v_usedTrks.end(), trkP->track()) != v_usedTrks.end()) return false; + uint8_t dummy(255); int nPix = trkP->summaryValue(dummy,xAOD::numberOfPixelHits)?dummy:-1; int nSCT = trkP->summaryValue(dummy,xAOD::numberOfSCTHits)?dummy:-1; int nBLa = trkP->summaryValue(dummy,xAOD::numberOfInnermostPixelLayerHits)?dummy:-1; @@ -574,17 +477,15 @@ pionQualityCuts(xAOD::TrackParticle *trkP,std::vector<Trk::Track*> &v_usedTrks) bool TRT_Electron_Monitoring_Tool:: fillAllHistograms(xAOD::TrackParticle *trkP, float mass, int PCand){ - - uint8_t dummy(-1); + uint8_t dummy(255); int nPix = trkP->summaryValue(dummy,xAOD::numberOfPixelHits)?dummy:-1; int nSCT = trkP->summaryValue(dummy,xAOD::numberOfSCTHits)?dummy:-1; if(!m_useTRTOnly && nPix+nSCT <= 3 ) return false; - double phi(-999),eta(-999); const Trk::Perigee* perigee = trkP->track()->perigeeParameters(); if (perigee) { - phi = perigee->momentum().phi()*180/TMath::Pi(); + phi = perigee->momentum().phi()*180/M_PI; if(phi<0) phi +=360; eta = perigee->momentum().eta(); } @@ -593,7 +494,6 @@ fillAllHistograms(xAOD::TrackParticle *trkP, float mass, int PCand){ ATH_MSG_WARNING( "Track has no perigee!" ); return false; } - float gamma = 0; if(mass>0){ CLHEP::HepLorentzVector hlv; @@ -608,7 +508,7 @@ fillAllHistograms(xAOD::TrackParticle *trkP, float mass, int PCand){ ATH_MSG_DEBUG( "Track has Lightlike Lorentz Vector!! Skipping..." ); return false; } - gamma = TMath::Log10(hlv.gamma()); + gamma = std::log10(hlv.gamma()); } int nLLHits[4]={0,0,0,0}; @@ -648,12 +548,12 @@ fillAllHistograms(xAOD::TrackParticle *trkP, float mass, int PCand){ if(RawDriftCircle && !isTubeHit) { bool highL = RawDriftCircle->highLevel(); - TProfile_LW *pHTFracTrackPhi = 0; - TProfile_LW *pHTFracStrawZR = 0; - TProfile_LW *pHTFracStrawZAI = 0; - TProfile_LW *pHTFracStrawZCO = 0; - TProfile_LW *pHTFracGamma = 0; - lw_geo_hists_t * myGeoHists = 0; + TProfile_LW *pHTFracTrackPhi{}; + TProfile_LW *pHTFracStrawZR{}; + TProfile_LW *pHTFracStrawZAI{}; + TProfile_LW *pHTFracStrawZCO{}; + TProfile_LW *pHTFracGamma{}; + lw_geo_hists_t * myGeoHists{}; if(mass==0){ switch (barrel_ec){ case DET_BARRELA: pHTFracTrackPhi = m_tBarrelA.pHTFracTrackPhi; @@ -702,15 +602,12 @@ fillAllHistograms(xAOD::TrackParticle *trkP, float mass, int PCand){ switch (PCand){ case PCAND_EL: pHTFracGamma = myGeoHists->pHTFracGammaEl; - //pHTFracGamma = charge>0 ? myGeoHists->pHTFracGammaPosEl : myGeoHists->pHTFracGammaNegEl; break; case PCAND_MU: pHTFracGamma = myGeoHists->pHTFracGammaMu; - //pHTFracGamma = charge>0 ? myGeoHists->pHTFracGammaPosMu : myGeoHists->pHTFracGammaNegMu; break; case PCAND_PI: pHTFracGamma = myGeoHists->pHTFracGammaPi; - //pHTFracGamma = charge>0 ? myGeoHists->pHTFracGammaPosPi : myGeoHists->pHTFracGammaNegPi; break; default : break; } @@ -729,7 +626,6 @@ fillAllHistograms(xAOD::TrackParticle *trkP, float mass, int PCand){ else{ if(pHTFracGamma) pHTFracGamma->Fill(gamma,1); myGeoHists->pHTFracGammaAll->Fill(gamma,1); - //charge>0 ? myGeoHists->pHTFracGammaPosAll->Fill(gamma,1) : myGeoHists->pHTFracGammaNegAll->Fill(gamma,1); } nHLHits[barrel_ec]++; nTRTHTHits++; @@ -744,7 +640,6 @@ fillAllHistograms(xAOD::TrackParticle *trkP, float mass, int PCand){ else{ if(pHTFracGamma) pHTFracGamma->Fill(gamma,0); myGeoHists->pHTFracGammaAll->Fill(gamma,0); - //charge>0 ? myGeoHists->pHTFracGammaPosAll->Fill(gamma,0) : myGeoHists->pHTFracGammaNegAll->Fill(gamma,0); } nLLHits[barrel_ec]++; nTRTHits++; @@ -754,7 +649,7 @@ fillAllHistograms(xAOD::TrackParticle *trkP, float mass, int PCand){ }//for(;TSOSItBegin!=TSOSItEnd; ++TSOSItBegin) if(mass==0) for(int i=0;i<4;i++){ - lw_geo_hists_t * myGeoHists = 0; + lw_geo_hists_t * myGeoHists{}; switch (i){ case DET_BARRELA: myGeoHists = &m_tBarrelA; @@ -776,14 +671,12 @@ fillAllHistograms(xAOD::TrackParticle *trkP, float mass, int PCand){ } } else{ - uint8_t dummy(-1); + uint8_t dummy(255); float HTProb = trkP->summaryValue(dummy,xAOD::eProbabilityHT)?dummy:-1; - - TH1F_LW *hPIDProb = 0; - TH1F_LW *hHTFrac = 0; - TProfile_LW *pPIDProbEta = 0; - TProfile_LW *pHTFracEta = 0; - + TH1F_LW *hPIDProb{}; + TH1F_LW *hHTFrac{}; + TProfile_LW *pPIDProbEta{}; + TProfile_LW *pHTFracEta{}; switch (PCand){ case PCAND_EL: hPIDProb = m_tEl.hPIDProb; @@ -851,21 +744,17 @@ TH1F_LW* TRT_Electron_Monitoring_Tool::trtBookHistoLW(MonGroup &mongroup, { TH1F_LW* hist = TH1F_LW::create(hName.c_str(),hTitle.c_str(),nbins,firstbin,lastbin); trtRegHist(hist, mongroup, hName.c_str()); - hist->GetXaxis()->SetLabelSize(x_labelSize); hist->GetYaxis()->SetLabelSize(y_labelSize); hist->GetXaxis()->SetTitle(xTitle.c_str()); hist->GetYaxis()->SetTitle(yTitle.c_str()); - return hist; - } void TRT_Electron_Monitoring_Tool::trtRegHist(LWHist* hist, MonGroup &mongrp, const char* hName){ if (mongrp.regHist(hist).isFailure()){ ATH_MSG_WARNING( "Failed to register histogram "<< hName ); } - return; } @@ -887,7 +776,6 @@ TProfile_LW* TRT_Electron_Monitoring_Tool::trtBookHistoLW(MonGroup &mongroup, { TProfile_LW* hist = TProfile_LW::create(hName.c_str(), hTitle.c_str(), nbins, firstbin, lastbin, ymin, ymax); trtRegHist(hist, mongroup, hName.c_str()); - hist->SetMarkerSize(msize); hist->SetMarkerStyle(mstyle); hist->SetMarkerColor(mcolor); @@ -895,7 +783,6 @@ TProfile_LW* TRT_Electron_Monitoring_Tool::trtBookHistoLW(MonGroup &mongroup, hist->GetYaxis()->SetLabelSize(y_labelSize); hist->GetXaxis()->SetTitle(xTitle.c_str()); hist->GetYaxis()->SetTitle(yTitle.c_str()); - return hist; } @@ -916,19 +803,16 @@ TH2F_LW* TRT_Electron_Monitoring_Tool::trtBookHistoLW(MonGroup &mongroup, { TH2F_LW* hist = TH2F_LW::create(hName.c_str(), hTitle.c_str(), xnbins, xfirstbin, xlastbin, ynbins, yfirstbin, ylastbin); trtRegHist(hist, mongroup, hName.c_str()); - hist->GetXaxis()->SetLabelSize(x_labelSize); hist->GetYaxis()->SetLabelSize(y_labelSize); hist->GetXaxis()->SetTitle(xTitle.c_str()); hist->GetYaxis()->SetTitle(yTitle.c_str()); - return hist; } int -TRT_Electron_Monitoring_Tool:: -myBarrelEC(int barrel_ec){ +TRT_Electron_Monitoring_Tool::myBarrelEC(int barrel_ec){ switch(barrel_ec){ case 1 : return DET_BARRELA; case -1 : return DET_BARRELC; diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/ZmumuEvent.cxx b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/ZmumuEvent.cxx index 438ae1aa96e9018e3258b2efe15f9b79bb0ad28c..b6c48e41003288bbe890cf1a958939072a1f3c6a 100644 --- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/ZmumuEvent.cxx +++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/ZmumuEvent.cxx @@ -11,15 +11,11 @@ // This files header #include "InDetPerformanceMonitoring/ZmumuEvent.h" -// Standard headers - // Package Headers #include "InDetPerformanceMonitoring/PerfMonServices.h" // ATLAS headers #include "StoreGate/StoreGateSvc.h" - - #include "CLHEP/Random/RandFlat.h" #include "xAODMuon/Muon.h" @@ -31,11 +27,8 @@ ZmumuEvent::ZmumuEvent() { m_xSampleName = "ZMM"; - m_container = PerfMonServices::MUID_COLLECTION; - m_doDebug = false; - // Setup the muon tags m_uMuonTags = 2; m_uTrackMatch = 0; @@ -56,18 +49,12 @@ void ZmumuEvent::Init() const std::string ZmumuEvent::getRegion() const{ - - const double eta1 = fabs(m_pxRecMuon[MUON1]->eta()); - const double eta2 = fabs(m_pxRecMuon[MUON2]->eta()); - //std::cout << " eta1: " << eta1 << std::endl; - //std::cout << " eta2: " << eta2 << std::endl; - + const double eta1 = std::fabs(m_pxRecMuon[MUON1]->eta()); + const double eta2 = std::fabs(m_pxRecMuon[MUON2]->eta()); if ( eta1 < m_etaCut && eta2 < m_etaCut ) return "BB"; - else if( (eta1 < m_etaCut && eta2 > m_etaCut) || (eta1 > m_etaCut && eta2 < m_etaCut) ) return "BE"; - else return "EE"; } @@ -77,31 +64,19 @@ bool ZmumuEvent::Reco() { // Clear out the previous events record. Clear(); - // const Analysis::MuonContainer* pxMuonContainer = PerfMonServices::getContainer<Analysis::MuonContainer>( m_container ); const xAOD::MuonContainer* pxMuonContainer = PerfMonServices::getContainer<xAOD::MuonContainer>( m_container ); if (!pxMuonContainer){ - // std::cout << "Can't retrieve combined muon collection" << std::endl; return false; } else{ if(m_doDebug){ std::cout << pxMuonContainer->size() << " combined muon "<<std::endl; } - xAOD::MuonContainer::const_iterator xMuonItr = pxMuonContainer->begin(); - xAOD::MuonContainer::const_iterator xMuonItrE = pxMuonContainer->end(); - while ( xMuonItr != xMuonItrE ) - { - const xAOD::Muon* pxCMuon = *xMuonItr; - // Apply muon cuts - if ( m_xMuonID.passSelection( pxCMuon ) ) { - RecordMuon( pxCMuon ); - } - xMuonItr++; - } + for (const auto & pxCMuon: *pxMuonContainer){ + // Apply muon cuts + if ( m_xMuonID.passSelection( pxCMuon ) ) RecordMuon( pxCMuon ); + } } - - // Reconstruct the invariant mass ( based on mu-sys pt ). ReconstructKinematics(); - m_passedSelectionCuts = EventSelection(); return m_passedSelectionCuts; } @@ -120,29 +95,22 @@ void ZmumuEvent::BookHistograms() //================================================================================== bool ZmumuEvent::EventSelection() { - if(m_doDebug){ std::cout <<" m_uNumberOfFullPassMuons: " << m_numberOfFullPassMuons << std::endl;} // First require two muon-id's with cuts pre-applied. if ( m_numberOfFullPassMuons != 2 ) return false; - if ( !((m_pxRecMuon[MUON1]->pt() > 20.0*CLHEP::GeV && m_pxRecMuon[MUON2]->pt() > 15.0*CLHEP::GeV ) || (m_pxRecMuon[MUON1]->pt() > 15.0*CLHEP::GeV && m_pxRecMuon[MUON2]->pt() > 20.0*CLHEP::GeV )) ) return false; - if(m_doDebug){ std::cout <<" m_fInvariantMass[ID]: "<< m_fInvariantMass[ID] << std::endl;} if ( -1 != (m_pxRecMuon[MUON1]->charge() * m_pxRecMuon[MUON2]->charge()) ){ std::cout << "same sign event!!!" << std::endl; return false; } - - - if ( m_fInvariantMass[ID] < 60.0f ) return false; if ( m_fInvariantMass[ID] > 120.0f ) return false; if ( m_fMuonDispersion[ID] < 0.2f ) return false; if ( getZCharge(ID) != 0 ) return false; - return true; } @@ -150,13 +118,12 @@ void ZmumuEvent::Clear() { m_numberOfFullPassMuons = 0; m_passedSelectionCuts = false; - for ( unsigned int u = 0; u < NUM_MUONS; ++u ) { - m_pxRecMuon[u] = NULL; - m_pxMSTrack[u] = NULL; - m_pxMETrack[u] = NULL; - m_pxIDTrack[u] = NULL; + m_pxRecMuon[u] = nullptr; + m_pxMSTrack[u] = nullptr; + m_pxMETrack[u] = nullptr; + m_pxIDTrack[u] = nullptr; } for ( unsigned int v = 0; v < NUM_TYPES; ++v ) { @@ -180,7 +147,6 @@ void ZmumuEvent::RecordMuon( const xAOD::Muon* pxMuon ) // Tracking Muon Spectrometer ( raw ) const xAOD::TrackParticle* pxMSTrack = pxMuon->trackParticle(xAOD::Muon::MuonSpectrometerTrackParticle); m_pxMSTrack[m_numberOfFullPassMuons] = pxMSTrack; - // Tracking ID ( fix later to include loose match track conditions ) const xAOD::TrackParticle* pxIDTrack = pxMuon->trackParticle(xAOD::Muon::InnerDetectorTrackParticle); m_pxIDTrack[m_numberOfFullPassMuons] = pxIDTrack; @@ -196,7 +162,6 @@ void ZmumuEvent::ReconstructKinematics() // Three ways. No checks here so make sure the pointers are ok before this. if ( m_numberOfFullPassMuons == 2 ) { - // Note that all the util. functions will check the pointers & return -999.9f on failure. m_fInvariantMass[MS] = EvalDiMuInvMass( m_pxMSTrack[MUON1], m_pxMSTrack[MUON2] ); m_fMuonDispersion[MS] = EvaluateAngle( m_pxMSTrack[MUON1], m_pxMSTrack[MUON2] ); @@ -325,35 +290,22 @@ const xAOD::TrackParticle* ZmumuEvent::getLooseIDTk( unsigned int /*uPart*/ ) { const xAOD::TrackParticleContainer* pxTrackContainer = PerfMonServices::getContainer<xAOD::TrackParticleContainer>( PerfMonServices::TRK_COLLECTION ); - if ( pxTrackContainer ) { - xAOD::TrackParticleContainer::const_iterator xTrkItr = pxTrackContainer->begin(); - xAOD::TrackParticleContainer::const_iterator xTrkItrE = pxTrackContainer->end(); - while ( xTrkItr != xTrkItrE ) - { - const xAOD::TrackParticle* pxTrack = *xTrkItr; + for (const auto & pxTrack: *pxTrackContainer){ if(!(pxTrack)) continue; const Trk::Track* pxTrkTrack = pxTrack->track(); if ( !pxTrack->track() ) continue; const Trk::Perigee* pxPerigee = pxTrkTrack->perigeeParameters() ; if ( !pxPerigee ) continue; - const float fTrkPhi = pxPerigee->parameters()[Trk::phi]; const float fTrkEta = pxPerigee->eta(); - - float fDPhi = fabs( fTrkPhi - m_pxMETrack[MUON1]->phi() ); - float fDEta = fabs( fTrkEta - m_pxMETrack[MUON2]->eta() ); - float fDR = sqrt( fDPhi*fDPhi + fDEta*fDEta ); - - if ( fDR < 0.3f ) - { - return pxTrack; - } - - xTrkItr++; + float fDPhi = std::fabs( fTrkPhi - m_pxMETrack[MUON1]->phi() ); + float fDEta = std::fabs( fTrkEta - m_pxMETrack[MUON2]->eta() ); + float fDR = std::sqrt( fDPhi*fDPhi + fDEta*fDEta ); + if ( fDR < 0.3f ) return pxTrack; } } // if () - return NULL; + return nullptr; } diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMainMon.h b/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMainMon.h index 59a6c97d317d6f035cb5e66b68338f61bccf6211..1de162d00c2aedbb49b9e8edef154fddd4e3f08c 100755 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMainMon.h +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMainMon.h @@ -401,6 +401,20 @@ class PixelMainMon : public ManagedMonitorToolBase { TH2F_LW* m_npixhits_per_track_lumi{}; TH2F* m_npixhits_per_track_lastXlb{}; + // zoomed clusterToTxcosAlpha peak region + TH2F_LW* m_zoomed_clusterToTcosA_lumi_IBL; + TH2F* m_zoomed_clusterToTcosA_lastXlb_IBL; + TH2F_LW* m_zoomed_clusterToTcosA_lumi_B0; + TH2F* m_zoomed_clusterToTcosA_lastXlb_B0; + TH2F_LW* m_zoomed_clusterToTcosA_lumi_B1; + TH2F* m_zoomed_clusterToTcosA_lastXlb_B1; + TH2F_LW* m_zoomed_clusterToTcosA_lumi_B2; + TH2F* m_zoomed_clusterToTcosA_lastXlb_B2; + TH2F_LW* m_zoomed_clusterToTcosA_lumi_ECA; + TH2F* m_zoomed_clusterToTcosA_lastXlb_ECA; + TH2F_LW* m_zoomed_clusterToTcosA_lumi_ECC; + TH2F* m_zoomed_clusterToTcosA_lastXlb_ECC; + // cluster size TH1F_LW* m_clusize_ontrack_mod[PixLayerIBL2D3D::COUNT]; TH1F_LW* m_clusize_offtrack_mod[PixLayerIBL2D3D::COUNT]; diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/src/Clusters.cxx b/InnerDetector/InDetMonitoring/PixelMonitoring/src/Clusters.cxx index d9df53ffa47e08803471830abe2a340dc6c39849..6e3ac3c594c985c1390688796b95e5977822489c 100644 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/Clusters.cxx +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/Clusters.cxx @@ -220,6 +220,62 @@ StatusCode PixelMainMon::bookClustersMon(void) { if (m_doOnTrack) { sc = clusterExpert.regHist(m_clustersOnOffTrack_per_lumi = TProfile_LW::create("ClustersOnOffTrack_per_lumi", ("Fraction pixel clusters on track per event per LB" + m_histTitleExt + ";lumi block; fraction clusters/event").c_str(), 2500, -0.5, 2499.5)); + + hname = makeHistname("Zoomed_Cluster_ToTxCosAlpha_lumi_IBL", false); + htitles = makeHisttitle("Zoomed Cluster ToTxCosAlpha, IBL", ";lumi block;ToT [BC]", false); + sc = clusterExpert.regHist(m_zoomed_clusterToTcosA_lumi_IBL = TH2F_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, min_LB, max_LB, 20, -0.5, 19.5)); + if (m_doOnline) { + hname = makeHistname("Zoomed_Cluster_ToTxCosAlpha_last100lb_IBL", false); + htitles = makeHisttitle("Zoomed Cluster ToTxCosAlpha last 100 LB, IBL", ";last 100 lumi blocks;ToT [BC]", false); + sc = clusterExpert.regHist(m_zoomed_clusterToTcosA_lastXlb_IBL = new TH2F(hname.c_str(), htitles.c_str(), 100, 0.5, 100.5, 20, -0.5, 19.5)); + if (m_zoomed_clusterToTcosA_lastXlb_IBL) m_zoomed_clusterToTcosA_lastXlb_IBL->SetOption("colz"); + } + hname = makeHistname("Zoomed_Cluster_ToTxCosAlpha_lumi_B0", false); + htitles = makeHisttitle("Zoomed Cluster ToTxCosAlpha, B0", ";lumi block;ToT [BC]", false); + sc = clusterExpert.regHist(m_zoomed_clusterToTcosA_lumi_B0 = TH2F_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, min_LB, max_LB, 20, 7.5, 27.5)); + if (m_doOnline) { + hname = makeHistname("Zoomed_Cluster_ToTxCosAlpha_last100lb_B0", false); + htitles = makeHisttitle("Zoomed Cluster ToTxCosAlpha last 100 LB, B0", ";last 100 lumi blocks;ToT [BC]", false); + sc = clusterExpert.regHist(m_zoomed_clusterToTcosA_lastXlb_B0 = new TH2F(hname.c_str(), htitles.c_str(), 100, 0.5, 100.5, 20, 7.5, 27.5)); + if (m_zoomed_clusterToTcosA_lastXlb_B0) m_zoomed_clusterToTcosA_lastXlb_B0->SetOption("colz"); + } + hname = makeHistname("Zoomed_Cluster_ToTxCosAlpha_lumi_B1", false); + htitles = makeHisttitle("Zoomed Cluster ToTxCosAlpha, B1", ";lumi block;ToT [BC]", false); + sc = clusterExpert.regHist(m_zoomed_clusterToTcosA_lumi_B1 = TH2F_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, min_LB, max_LB, 20, 19.5, 39.5)); + if (m_doOnline) { + hname = makeHistname("Zoomed_Cluster_ToTxCosAlpha_last100lb_B1", false); + htitles = makeHisttitle("Zoomed Cluster ToTxCosAlpha last 100 LB, B1", ";last 100 lumi blocks;ToT [BC]", false); + sc = clusterExpert.regHist(m_zoomed_clusterToTcosA_lastXlb_B1 = new TH2F(hname.c_str(), htitles.c_str(), 100, 0.5, 100.5, 20, 19.5, 39.5)); + if (m_zoomed_clusterToTcosA_lastXlb_B1) m_zoomed_clusterToTcosA_lastXlb_B1->SetOption("colz"); + } + hname = makeHistname("Zoomed_Cluster_ToTxCosAlpha_lumi_B2", false); + htitles = makeHisttitle("Zoomed Cluster ToTxCosAlpha, B2", ";lumi block;ToT [BC]", false); + sc = clusterExpert.regHist(m_zoomed_clusterToTcosA_lumi_B2 = TH2F_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, min_LB, max_LB, 20, 19.5, 39.5)); + if (m_doOnline) { + hname = makeHistname("Zoomed_Cluster_ToTxCosAlpha_last100lb_B2", false); + htitles = makeHisttitle("Zoomed Cluster ToTxCosAlpha last 100 LB, B2", ";last 100 lumi blocks;ToT [BC]", false); + sc = clusterExpert.regHist(m_zoomed_clusterToTcosA_lastXlb_B2 = new TH2F(hname.c_str(), htitles.c_str(), 100, 0.5, 100.5, 20, 19.5, 39.5)); + if (m_zoomed_clusterToTcosA_lastXlb_B2) m_zoomed_clusterToTcosA_lastXlb_B2->SetOption("colz"); + } + hname = makeHistname("Zoomed_Cluster_ToTxCosAlpha_lumi_ECA", false); + htitles = makeHisttitle("Zoomed Cluster ToTxCosAlpha, ECA", ";lumi block;ToT [BC]", false); + sc = clusterExpert.regHist(m_zoomed_clusterToTcosA_lumi_ECA = TH2F_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, min_LB, max_LB, 20, 19.5, 39.5)); + if (m_doOnline) { + hname = makeHistname("Zoomed_Cluster_ToTxCosAlpha_last100lb_ECA", false); + htitles = makeHisttitle("Zoomed Cluster ToTxCosAlpha last 100 LB, ECA", ";last 100 lumi blocks;ToT [BC]", false); + sc = clusterExpert.regHist(m_zoomed_clusterToTcosA_lastXlb_ECA = new TH2F(hname.c_str(), htitles.c_str(), 100, 0.5, 100.5, 20, 19.5, 39.5)); + if (m_zoomed_clusterToTcosA_lastXlb_ECA) m_zoomed_clusterToTcosA_lastXlb_ECA->SetOption("colz"); + } + hname = makeHistname("Zoomed_Cluster_ToTxCosAlpha_lumi_ECC", false); + htitles = makeHisttitle("Zoomed Cluster ToTxCosAlpha, ECC", ";lumi block;ToT [BC]", false); + sc = clusterExpert.regHist(m_zoomed_clusterToTcosA_lumi_ECC = TH2F_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, min_LB, max_LB, 20, 19.5, 39.5)); + if (m_doOnline) { + hname = makeHistname("Zoomed_Cluster_ToTxCosAlpha_last100lb_ECC", false); + htitles = makeHisttitle("Zoomed Cluster ToTxCosAlpha last 100 LB, ECC", ";last 100 lumi blocks;ToT [BC]", false); + sc = clusterExpert.regHist(m_zoomed_clusterToTcosA_lastXlb_ECC = new TH2F(hname.c_str(), htitles.c_str(), 100, 0.5, 100.5, 20, 19.5, 39.5)); + if (m_zoomed_clusterToTcosA_lastXlb_ECC) m_zoomed_clusterToTcosA_lastXlb_ECC->SetOption("colz"); + } + } if (m_do2DMaps) { @@ -524,6 +580,12 @@ StatusCode PixelMainMon::fillClustersMon(void) { if (pixlayerdbm == PixLayerDBM::kIBL && m_cluster_ToT1d_corr[PixLayerIBL2D3DDBM::kIBL]) m_cluster_ToT1d_corr[PixLayerIBL2D3DDBM::kIBL]->Fill(cluster.totalToT() * cosalpha); if (pixlayeribl2d3ddbm != 99 && m_cluster_Q_corr[pixlayeribl2d3ddbm]) m_cluster_Q_corr[pixlayeribl2d3ddbm]->Fill(cluster.totalCharge() * cosalpha); if (pixlayerdbm == PixLayerDBM::kIBL && m_cluster_Q_corr[PixLayerIBL2D3DDBM::kIBL]) m_cluster_Q_corr[PixLayerIBL2D3DDBM::kIBL]->Fill(cluster.totalCharge() * cosalpha); + if (pixlayer == PixLayer::kIBL && m_zoomed_clusterToTcosA_lumi_IBL) m_zoomed_clusterToTcosA_lumi_IBL->Fill(m_manager->lumiBlockNumber(), cluster.totalToT() * cosalpha); + if (pixlayer == PixLayer::kB0 && m_zoomed_clusterToTcosA_lumi_B0) m_zoomed_clusterToTcosA_lumi_B0->Fill(m_manager->lumiBlockNumber(), cluster.totalToT() * cosalpha); + if (pixlayer == PixLayer::kB1 && m_zoomed_clusterToTcosA_lumi_B1) m_zoomed_clusterToTcosA_lumi_B1->Fill(m_manager->lumiBlockNumber(), cluster.totalToT() * cosalpha); + if (pixlayer == PixLayer::kB2 && m_zoomed_clusterToTcosA_lumi_B2) m_zoomed_clusterToTcosA_lumi_B2->Fill(m_manager->lumiBlockNumber(), cluster.totalToT() * cosalpha); + if (pixlayer == PixLayer::kECA && m_zoomed_clusterToTcosA_lumi_ECA) m_zoomed_clusterToTcosA_lumi_ECA->Fill(m_manager->lumiBlockNumber(), cluster.totalToT() * cosalpha); + if (pixlayer == PixLayer::kECC && m_zoomed_clusterToTcosA_lumi_ECC) m_zoomed_clusterToTcosA_lumi_ECC->Fill(m_manager->lumiBlockNumber(), cluster.totalToT() * cosalpha); } if (pixlayeribl2d3ddbm != 99 && m_cluster_groupsize_mod[pixlayeribl2d3ddbm]) m_cluster_groupsize_mod[pixlayeribl2d3ddbm]->Fill(npixHitsInCluster); if (pixlayerdbm == PixLayerDBM::kIBL && m_cluster_groupsize_mod[PixLayerIBL2D3DDBM::kIBL]) m_cluster_groupsize_mod[PixLayerIBL2D3DDBM::kIBL]->Fill(npixHitsInCluster); @@ -687,6 +749,56 @@ StatusCode PixelMainMon::fillClustersMon(void) { } StatusCode PixelMainMon::procClustersMon(void) { + if (m_doOnline && m_doOnTrack) { + int lastlb = m_manager->lumiBlockNumber()-1; //remove -1 for testing + float cont(0.0); + if (m_zoomed_clusterToTcosA_lumi_IBL && m_zoomed_clusterToTcosA_lastXlb_IBL + && m_zoomed_clusterToTcosA_lumi_B0 && m_zoomed_clusterToTcosA_lastXlb_B0 + && m_zoomed_clusterToTcosA_lumi_B1 && m_zoomed_clusterToTcosA_lastXlb_B1 + && m_zoomed_clusterToTcosA_lumi_B2 && m_zoomed_clusterToTcosA_lastXlb_B2 + && m_zoomed_clusterToTcosA_lumi_ECA && m_zoomed_clusterToTcosA_lastXlb_ECA + && m_zoomed_clusterToTcosA_lumi_ECC && m_zoomed_clusterToTcosA_lastXlb_ECC) { + + int bingx = m_zoomed_clusterToTcosA_lumi_B2->GetXaxis()->FindBin(lastlb); + int nbingy = m_zoomed_clusterToTcosA_lumi_B2->GetNbinsY(); + int nXbins = m_zoomed_clusterToTcosA_lastXlb_B2->GetNbinsX(); + + m_zoomed_clusterToTcosA_lastXlb_IBL->GetXaxis()->Set(nXbins, lastlb-nXbins+0.5, lastlb+0.5); + m_zoomed_clusterToTcosA_lastXlb_IBL->Reset(); + m_zoomed_clusterToTcosA_lastXlb_B0->GetXaxis()->Set(nXbins, lastlb-nXbins+0.5, lastlb+0.5); + m_zoomed_clusterToTcosA_lastXlb_B0->Reset(); + m_zoomed_clusterToTcosA_lastXlb_B1->GetXaxis()->Set(nXbins, lastlb-nXbins+0.5, lastlb+0.5); + m_zoomed_clusterToTcosA_lastXlb_B1->Reset(); + m_zoomed_clusterToTcosA_lastXlb_B2->GetXaxis()->Set(nXbins, lastlb-nXbins+0.5, lastlb+0.5); + m_zoomed_clusterToTcosA_lastXlb_B2->Reset(); + m_zoomed_clusterToTcosA_lastXlb_ECA->GetXaxis()->Set(nXbins, lastlb-nXbins+0.5, lastlb+0.5); + m_zoomed_clusterToTcosA_lastXlb_ECA->Reset(); + m_zoomed_clusterToTcosA_lastXlb_ECC->GetXaxis()->Set(nXbins, lastlb-nXbins+0.5, lastlb+0.5); + m_zoomed_clusterToTcosA_lastXlb_ECC->Reset(); + + for (int binfx=nXbins; binfx>0; binfx--) { + if (bingx>0) { + for (int bingy = 1; bingy <= nbingy; bingy++) { + cont = m_zoomed_clusterToTcosA_lumi_IBL->GetBinContent(bingx, bingy); + if (cont!=0) m_zoomed_clusterToTcosA_lastXlb_IBL->SetBinContent(binfx, bingy, cont); + cont = m_zoomed_clusterToTcosA_lumi_B0->GetBinContent(bingx, bingy); + if (cont!=0) m_zoomed_clusterToTcosA_lastXlb_B0->SetBinContent(binfx, bingy, cont); + cont = m_zoomed_clusterToTcosA_lumi_B1->GetBinContent(bingx, bingy); + if (cont!=0) m_zoomed_clusterToTcosA_lastXlb_B1->SetBinContent(binfx, bingy, cont); + cont = m_zoomed_clusterToTcosA_lumi_B2->GetBinContent(bingx, bingy); + if (cont!=0) m_zoomed_clusterToTcosA_lastXlb_B2->SetBinContent(binfx, bingy, cont); + cont = m_zoomed_clusterToTcosA_lumi_ECA->GetBinContent(bingx, bingy); + if (cont!=0) m_zoomed_clusterToTcosA_lastXlb_ECA->SetBinContent(binfx, bingy, cont); + cont = m_zoomed_clusterToTcosA_lumi_ECC->GetBinContent(bingx, bingy); + if (cont!=0) m_zoomed_clusterToTcosA_lastXlb_ECC->SetBinContent(binfx, bingy, cont); + } + bingx--; + } + } + //m_zoomed_clusterToTcosA_lastXlb_B2->SetEntries(lastlb); // for testing + } + + } if (m_doOffline) { fillSummaryHistos(m_cluster_occupancy.get(), m_cluster_occupancy_summary_mod[PixLayer::kECA], diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMainMon.cxx b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMainMon.cxx index d6a5f663a255e4375ae8eecb792536491d509932..f3c49d28fa188003fa2d48315eb2fa93020fefea 100755 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMainMon.cxx +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMainMon.cxx @@ -882,6 +882,11 @@ StatusCode PixelMainMon::procHistograms() { if (msgLvl(MSG::INFO)) msg(MSG::INFO) << "Could not proc Hit histograms" << endmsg; } } + if (m_doCluster) { + if (procClustersMon().isFailure()) { + if (msgLvl(MSG::INFO)) msg(MSG::INFO) << "Could not proc Cluster histograms" << endmsg; + } + } if (m_doTrack) { if (procTrackMon().isFailure()) { if (msgLvl(MSG::INFO)) msg(MSG::INFO) << "Could not proc Track histograms" << endmsg; diff --git a/InnerDetector/InDetRecTools/InDetConversionFinderTools/InDetConversionFinderTools/ConversionPostSelector.h b/InnerDetector/InDetRecTools/InDetConversionFinderTools/InDetConversionFinderTools/ConversionPostSelector.h index bb6bf8caf93a0f188759b094f3e2341ed91e2bf3..44c223cc4f9617bdd2ea3fafaecdfc78d0d40a0b 100644 --- a/InnerDetector/InDetRecTools/InDetConversionFinderTools/InDetConversionFinderTools/ConversionPostSelector.h +++ b/InnerDetector/InDetRecTools/InDetConversionFinderTools/InDetConversionFinderTools/ConversionPostSelector.h @@ -6,9 +6,17 @@ #define INDETCONVERSIONFINDERTOOLS_CONVERSIONPOSTSELECTOR_H #include "AthenaBaseComps/AthAlgTool.h" -#include "TrkParameters/TrackParameters.h" -#include "TrkEventPrimitives/ParticleHypothesis.h" +#include "TrkEventPrimitives/ParticleHypothesis.h" //ParticleMasses struct +#include "TrkParameters/TrackParameters.h" //typedef #include "xAODTracking/VertexFwd.h" +#include "GeoPrimitives/GeoPrimitives.h" //Amg::Vector3D typedef +#include <vector> + + + +namespace CLHEP{ + class HepLorentzVector; +} namespace InDet { diff --git a/InnerDetector/InDetRecTools/InDetConversionFinderTools/src/ConversionPostSelector.cxx b/InnerDetector/InDetRecTools/InDetConversionFinderTools/src/ConversionPostSelector.cxx index 32a2548074548e4e5246749bf6ab6be0b0b1d0ad..b5c87d88fc1e147fcc6a4d1558341bc40a0b00e1 100644 --- a/InnerDetector/InDetRecTools/InDetConversionFinderTools/src/ConversionPostSelector.cxx +++ b/InnerDetector/InDetRecTools/InDetConversionFinderTools/src/ConversionPostSelector.cxx @@ -11,13 +11,14 @@ changes : ***************************************************************************/ #include "InDetConversionFinderTools/ConversionPostSelector.h" - #include "xAODTracking/TrackParticle.h" #include "xAODTracking/Vertex.h" +#include "CLHEP/Vector/LorentzVector.h" +#include <cmath> -using CLHEP::HepLorentzVector; -using CLHEP::pi; -using CLHEP::twopi; +namespace{ + constexpr double twopi{2.*M_PI}; +} namespace InDet { @@ -135,17 +136,17 @@ namespace InDet { const Trk::TrackParameters& perigee2 = *(trkAtVx[1].perigeeAtVertex()); //invariant mass - HepLorentzVector momentum; + CLHEP::HepLorentzVector momentum; Amg::Vector3D sum_mom = perigee1.momentum() + perigee2.momentum(); - double m2 = pow(ConversionPostSelector::s_particleMasses.mass[Trk::electron],2); - double ee = sqrt(m2 + perigee1.momentum().mag2()) + sqrt(m2 + perigee2.momentum().mag2()); + double m2 = std::pow(ConversionPostSelector::s_particleMasses.mass[Trk::electron],2); + double ee = std::sqrt(m2 + perigee1.momentum().mag2()) + std::sqrt(m2 + perigee2.momentum().mag2()); momentum.setPx(sum_mom.x()); momentum.setPy(sum_mom.y()); momentum.setPz(sum_mom.z()); momentum.setE(ee); double inv_mass = momentum.m(); - double photonP = sqrt(momentum.x()*momentum.x() + momentum.y()*momentum.y()); + double photonP = std::sqrt(momentum.x()*momentum.x() + momentum.y()*momentum.y()); double pt1 = perigee1.pT(); double pt2 = perigee2.pT(); if (pt1<m_minPt || pt2<m_minPt) pass = false; - if (fabs(inv_mass) > invMassCut) pass = false; + if (std::fabs(inv_mass) > invMassCut) pass = false; if (photonP < fitMomentum) pass = false; double fR = 1000.; @@ -158,14 +159,14 @@ namespace InDet { if(flag==1 && fR-vtxR<m_maxdR) pass = false; double PhiVtxTrk = vertex->position().phi() - perigee1.parameters()[Trk::phi0]; - if (PhiVtxTrk < -pi) PhiVtxTrk += twopi; - if (PhiVtxTrk > pi) PhiVtxTrk -= twopi; - if (fabs(PhiVtxTrk)>m_maxPhiVtxTrk) pass = false; + if (PhiVtxTrk < -M_PI) PhiVtxTrk += twopi; + if (PhiVtxTrk > M_PI) PhiVtxTrk -= twopi; + if (std::fabs(PhiVtxTrk)>m_maxPhiVtxTrk) pass = false; if (pass && m_decorateVertices) { ATH_MSG_DEBUG("Decorating vertex with values used in post selector"); - decorateVertex(*vertex, inv_mass, pt1, pt2, fR, fabs(PhiVtxTrk) ); + decorateVertex(*vertex, inv_mass, pt1, pt2, fR, std::fabs(PhiVtxTrk) ); } } @@ -239,58 +240,58 @@ namespace InDet { if(flag==1 && fR-vtxR<m_maxdR) pass = false; //invariant mass. First assume K0, if failed assume Lambda - HepLorentzVector momentumK0 = fourP(perigee1,perigee2,m_massK0,false); + CLHEP::HepLorentzVector momentumK0 = fourP(perigee1,perigee2,m_massK0,false); double inv_massK0 = momentumK0.m(); - if (fabs(inv_massK0-m_massK0) <= m_nsig*m_sigmaK0) isK0 = true; - HepLorentzVector momentumL = fourP(perigee1,perigee2,m_massLambda,false); + if (std::fabs(inv_massK0-m_massK0) <= m_nsig*m_sigmaK0) isK0 = true; + CLHEP::HepLorentzVector momentumL = fourP(perigee1,perigee2,m_massLambda,false); double inv_massL = momentumL.m(); - if (fabs(inv_massL-m_massLambda) <= m_nsig*m_sigmaLambda) isLambda = true; - HepLorentzVector momentumLb = fourP(perigee1,perigee2,m_massLambda,true); + if (std::fabs(inv_massL-m_massLambda) <= m_nsig*m_sigmaLambda) isLambda = true; + CLHEP::HepLorentzVector momentumLb = fourP(perigee1,perigee2,m_massLambda,true); double inv_massLb = momentumLb.m(); - if (fabs(inv_massLb-m_massLambda) <= m_nsig*m_sigmaLambda) isLambdaBar = true; + if (std::fabs(inv_massLb-m_massLambda) <= m_nsig*m_sigmaLambda) isLambdaBar = true; if (!isLambdaBar && !isLambda && !isK0) pass = false; - HepLorentzVector momentum; + CLHEP::HepLorentzVector momentum; if(isK0 && isLambda && !isLambdaBar) {momentum = momentumK0; kind = 110;} if(isK0 && isLambdaBar && !isLambda) {momentum = momentumK0; kind = 101;} if(isK0 && !isLambda && !isLambdaBar) {momentum = momentumK0; kind = 100;} if(!isK0 && isLambda && !isLambdaBar) {momentum = momentumL; kind = 10;} if(!isK0 && isLambdaBar && !isLambda) {momentum = momentumLb; kind = 1;} if(!isK0 && isLambda && isLambdaBar) {momentum = momentumL; kind = 11;} - double particleP = sqrt(momentum.x()*momentum.x() + momentum.y()*momentum.y()); + double particleP = std::sqrt(momentum.x()*momentum.x() + momentum.y()*momentum.y()); if (particleP < fitMomentum) pass = false; } type = kind; return pass; } - HepLorentzVector ConversionPostSelector:: - fourP(const Trk::TrackParameters& per1,const Trk::TrackParameters& per2,double mass, bool isBar){ - HepLorentzVector momentum; + CLHEP::HepLorentzVector + ConversionPostSelector::fourP(const Trk::TrackParameters& per1,const Trk::TrackParameters& per2,double mass, bool isBar){ + CLHEP::HepLorentzVector momentum; Amg::Vector3D sum_mom = per1.momentum() + per2.momentum(); double mp1 = 0.; double mp2 = 0.; if(mass==m_massK0) { - mp1 = pow(ConversionPostSelector::s_particleMasses.mass[Trk::pion],2); - mp2 = pow(ConversionPostSelector::s_particleMasses.mass[Trk::pion],2); + mp1 = std::pow(ConversionPostSelector::s_particleMasses.mass[Trk::pion],2); + mp2 = std::pow(ConversionPostSelector::s_particleMasses.mass[Trk::pion],2); }else{ if(!isBar){ if(per1.charge()>0) { - mp1 = pow(ConversionPostSelector::s_particleMasses.mass[Trk::proton],2); - mp2 = pow(ConversionPostSelector::s_particleMasses.mass[Trk::pion],2); + mp1 = std::pow(ConversionPostSelector::s_particleMasses.mass[Trk::proton],2); + mp2 = std::pow(ConversionPostSelector::s_particleMasses.mass[Trk::pion],2); } else { - mp2 = pow(ConversionPostSelector::s_particleMasses.mass[Trk::proton],2); - mp1 = pow(ConversionPostSelector::s_particleMasses.mass[Trk::pion],2); + mp2 = std::pow(ConversionPostSelector::s_particleMasses.mass[Trk::proton],2); + mp1 = std::pow(ConversionPostSelector::s_particleMasses.mass[Trk::pion],2); } }else{ if(per1.charge()>0) { - mp1 = pow(ConversionPostSelector::s_particleMasses.mass[Trk::pion],2); - mp2 = pow(ConversionPostSelector::s_particleMasses.mass[Trk::proton],2); + mp1 = std::pow(ConversionPostSelector::s_particleMasses.mass[Trk::pion],2); + mp2 = std::pow(ConversionPostSelector::s_particleMasses.mass[Trk::proton],2); } else { - mp2 = pow(ConversionPostSelector::s_particleMasses.mass[Trk::pion],2); - mp1 = pow(ConversionPostSelector::s_particleMasses.mass[Trk::proton],2); + mp2 = std::pow(ConversionPostSelector::s_particleMasses.mass[Trk::pion],2); + mp1 = std::pow(ConversionPostSelector::s_particleMasses.mass[Trk::proton],2); } } } - double ee = sqrt(mp1 + per1.momentum().mag2()) + sqrt(mp2 + per2.momentum().mag2()); + double ee = std::sqrt(mp1 + per1.momentum().mag2()) + std::sqrt(mp2 + per2.momentum().mag2()); momentum.setPx(sum_mom.x()); momentum.setPy(sum_mom.y()); momentum.setPz(sum_mom.z()); momentum.setE(ee); return momentum; } diff --git a/InnerDetector/InDetRecTools/InDetPriVxFinderTool/src/InDetAdaptiveMultiPriVxFinderTool.cxx b/InnerDetector/InDetRecTools/InDetPriVxFinderTool/src/InDetAdaptiveMultiPriVxFinderTool.cxx index dd493e5f701419f712768fcbb3da143264d95238..78ec1f649db3e45437612e03b7f0706cbf837edb 100755 --- a/InnerDetector/InDetRecTools/InDetPriVxFinderTool/src/InDetAdaptiveMultiPriVxFinderTool.cxx +++ b/InnerDetector/InDetRecTools/InDetPriVxFinderTool/src/InDetAdaptiveMultiPriVxFinderTool.cxx @@ -362,11 +362,9 @@ namespace InDet ATH_MSG_DEBUG("No tracks available after track selection for seeding. No finding done."); break; } - iteration += 1; ATH_MSG_DEBUG("Starting iteration number " << iteration << " with " << seedtracknumber << " seed tracks."); //now use all the perigee parameters you have so far - if (m_realMultiVertex == true) { trkbegin = origTracks.begin(); trkend = origTracks.end(); @@ -374,14 +372,11 @@ namespace InDet trkbegin = seedTracks.begin(); trkend = seedTracks.end(); } - std::vector<const Trk::TrackParameters*> perigeeList; - for (std::vector<const Trk::ITrackLink*>::iterator seedtrkAtVtxIter = seedtrkbegin; seedtrkAtVtxIter != seedtrkend; ++seedtrkAtVtxIter) { perigeeList.push_back((*seedtrkAtVtxIter)->parameters()); } - xAOD::Vertex* constraintVertex = 0; if (m_useBeamConstraint) { constraintVertex = new xAOD::Vertex(); @@ -402,7 +397,6 @@ namespace InDet constraintVertex->setCovariancePosition(looseConstraintCovariance); constraintVertex->setFitQuality(0., -3.); } - // TODO: memory leak here with theconstraint when the loop breaks? if (actualVertex.z() == 0.) { ATH_MSG_DEBUG("No seed found: no further primary vertex finding performed on this event"); @@ -412,31 +406,22 @@ namespace InDet constraintVertex = 0; break; } - //new xAOD::Vertex with this xAOD::Vertex* actualcandidate = new xAOD::Vertex; actualcandidate->makePrivateStore(); - actualcandidate->setVertexType(xAOD::VxType::NotSpecified); // to mimic the initialization present in the old EDM - // constructor + actualcandidate->setVertexType(xAOD::VxType::NotSpecified); // to mimic the initialization present in the old EDM // constructor // now add decorations! MvfFitInfo(*actualcandidate) = new Trk::MvfFitInfo(constraintVertex, new Amg::Vector3D(actualVertex), new Amg::Vector3D(actualVertex)); isInitialized(*actualcandidate) = false; - std::vector<Trk::VxTrackAtVertex*> vector_of_tracks(0); VTAV(*actualcandidate) = vector_of_tracks; // TODO: maybe needed before push_back? - - //get link to the tracks - //std::vector<Trk::VxTrackAtVertex>* tracksOfVertex = &( actualcandidate->vxTrackAtVertex() ); - //now iterate on all tracks and find out if they are sufficiently close to the found vertex ATH_MSG_VERBOSE("Adding all the tracks which are near the seed to the candidate "); for (std::vector<const Trk::ITrackLink*>::const_iterator trkiter = trkbegin; trkiter != trkend; ++trkiter) { - // if (fabs((*trkiter)->parameters()->position()[Trk::z]-actualVertex.position().z())<m_TracksMaxZinterval) { - if (fabs(estimateDeltaZ(*(*trkiter)->parameters(), actualVertex)) < m_TracksMaxZinterval) { //accessing corresponding link to vertices Trk::TrackToVtxLink* actuallink = TrackLinkOf[*trkiter]; @@ -449,15 +434,12 @@ namespace InDet actuallink)); } } - ATH_MSG_VERBOSE(VTAV(*actualcandidate).size() << " tracks added to vertex candidate due to proximity"); - //now consider to recovery from the case where no tracks were added to the vertex - if (VTAV(*actualcandidate).size() == 0) { + if (VTAV(*actualcandidate).empty()) { //you need to define a new seed (because the old one is probably in between two ones...) double zdistance = 1e8; const Trk::ITrackLink* nearestTrack = 0; - for (std::vector<const Trk::ITrackLink*>::const_iterator seedtrkiter = seedtrkbegin; seedtrkiter != seedtrkend; ++seedtrkiter) { if (fabs((*seedtrkiter)->parameters()->position()[Trk::z] - actualVertex.z()) < zdistance) { @@ -465,8 +447,7 @@ namespace InDet nearestTrack = *seedtrkiter; } } - - if (nearestTrack != 0) { + if (nearestTrack) { double newz = (nearestTrack->parameters())->position()[Trk::z]; xAOD::Vertex* oldcandidate = actualcandidate; // to placehold old pointers @@ -494,7 +475,7 @@ namespace InDet for (std::vector<const Trk::ITrackLink*>::const_iterator trkiter = trkbegin; trkiter != trkend; ++trkiter) { // if (fabs((*trkiter)->parameters()->position()[Trk::z]-actualVertex.z())<m_TracksMaxZinterval) { - if (fabs(estimateDeltaZ(*((*trkiter)->parameters()), + if (std::fabs(estimateDeltaZ(*((*trkiter)->parameters()), actualVertex)) < m_TracksMaxZinterval) { //accessing corresponding link to vertices Trk::TrackToVtxLink* actuallink = TrackLinkOf[*trkiter]; @@ -508,31 +489,25 @@ namespace InDet } } - if (VTAV(*actualcandidate).size() == 0) { + if (VTAV(*actualcandidate).empty()) { ATH_MSG_DEBUG("No tracks found near seed, while at least one track was expected."); break; } } else { ATH_MSG_DEBUG("Nearest track to seed is missing."); + delete actualcandidate; break; } } - - ATH_MSG_VERBOSE("Running addVtxTofit(); The current candidate has " << VTAV(*actualcandidate).size() << " tracks in the vector"); - m_MultiVertexFitter->addVtxTofit(actualcandidate); - ATH_MSG_VERBOSE("After fit the current candidate has z: " << actualcandidate->position()[Trk::z]); - //get link to the tracks (they are now all properly in the std::vector<Trk::VxTrackAtVertex> of the xAOD::Vertex) // TODO: maybe I shouldn't be using xAOD::Vertex vector at all for VxTrackAtVertex... //std::vector<Trk::VxTrackAtVertex>* tracksOfVertex = &( actualcandidate->vxTrackAtVertex() ); - std::vector<Trk::VxTrackAtVertex*>::iterator trkAtVtxbegin = VTAV(*actualcandidate).begin(); std::vector<Trk::VxTrackAtVertex*>::iterator trkAtVtxend = VTAV(*actualcandidate).end(); - //now check that there is at least one track added to the fit //(this is not always the case because only tracks above a certain compatibility threshold are considered) bool atleastonecompatibletrack = false; @@ -568,7 +543,6 @@ namespace InDet } bool newVertexIsFine = false; - if (m_addSingleTrackVertices) { if (m_useBeamConstraint) { if (numberOfCompatibleTracks > 0) { @@ -586,11 +560,9 @@ namespace InDet } ATH_MSG_VERBOSE("newVertexIsFine = " << newVertexIsFine); - //this now should be so powerful to do everything by itself //problem now is to delete the really compatible tracks to this fit from the tracks //which still remain to be fitted - if (atleastonecompatibletrack) { for (std::vector<Trk::VxTrackAtVertex*>::iterator trkAtVtxIter = trkAtVtxbegin; trkAtVtxIter != trkAtVtxend; ++trkAtVtxIter) { @@ -641,7 +613,6 @@ namespace InDet foundTrack = *seedtrkiter; } } - if (foundTrack != 0) { double compatibility = (*trkAtVtxIter)->vtxCompatibility(); ATH_MSG_VERBOSE("New track has compatibility: " << compatibility); @@ -653,7 +624,6 @@ namespace InDet } ATH_MSG_VERBOSE("Highest compatibility track:" << trackHighestCompatibility << "with compatibility: " << highestcompatibility); - if (trackHighestCompatibility != 0) { std::vector<const Trk::ITrackLink*>::iterator foundTrack = seedtrkend; for (std::vector<const Trk::ITrackLink*>::iterator seedtrkiter = seedtrkbegin; seedtrkiter != seedtrkend; @@ -662,7 +632,6 @@ namespace InDet foundTrack = seedtrkiter; } } - if (foundTrack != seedtrkend) { seedTracks.erase(foundTrack); seedtrkbegin = seedTracks.begin(); @@ -673,10 +642,8 @@ namespace InDet } } else { //alternative method: delete seed track nearest in z to the seed - double zdistance = 1e8; const Trk::ITrackLink* nearestTrack = 0; - for (std::vector<const Trk::ITrackLink*>::const_iterator seedtrkiter = seedtrkbegin; seedtrkiter != seedtrkend; ++seedtrkiter) { if (fabs((*seedtrkiter)->parameters()->position()[Trk::z] - actualVertex.z()) < zdistance) { @@ -684,7 +651,6 @@ namespace InDet nearestTrack = *seedtrkiter; } } - if (nearestTrack != 0) { std::vector<const Trk::ITrackLink*>::iterator foundTrackToDelete = std::find(seedtrkbegin, seedtrkend, nearestTrack); @@ -706,50 +672,38 @@ namespace InDet /////////////// //now break the cycle if you didn't diminish the number of seeds... - ATH_MSG_DEBUG("Remaining seeds: " << seedTracks.size() << " previous round " << seedtracknumber); - bool deleteLastVertex = false; - if (!newVertexIsFine) { deleteLastVertex = true; } else { double contamination = 0.; - double contaminationNum = 0; double contaminationDeNom = 0; - std::vector<Trk::VxTrackAtVertex*>::iterator TRKtrkbegin(VTAV(*actualcandidate).begin()); std::vector<Trk::VxTrackAtVertex*>::iterator TRKtrkend(VTAV(*actualcandidate).end()); - for (std::vector<Trk::VxTrackAtVertex*>::iterator TRKtrkiter = TRKtrkbegin; TRKtrkiter != TRKtrkend; ++TRKtrkiter) { double trackWeight = (*TRKtrkiter)->weight(); contaminationNum += trackWeight * (1. - trackWeight); contaminationDeNom += trackWeight * trackWeight; } - if (contaminationDeNom > 0) { contamination = contaminationNum / contaminationDeNom; } - - if (contamination > m_maximumVertexContamination) { ATH_MSG_VERBOSE( "Contamination estimator " << contamination << " fails cut of " << m_maximumVertexContamination); deleteLastVertex = true; } - //now try to understand if the vertex was merged with another one... std::vector<xAODVertex_pair>::iterator vxbegin = myxAODVertices.begin(); std::vector<xAODVertex_pair>::iterator vxend = myxAODVertices.end(); - for (std::vector<xAODVertex_pair>::iterator vxiter = vxbegin; vxiter != vxend; ++vxiter) { ATH_MSG_VERBOSE("Estimating compatibility of z positions: " << ((*vxiter).second)->position()[Trk::z] << " and " << actualcandidate->position()[Trk::z]); //in case of no beam spot constraint you should use the full 3d significance on the distance double dependence = 0; - if (!m_do3dSplitting) { dependence = fabs((*vxiter).second->position()[Trk::z] - actualcandidate->position()[Trk::z]) / TMath::Sqrt((*vxiter).second->covariancePosition()(Trk::z, Trk::z) + @@ -758,9 +712,7 @@ namespace InDet Amg::MatrixX sumCovariances = (*vxiter).second->covariancePosition() + actualcandidate->covariancePosition(); - sumCovariances = sumCovariances.inverse().eval(); - Amg::Vector3D hepVectorPosition; hepVectorPosition[0] = ((*vxiter).second->position() - @@ -773,9 +725,7 @@ namespace InDet actualcandidate->position()).z(); dependence = sqrt(hepVectorPosition.dot(sumCovariances * hepVectorPosition)); } - ATH_MSG_VERBOSE("Significance of vertex pair is: " << dependence << "vs. cut at " << m_cutVertexDependence); - if (dependence < m_cutVertexDependence) { ATH_MSG_VERBOSE("Deleting last vertex since it was found to be merged with another!"); deleteLastVertex = true; @@ -783,16 +733,13 @@ namespace InDet } } } - ATH_MSG_VERBOSE("Decision to delete last vertex: " << deleteLastVertex); - //////////// //Ok all tracks in seed were deleted. You can go ahead and discover further vertices... //please clean the track to vertices links before (required by real multivertexfit) if (deleteLastVertex) { std::vector<Trk::VxTrackAtVertex*>::iterator MVFtrkAtVtxBegin = VTAV(*actualcandidate).begin(); std::vector<Trk::VxTrackAtVertex*>::iterator MVFtrkAtVtxEnd = VTAV(*actualcandidate).end(); - for (std::vector<Trk::VxTrackAtVertex*>::iterator MVFtrkIterator = MVFtrkAtVtxBegin; MVFtrkIterator != MVFtrkAtVtxEnd; ++MVFtrkIterator) { ATH_MSG_VERBOSE("Deleting one vertex from tracklink " << @@ -800,29 +747,22 @@ namespace InDet (static_cast<Trk::MVFVxTrackAtVertex*>(*MVFtrkIterator))->linkToVertices()->vertices()->pop_back(); } seedtracknumber = seedTracks.size(); - ATH_MSG_VERBOSE("Redoing fit after scrapping last vertex"); - m_MultiVertexFitter->addVtxTofit(actualcandidate); // TODO: I think this is fine still, but think about it more - releaseCandidate(actualcandidate); } else { seedtracknumber = seedTracks.size(); ATH_MSG_VERBOSE("Storing new vertex with " << actualcandidate->vxTrackAtVertex().size() << " tracks"); - myxAODVertices.push_back - (xAODVertex_pair(0,//estimateSignalCompatibility(actualcandidate), - actualcandidate)); + myxAODVertices.push_back(xAODVertex_pair(0,actualcandidate)); } } while (( (m_addSingleTrackVertices && seedTracks.size() > 0) || ((!m_addSingleTrackVertices) && seedTracks.size() > 1)) && iteration < m_maxIterations); - if (iteration >= m_maxIterations) { ATH_MSG_WARNING("Maximum number of iterations (" << m_maxIterations << ") reached; to reconstruct more vertices, set maxIterations to a higher value."); } - ATH_MSG_DEBUG("Primary vertex finding complete with " << iteration << " iterations and " << myxAODVertices.size() << " vertices found."); @@ -832,14 +772,12 @@ namespace InDet //on...) std::vector<xAODVertex_pair>::iterator vtxBegin = myxAODVertices.begin(); std::vector<xAODVertex_pair>::iterator vtxEnd = myxAODVertices.end(); - // To make sure that the right tracks are in the std::vector<Trk::VxTrackAtVertex> of each vertex - up until now, // they are kept in the VTAV decoration for (std::vector<xAODVertex_pair>::iterator vtxIter = vtxBegin; vtxIter != vtxEnd; ++vtxIter) { xAOD::Vertex* cand = vtxIter->second; std::vector<Trk::VxTrackAtVertex>* tracksOfVertex = &(cand->vxTrackAtVertex()); tracksOfVertex->clear(); - std::vector<Trk::VxTrackAtVertex*>::iterator MVFtrkBegin = VTAV(*cand).begin(); std::vector<Trk::VxTrackAtVertex*>::iterator MVFtrkEnd = VTAV(*cand).end(); for (std::vector<Trk::VxTrackAtVertex*>::iterator MVFtrkIter = MVFtrkBegin; MVFtrkIter != MVFtrkEnd; @@ -847,41 +785,31 @@ namespace InDet tracksOfVertex->push_back(**MVFtrkIter); } } - //before filling the container, you have to decide what is your most probable signal vertex for (std::vector<xAODVertex_pair>::iterator vtxIter = vtxBegin; vtxIter != vtxEnd; ++vtxIter) { (*vtxIter).first = estimateSignalCompatibility((*vtxIter).second); } - std::sort(myxAODVertices.begin(), myxAODVertices.end()); - if (msgLvl(MSG::VERBOSE)) { ATH_MSG_VERBOSE("Vertex positions after sorting"); for (std::vector<xAODVertex_pair>::iterator vtxIter = vtxBegin; vtxIter != vtxEnd; ++vtxIter) { ATH_MSG_VERBOSE("z position: " << (*vtxIter).second->position().z()); } } - if (myxAODVertices.size() == 0) { ATH_MSG_WARNING("No vertices found: returning a place-holder at the beam spot center."); - xAOD::Vertex* beamspotCandidate = new xAOD::Vertex; beamspotCandidate->makePrivateStore(); beamspotCandidate->setPosition(m_iBeamCondSvc->beamVtx().position()); beamspotCandidate->setCovariancePosition(m_iBeamCondSvc->beamVtx().covariancePosition()); beamspotCandidate->vxTrackAtVertex() = std::vector<Trk::VxTrackAtVertex>(); // TODO: I don't need to set fitQuality too do I? - myxAODVertices.push_back(xAODVertex_pair(0, beamspotCandidate)); } - - vtxBegin = myxAODVertices.begin(); vtxEnd = myxAODVertices.end(); - for (std::vector<xAODVertex_pair>::const_iterator vtxIter = vtxBegin; vtxIter != vtxEnd; ++vtxIter) { xAOD::Vertex* cand = vtxIter->second; - std::vector<Trk::VxTrackAtVertex*>::iterator MVFtrkBegin = VTAV(*cand).begin(); std::vector<Trk::VxTrackAtVertex*>::iterator MVFtrkEnd = VTAV(*cand).end(); // TODO: here, I must clean up VTAV decoration separately from vector of VxTrackAtVertex @@ -892,15 +820,11 @@ namespace InDet delete *MVFtrkIter; *MVFtrkIter = 0; } - - //delete VTAV( *cand ); delete MvfFitInfo(*cand); - std::vector<Trk::VxTrackAtVertex>::iterator trkAtVtxBegin = cand->vxTrackAtVertex().begin(); std::vector<Trk::VxTrackAtVertex>::iterator trkAtVtxEnd = cand->vxTrackAtVertex().end(); - for (std::vector<Trk::VxTrackAtVertex>::iterator trkAtVtxIter = trkAtVtxBegin; trkAtVtxIter != trkAtVtxEnd; ) {//++trkAtVtxIter) - // { + for (std::vector<Trk::VxTrackAtVertex>::iterator trkAtVtxIter = trkAtVtxBegin; trkAtVtxIter != trkAtVtxEnd; ) {//++trkAtVtxIter) // { //cleaning up incompatible vertices if (((*trkAtVtxIter).vtxCompatibility() > m_maxVertexChi2 && m_useFastCompatibility) || (((*trkAtVtxIter).weight() < m_minweight @@ -914,16 +838,13 @@ namespace InDet } theVertexContainer->push_back(cand); } - // If track links are to xAOD::TrackParticles, set the links directly in xAOD::Vertex with their weights // Needed for weight calculator in sorting tool xAOD::VertexContainer::iterator vxBegin = theVertexContainer->begin(); xAOD::VertexContainer::iterator vxEnd = theVertexContainer->end(); for (xAOD::VertexContainer::iterator vxIter = vxBegin; vxIter != vxEnd; ++vxIter) { std::vector<Trk::VxTrackAtVertex>* myVxTracksAtVtx = &((*vxIter)->vxTrackAtVertex()); - if (!myVxTracksAtVtx) continue; - std::vector<Trk::VxTrackAtVertex>::iterator tracksBegin = myVxTracksAtVtx->begin(); std::vector<Trk::VxTrackAtVertex>::iterator tracksEnd = myVxTracksAtVtx->end(); for (std::vector<Trk::VxTrackAtVertex>::iterator tracksIter = tracksBegin; @@ -933,24 +854,18 @@ namespace InDet dynamic_cast<Trk::LinkToXAODTrackParticle*>((*tracksIter).trackOrParticleLink()); if (linkToXAODTP) { ATH_MSG_VERBOSE("Iterating over new vertex in fixing xAOD::TrackParticle links... "); - (*vxIter)->addTrackAtVertex(*linkToXAODTP, (*tracksIter).weight()); } // TODO: esle write in a warning? (if tracks were TrkTracks or Trk::TrackParticleBase) - sorting tool expects // there to be xAOD::TrackParticleLinks! } } - if (m_selectiontype == 1 && m_testingclass != 0) delete m_testingclass; - - std::vector<Trk::TrackToVtxLink*>::iterator begin = myTrackToVtxLinks.begin(); std::vector<Trk::TrackToVtxLink*>::iterator end = myTrackToVtxLinks.end(); - //delete all TrackToVtxLink objects for (std::vector<Trk::TrackToVtxLink*>::iterator iterator = begin; iterator != end; ++iterator) { delete *iterator; } - //---- add dummy vertex at the end ------------------------------------------------------// //---- if one or more vertices are already there: let dummy have same position as primary vertex if (theVertexContainer->size() >= 1) { @@ -978,7 +893,6 @@ namespace InDet dummyxAODVertex->vxTrackAtVertex() = std::vector<Trk::VxTrackAtVertex>(); dummyxAODVertex->setVertexType(xAOD::VxType::NoVtx); } - // loop over the pile up to set it as pile up (EXCLUDE first and last vertex: loop from 1 to size-1) for (unsigned int i = 0; i < theVertexContainer->size() - 1; i++) { if (i > 0) { diff --git a/InnerDetector/InDetRecTools/InDetPriVxFinderTool/src/InDetPriVxFinderTool.cxx b/InnerDetector/InDetRecTools/InDetPriVxFinderTool/src/InDetPriVxFinderTool.cxx index b426a3ec7960bf9355c1e82c67d2c592881d4e97..afbdafacc8119f3073b3c71f01313d2a60e1df0b 100755 --- a/InnerDetector/InDetRecTools/InDetPriVxFinderTool/src/InDetPriVxFinderTool.cxx +++ b/InnerDetector/InDetRecTools/InDetPriVxFinderTool/src/InDetPriVxFinderTool.cxx @@ -433,8 +433,6 @@ namespace InDet if (right_seed.size() > 1 && left_seed.size() > 1) { seedsVector.push_back(right_seed); seedsVector.push_back(left_seed); - - // std::cout<<"Seed vectors of sizes created: "<<right_seed.size()<<" and "<<left_seed.size()<<std::endl; }//otherwise making the vector empty and thus no seeds produced at all } else seedsVector.push_back(origParameters); // if not creating split vertices } else { // if not enabling multiple vertices @@ -450,7 +448,6 @@ namespace InDet //---- validate the element links ---------------// for (xAOD::VertexContainer::iterator vxContItr = returnContainers.first->begin(); vxContItr != returnContainers.first->end(); vxContItr++) { std::vector<Trk::VxTrackAtVertex>* tmpVxTAVtx = &(*vxContItr)->vxTrackAtVertex(); - //assigning the input tracks to the fitted vertices through VxTrackAtVertices for (std::vector<Trk::VxTrackAtVertex>::iterator itr = tmpVxTAVtx->begin(); itr != tmpVxTAVtx->end(); itr++) { const Trk::TrackParameters* initialPerigee = (*itr).initialPerigee(); @@ -462,7 +459,6 @@ namespace InDet continue; } } - // validate the track link if (correspondingTrack != 0) { Trk::LinkToXAODTrackParticle* link = new Trk::LinkToXAODTrackParticle; @@ -500,32 +496,20 @@ namespace InDet std::pair<xAOD::VertexContainer*, xAOD::VertexAuxContainer*> InDetPriVxFinderTool::findVertex(std::vector< std::vector<const Trk::TrackParameters*> >& zTrackColl) { - // std::cout<<"Starting the main part of the finding "<<std::endl; - //---- Constraint vertex section: if enabled in jobOptions a constraint is assigned --// Amg::Vector3D vertex = Amg::Vector3D(0., 0., 0.); //for fit() we need Amg::Vector3D or Trk::RecVertex std::vector<Trk::VxTrackAtVertex>* trkAtVtx = nullptr; - // Finding hot spots of z0's in case of pile up. std::vector<const Trk::TrackParameters*> zTracks; - //typedef std::vector<const Trk::TrackParameters*>::const_iterator zTrkIter; zTracks.clear(); - - //typedef std::vector<std::vector<const Trk::TrackParameters* > >::iterator zTrkCollIter; - // VertexContainer which takes xAOD::Vertex and is stored in StoreGate xAOD::VertexContainer* theVertexContainer = new xAOD::VertexContainer; xAOD::VertexAuxContainer* theVertexAuxContainer = new xAOD::VertexAuxContainer; theVertexContainer->setStore(theVertexAuxContainer); - std::map<double, xAOD::Vertex*> vertexMap; std::vector<xAOD::Vertex*> splitVtxVector; - double vertexPt; - xAOD::Vertex* myxAODVertex = 0; - // std::cout<<"Getting to the loop; size is: "<< zTrackColl.size()<<std::endl; - for (unsigned int i = 0; i < zTrackColl.size(); i++) { // std::cout<<"Inside the loop"<<std::endl; if (msgLvl(MSG::DEBUG)) msg() << "Fitting vertex of Z-Cluster " << i << " with " << zTrackColl[i].size() << " Tracks" << endmsg; @@ -533,7 +517,6 @@ namespace InDet std::vector<const Trk::TrackParameters*> origParameters; origParameters.clear(); origParameters = zTrackColl[i]; - //---- Start of fitting section ------------------------------------------------------// if (origParameters.size() == 1 && m_useBeamConstraint) { xAOD::Vertex theconstraint; @@ -545,19 +528,13 @@ namespace InDet } else if (origParameters.size() < 2 && m_createSplitVertices) { // in the case this is a split vertex and it has only one track // we make a dummy vertex and push it back to the container - myxAODVertex = new xAOD::Vertex; myxAODVertex->makePrivateStore(); myxAODVertex->setPosition(m_iBeamCondSvc->beamVtx().position()); myxAODVertex->setCovariancePosition(m_iBeamCondSvc->beamVtx().covariancePosition()); myxAODVertex->vxTrackAtVertex() = std::vector<Trk::VxTrackAtVertex>(); myxAODVertex->setVertexType(xAOD::VxType::NoVtx); - - // std::cout<<"this is a case when the split seeds are too small, dummy returned"<<std::endl; } else if (origParameters.size() > 1) { - // std::cout<<"choosing 2nd option"<<std::endl; - - // if(msgLvl(MSG::VERBOSE)) msg() << "First call of fitting tool!" << endmsg; if (m_useBeamConstraint) { xAOD::Vertex theconstraint; theconstraint.makePrivateStore(); @@ -568,27 +545,13 @@ namespace InDet } else { myxAODVertex = m_iVertexFitter->fit(origParameters, vertex); } - - if (myxAODVertex != 0) { - // std::cout<< "non-zero xAOD::Vertex!"<<std::endl; - + if (myxAODVertex) { /* Get the vertex position */ - // std::cout<< "position: "<< myxAODVertex->position() <<std::endl; - Amg::Vector3D vertex(myxAODVertex->position()); trkAtVtx = &(myxAODVertex->vxTrackAtVertex()); - // std::cout<< "number of fitted tracks"<< trkAtVtx->size()<< std::endl; - /* The fit tool does not return tracks chi2 ordered anymore We have to do it */ std::vector<int> indexOfSortedChi2; - // std::cout<< "Calling the sort " <<std::endl; - sortTracksInChi2(indexOfSortedChi2, myxAODVertex); - - // std::cout<< "Sort done " <<std::endl; - - - /* If more than 2 tracks were used, do a chi2 selection of tracks used in the fit: @@ -604,24 +567,19 @@ namespace InDet // first track Trk::VxTrackAtVertex* tmpVTAV = &(*trkAtVtx) [indexOfSortedChi2[0]]; origParameters.push_back(tmpVTAV->initialPerigee()); - // second track tmpVTAV = &(*trkAtVtx) [indexOfSortedChi2[1]]; origParameters.push_back(tmpVTAV->initialPerigee()); - for (unsigned int i = 2; i < trkAtVtx->size(); ++i) { if ((*trkAtVtx) [indexOfSortedChi2[i]].trackQuality().chiSquared() > m_maxChi2PerTrack) continue; tmpVTAV = &(*trkAtVtx) [indexOfSortedChi2[i]]; origParameters.push_back(tmpVTAV->initialPerigee()); } - - // delete old xAOD::Vertex first - if (myxAODVertex != 0) { + if (myxAODVertex) { delete myxAODVertex; myxAODVertex = 0; } - if (msgLvl(MSG::VERBOSE)) msg() << "Second call of fitting tool!" << endmsg; if (m_useBeamConstraint) { xAOD::Vertex theconstraint; @@ -633,10 +591,11 @@ namespace InDet } else { myxAODVertex = m_iVertexFitter->fit(origParameters, vertex); } - + /** This value is never used before it gets overwritten (coverity 111631) if (myxAODVertex) { trkAtVtx = &(myxAODVertex->vxTrackAtVertex()); } + **/ }//end of chi2 cut method 1 /* Version 2: @@ -684,28 +643,22 @@ namespace InDet } // end if "more than one track after m_preSelect(...)" else if (msgLvl(MSG::DEBUG)) msg() << "Less than two tracks or fitting without constraint - drop candidate vertex." << endmsg; // end if preselection for first iteration - if ((origParameters.size() > 1 || (m_useBeamConstraint && origParameters.size() == 1)) && myxAODVertex && !m_createSplitVertices) { if (msgLvl(MSG::VERBOSE)) msg() << "Storing the fitted vertex." << endmsg; - /* Store the primary vertex */ trkAtVtx = &(myxAODVertex->vxTrackAtVertex()); - vertexPt = 0.; for (unsigned int i = 0; i < trkAtVtx->size(); ++i) { const Trk::TrackParameters* tmpTP = dynamic_cast<const Trk::TrackParameters*> ((*(trkAtVtx)) [i].initialPerigee()); if (tmpTP) vertexPt += tmpTP->pT(); } - vertexMap[vertexPt] = myxAODVertex; } else if (m_createSplitVertices) { //storing a split vertex, if did not work - storing a dummy if (myxAODVertex) { - // std::cout<<"Normal xAOD::Vertex found in the split mode "<<std::endl; myxAODVertex->setVertexType(xAOD::VxType::PriVtx); splitVtxVector.push_back(myxAODVertex); } else { - // std::cout<<"No candidate reconstructed, storing the dummy "<<std::endl; xAOD::Vertex* dummyxAODVertex = new xAOD::Vertex; dummyxAODVertex->makePrivateStore(); dummyxAODVertex->setPosition(m_iBeamCondSvc->beamVtx().position()); @@ -719,11 +672,7 @@ namespace InDet myxAODVertex = 0; } }//end of loop over the pre-defined seeds - //no sorting for the split vertices -otherwise, why splitting at all? - // std::cout<<"Past loop over the clusters "<<std::endl; - - if (!m_createSplitVertices) { for (std::map<double, xAOD::Vertex*>::reverse_iterator i = vertexMap.rbegin(); i != vertexMap.rend(); i++) { if (msgLvl(MSG::VERBOSE)) msg() << "Sorting the fitted vertices. " << vertexMap.size() << " have been found." << endmsg; @@ -742,8 +691,6 @@ namespace InDet }//end of sorting loop } else for (std::vector<xAOD::Vertex*>::iterator l_vt = splitVtxVector.begin(); l_vt != splitVtxVector.end(); ++l_vt) theVertexContainer->push_back(*l_vt); - - // std::cout<<"Past the second loop "<<std::endl; //---- add dummy vertex at the end ------------------------------------------------------// //---- if one or more vertices are already there: let dummy have same position as primary vertex if (theVertexContainer->size() >= 1 && !m_createSplitVertices) { @@ -787,15 +734,12 @@ namespace InDet new_dummyxAODVertex->setVertexType(xAOD::VxType::NoVtx); } } - // loop over the pile up to set it as pile up (EXCLUDE first and last vertex: loop from 1 to size-1) if (!m_createSplitVertices) { for (unsigned int i = 1; i < theVertexContainer->size() - 1; i++) { (*theVertexContainer)[i]->setVertexType(xAOD::VxType::PileUp); } } - - // std::cout<<"returning the container "<<std::endl; return std::make_pair(theVertexContainer, theVertexAuxContainer); }//end m_find vertex ethod diff --git a/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/InDetVKalVxInJetTool/InDetTrkInJetType.h b/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/InDetVKalVxInJetTool/InDetTrkInJetType.h index f192f9ef81402a3383385b03a531d4490b338b8b..452143dc8a6ea52d9d4a3e48e922e259cad6ffe8 100644 --- a/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/InDetVKalVxInJetTool/InDetTrkInJetType.h +++ b/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/InDetVKalVxInJetTool/InDetTrkInJetType.h @@ -23,12 +23,18 @@ #include <vector> #include "AthenaBaseComps/AthAlgTool.h" #include "GaudiKernel/ToolHandle.h" -#include "TLorentzVector.h" #include "xAODTracking/TrackParticleContainer.h" -#include "TrkVKalVrtFitter/TrkVKalVrtFitter.h" -#include "Particle/TrackParticle.h" +#include "TrkVertexFitterInterfaces/IVertexFitter.h" // +class TLorentzVector; +namespace Rec{ + class TrackParticle; +} + +namespace Trk{ + class TrkVKalVrtFitter; +} namespace TMVA { class Reader; } namespace InDet { @@ -80,23 +86,23 @@ namespace InDet { float m_Z0_limUpp; std::string m_calibFileName; ToolHandle < Trk::IVertexFitter > m_fitterSvc; - Trk::TrkVKalVrtFitter* m_fitSvc; - - int m_initialised; - - float m_prbS; - float m_Sig3D; - float m_prbP; - float m_d0; - float m_vChi2; - float m_pTvsJet; - float m_prodTJ; - float m_SigZ; - float m_SigR; - float m_ptjet; - float m_etajet; - float m_ibl; - float m_bl; + Trk::TrkVKalVrtFitter* m_fitSvc{}; + + int m_initialised{}; + + float m_prbS{}; + float m_Sig3D{}; + float m_prbP{}; + float m_d0{}; + float m_vChi2{}; + float m_pTvsJet{}; + float m_prodTJ{}; + float m_SigZ{}; + float m_SigR{}; + float m_ptjet{}; + float m_etajet{}; + float m_ibl{}; + float m_bl{}; }; diff --git a/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/BTagVrtSec.cxx b/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/BTagVrtSec.cxx index e18a662ac0508e9aaa2caf0cdf34e603ef6b097a..ecf1ccae1066ee6bad93e1b4659568b50b1b87ad 100755 --- a/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/BTagVrtSec.cxx +++ b/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/BTagVrtSec.cxx @@ -38,8 +38,8 @@ namespace InDet{ if(N==1) return Vec[0]; if(N>1){ std::vector<float> tmp(Vec); - std::sort(tmp.begin(),tmp.end()); - return (tmp[(N-1)/2]+tmp[N/2])/2.; + std::sort(tmp.begin(),tmp.end()); //can use nth_element instead of completely sorting, it's quicker + return (tmp[(N-1)/2]+tmp[N/2])/2.; //only true if the number of elements is even? } return 0.; } @@ -340,6 +340,7 @@ namespace InDet{ Vrt2TrackNumber = (double) ListSecondTracks.size()/2.; std::vector<const xAOD::TrackParticle*> saveSecondTracks(ListSecondTracks); RemoveDoubleEntries(ListSecondTracks); + AnalysisUtils::Sort::pT (&ListSecondTracks); for(auto iv0 : TrkFromV0){ auto itf=std::find(SelectedTracks.begin(),SelectedTracks.end(),iv0); if(itf!=SelectedTracks.end()) SelectedTracks.erase(itf);} //--- @@ -758,6 +759,7 @@ namespace InDet{ } } } + if (not m_curTup) return; //something very wrong if(m_fillHist){ m_curTup->ptjet=JetDir.Perp(); m_curTup->etajet=fabs(JetDir.Eta()); m_curTup->phijet=JetDir.Phi(); m_curTup->nTrkInJet=std::min(NTracks,DevTuple::maxNTrk); }; if(nTrkHF==0) return; //====== No at all good HF tracks diff --git a/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/InDetTrkInJetType.cxx b/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/InDetTrkInJetType.cxx index 49a0c844966a441ef511188f7690496bb4749876..174e8787bd3f32e75ecf42572c4eeba3cba4c012 100644 --- a/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/InDetTrkInJetType.cxx +++ b/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/InDetTrkInJetType.cxx @@ -6,6 +6,10 @@ #include "TMVA/MethodBase.h" #include "TMVA/Reader.h" #include "PathResolver/PathResolver.h" +#include "TLorentzVector.h" +#include "TrkVKalVrtFitter/TrkVKalVrtFitter.h" + +#include "Particle/TrackParticle.h" // //------------------------------------------------- namespace InDet { diff --git a/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/InDetVKalVxInJetTool.cxx b/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/InDetVKalVxInJetTool.cxx index f606e53685d0deb6d435bf48d68c248a142604e9..b947561ad208c494f40304a845dba9f2b627ec26 100755 --- a/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/InDetVKalVxInJetTool.cxx +++ b/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/InDetVKalVxInJetTool.cxx @@ -25,6 +25,9 @@ //} namespace InDet { + +const int InDetVKalVxInJetTool::DevTuple::maxNTrk; + // //Constructor-------------------------------------------------------------- InDetVKalVxInJetTool::InDetVKalVxInJetTool(const std::string& type, diff --git a/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx b/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx index b1fd5d2caa6a4d85dae19f01904fce3d61d47ff8..5c322d61c54f76eaeb1226dc026a40559d98e2aa 100755 --- a/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx +++ b/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx @@ -11,20 +11,21 @@ //------------------------------------------------- // Other stuff #include <cmath> -//#include<iostream> namespace InDet{ double InDetVKalVxInJetTool::RankBTrk(double TrkPt, double JetPt, double Signif) const { - double coeffSig=1.0; - double s_prob=(Signif-coeffSig)/Signif; // Old probability to be b-track + //code re-ordered to avoid divide by zero double coeffPt=10.; - double pfrac=(TrkPt-m_cutPt)/sqrt(JetPt); + double pfrac=(TrkPt-m_cutPt)/std::sqrt(JetPt); double p_prob= pfrac/(coeffPt+pfrac); // Old probability to be b-track + if (Signif == 0.) return p_prob; //should be less than some epsilon? + // + double coeffSig=1.0; + double s_prob=(Signif-coeffSig)/Signif; // Old probability to be b-track if(TrkPt + JetPt == 0.) return s_prob; - else if(Signif == 0.) return p_prob; //----------------------------------Initial definition of selective variable double contrib=0.4; return (1.+contrib)*std::max(s_prob,0.)+(1.-contrib)*p_prob; diff --git a/InnerDetector/InDetTrigRecAlgs/SiTrigSPSeededTrackFinder/src/SiTrigSPSeededTrackFinder.cxx b/InnerDetector/InDetTrigRecAlgs/SiTrigSPSeededTrackFinder/src/SiTrigSPSeededTrackFinder.cxx index 0c14205c3410dc292abd1481f7206cb1e7e9ce20..e2c1df953de27f3d8f7b64a9d75c2f459c48c3d4 100755 --- a/InnerDetector/InDetTrigRecAlgs/SiTrigSPSeededTrackFinder/src/SiTrigSPSeededTrackFinder.cxx +++ b/InnerDetector/InDetTrigRecAlgs/SiTrigSPSeededTrackFinder/src/SiTrigSPSeededTrackFinder.cxx @@ -340,24 +340,19 @@ HLT::ErrorCode InDet::SiTrigSPSeededTrackFinder::hltExecute(const HLT::TriggerEl /////////////////////////////////////// while((seed = m_seedsmaker->next())) { - if (m_doTimeOutChecks && Athena::Timeout::instance().reached() ) { - ATH_MSG_WARNING( "Timeout reached. Aborting sequence." ); - return HLT::ErrorCode(HLT::Action::ABORT_CHAIN, HLT::Reason::TIMEOUT); + ATH_MSG_WARNING( "Timeout reached. Aborting sequence." ); + delete foundTracks; + return HLT::ErrorCode(HLT::Action::ABORT_CHAIN, HLT::Reason::TIMEOUT); } - - if(doTiming()) - m_timerSeedProcessing->start(); - + if(doTiming()) m_timerSeedProcessing->start(); ++m_nseeds; - - const std::list<Trk::Track*>& T = - m_trackmaker->getTracks(seed->spacePoints()); + const std::list<Trk::Track*>& T = m_trackmaker->getTracks(seed->spacePoints()); if (m_fastTracking){ - for(std::list<Trk::Track*>::const_iterator t=T.begin(); t!=T.end(); ++t) { - if((*t)) qualityTrack.insert(std::make_pair(-trackQuality((*t)),(*t))); - } + for(std::list<Trk::Track*>::const_iterator t=T.begin(); t!=T.end(); ++t) { + if((*t)) qualityTrack.insert(std::make_pair(-trackQuality((*t)),(*t))); + } } if (msgLvl() <= MSG::VERBOSE) { diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/InDetPhysValMonitoring/CutFlow.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/InDetPhysValMonitoring/CutFlow.h new file mode 100644 index 0000000000000000000000000000000000000000..120e01013bc43d2c18e3ec3a62a9544e2120c1a2 --- /dev/null +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/InDetPhysValMonitoring/CutFlow.h @@ -0,0 +1,255 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +/** + * @file CutList.h + * @author shaun roe + **/ + +#ifndef _IDPVM_CutFlow_h_ +#define _IDPVM_CutFlow_h_ +#include <functional> +#include <algorithm> +#include <string> +#include <vector> + + +/** Templated class containing a cut, name of cut and description of cut(optional) + * Typically, the class will be templated on <xAOD::TruthParticle> or <xAOD::TrackParticle>. + * The cut is passed in as any predicate function, the type is declared as function<bool(A)> + * although typically these will be lambda functions. + * The cut is an 'accept' cut, i.e. the value passes if it is true. + * These predicate functions are called each time the 'pass' method is called. + * The class keeps an internal count of how many values passed, and may be used + * as a functional due to the overloaded () operator. + */ +template<class A> +class Accept { +public: + ///Default constructor with a simple predicate returning false + Accept() : m_predicate([](A) { + return false; + }), m_name {}, m_desc {} { + // nop + } + /** @brief Normal constructor + * @param predicate any function taking the templated value and returning a bool + * @param name optional name for this cut + * @param description optional description for this cut + */ + Accept(const std::function<bool(const A&)>& predicate, const std::string& name = "", + const std::string& description = "") : m_predicate(predicate), m_name(name), m_desc(description) + { + // nop + } + + ///Overloading the () operator allows the class to be used as a functional + bool + operator () (const A& i) const { + return pass(i); + } + + ///Apply the predicate function and return the value, also updating an internal counter + bool + pass(const A& i) const { + const bool passed = m_predicate(i); + return passed; + } + + + ///Return cut name + std::string + name() const { + return m_name; + } + + ///Return cut description + std::string + description() const { + return m_desc; + } + + ///Utility typedefs to help callers: the value type + typedef A value_type; + ///Utility typedefs to help callers: the function type + typedef const std::function<bool (const A&)> func_type; +private: + // std::function<bool(A)> m_predicate; + func_type m_predicate; + std::string m_name; + std::string m_desc; +}; + +/** Templated CutList class to contain a group of cuts. + * The CutList is typically instantiated with a vector of Accept objects, although + * additional cuts may be added with the 'add' method. + * Cuts may be applied in one of two ways, determined by the 'mode' parameter: + * ALL: Always apply every cut + * UNTIL_FAIL: Apply cuts until the first one fails + * The 'accept' method applies the cuts and keeps internal count of how many times it is called. + */ +template<class A> +class CutList { +public: + + ///Normal constructor takes a vector<Accept>. Note default mode is 'ALL'. + CutList(const std::vector<Accept<A> >& cuts) : m_cuts(cuts) { + // nop + } + + ///Default constructor with no cuts implemented + CutList() : m_cuts{} { + // nop + } + + + ///Add one cut + void + add(const Accept<A>& newCut) { + m_cuts.push_back(newCut); + } + + ///Apply cuts and return the boolean result; keep count of number of calls and passes + unsigned int + accept(const A& value) const { + unsigned int missing_cuts = m_cuts.size(); + + for (auto& thisCut:m_cuts) { + if (not thisCut.pass(value)) { + break; + } + --missing_cuts; + } + return missing_cuts; + } + + unsigned int + testAllCuts(const A& value, std::vector<unsigned int> &counter) const { + unsigned int idx = 0; + ++(counter[idx++]); + if (counter.size() != m_cuts.size()+2 /* CutFlow::kNReserved */) { + throw std::logic_error("Number of cuts and counters do not match." ); + } + unsigned int missing_cuts = 0; + ++(counter[idx++]); + for (auto& thisCut:m_cuts) { + if (!thisCut.pass(value)) { ++missing_cuts; } + else { ++(counter[idx]); } + ++idx; + } + return missing_cuts; + } + + ///Return the number of cuts + unsigned int + size() const { + return m_cuts.size(); + } + + ///Return a vector of the cut names + std::vector<std::string> + names() const { + std::vector<std::string> result(m_cuts.size()); + unsigned int idx(0); + for (const auto& i:m_cuts) { + result[idx++] = i.name(); + } + return result; // return-value-optimisation is invoked + } + +private: + std::vector<Accept<A> > m_cuts; +}; + +class CutFlow +{ +public: + + enum CutMode { + ALL, UNTIL_FAIL + }; + + enum EReservedCuts { + kAll, + kIsValidParticle, + kNReserved + }; + + CutFlow() {} + + CutFlow(unsigned int n_cuts, CutMode cut_mode = UNTIL_FAIL) + : m_counter(n_cuts+kNReserved,0) , + m_integrated( cut_mode == ALL ), + m_accumulateIntegrated( cut_mode == ALL ) + {} + + std::vector<unsigned int> &counter() {return m_counter; } + const std::vector<unsigned int> &counter() const {return m_counter; } + + private: + // disallow implicit conversion of CutResult + void update(bool) { + } + + public: + //@TODO event weights ? + void update(unsigned int missing_cuts) { + assert( m_integrated == false); + ++(m_counter.at(m_counter.size()-missing_cuts-1) ); + } + + void merge(CutFlow &&a_cutflow) { + if (m_counter.empty()) { + m_counter = std::move(a_cutflow.m_counter); + m_integrated = a_cutflow.m_integrated; + m_accumulateIntegrated = a_cutflow.m_accumulateIntegrated; + } + else { + if (m_counter.size() != a_cutflow.m_counter.size() || m_integrated != a_cutflow.m_integrated) { + throw std::logic_error("Tried to merge non matching cut_flows."); + } + std::vector<unsigned int>::iterator iter=m_counter.begin(); + for(unsigned int count : a_cutflow.m_counter) { + *(iter++) += count; + } + } + } + + void clear() { + for(unsigned int &count : m_counter) {count=0; } + } + + ///Produce a formatted string report of the results + std::string + report(const std::vector<std::string> &names) { + if (not m_integrated) { + unsigned int sum=0; + for(std::vector<unsigned int>::reverse_iterator iter = m_counter.rbegin(); + iter != m_counter.rend(); + ++iter) { + *iter += sum; + sum = *iter; + }; + m_integrated=true; + } + + std::string op = "\nCutList Report; Total processed: " + std::to_string(m_counter[kIsValidParticle]); + op += "\nTotal passed: " + std::to_string(m_counter[m_counter.size()-1]); + std::string modeString = (m_accumulateIntegrated) ? "\nAll cuts were applied\n" : "\nCuts were applied until one fails\n"; + op += modeString; + for (unsigned int idx=0; idx<names.size(); ++idx) { + op += names[idx] + ": " + std::to_string( idx+kNReserved<m_counter.size() ? m_counter[idx+kNReserved] : -1) + " passed\n"; + } + if (names.size()+kNReserved != m_counter.size()) { + throw std::logic_error(std::string( "Number of cuts and counters do not match. Resulting report:\n") + op ); + } + return op; + } + +private: + std::vector<unsigned int> m_counter; + bool m_integrated = false; + bool m_accumulateIntegrated = false; +}; +#endif diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/InDetPhysValMonitoring/IAthSelectionTool.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/InDetPhysValMonitoring/IAthSelectionTool.h index 882aa2afe1745174e6c6cdf8904a1eddab717edc..9b02bef4f875c7f91c13803e34c6bfd798b36588 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/InDetPhysValMonitoring/IAthSelectionTool.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/InDetPhysValMonitoring/IAthSelectionTool.h @@ -22,26 +22,52 @@ static const InterfaceID IID_IAthSelectionTool("IAthSelectionTool",1,0); + /// IAthSelectionTool is a virtual baseclass for selection methods class IAthSelectionTool:virtual public IAlgTool{ public: + + class CutResult { + public: + CutResult(unsigned int missing_cuts) : m_missingCuts(missing_cuts) {} + + unsigned int missingCuts() const { + return m_missingCuts; + } + + operator bool() const { + return m_missingCuts==0; + } + + private: + unsigned int m_missingCuts = 0; + }; + ///interfaceID reimplemented from base static const InterfaceID & interfaceID(); ///virtual destructor, does nothing virtual ~IAthSelectionTool(){ } + + /** @brief The most important method to determine whether the particle is accepted + * @param p Pointer to particle baseclass, will be cast to truth or track + * @return true if particle passes cuts + */ + virtual IAthSelectionTool::CutResult + testAllCuts(const xAOD::IParticle * p, std::vector<unsigned int> &counter) const = 0; + /** @brief The most important method to determine whether the particle is accepted * @param p Pointer to particle baseclass, will be cast to truth or track - * @return true if particle passes cuts - */ - virtual bool accept(const xAOD::IParticle * p) = 0; - ///Clear internal counters for each cut - virtual void clearCounters()=0; - ///Gives a vector of unsigned int counters; relies on return-value-optimisation to be efficient - virtual std::vector<unsigned int> counters() const =0; + * @return the number of cuts which are not passed or tested + */ + virtual IAthSelectionTool::CutResult accept(const xAOD::IParticle * p) const = 0; + + /** @brief return the number of cuts. + * @return the number of cuts + */ + virtual unsigned int nCuts() const = 0; + ///return the names of the cuts as a vector<string> virtual std::vector<std::string> names() const = 0; - ///Returns a formatted text string reporting the cuts' results - virtual std::string str() const =0; }; inline const InterfaceID & IAthSelectionTool::interfaceID(){ diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/InDetPhysValMonitoring/InDetPhysValMonitoringTool.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/InDetPhysValMonitoring/InDetPhysValMonitoringTool.h index 699f2497d1a08bd373bad956032c838ddd2a6fae..a29dbe65f5dcf1453542527a2e1d9f6288d96b92 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/InDetPhysValMonitoring/InDetPhysValMonitoringTool.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/InDetPhysValMonitoring/InDetPhysValMonitoringTool.h @@ -16,6 +16,7 @@ //local include #include "InDetPhysValMonitoring/IAthSelectionTool.h" +#include "InDetPhysValMonitoring/CutFlow.h" //#include "PATCore/IAsgSelectionTool.h" #include "AthenaMonitoring/ManagedMonitorToolBase.h" @@ -125,6 +126,8 @@ private: bool m_TrkSelectPV; // make track selection relative to PV ToolHandle<InDet::IInDetTrackSelectionTool> m_trackSelectionTool; ToolHandle<IAthSelectionTool> m_truthSelectionTool; + mutable std::mutex m_mutex; + mutable CutFlow m_truthCutFlow; std::vector<int> m_prospectsMatched; int m_twoMatchedEProb; int m_threeMatchedEProb; @@ -133,7 +136,6 @@ private: std::vector<std::string> m_trackCutflowNames; std::vector<int> m_trackCutflow; - std::vector<unsigned int> m_truthCutCounters; std::string m_pileupSwitch; // All, PileUp, or HardScatter ///Jet Things SG::ReadHandleKey<xAOD::JetContainer> m_jetContainerName diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/AthTruthSelectionTool.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/AthTruthSelectionTool.cxx index b7802f6a93e962ef2dc154121ef87ace0fae6d88..3033c3525729a19c2b7386d5525a72fc36c7a279 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/AthTruthSelectionTool.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/AthTruthSelectionTool.cxx @@ -47,11 +47,6 @@ AthTruthSelectionTool::AthTruthSelectionTool(const std::string& type, const std: declareProperty("zDisc", m_zDisc=-1.0, "Select truth particle based on extrapolated position on disks placed at +/- z positions. Enabled if greater than 0."); declareProperty("minRadiusDisc", m_minRadiusDisc=0.0, "Minimum radius on disk for accepting extrapolated truth particle to surface."); declareProperty("maxRadiusDisc", m_maxRadiusDisc=0.0, "Maximum radius on disk for accepting extrapolated truth particle to surface."); - - //reset cache - m_cylinder = 0; - m_disc1 = 0; - m_disc2 = 0; } StatusCode @@ -73,150 +68,148 @@ AthTruthSelectionTool::initialize() { }, std::string("min_pt")) }; // - m_cutFlow = CutFlow<P_t>(filters); + m_cutList = CutList<P_t>(filters); if (m_maxProdVertRadius>0) { - m_cutFlow.add(Accept_t([this](const P_t& p) -> bool { + m_cutList.add(Accept_t([this](const P_t& p) -> bool { return((not (p.hasProdVtx()))or(p.prodVtx()->perp() < m_maxProdVertRadius)); }, "decay_before_" + std::to_string(m_maxProdVertRadius))); } if (m_maxPt > 0) { - m_cutFlow.add(Accept_t([this](const P_t& p) { + m_cutList.add(Accept_t([this](const P_t& p) { return(p.pt() < m_maxPt); }, "max_pt")); } if (m_maxBarcode > -1) { - m_cutFlow.add(Accept_t([this](const P_t& p) { + m_cutList.add(Accept_t([this](const P_t& p) { return(p.barcode() < m_maxBarcode); }, "barcode < " + std::to_string(m_maxBarcode))); } if (m_requireCharged) { - m_cutFlow.add(Accept_t([](const P_t& p) { + m_cutList.add(Accept_t([](const P_t& p) { return(not (p.isNeutral())); }, "charged")); } if (m_requireStatus1) { - m_cutFlow.add(Accept_t([](const P_t& p) { + m_cutList.add(Accept_t([](const P_t& p) { return(p.status() == 1); }, "status1")); } if (m_pdgId > 0) { - m_cutFlow.add(Accept_t([this](const P_t& p) { + m_cutList.add(Accept_t([this](const P_t& p) { return(std::abs(p.pdgId()) == m_pdgId); }, "pdgId")); } if (m_grandparent) { - m_cutFlow.add(Accept_t([](const P_t& p) { + m_cutList.add(Accept_t([](const P_t& p) { return((p.nParents() == 0) || ((p.nParents() == 1)and((p.parent(0))->nParents() == 0))); }, "hasNoGrandparent")); } if (m_poselectronfromgamma) { - m_cutFlow.add(Accept_t([](const P_t& p) { + m_cutList.add(Accept_t([](const P_t& p) { return((p.absPdgId() == electronId)and(p.nParents() >= 1) and(p.parent(0)) and(p.parent(0)->pdgId() == gammaId)); }, "poselectronfromgamma")); } if (m_radiusCylinder > 0) { - // m_cutFlow.add(Accept_t(acceptExtrapolatedTPToSurface, "SelectCylinder")); - m_cutFlow.add(Accept_t([this](const P_t& p) -> bool { - ATH_MSG_VERBOSE("Checking particle for intersection with cylinder of radius " << m_radiusCylinder); - //create surface we extrapolate to and cache it - if (m_cylinder == 0) { - ATH_MSG_VERBOSE("Creating and caching cylinder surface"); - Amg::Transform3D *trnsf = new Amg::Transform3D(); - trnsf->setIdentity(); - m_cylinder = new Trk::CylinderSurface( trnsf, m_radiusCylinder, 20000.); - } - const xAOD::TruthVertex* ptruthVertex = p.prodVtx(); - if (ptruthVertex == 0) { - //cannot derive production vertex, reject track - ATH_MSG_VERBOSE("Rejecting particle without production vertex."); - return false; - } - const auto xPos = ptruthVertex->x(); - const auto yPos = ptruthVertex->y(); - const auto z_truth = ptruthVertex->z(); - const Amg::Vector3D position(xPos, yPos, z_truth); - const Amg::Vector3D momentum(p.px(), p.py(), p.pz()); - const Trk::CurvilinearParameters cParameters(position, momentum, p.charge()); - const Trk::TrackParameters *exParameters = m_extrapolator->extrapolate(cParameters, *m_cylinder, Trk::anyDirection, false, Trk::pion); - if (!exParameters) { - ATH_MSG_VERBOSE("Failed extrapolation. Rejecting track."); - return false; - } - ATH_MSG_VERBOSE("Extrapolated parameters to cylinder: " << *exParameters); - const float ex_abs_z = fabs(exParameters->position().z()); - if ( (ex_abs_z > m_minZCylinder) and (ex_abs_z < m_maxZCylinder) ) { - ATH_MSG_VERBOSE("Particle accepted."); - return true; - } - //else.. - ATH_MSG_VERBOSE("Particle rejected"); - return false; - }, "SelectCylinder")); + // m_cutList.add(Accept_t(acceptExtrapolatedTPToSurface, "SelectCylinder")); + if (not m_cylinder) { + ATH_MSG_VERBOSE("Creating and caching cylinder surface"); + Amg::Transform3D *trnsf = new Amg::Transform3D; + trnsf->setIdentity(); + m_cylinder = std::make_unique<Trk::CylinderSurface>( trnsf, m_radiusCylinder, 20000.); + } + m_cutList.add(Accept_t([this](const P_t& p) -> bool { + ATH_MSG_VERBOSE("Checking particle for intersection with cylinder of radius " << m_radiusCylinder); + //create surface we extrapolate to and cache it + const xAOD::TruthVertex* ptruthVertex = p.prodVtx(); + if (ptruthVertex == 0) { + //cannot derive production vertex, reject track + ATH_MSG_VERBOSE("Rejecting particle without production vertex."); + return false; + } + const auto xPos = ptruthVertex->x(); + const auto yPos = ptruthVertex->y(); + const auto z_truth = ptruthVertex->z(); + const Amg::Vector3D position(xPos, yPos, z_truth); + const Amg::Vector3D momentum(p.px(), p.py(), p.pz()); + const Trk::CurvilinearParameters cParameters(position, momentum, p.charge()); + const Trk::TrackParameters *exParameters = m_extrapolator->extrapolate(cParameters, *m_cylinder, Trk::anyDirection, false, Trk::pion); + if (!exParameters) { + ATH_MSG_VERBOSE("Failed extrapolation. Rejecting track."); + return false; + } + ATH_MSG_VERBOSE("Extrapolated parameters to cylinder: " << *exParameters); + const float ex_abs_z = fabs(exParameters->position().z()); + if ( (ex_abs_z > m_minZCylinder) and (ex_abs_z < m_maxZCylinder) ) { + ATH_MSG_VERBOSE("Particle accepted."); + return true; + } + //else.. + ATH_MSG_VERBOSE("Particle rejected"); + return false; + }, "SelectCylinder")); } else if (m_zDisc > 0) { - //m_cutFlow.add(Accept_t(acceptExtrapolatedTPToSurface, "SelectDisc")); - m_cutFlow.add(Accept_t([this](const P_t& p) -> bool { - ATH_MSG_VERBOSE("Checking particle for intersection with discs of |z| " << m_zDisc); - //create surface we extrapolate to and cache it - if (m_disc1 == 0) { //m_disc2 == 0 implied - ATH_MSG_VERBOSE("Creating and caching disc surface"); - Amg::Transform3D *trnsf_shiftZ = new Amg::Transform3D(); - (*trnsf_shiftZ) = Amg::Translation3D(0.,0.,m_zDisc); - m_disc1 = new Trk::DiscSurface( trnsf_shiftZ, m_minRadiusDisc, m_maxRadiusDisc); - (*trnsf_shiftZ) = Amg::Translation3D(0.,0.,-m_zDisc); - m_disc2 = new Trk::DiscSurface( trnsf_shiftZ, m_minRadiusDisc, m_maxRadiusDisc); - } - const xAOD::TruthVertex* ptruthVertex = p.prodVtx(); - if (ptruthVertex == 0) { - //cannot derive production vertex, reject track - ATH_MSG_VERBOSE("Rejecting particle without production vertex."); - return false; - } - const auto xPos = ptruthVertex->x(); - const auto yPos = ptruthVertex->y(); - const auto z_truth = ptruthVertex->z(); - const Amg::Vector3D position(xPos, yPos, z_truth); - const Amg::Vector3D momentum(p.px(), p.py(), p.pz()); - const Trk::CurvilinearParameters cParameters(position, momentum, p.charge()); - const Trk::TrackParameters *exParameters = m_extrapolator->extrapolate(cParameters, *m_disc1, Trk::anyDirection, true, Trk::pion); - if (exParameters) { - //since boundary check is true, should be enough to say we've hit the disk.. - ATH_MSG_VERBOSE("Successfully extrapolated track to disk at +" << m_zDisc << ": " << *exParameters); - float ex_radius = sqrt(pow(exParameters->position().x(),2)+pow(exParameters->position().y(),2)); - ATH_MSG_VERBOSE("radial position at surface: " << ex_radius); - if ((ex_radius > m_minRadiusDisc) and (ex_radius < m_maxRadiusDisc)) { - ATH_MSG_VERBOSE("Confirmed within the disk. Accepting particle"); - return true; - } - //else... - ATH_MSG_VERBOSE("Strange, extrapolation succeeded but extrapolated position not within disc radius! Test next disc"); - } - exParameters = m_extrapolator->extrapolate(cParameters, *m_disc2, Trk::anyDirection, true, Trk::pion); - if (exParameters) { - //since boundary check is true, should be enough to say we've hit the disk.. - ATH_MSG_VERBOSE("Successfully extrapolated track to disk at -" << m_zDisc << ": " << *exParameters); - float ex_radius = sqrt(pow(exParameters->position().x(),2)+pow(exParameters->position().y(),2)); - ATH_MSG_VERBOSE("radial position at surface: " << ex_radius); - if ((ex_radius > m_minRadiusDisc) and (ex_radius < m_maxRadiusDisc)) { - ATH_MSG_VERBOSE("Confirmed within the disk. Accepting particle"); - return true; - } - //else... - ATH_MSG_VERBOSE("Strange, extrapolation succeeded but extrapolated position not within disc radius! Rejecting"); - } - //else.. - ATH_MSG_VERBOSE("Particle rejected"); - return false; - }, "SelectDisc")); + //m_cutList.add(Accept_t(acceptExtrapolatedTPToSurface, "SelectDisc")); + if (not m_disc1 || not m_disc2) { //m_disc2 == 0 implied + ATH_MSG_VERBOSE("Creating and caching disc surface"); + Amg::Transform3D *trnsf_shiftZ = new Amg::Transform3D(); + (*trnsf_shiftZ) = Amg::Translation3D(0.,0.,m_zDisc); + m_disc1 = std::make_unique<Trk::DiscSurface>( trnsf_shiftZ, m_minRadiusDisc, m_maxRadiusDisc); + (*trnsf_shiftZ) = Amg::Translation3D(0.,0.,-m_zDisc); + m_disc2 = std::make_unique<Trk::DiscSurface>( trnsf_shiftZ, m_minRadiusDisc, m_maxRadiusDisc); + } + m_cutList.add(Accept_t([this](const P_t& p) -> bool { + ATH_MSG_VERBOSE("Checking particle for intersection with discs of |z| " << m_zDisc); + //create surface we extrapolate to and cache it + const xAOD::TruthVertex* ptruthVertex = p.prodVtx(); + if (ptruthVertex == 0) { + //cannot derive production vertex, reject track + ATH_MSG_VERBOSE("Rejecting particle without production vertex."); + return false; + } + const auto xPos = ptruthVertex->x(); + const auto yPos = ptruthVertex->y(); + const auto z_truth = ptruthVertex->z(); + const Amg::Vector3D position(xPos, yPos, z_truth); + const Amg::Vector3D momentum(p.px(), p.py(), p.pz()); + const Trk::CurvilinearParameters cParameters(position, momentum, p.charge()); + const Trk::TrackParameters *exParameters = m_extrapolator->extrapolate(cParameters, *m_disc1, Trk::anyDirection, true, Trk::pion); + if (exParameters) { + //since boundary check is true, should be enough to say we've hit the disk.. + ATH_MSG_VERBOSE("Successfully extrapolated track to disk at +" << m_zDisc << ": " << *exParameters); + float ex_radius = sqrt(pow(exParameters->position().x(),2)+pow(exParameters->position().y(),2)); + ATH_MSG_VERBOSE("radial position at surface: " << ex_radius); + if ((ex_radius > m_minRadiusDisc) and (ex_radius < m_maxRadiusDisc)) { + ATH_MSG_VERBOSE("Confirmed within the disk. Accepting particle"); + return true; + } + //else... + ATH_MSG_VERBOSE("Strange, extrapolation succeeded but extrapolated position not within disc radius! Test next disc"); + } + exParameters = m_extrapolator->extrapolate(cParameters, *m_disc2, Trk::anyDirection, true, Trk::pion); + if (exParameters) { + //since boundary check is true, should be enough to say we've hit the disk.. + ATH_MSG_VERBOSE("Successfully extrapolated track to disk at -" << m_zDisc << ": " << *exParameters); + float ex_radius = sqrt(pow(exParameters->position().x(),2)+pow(exParameters->position().y(),2)); + ATH_MSG_VERBOSE("radial position at surface: " << ex_radius); + if ((ex_radius > m_minRadiusDisc) and (ex_radius < m_maxRadiusDisc)) { + ATH_MSG_VERBOSE("Confirmed within the disk. Accepting particle"); + return true; + } + //else... + ATH_MSG_VERBOSE("Strange, extrapolation succeeded but extrapolated position not within disc radius! Rejecting"); + } + //else.. + ATH_MSG_VERBOSE("Particle rejected"); + return false; + }, "SelectDisc")); } //m_zDisc > 0 - m_counters = std::vector<unsigned int>(m_cutFlow.size(), 0); - std::string msg = std::to_string(m_cutFlow.size()) + " truth acceptance cuts are used:\n"; - for (const auto& i:m_cutFlow.names()) { + std::string msg = std::to_string(m_cutList.size()) + " truth acceptance cuts are used:\n"; + for (const auto& i:m_cutList.names()) { msg += i + "\n"; } ATH_MSG_INFO(msg); - clearCounters(); ATH_CHECK(m_extrapolator.retrieve()); @@ -229,35 +222,32 @@ AthTruthSelectionTool::finalize() { return StatusCode::SUCCESS; } -void -AthTruthSelectionTool::clearCounters() { - m_cutFlow.clear(); - m_counters = m_cutFlow.counters(); -} - -std::vector<unsigned int> -AthTruthSelectionTool::counters() const { - return m_cutFlow.counters(); -} std::vector<std::string> AthTruthSelectionTool::names() const { - return m_cutFlow.names(); + return m_cutList.names(); } -bool -AthTruthSelectionTool::accept(const xAOD::IParticle* particle) { +IAthSelectionTool::CutResult +AthTruthSelectionTool::accept(const xAOD::IParticle* particle) const { const xAOD::TruthParticle* pTruth = dynamic_cast<const xAOD::TruthParticle*>(particle); + //@TODO if (not pTruth) { - return false; + return m_cutList.size()+1; // marker for invalid particles } - return m_cutFlow.accept(*pTruth); + return m_cutList.accept(*pTruth); } -std::string -AthTruthSelectionTool::str() const { - return m_cutFlow.report(); +IAthSelectionTool::CutResult +AthTruthSelectionTool::testAllCuts(const xAOD::IParticle * particle, std::vector<unsigned int> &counter) const { + const xAOD::TruthParticle* pTruth = dynamic_cast<const xAOD::TruthParticle*>(particle); + + //@TODO + if (not pTruth) { + return m_cutList.size()+1; // marker for invalid particles + } + return m_cutList.testAllCuts(*pTruth,counter); } /* @@ -280,7 +270,7 @@ bool AthTruthSelectionTool::acceptExtrapolatedTPToSurface(const xAOD::TruthParti const auto xPos = ptruthVertex->x(); const auto yPos = ptruthVertex->y(); const auto z_truth = ptruthVertex->z(); - const Amg::Vector3D position(xPos, yPos, z_truth); + const Amg::Vector3D position(xPos, yPos, z_truth); const Amg::Vector3D momentum(p.px(), p.py(), p.pz()); const Trk::CurvilinearParameters cParameters(position, momentum, p.charge()); const Trk::TrackParameters *exParameters = m_extrapolator->extrapolate(cParameters, *m_cylinder, Trk::anyDirection, false, Trk::pion); @@ -316,7 +306,7 @@ bool AthTruthSelectionTool::acceptExtrapolatedTPToSurface(const xAOD::TruthParti const auto xPos = ptruthVertex->x(); const auto yPos = ptruthVertex->y(); const auto z_truth = ptruthVertex->z(); - const Amg::Vector3D position(xPos, yPos, z_truth); + const Amg::Vector3D position(xPos, yPos, z_truth); const Amg::Vector3D momentum(p.px(), p.py(), p.pz()); const Trk::CurvilinearParameters cParameters(position, momentum, p.charge()); const Trk::TrackParameters *exParameters = m_extrapolator->extrapolate(cParameters, *m_disc1, Trk::anyDirection, true, Trk::pion); @@ -326,8 +316,8 @@ bool AthTruthSelectionTool::acceptExtrapolatedTPToSurface(const xAOD::TruthParti float ex_radius = fabs(exParameters->parameters()[Trk::d0]); ATH_MSG_VERBOSE("|loc1| (|d0|) parameter at surface: " << ex_radius); if ((ex_radius > m_minRadiusDisc) and (ex_radius < m_maxRadiusDisc)) { - ATH_MSG_VERBOSE("Confirmed within the disk. Accepting particle"); - return true; + ATH_MSG_VERBOSE("Confirmed within the disk. Accepting particle"); + return true; } //else... ATH_MSG_VERBOSE("Strange, extrapolation succeeded but extrapolated position not within disc radius! Test next disc"); @@ -339,17 +329,17 @@ bool AthTruthSelectionTool::acceptExtrapolatedTPToSurface(const xAOD::TruthParti float ex_radius = fabs(exParameters->parameters()[Trk::d0]); ATH_MSG_VERBOSE("|loc1| (|d0|) parameter at surface: " << ex_radius); if ((ex_radius > m_minRadiusDisc) and (ex_radius < m_maxRadiusDisc)) { - ATH_MSG_VERBOSE("Confirmed within the disk. Accepting particle"); - return true; + ATH_MSG_VERBOSE("Confirmed within the disk. Accepting particle"); + return true; } //else... ATH_MSG_VERBOSE("Strange, extrapolation succeeded but extrapolated position not within disc radius! Rejecting"); } //else.. ATH_MSG_VERBOSE("Particle rejected"); - return false; + return false; } //if not cut enabled, returns OK - return true; + return true; } */ diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/AthTruthSelectionTool.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/AthTruthSelectionTool.h index 5148c9d74aec202835173fc72c4cbdc7be3833a4..fae47b2947a7c56b6af2adb3f07de698153f5624 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/AthTruthSelectionTool.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/AthTruthSelectionTool.h @@ -17,7 +17,7 @@ #include "InDetPhysValMonitoring/IAthSelectionTool.h" #include "xAODTruth/TruthParticle.h" // typedef, can't fwd declare #include "AthenaBaseComps/AthAlgTool.h" -#include "CutFlow.h" +#include "InDetPhysValMonitoring/CutFlow.h" #include "GaudiKernel/ToolHandle.h" #include "TrkSurfaces/CylinderSurface.h" #include "TrkSurfaces/DiscSurface.h" @@ -33,14 +33,21 @@ public: }; StatusCode initialize() final; StatusCode finalize() final; - bool accept(const xAOD::IParticle* particle) final; - void clearCounters() final; - std::vector<unsigned int> counters() const final; + + virtual IAthSelectionTool::CutResult + accept(const xAOD::IParticle* particle) const final; + + virtual IAthSelectionTool::CutResult + testAllCuts(const xAOD::IParticle * p, std::vector<unsigned int> &counter) const final; + + unsigned int nCuts() const final { + return m_cutList.size(); + } + std::vector<std::string> names() const final; - std::string str() const final; private: - CutFlow<xAOD::TruthParticle> m_cutFlow; + CutList<xAOD::TruthParticle> m_cutList; // Cut values; float m_maxEta; float m_maxPt; @@ -67,9 +74,9 @@ private: float m_maxRadiusDisc; ///< for disk topology: maximum radius //cache surfaces - mutable Trk::CylinderSurface* m_cylinder; - mutable Trk::DiscSurface* m_disc1; - mutable Trk::DiscSurface* m_disc2; + std::unique_ptr<Trk::CylinderSurface> m_cylinder; + std::unique_ptr<Trk::DiscSurface> m_disc1; + std::unique_ptr<Trk::DiscSurface> m_disc2; /* @} */ diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/CutFlow.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/CutFlow.h deleted file mode 100644 index 3517e8270f9b222b6859fb493f0d8cdd07b4b472..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/CutFlow.h +++ /dev/null @@ -1,233 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -/** - * @file CutFlow.h - * @author shaun roe - **/ - - -#include <functional> -#include <algorithm> -#include <string> -#include <vector> - - -/** Templated class containing a cut, name of cut and description of cut(optional) - * Typically, the class will be templated on <xAOD::TruthParticle> or <xAOD::TrackParticle>. - * The cut is passed in as any predicate function, the type is declared as function<bool(A)> - * although typically these will be lambda functions. - * The cut is an 'accept' cut, i.e. the value passes if it is true. - * These predicate functions are called each time the 'pass' method is called. - * The class keeps an internal count of how many values passed, and may be used - * as a functional due to the overloaded () operator. - */ -template<class A> -class Accept { -public: - ///Default constructor with a simple predicate returning false - Accept() : m_predicate([](A) { - return false; - }), m_name {}, m_desc {}, m_nPassed(0) { - // nop - } - /** @brief Normal constructor - * @param predicate any function taking the templated value and returning a bool - * @param name optional name for this cut - * @param description optional description for this cut - */ - Accept(const std::function<bool(const A&)>& predicate, const std::string& name = "", - const std::string& description = "") : m_predicate(predicate), m_name(name), m_desc(description), - m_nPassed(0) { - // nop - } - - ///Overloading the () operator allows the class to be used as a functional - bool - operator () (const A& i) { - return pass(i); - } - - ///Apply the predicate function and return the value, also updating an internal counter - bool - pass(const A& i) { - const bool passed = m_predicate(i); - - m_nPassed += (int) passed; - return passed; - } - - ///Clear internal counter - void - clearCount() { - m_nPassed = 0; - } - - ///Return internal counter - unsigned int - getCount() const { - return m_nPassed; - } - - ///Return cut name - std::string - name() const { - return m_name; - } - - ///Return cut description - std::string - description() const { - return m_desc; - } - - ///Utility typedefs to help callers: the value type - typedef A value_type; - ///Utility typedefs to help callers: the function type - typedef const std::function<bool (const A&)> func_type; -private: - // std::function<bool(A)> m_predicate; - func_type m_predicate; - std::string m_name; - std::string m_desc; - unsigned int m_nPassed; -}; - -/** Templated CutFlow class to contain a group of cuts. - * The CutFlow is typically instantiated with a vector of Accept objects, although - * additional cuts may be added with the 'add' method. - * Cuts may be applied in one of two ways, determined by the 'mode' parameter: - * ALL: Always apply every cut - * UNTIL_FAIL: Apply cuts until the first one fails - * The 'accept' method applies the cuts and keeps internal count of how many times it is called. - */ -template<class A> -class CutFlow { -public: - ///Cut mode: Apply ALL cuts, or until the first failure - enum CutFlowMode { - ALL, UNTIL_FAIL - }; - ///Normal constructor takes a vector<Accept>. Note default mode is 'ALL'. - CutFlow(const std::vector<Accept<A> >& cuts) : m_cuts(cuts), m_mode(ALL), - m_passed(0), m_processed(0) { - // nop - } - - ///Default constructor with no cuts implemented - CutFlow() : m_cuts{}, m_mode(ALL), m_passed(0), m_processed(0) { - // nop - } - - ///Add one cut - void - add(const Accept<A>& newCut) { - m_cuts.push_back(newCut); - } - - ///Clear internal counters - void - clear() { - m_processed = 0; - m_passed = 0; - for (auto& i:m_cuts) { - i.clearCount(); - } - } - - ///set the accept mode according to the CutFlowMode - void - setMode(const CutFlowMode m) { - m_mode = m; - } - - ///get the accept mode - CutFlowMode - getMode() const { - return m_mode; - } - - ///Apply cuts and return the boolean result; keep count of number of calls and passes - bool - accept(const A& value) { - bool result(true); - - if (m_mode == ALL) { - for (auto& thisCut:m_cuts) { - const bool passed = thisCut.pass(value); - result &= passed; - } - } else { - for (auto& thisCut:m_cuts) { - const bool passed = thisCut.pass(value); - if (not passed) { - result = false; - break; - } - } - } - m_processed++; - m_passed += (int) result; - return result; - } - - ///Return the number of cuts - unsigned int - size() const { - return m_cuts.size(); - } - - ///Return the number of times the 'accept' method was called - unsigned int - nProcessed() const { - return m_processed; - } - - ///Returnn the number of values which passed all cuts - unsigned int - nPassed() const { - return m_passed; - } - - ///Return a vector of individual counters for each cut - std::vector<unsigned int> - counters() const { - std::vector<unsigned int> result(m_cuts.size(), 0); - unsigned int idx(0); - for (const auto& i:m_cuts) { - result[idx++] = i.getCount(); - } - return result; // return-value-optimisation is invoked - } - - ///Return a vector of the cut names - std::vector<std::string> - names() const { - std::vector<std::string> result(m_cuts.size()); - unsigned int idx(0); - for (const auto& i:m_cuts) { - result[idx++] = i.name(); - } - return result; // return-value-optimisation is invoked - } - - ///Produce a formatted string report of the results - std::string - report() const { - std::string op = "\nCutFlow Report; Total processed: " + std::to_string(m_processed); - op += "\nTotal passed: " + std::to_string(m_passed); - std::string modeString = (m_mode == ALL) ? "\nAll cuts were applied\n" : "\nCuts were applied until one fails\n"; - op += modeString; - for (const auto& thisCut:m_cuts) { - op += thisCut.name() + ": " + std::to_string(thisCut.getCount()) + " passed\n"; - } - return op; - } - -private: - std::vector<Accept<A> > m_cuts; - CutFlowMode m_mode; - unsigned int m_passed; - unsigned int m_processed; -}; diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValMonitoringTool.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValMonitoringTool.cxx index 2761964c1fb379292052f9a979705b234ed40d1e..9a001e4ac1278c0c8b0cee5b0575952c1f831c12 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValMonitoringTool.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValMonitoringTool.cxx @@ -155,7 +155,6 @@ InDetPhysValMonitoringTool::InDetPhysValMonitoringTool(const std::string& type, m_threeMatchedEProb(0), m_fourMatchedEProb(0), m_truthCounter(0), - m_truthCutCounters{}, m_fillTIDEPlots(false), m_fillExtraTIDEPlots(false) { declareProperty("useTrackSelection", m_useTrackSelection); @@ -184,7 +183,7 @@ InDetPhysValMonitoringTool::initialize() { ATH_CHECK(m_trackSelectionTool.retrieve(EnableTool {m_useTrackSelection} )); ATH_CHECK(m_truthSelectionTool.retrieve(EnableTool {not m_truthParticleName.key().empty()} )); if (m_truthSelectionTool.get() ) { - m_truthCutCounters = m_truthSelectionTool->counters(); + m_truthCutFlow = CutFlow(m_truthSelectionTool->nCuts()); } m_monPlots = std::move(std::unique_ptr<InDetRttPlots> (new InDetRttPlots(0, m_dirName + m_folder))); m_monPlots->SetFillExtraTIDEPlots(m_fillExtraTIDEPlots); @@ -306,7 +305,7 @@ InDetPhysValMonitoringTool::fillHistograms() { std::vector<int> incTrkNum = { 0, 0, 0 }; - if (m_truthSelectionTool.get()) { m_truthSelectionTool->clearCounters(); } + CutFlow tmp_truth_cutflow( m_truthSelectionTool.get() ? m_truthSelectionTool->nCuts() : 0 ); // dummy variables int base(0), hasTruth(0), hashighprob(0), passtruthsel(0); @@ -378,10 +377,12 @@ InDetPhysValMonitoringTool::fillHistograms() { hashighprob += 1; } // if there is associated truth also a truth selection tool was retrieved. - if (m_truthSelectionTool->accept(associatedTruth)) { - passtruthsel += 1; + IAthSelectionTool::CutResult passed( m_truthSelectionTool ? m_truthSelectionTool->accept(associatedTruth) : IAthSelectionTool::CutResult(0) ); + if (m_truthSelectionTool) { + tmp_truth_cutflow.update( passed.missingCuts() ); + passtruthsel += (bool) passed; } - if ((prob > minProbEffLow) and m_truthSelectionTool->accept(associatedTruth)) { + if ((prob > minProbEffLow) and passed) { m_monPlots->fill(*thisTrack, *associatedTruth); // Make all plots requiring both truth & track (meas, res, & // pull) } @@ -390,13 +391,9 @@ InDetPhysValMonitoringTool::fillHistograms() { m_monPlots->fillLinkedandUnlinked(*thisTrack, Prim_w, Sec_w, Unlinked_w); } if (m_truthSelectionTool.get()) { - ATH_MSG_DEBUG(m_truthSelectionTool->str()); - const auto& tmp = m_truthSelectionTool->counters(); // get array of counters for the cuts - - unsigned idx(0); - for (auto& i:m_truthCutCounters) { - i += tmp[idx++]; // i=sum of all the individual counters on each cut. - } + ATH_MSG_DEBUG( CutFlow(tmp_truth_cutflow).report(m_truthSelectionTool->names()) ); + std::lock_guard<std::mutex> lock(m_mutex); + m_truthCutFlow.merge(std::move(tmp_truth_cutflow)); } int nTruths(0), nInsideOut(0), nOutsideIn(0); std::vector<int> incTrkDenom = { @@ -443,7 +440,7 @@ InDetPhysValMonitoringTool::fillHistograms() { } // if the vector of truth particles is not empty also a truthSelectionTool was retrieved - const bool accept = m_truthSelectionTool->accept(thisTruth); + const IAthSelectionTool::CutResult accept = m_truthSelectionTool->accept(thisTruth); if (accept) { ++m_truthCounter; // total number of truth tracks which pass cuts ++num_truth_selected; // total number of truth which pass cuts per event @@ -699,11 +696,8 @@ InDetPhysValMonitoringTool::procHistograms() { ATH_MSG_INFO(""); ATH_MSG_INFO("Cutflow for truth tracks:"); - unsigned int idx(0); if (m_truthSelectionTool.get()) { - for (const auto& cutName:m_truthSelectionTool->names()) { - ATH_MSG_INFO("number after " << cutName << ": " << m_truthCutCounters[idx++]); - } + ATH_MSG_INFO("Truth selection report: " << m_truthCutFlow.report( m_truthSelectionTool->names()) ); } if (endOfRunFlag()) { m_monPlots->finalize(); diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValTruthDecoratorAlg.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValTruthDecoratorAlg.cxx index 296bd95fdefa748948825791b76df643fe751bfa..f977cd046f7a464b3fb51e5d490cfb2bf6480d3b 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValTruthDecoratorAlg.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValTruthDecoratorAlg.cxx @@ -40,6 +40,9 @@ InDetPhysValTruthDecoratorAlg::initialize() { ATH_CHECK(m_extrapolator.retrieve()); ATH_CHECK(m_beamSpotSvc.retrieve()); ATH_CHECK( m_truthSelectionTool.retrieve( EnableTool { not m_truthSelectionTool.name().empty() } ) ); + if (not m_truthSelectionTool.name().empty() ) { + m_cutFlow = CutFlow(m_truthSelectionTool->nCuts() ); + } ATH_CHECK( m_truthParticleName.initialize()); @@ -60,6 +63,10 @@ InDetPhysValTruthDecoratorAlg::initialize() { StatusCode InDetPhysValTruthDecoratorAlg::finalize() { + if (not m_truthSelectionTool.name().empty()) { + std::lock_guard<std::mutex> lock(m_mutex); + ATH_MSG_DEBUG( "Truth selection cut flow : " << m_cutFlow.report(m_truthSelectionTool->names()) ); + } return StatusCode::SUCCESS; } @@ -81,10 +88,15 @@ InDetPhysValTruthDecoratorAlg::execute_r(const EventContext &ctx) const { float_decor( IDPVM::createDecoratorsWithAccessor(m_decor, ctx) ); if ( m_truthSelectionTool.get() ) { + CutFlow tmp_cut_flow(m_truthSelectionTool->nCuts()); for (const xAOD::TruthParticle *truth_particle : *ptruth) { - if (not m_truthSelectionTool->accept(truth_particle)) continue; + auto passed = m_truthSelectionTool->accept(truth_particle); + tmp_cut_flow.update( passed.missingCuts() ); + if (not passed) continue; decorateTruth(*truth_particle, float_decor); } + std::lock_guard<std::mutex> lock(m_mutex); + m_cutFlow.merge(std::move(tmp_cut_flow)); } else { for (const xAOD::TruthParticle *truth_particle : *ptruth) { diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValTruthDecoratorAlg.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValTruthDecoratorAlg.h index 91d1f80f97666fcc81b339d8330e2344f335fbbf..6a9ad9d4475c0cfa3324fa9d7629daad8ebfc2c5 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValTruthDecoratorAlg.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValTruthDecoratorAlg.h @@ -22,6 +22,7 @@ #include "AthContainers/AuxElement.h" #include "GaudiKernel/EventContext.h" #include "InDetPhysValMonitoring/IAthSelectionTool.h" +#include "InDetPhysValMonitoring/CutFlow.h" #include <utility> #include <vector> @@ -52,6 +53,9 @@ private: PublicToolHandle<IAthSelectionTool> m_truthSelectionTool {this,"TruthSelectionTool","",""}; + mutable std::mutex m_mutex; + mutable CutFlow m_cutFlow; + ///TruthParticle container's name needed to create decorators SG::ReadHandleKey<xAOD::TruthParticleContainer> m_truthParticleName {this, "TruthParticleContainerName", "TruthParticles", ""}; diff --git a/LArCalorimeter/LArCellRec/CMakeLists.txt b/LArCalorimeter/LArCellRec/CMakeLists.txt index d0622500957196e9853dfefe0b9ffb4c8e3b817d..93ceae22d9bbbb4ab3e8149263ca5b97e9fb48d0 100644 --- a/LArCalorimeter/LArCellRec/CMakeLists.txt +++ b/LArCalorimeter/LArCellRec/CMakeLists.txt @@ -41,13 +41,14 @@ atlas_depends_on_subdirs( PUBLIC find_package( CLHEP ) find_package( HepMC ) find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread ) +find_package( TBB ) # Component(s) in the package: atlas_add_component( LArCellRec src/*.cxx src/components/*.cxx - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${HEPMC_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} ${HEPMC_LIBRARIES} CaloConditions CaloDetDescrLib CaloEvent CaloIdentifier CaloRecLib CaloUtilsLib AthAllocators AthenaBaseComps AthenaKernel StoreGateLib SGtests AtlasDetDescr Identifier GaudiKernel LArIdentifier LArRawEvent LArRecConditions LArSimEvent CaloTriggerToolLib AthenaPoolUtilities xAODEventInfo xAODTrigL1Calo GeneratorObjects LArRecEvent LArCablingLib TrigT1CaloCalibConditions TrigT1CaloCondSvcLib ) + INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${HEPMC_INCLUDE_DIRS} ${TBB_INCLUDE_DIRS} + LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} ${HEPMC_LIBRARIES} ${TBB_LIBRARIES} CaloConditions CaloDetDescrLib CaloEvent CaloIdentifier CaloRecLib CaloUtilsLib AthAllocators AthenaBaseComps AthenaKernel StoreGateLib SGtests AtlasDetDescr Identifier GaudiKernel LArIdentifier LArRawEvent LArRecConditions LArSimEvent CaloTriggerToolLib AthenaPoolUtilities xAODEventInfo xAODTrigL1Calo GeneratorObjects LArRecEvent LArCablingLib TrigT1CaloCalibConditions TrigT1CaloCondSvcLib ) # Install files from the package: atlas_install_python_modules( python/*.py ) diff --git a/LArCalorimeter/LArCellRec/share/LArBadFebMaskingTool_test.py b/LArCalorimeter/LArCellRec/share/LArBadFebMaskingTool_test.py index 1d0bd762bdcb0e6aeeaa45ccbcaf299f8c7a3fe5..37d516f80febbba6eae8357f186aa660298bcb91 100644 --- a/LArCalorimeter/LArCellRec/share/LArBadFebMaskingTool_test.py +++ b/LArCalorimeter/LArCellRec/share/LArBadFebMaskingTool_test.py @@ -58,10 +58,10 @@ def make_bad_channel_tool (name, badfebs = []): febfile = '' if badfebs: febfile = name + '.badfebs' + f = open (febfile, 'w') for (feb, err) in badfebs: - f = open (febfile, 'w') print >> f, feb[0], feb[1], feb[2], feb[3], err - f.close() + f.close() return LArBadChanTool (name, ReadFromASCII = True, WriteEmptyFolders = True, @@ -107,10 +107,16 @@ class TestAlg (Alg): self.onlineID = self.detStore['LArOnlineID'] self.offlineID = self.detStore['CaloCell_ID'] self.cabling = ROOT.ToolHandle(ROOT.LArCablingService)('LArCablingService') - return self.tool1.retrieve() - return self.tool2.retrieve() - return self.tool3.retrieve() - return self.cabling.retrieve() + if not self.tool1.retrieve(): + return StatusCode.Failure + if not self.tool2.retrieve(): + return StatusCode.Failure + if not self.tool3.retrieve(): + return StatusCode.Failure + if not self.cabling.retrieve(): + return StatusCode.Failure + return StatusCode.Success + def execute (self): iev = self.getContext().evt() tool = self.tool1 @@ -190,7 +196,6 @@ class TestAlg (Alg): def check_and_reset_cells (self, ccc, errs): badcells = self.expand_errors (errs) - j = 0 for c in ccc: i = c.caloDDE().calo_hash().value() err = badcells.get(i) @@ -209,7 +214,6 @@ class TestAlg (Alg): c.setTime (i+0.5) c.setQuality (10) c.setProvenance (11) - j += 1 return @@ -230,13 +234,13 @@ class TestAlg (Alg): -badchan_empty = make_bad_channel_tool ('badchan_empty') +badchan_empty = make_bad_channel_tool ('masking_badchan_empty') ToolSvc += badchan_empty -badchan2 = make_bad_channel_tool ('badchan2', [(BADFEB1, 'deadAll')]) +badchan2 = make_bad_channel_tool ('masking_badchan2', [(BADFEB1, 'deadAll')]) ToolSvc += badchan2 -badchan3 = make_bad_channel_tool ('badchan3', [(BADFEB3, 'inError')]) +badchan3 = make_bad_channel_tool ('masking_badchan3', [(BADFEB3, 'inError')]) ToolSvc += badchan3 tool1 = LArBadFebMaskingTool ('tool1', diff --git a/LArCalorimeter/LArCellRec/share/LArBadFebMaskingTool_test.ref b/LArCalorimeter/LArCellRec/share/LArBadFebMaskingTool_test.ref index 1e8a91a459cddd6abed37f2326f67e7ed5412cbe..edabc99b20901d6826a161d669455d4dd55383be 100644 --- a/LArCalorimeter/LArCellRec/share/LArBadFebMaskingTool_test.ref +++ b/LArCalorimeter/LArCellRec/share/LArBadFebMaskingTool_test.ref @@ -1,7 +1,7 @@ -Tue Oct 2 15:11:22 CEST 2018 +Tue Oct 2 16:53:28 CEST 2018 Preloading tcmalloc_minimal.so Py:Athena INFO including file "AthenaCommon/Preparation.py" -Py:Athena INFO using release [WorkDir-22.0.1] [x86_64-slc6-gcc62-opt] [warn_lar/7b7c03e74d] -- built on [2018-10-02T1309] +Py:Athena INFO using release [WorkDir-22.0.1] [x86_64-slc6-gcc62-opt] [warn_lar/00cf2cec20] -- built on [2018-10-02T1452] Py:Athena INFO including file "AthenaCommon/Atlas.UnixStandardJob.py" Py:Athena INFO executing ROOT6Setup Py:Athena INFO including file "AthenaCommon/Execution.py" @@ -29,7 +29,7 @@ ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to leve ApplicationMgr SUCCESS ==================================================================================================================================== Welcome to ApplicationMgr (GaudiCoreSvc v30r3) - running on pc-tbed-pub-31.cern.ch on Tue Oct 2 15:11:35 2018 + running on pc-tbed-pub-31.cern.ch on Tue Oct 2 16:53:39 2018 ==================================================================================================================================== ApplicationMgr INFO Successfully loaded modules : AthenaServices ApplicationMgr INFO Application Manager Configured successfully @@ -187,7 +187,7 @@ EndcapDMConstru... INFO Start building EC electronics geometry multi-layered version of absorbers activated, mlabs == 1 ================================================ EndcapDMConstru... INFO Start building EC electronics geometry -GeoModelSvc INFO GeoModelSvc.LArDetectorToolNV SZ= 23988Kb Time = 0.58S +GeoModelSvc INFO GeoModelSvc.LArDetectorToolNV SZ= 22964Kb Time = 0.58S ClassIDSvc INFO getRegistryEntries: read 213 CLIDRegistry entries for module ALL ClassIDSvc INFO getRegistryEntries: read 65 CLIDRegistry entries for module ALL AthenaEventLoopMgr INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00 @@ -310,12 +310,18 @@ ClassIDSvc INFO getRegistryEntries: read 65 CLIDRegistry entries for ClassIDSvc INFO getRegistryEntries: read 4020 CLIDRegistry entries for module ALL ToolSvc.tool1 INFO bit mask for errors to mask 16381 ClassIDSvc INFO getRegistryEntries: read 64 CLIDRegistry entries for module ALL -IOVSvcTool INFO Still in initialize phase, not tiggering callback for LArCablingService[0xa807e00]+7fd1bd1e7650 bound to AthenaAttributeList[/LAR/Identifier/OnOffIdMap] +IOVSvcTool INFO Still in initialize phase, not tiggering callback for LArCablingService[0x9c1be00]+7f17d048f650 bound to AthenaAttributeList[/LAR/Identifier/OnOffIdMap] ToolSvc.LArCabl... INFO Successfully installed callback on folder/LAR/Identifier/OnOffIdMap ToolSvc.LArCabl... INFO Successfully installed callback on folder/LAR/Identifier/CalibIdMap ToolSvc.LArCabl... INFO Successfully installed callback on folder/LAR/Identifier/FebRodMap ToolSvc.LArCabl... INFO Sucessfully initialized LArCablingService with 3 callbacks. -ToolSvc.badchan... INFO Read 0 lines in total (for all COOL channels and missing FEBs together) +ToolSvc.masking... INFO Read 0 lines in total (for all COOL channels and missing FEBs together) +ToolSvc.tool2 INFO bit mask for errors to mask 16381 +ToolSvc.masking... INFO Decoded 1 lines from FEB file masking_badchan2.badfebs +ToolSvc.masking... INFO Read 1 lines in total (for all COOL channels and missing FEBs together) +ToolSvc.tool3 INFO bit mask for errors to mask 16381 +ToolSvc.masking... INFO Decoded 1 lines from FEB file masking_badchan3.badfebs +ToolSvc.masking... INFO Read 1 lines in total (for all COOL channels and missing FEBs together) HistogramPersis...WARNING Histograms saving not required. ApplicationMgr INFO Application Manager Initialized successfully CondInputLoader INFO created CondCont<AthenaAttributeList> with key 'ConditionStore+/LAR/BadChannels/MissingFEBs' @@ -453,14 +459,8 @@ AthenaEventLoopMgr INFO ===>>> start processing event #2, run #1 1 events p ClassIDSvc INFO getRegistryEntries: read 13 CLIDRegistry entries for module ALL AthenaEventLoopMgr INFO ===>>> done processing event #2, run #1 2 events processed so far <<<=== AthenaEventLoopMgr INFO ===>>> start processing event #3, run #1 2 events processed so far <<<=== -ToolSvc.tool2 INFO bit mask for errors to mask 16381 -ToolSvc.badchan2 INFO Decoded 1 lines from FEB file badchan2.badfebs -ToolSvc.badchan2 INFO Read 1 lines in total (for all COOL channels and missing FEBs together) AthenaEventLoopMgr INFO ===>>> done processing event #3, run #1 3 events processed so far <<<=== AthenaEventLoopMgr INFO ===>>> start processing event #4, run #1 3 events processed so far <<<=== -ToolSvc.tool3 INFO bit mask for errors to mask 16381 -ToolSvc.badchan3 INFO Decoded 1 lines from FEB file badchan3.badfebs -ToolSvc.badchan3 INFO Read 1 lines in total (for all COOL channels and missing FEBs together) AthenaEventLoopMgr INFO ===>>> done processing event #4, run #1 4 events processed so far <<<=== AthenaEventLoopMgr INFO ===>>> start processing event #5, run #1 4 events processed so far <<<=== AthenaEventLoopMgr INFO ===>>> done processing event #5, run #1 5 events processed so far <<<=== @@ -468,17 +468,17 @@ AthenaEventLoopMgr INFO ===>>> start processing event #6, run #1 5 events p AthenaEventLoopMgr INFO ===>>> done processing event #6, run #1 6 events processed so far <<<=== /cvmfs/atlas-co... INFO Database being retired... /cvmfs/atlas-co... INFO Database being retired... -/cvmfs/atlas-co... INFO Database being retired... Domain[ROOT_All] INFO -> Deaccess DbDatabase READ [ROOT_All] F4885664-6C4D-DF11-A94A-00304867340C /cvmfs/atlas-co... INFO Database being retired... /cvmfs/atlas-co... INFO Database being retired... +/cvmfs/atlas-co... INFO Database being retired... Domain[ROOT_All] INFO -> Deaccess DbDatabase READ [ROOT_All] 445FAD9A-5DB3-E14A-81DB-BA6244602734 /cvmfs/atlas-co... INFO Database being retired... /cvmfs/atlas-co... INFO Database being retired... /cvmfs/atlas-co... INFO Database being retired... -Domain[ROOT_All] INFO -> Deaccess DbDatabase READ [ROOT_All] D27D07D4-C135-E011-84A9-003048F0E01E /cvmfs/atlas-co... INFO Database being retired... /cvmfs/atlas-co... INFO Database being retired... +Domain[ROOT_All] INFO -> Deaccess DbDatabase READ [ROOT_All] D27D07D4-C135-E011-84A9-003048F0E01E Domain[ROOT_All] INFO > Deaccess DbDomain READ [ROOT_All] ApplicationMgr INFO Application Manager Stopped successfully IncidentProcAlg1 INFO Finalize @@ -487,33 +487,33 @@ testalg1 INFO Finalizing testalg1... IncidentProcAlg2 INFO Finalize PyComponentMgr INFO Finalizing PyComponentMgr... IdDictDetDescrCnv INFO in finalize -IOVDbSvc INFO Folder /LAR/Align (PoolRef) db-read 1/1 objs/chan/bytes 1/1/170 (( 0.75 ))s -IOVDbSvc INFO Folder /LAR/BadChannels/BadChannels (AttrListColl) db-read 1/1 objs/chan/bytes 0/8/0 (( 0.75 ))s -IOVDbSvc INFO Folder /LAR/BadChannels/MissingFEBs (AttrList) db-read 1/1 objs/chan/bytes 1/1/16 (( 0.71 ))s -IOVDbSvc INFO Folder /LAR/Identifier/CalibIdMap (AttrList) db-read 1/2 objs/chan/bytes 1/1/1520148 (( 0.31 ))s +IOVDbSvc INFO Folder /LAR/Align (PoolRef) db-read 1/1 objs/chan/bytes 1/1/170 (( 0.07 ))s +IOVDbSvc INFO Folder /LAR/BadChannels/BadChannels (AttrListColl) db-read 1/1 objs/chan/bytes 0/8/0 (( 0.03 ))s +IOVDbSvc INFO Folder /LAR/BadChannels/MissingFEBs (AttrList) db-read 1/1 objs/chan/bytes 1/1/16 (( 0.02 ))s +IOVDbSvc INFO Folder /LAR/Identifier/CalibIdMap (AttrList) db-read 1/2 objs/chan/bytes 1/1/1520148 (( 0.02 ))s IOVDbSvc INFO Folder /LAR/Identifier/FebRodMap (AttrList) db-read 1/2 objs/chan/bytes 1/1/6100 (( 0.01 ))s -IOVDbSvc INFO Folder /LAR/Identifier/OnOffIdMap (AttrList) db-read 1/2 objs/chan/bytes 1/1/780292 (( 0.03 ))s +IOVDbSvc INFO Folder /LAR/Identifier/OnOffIdMap (AttrList) db-read 1/2 objs/chan/bytes 1/1/780292 (( 0.07 ))s IOVDbSvc INFO Folder /CALO/Ofl/Identifier/CaloTTOnAttrIdMapAtlas (PoolRef) db-read 0/0 objs/chan/bytes 0/1/0 (( 0.00 ))s IOVDbSvc INFO Folder /CALO/Ofl/Identifier/CaloTTOnOffIdMapAtlas (PoolRef) db-read 0/0 objs/chan/bytes 0/1/0 (( 0.00 ))s IOVDbSvc INFO Folder /CALO/Ofl/Identifier/CaloTTPpmRxIdMapAtlas (PoolRef) db-read 0/0 objs/chan/bytes 0/1/0 (( 0.00 ))s -IOVDbSvc INFO Folder /LAR/ElecCalibMC/AutoCorr (PoolColl) db-read 1/1 objs/chan/bytes 3/3/486 (( 0.02 ))s -IOVDbSvc INFO Folder /LAR/LArCellPositionShift (PoolRef) db-read 1/1 objs/chan/bytes 1/1/195 (( 0.02 ))s -IOVDbSvc INFO Folder /LAR/ElecCalibMC/DAC2uA (PoolColl) db-read 1/1 objs/chan/bytes 1/1/170 (( 0.02 ))s -IOVDbSvc INFO Folder /LAR/ElecCalibMC/HVScaleCorr (PoolColl) db-read 1/1 objs/chan/bytes 12/12/1980 (( 0.02 ))s -IOVDbSvc INFO Folder /LAR/ElecCalibMC/MinBias (PoolColl) db-read 1/1 objs/chan/bytes 1/1/174 (( 0.02 ))s -IOVDbSvc INFO Folder /LAR/ElecCalibMC/MinBiasAverage (PoolColl) db-read 1/1 objs/chan/bytes 1/1/181 (( 0.02 ))s -IOVDbSvc INFO Folder /LAR/ElecCalibMC/MphysOverMcal (PoolColl) db-read 1/1 objs/chan/bytes 3/3/516 (( 0.02 ))s -IOVDbSvc INFO Folder /LAR/ElecCalibMC/Noise (PoolColl) db-read 1/1 objs/chan/bytes 3/3/516 (( 0.02 ))s -IOVDbSvc INFO Folder /LAR/ElecCalibMC/Pedestal (PoolRef) db-read 1/1 objs/chan/bytes 1/1/167 (( 0.02 ))s -IOVDbSvc INFO Folder /LAR/ElecCalibMC/Ramp (PoolColl) db-read 1/1 objs/chan/bytes 3/3/489 (( 0.02 ))s -IOVDbSvc INFO Folder /LAR/ElecCalibMC/Shape (PoolColl) db-read 1/1 objs/chan/bytes 3/3/477 (( 0.02 ))s -IOVDbSvc INFO Folder /LAR/Identifier/LArTTCellMapAtlas (PoolRef) db-read 1/0 objs/chan/bytes 1/1/173 (( 0.02 ))s +IOVDbSvc INFO Folder /LAR/ElecCalibMC/AutoCorr (PoolColl) db-read 1/1 objs/chan/bytes 3/3/486 (( 0.53 ))s +IOVDbSvc INFO Folder /LAR/LArCellPositionShift (PoolRef) db-read 1/1 objs/chan/bytes 1/1/195 (( 0.44 ))s +IOVDbSvc INFO Folder /LAR/ElecCalibMC/DAC2uA (PoolColl) db-read 1/1 objs/chan/bytes 1/1/170 (( 0.50 ))s +IOVDbSvc INFO Folder /LAR/ElecCalibMC/HVScaleCorr (PoolColl) db-read 1/1 objs/chan/bytes 12/12/1980 (( 0.43 ))s +IOVDbSvc INFO Folder /LAR/ElecCalibMC/MinBias (PoolColl) db-read 1/1 objs/chan/bytes 1/1/174 (( 0.49 ))s +IOVDbSvc INFO Folder /LAR/ElecCalibMC/MinBiasAverage (PoolColl) db-read 1/1 objs/chan/bytes 1/1/181 (( 0.37 ))s +IOVDbSvc INFO Folder /LAR/ElecCalibMC/MphysOverMcal (PoolColl) db-read 1/1 objs/chan/bytes 3/3/516 (( 0.39 ))s +IOVDbSvc INFO Folder /LAR/ElecCalibMC/Noise (PoolColl) db-read 1/1 objs/chan/bytes 3/3/516 (( 0.95 ))s +IOVDbSvc INFO Folder /LAR/ElecCalibMC/Pedestal (PoolRef) db-read 1/1 objs/chan/bytes 1/1/167 (( 0.49 ))s +IOVDbSvc INFO Folder /LAR/ElecCalibMC/Ramp (PoolColl) db-read 1/1 objs/chan/bytes 3/3/489 (( 0.53 ))s +IOVDbSvc INFO Folder /LAR/ElecCalibMC/Shape (PoolColl) db-read 1/1 objs/chan/bytes 3/3/477 (( 0.50 ))s +IOVDbSvc INFO Folder /LAR/Identifier/LArTTCellMapAtlas (PoolRef) db-read 1/0 objs/chan/bytes 1/1/173 (( 0.44 ))s IOVDbSvc WARNING Folder /LAR/Identifier/LArTTCellMapAtlas is requested but no data retrieved -IOVDbSvc INFO Folder /LAR/ElecCalibMC/fSampl (PoolColl) db-read 1/1 objs/chan/bytes 1/1/194 (( 0.02 ))s -IOVDbSvc INFO Folder /LAR/ElecCalibMC/uA2MeV (PoolColl) db-read 1/1 objs/chan/bytes 1/1/165 (( 0.02 ))s -IOVDbSvc INFO Total payload read from COOL: 2312609 bytes in (( 2.84 ))s +IOVDbSvc INFO Folder /LAR/ElecCalibMC/fSampl (PoolColl) db-read 1/1 objs/chan/bytes 1/1/194 (( 2.05 ))s +IOVDbSvc INFO Folder /LAR/ElecCalibMC/uA2MeV (PoolColl) db-read 1/1 objs/chan/bytes 1/1/165 (( 0.59 ))s +IOVDbSvc INFO Total payload read from COOL: 2312609 bytes in (( 8.95 ))s IOVDbSvc INFO Connection sqlite://;schema=mycool.db;dbname=OFLP200 : nConnect: 0 nFolders: 0 ReadTime: (( 0.00 ))s -IOVDbSvc INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 2 nFolders: 20 ReadTime: (( 2.84 ))s +IOVDbSvc INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 2 nFolders: 20 ReadTime: (( 8.95 ))s IOVDbSvc INFO Connection COOLOFL_CALO/OFLP200 : nConnect: 1 nFolders: 3 ReadTime: (( 0.00 ))s AthDictLoaderSvc INFO in finalize... ToolSvc INFO Removing all tools created by ToolSvc @@ -532,9 +532,9 @@ ToolSvc.tool1 INFO Number of masked Feb per event 0.333333 *****Chrono***** INFO **************************************************************************************************** *****Chrono***** INFO The Final CPU consumption ( Chrono ) Table (ordered) *****Chrono***** INFO **************************************************************************************************** -cObjR_ALL INFO Time User : Tot= 440 [ms] Ave/Min/Max= 12.6(+- 57.1)/ 0/ 340 [ms] #= 35 -cObj_ALL INFO Time User : Tot= 0.67 [s] Ave/Min/Max=0.0335(+-0.0855)/ 0/ 0.37 [s] #= 20 -ChronoStatSvc INFO Time User : Tot= 46.9 [s] #= 1 +cObjR_ALL INFO Time User : Tot= 430 [ms] Ave/Min/Max= 12.3(+- 52.1)/ 0/ 310 [ms] #= 35 +cObj_ALL INFO Time User : Tot= 0.63 [s] Ave/Min/Max=0.0315(+-0.0773)/ 0/ 0.33 [s] #= 20 +ChronoStatSvc INFO Time User : Tot= 47 [s] #= 1 *****Chrono***** INFO **************************************************************************************************** ChronoStatSvc.f... INFO Service finalized successfully ApplicationMgr INFO Application Manager Finalized successfully diff --git a/LArCalorimeter/LArCellRec/src/LArCellDeadOTXCorr.cxx b/LArCalorimeter/LArCellRec/src/LArCellDeadOTXCorr.cxx index dc2fb02a1e928117ad2f0c75484789a6f6eac3cd..d9db0f958b48602b0daadbef6eb93cceb2219eb0 100644 --- a/LArCalorimeter/LArCellRec/src/LArCellDeadOTXCorr.cxx +++ b/LArCalorimeter/LArCellRec/src/LArCellDeadOTXCorr.cxx @@ -117,7 +117,7 @@ LArCellDeadOTXCorr::LArCellDeadOTXCorr( const std::string& type, const std::string& name, const IInterface* parent) - : AthAlgTool(type, name, parent), + : base_class(type, name, parent), m_cablingService("LArCablingService"), m_caloMgr(nullptr), m_lvl1Helper(nullptr), @@ -127,11 +127,10 @@ LArCellDeadOTXCorr::LArCellDeadOTXCorr( m_l1CondSvc(nullptr), m_ttSvc(nullptr) { - declareInterface<ICaloCellMakerTool>(this); declareProperty("triggerTowerLocation", m_TTLocation = "xAODTriggerTowers"); declareProperty("badChannelTool",m_badChannelTool); declareProperty("triggerNoiseCut", m_triggerNoiseCut); - declareProperty("useL1CaloDB", m_useL1CaloDB = false); + declareProperty("useL1CaloDB", m_useL1CaloDBProp = false); declareProperty("ignoredTTs", m_ignoredTTs); declareConstant("etaCalibrationSizes", m_etaCalibrationSizes); @@ -141,6 +140,7 @@ LArCellDeadOTXCorr::LArCellDeadOTXCorr( finish_ctor(); + m_useL1CaloDB = m_useL1CaloDBProp; } StatusCode @@ -234,6 +234,7 @@ StatusCode LArCellDeadOTXCorr::initialize() m_l1CaloTTIdTools = dynamic_cast<L1CaloTTIdTools*> (algtool); */ + m_useL1CaloDB = m_useL1CaloDBProp; ATH_CHECK( m_badChannelTool.retrieve() ); ATH_CHECK( detStore()->retrieve(m_TT_ID) ); @@ -244,7 +245,8 @@ StatusCode LArCellDeadOTXCorr::initialize() // process method // -StatusCode LArCellDeadOTXCorr::process(CaloCellContainer * cellCont ){ +StatusCode LArCellDeadOTXCorr::process(CaloCellContainer * cellCont ) { + const EventContext& ctx = Gaudi::Hive::currentContext(); ATH_MSG_DEBUG (" in process..."); ATH_MSG_DEBUG (" Nb of eta calibration factors found : "<<m_etaCalibrations.size()); for(unsigned int i=0;i<m_etaCalibrations.size();i++) @@ -255,7 +257,7 @@ StatusCode LArCellDeadOTXCorr::process(CaloCellContainer * cellCont ){ //Retrieve Trigger Towers from SG //const TriggerTowerCollection* storedTTs = 0; //const xAOD::TriggerTowerContainer* storedTTs = 0; - SG::ReadHandle<xAOD::TriggerTowerContainer> storedTTs(m_TTLocation); + SG::ReadHandle<xAOD::TriggerTowerContainer> storedTTs(m_TTLocation, ctx); if(!storedTTs.isValid()) { ATH_MSG_ERROR("Could not read container " << m_TTLocation.key()); return StatusCode::FAILURE; @@ -334,7 +336,7 @@ StatusCode LArCellDeadOTXCorr::process(CaloCellContainer * cellCont ){ Identifier ttId; - std::map<Identifier, Identifier>::iterator itCellTT = m_cellTTMapping.find(cId); + auto itCellTT = m_cellTTMapping.find(cId); if(itCellTT!=m_cellTTMapping.end()) ttId = itCellTT->second; else @@ -365,14 +367,12 @@ StatusCode LArCellDeadOTXCorr::process(CaloCellContainer * cellCont ){ trigtow.push_back(ttId); bool isBad = false; - std::vector<unsigned int>::iterator itBad = m_ignoredTTs.begin(); - std::vector<unsigned int>::iterator itBadE = m_ignoredTTs.end(); L1CaloCoolChannelId coolChannelId = m_ttSvc->createL1CoolChannelId(m_ttSvc->createTTChannelID(ttId)); unsigned int uiId = coolChannelId.id(); - for(;itBad!=itBadE;++itBad) - { - if(*itBad == uiId) + for (unsigned int iBad : m_ignoredTTs) + { + if(iBad == uiId) { isBad = true; break; @@ -392,7 +392,7 @@ StatusCode LArCellDeadOTXCorr::process(CaloCellContainer * cellCont ){ // we first look if the index and type of this TT are already known and if this // index corresponds to the TT we want - std::map<Identifier, std::pair<unsigned int, int> >::iterator itTT = m_idIndexMapping.find(ttId); + auto itTT = m_idIndexMapping.find(ttId); if(itTT!=m_idIndexMapping.end()) { ttIndex = itTT->second.first; @@ -736,8 +736,8 @@ double LArCellDeadOTXCorr::TTID_phiWidth(double eta) const { //---- Functions used to calculate a parabola double LArCellDeadOTXCorr::getA(double x1, double y1, - double x2, double y2, - double x3, double y3) + double x2, double y2, + double x3, double y3) const { double n = y3-y1 + (x1-x3)*(y2-y1)/(x2-x1); double d = (x3-x1)*(x3-x2); @@ -745,20 +745,24 @@ double LArCellDeadOTXCorr::getA(double x1, double y1, } double LArCellDeadOTXCorr::getB(double a, - double x1, double y1, - double x2, double y2) + double x1, double y1, + double x2, double y2) const { return (y2-y1 - a*(x2*x2-x1*x1))/(x2-x1); } double LArCellDeadOTXCorr::getC(double a, double b, - double x1, double y1) + double x1, double y1) const { return (y1 - a*x1*x1 - b*x1); } -void LArCellDeadOTXCorr::getInitialFitParameters(const std::vector<uint_least16_t> & ADCsamples, double & max, double& maxPos, unsigned int& TTADCMaxIndex) +void +LArCellDeadOTXCorr::getInitialFitParameters(const std::vector<uint_least16_t> & ADCsamples, + double & max, + double& maxPos, + unsigned int& TTADCMaxIndex) const { max = -9999.; maxPos = -1.; @@ -794,7 +798,7 @@ void LArCellDeadOTXCorr::getInitialFitParameters(const std::vector<uint_least16_ } -double LArCellDeadOTXCorr::getL1Energy(const std::vector<uint_least16_t> & ADCsamples, int pedestal, double eta, int type) +double LArCellDeadOTXCorr::getL1Energy(const std::vector<uint_least16_t> & ADCsamples, int pedestal, double eta, int type) const { double energy = 0; int nbSamples = ADCsamples.size(); @@ -863,7 +867,7 @@ double LArCellDeadOTXCorr::getL1Energy(const std::vector<uint_least16_t> & ADCsa return energy; } -double LArCellDeadOTXCorr::getEtaCalibration(double eta, int type) +double LArCellDeadOTXCorr::getEtaCalibration(double eta, int type) const { unsigned int totalEtaSize = 0; @@ -960,7 +964,7 @@ double LArCellDeadOTXCorr::getEtaCalibration(double eta, int type) } -double LArCellDeadOTXCorr::getEnergyCalibration(double eta, int type, double energy) +double LArCellDeadOTXCorr::getEnergyCalibration(double eta, int type, double energy) const { unsigned int totalEnergySize = 0; @@ -1064,7 +1068,7 @@ double LArCellDeadOTXCorr::getEnergyCalibration(double eta, int type, double ene } -double LArCellDeadOTXCorr::getMaxOverSumRatio(const std::vector<uint_least16_t>& ADCsamples, int pedestal) +double LArCellDeadOTXCorr::getMaxOverSumRatio(const std::vector<uint_least16_t>& ADCsamples, int pedestal) const { int max = -9999; int sum = 0; diff --git a/LArCalorimeter/LArCellRec/src/LArCellDeadOTXCorr.h b/LArCalorimeter/LArCellRec/src/LArCellDeadOTXCorr.h index 5b97a1b6b7b13f93337da5585b136be05881d1a0..d61531cbd87359a01ec507317e671270b146e8e9 100644 --- a/LArCalorimeter/LArCellRec/src/LArCellDeadOTXCorr.h +++ b/LArCalorimeter/LArCellRec/src/LArCellDeadOTXCorr.h @@ -42,9 +42,12 @@ #include "CaloRec/ToolWithConstantsMixin.h" #include "xAODTrigL1Calo/TriggerTowerContainer.h" +#include "tbb/concurrent_unordered_map.h" + #include <string> #include <vector> #include <map> +#include <atomic> class LArCablingService; class StoreGateSvc; @@ -66,9 +69,9 @@ class L1CaloCondSvc; * Trigger energy is estimated with a Landau-Landau fit on ADC samples. Corrections depending on eta and on the energy are then applied.\n * Known cell energies in the trigger tower are removed to this trigger energy, and the result is uniformly divided into the missing layer. */ -class LArCellDeadOTXCorr : public AthAlgTool, - public CaloRec::ToolWithConstantsMixin, - virtual public ICaloCellMakerTool +class LArCellDeadOTXCorr +: public extends<AthAlgTool, ICaloCellMakerTool>, + public CaloRec::ToolWithConstantsMixin { public: @@ -79,15 +82,15 @@ class LArCellDeadOTXCorr : public AthAlgTool, virtual ~LArCellDeadOTXCorr(); - virtual StatusCode initialize() ; - virtual StatusCode process( CaloCellContainer * CellCont) ; - virtual StatusCode finalize(); + virtual StatusCode initialize() override; + virtual StatusCode process( CaloCellContainer * CellCont) override; + virtual StatusCode finalize() override; using AthAlgTool::setProperty; virtual StatusCode setProperty (const std::string& propname, - const std::string& value); - virtual StatusCode setProperty (const Property& p); + const std::string& value) override; + virtual StatusCode setProperty (const Property& p) override; private: @@ -101,7 +104,8 @@ class LArCellDeadOTXCorr : public AthAlgTool, //std::string m_TTLocation; SG::ReadHandleKey<xAOD::TriggerTowerContainer> m_TTLocation; std::vector<double> m_triggerNoiseCut; - bool m_useL1CaloDB; + bool m_useL1CaloDBProp; + mutable std::atomic<bool> m_useL1CaloDB; CaloRec::Array<1> m_etaCalibrationSizes; CaloRec::Array<1> m_energyCalibrationTypes; @@ -115,9 +119,14 @@ class LArCellDeadOTXCorr : public AthAlgTool, std::vector<unsigned int> m_ignoredTTs; - std::map<Identifier, Identifier> m_cellTTMapping; - std::map<Identifier, std::pair<unsigned int, int> > m_idIndexMapping; - + struct IdHash + { + size_t operator() (const Identifier& id) const + { return id.get_compact(); } + }; + mutable tbb::concurrent_unordered_map<Identifier,Identifier,IdHash> m_cellTTMapping; + mutable tbb::concurrent_unordered_map<Identifier, std::pair<unsigned int, int>, IdHash> m_idIndexMapping; + const CaloIdManager* m_caloMgr; const CaloLVL1_ID* m_lvl1Helper; const CaloCell_ID* m_calo_id; @@ -148,15 +157,15 @@ class LArCellDeadOTXCorr : public AthAlgTool, // functions used to calculate trigger energy from parabola fit double getA(double x1, double y1, - double x2, double y2, - double x3, double y3); - + double x2, double y2, + double x3, double y3) const; + double getB(double a, - double x1, double y1, - double x2, double y2); + double x1, double y1, + double x2, double y2) const; double getC(double a, double b, - double x1, double y1); + double x1, double y1) const; /** @@ -170,13 +179,16 @@ class LArCellDeadOTXCorr : public AthAlgTool, * * Energy is first estimated with a Landau-Landau fit; then a calibration factor depending on eta and the energy is applied. */ - double getL1Energy(const std::vector<uint_least16_t> & ADCsamples, int pedestal, double eta, int type); + double getL1Energy(const std::vector<uint_least16_t> & ADCsamples, int pedestal, double eta, int type) const; - void getInitialFitParameters(const std::vector<uint_least16_t> & ADCsamples, double & max, double& maxPos, unsigned int& TTADCMaxIndex); + void getInitialFitParameters(const std::vector<uint_least16_t> & ADCsamples, + double & max, + double& maxPos, + unsigned int& TTADCMaxIndex) const; - double getEtaCalibration(double eta, int type); - double getEnergyCalibration(double eta, int type, double energy); - double getMaxOverSumRatio(const std::vector<uint_least16_t>& ADCsamples, int pedestal); + double getEtaCalibration(double eta, int type) const; + double getEnergyCalibration(double eta, int type, double energy) const; + double getMaxOverSumRatio(const std::vector<uint_least16_t>& ADCsamples, int pedestal) const; static const std::map<int,int> defineSizeType(); diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/test/test_larcalib_pedestal.sh b/LArCalorimeter/LArExample/LArCalibProcessing/test/test_larcalib_pedestal.sh new file mode 100755 index 0000000000000000000000000000000000000000..79df1195b175e102c2e139ef8482970a52a2fa55 --- /dev/null +++ b/LArCalorimeter/LArExample/LArCalibProcessing/test/test_larcalib_pedestal.sh @@ -0,0 +1,10 @@ +#!/bin/sh +# +# art-description: Testing LAR pedestal +# art-type: build +# art-include: 21.0/Athena +# art-include: master/Athena + +athena.py -c 'doMonitoring=False; runAccumulator=False; doLArCalibDataQuality=True; GainList=["HIGH"]; PartitionType="EMB"; Partition="EB-EMBA"; PartitionTypeGeneric="EMBPS"; RunNumberList=[174585]; RunNumberFlag=int(RunNumberList[0]); InputDir=" "; FullFileName=["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/LArCalibProcessing/data11_calib.00174585.calibration_LArElec-Pedestal-7s-High-BarrelPS.daq.RAW._lb0000._EB-EMBA._0001.data"]; GroupingType="ExtendedSubDetector"; from AthenaCommon.GlobalFlags import globalflags; globalflags.DatabaseInstance.set_Value_and_Lock ("COMP200"); from AthenaCommon.JobProperties import jobproperties; jobproperties.Global.DetDescrVersion.set_Value_and_Lock ("ATLAS-R1-2011-02-00-00"); DBConnectionCOOL="COOLOFL_LAR/COMP200" ' LArCalibProcessing/UseLArExtendedSubDetGrouping.py LArCalibProcessing/LArCalib_PedestalAutoCorr_jobOptions.py LArCalibProcessing/LArCalib_PedestalAutoCorr_testing.py + +echo "art-result: $? pedestal" diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/test/test_larcalib_ramp.sh b/LArCalorimeter/LArExample/LArCalibProcessing/test/test_larcalib_ramp.sh new file mode 100755 index 0000000000000000000000000000000000000000..baba662fe7a32413462b582024910fc462aebc0c --- /dev/null +++ b/LArCalorimeter/LArExample/LArCalibProcessing/test/test_larcalib_ramp.sh @@ -0,0 +1,10 @@ +#!/bin/sh +# +# art-description: Testing LAR ramp +# art-type: build +# art-include: 21.0/Athena +# art-include: master/Athena + +athena.py -c 'doMonitoring=False; doLArCalibDataQuality=True; CorrectBadChannels=True; ApplyAdHocCorrection=False; GainList=["HIGH"]; PartitionType="EMB"; Partition="EB-EMBA"; PartitionTypeGeneric="EMBPS"; RunNumberList=[174586]; RunNumberFlag=int(RunNumberList[0]); InputDir=" "; FullFileName=["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/LArCalibProcessing/data11_calib.00174586.calibration_LArElec-Ramp-7s-High-BarrelPS.daq.RAW._lb0000._EB-EMBA._0001.data"]; GroupingType="ExtendedSubDetector"; from AthenaCommon.GlobalFlags import globalflags; globalflags.DatabaseInstance.set_Value_and_Lock ("COMP200"); from AthenaCommon.JobProperties import jobproperties; jobproperties.Global.DetDescrVersion.set_Value_and_Lock ("ATLAS-R1-2011-02-00-00"); DBConnectionCOOL="COOLOFL_LAR/COMP200"; InputDBConnectionOFC="COOLONL_LAR/COMP200"; CaliOFCFolder="/LAR/ElecCalibOnl/OFC"; CaliOFCTagSpec="HEAD" ' LArCalibProcessing/UseLArExtendedSubDetGrouping.py LArCalibProcessing/LArCalib_Ramp_jobOptions.py LArCalibProcessing/LArCalib_Ramp_testing.py + +echo "art-result: $? ramp" diff --git a/LArCalorimeter/LArGeoModel/LArGeoAlgsNV/CMakeLists.txt b/LArCalorimeter/LArGeoModel/LArGeoAlgsNV/CMakeLists.txt index 42ba96c45ba6f03f9f41a644ce2ac2b62e8e3d4e..53f4892c323570917c97d05fa0bd0b45da0250fb 100644 --- a/LArCalorimeter/LArGeoModel/LArGeoAlgsNV/CMakeLists.txt +++ b/LArCalorimeter/LArGeoModel/LArGeoAlgsNV/CMakeLists.txt @@ -12,7 +12,7 @@ atlas_depends_on_subdirs( PUBLIC DetectorDescription/GeoModel/GeoModelUtilities LArCalorimeter/LArGeoModel/LArReadoutGeometry PRIVATE - Control/CLIDSvc + Control/AthenaKernel Control/SGTools Control/StoreGate Database/RDBAccessSvc diff --git a/LArCalorimeter/LArGeoModel/LArGeoAlgsNV/src/LArDetectorTool.cxx b/LArCalorimeter/LArGeoModel/LArGeoAlgsNV/src/LArDetectorTool.cxx index 2c0062c07486b94c3c8b0ad83d67fa11eccd3046..dfeda29711ee1f01f1be4ea625c9bbab802cd260 100755 --- a/LArCalorimeter/LArGeoModel/LArGeoAlgsNV/src/LArDetectorTool.cxx +++ b/LArCalorimeter/LArGeoModel/LArGeoAlgsNV/src/LArDetectorTool.cxx @@ -34,7 +34,7 @@ #include "LArHV/EMBPresamplerHVManager.h" #include "LArHV/EMECPresamplerHVManager.h" -#include "CLIDSvc/tools/ClassID_traits.h" +#include "AthenaKernel/ClassID_traits.h" #include "SGTools/DataProxy.h" // Name of the folder for LAr Alignment information : diff --git a/LArCalorimeter/LArROD/src/LArRawChannelBuilderAlg.cxx b/LArCalorimeter/LArROD/src/LArRawChannelBuilderAlg.cxx index 6ab73f642d4093b263850027a95853fc5e340f3c..fe5bf88b8e83cc027a8669ae8b885403a68bcdc3 100644 --- a/LArCalorimeter/LArROD/src/LArRawChannelBuilderAlg.cxx +++ b/LArCalorimeter/LArROD/src/LArRawChannelBuilderAlg.cxx @@ -115,7 +115,7 @@ StatusCode LArRawChannelBuilderAlg::execute_r(const EventContext& ctx) const { if (saturated) prov|=0x0400; if (std::fabs(E)>m_eCutFortQ) { - ATH_MSG_VERBOSE("Channel " << m_onlineId->channel_name(id) << " gain " << gain << " above theshold for tQ computation"); + ATH_MSG_VERBOSE("Channel " << m_onlineId->channel_name(id) << " gain " << gain << " above threshold for tQ computation"); prov|=0x2000; //Get time by applying OFC-b coefficients: @@ -141,6 +141,7 @@ StatusCode LArRawChannelBuilderAlg::execute_r(const EventContext& ctx) const { if (!connected) continue; //No conditions for disconnected channel, who cares? ATH_MSG_ERROR("No valid shape for channel " << m_onlineId->channel_name(id) << " gain " << gain); + ATH_MSG_ERROR("Got size " << fullShape.size() << ", expected at least " << nSamples+firstSample); return StatusCode::FAILURE; } @@ -152,6 +153,7 @@ StatusCode LArRawChannelBuilderAlg::execute_r(const EventContext& ctx) const { if (ATH_UNLIKELY(fullshapeDer.size()<nSamples+firstSample)) { ATH_MSG_ERROR("No valid shape derivative for channel " << m_onlineId->channel_name(id) << " gain " << gain); + ATH_MSG_ERROR("Got size " << fullshapeDer.size() << ", expected at least " << nSamples+firstSample); return StatusCode::FAILURE; } diff --git a/LArCalorimeter/LArRawConditions/LArRawConditions/LArMCSym.h b/LArCalorimeter/LArRawConditions/LArRawConditions/LArMCSym.h index 584f6aac5f144f6f5c48366e8fec86da4848593d..913b55deefb1a4ae591b5325dc91746af2fca686 100755 --- a/LArCalorimeter/LArRawConditions/LArRawConditions/LArMCSym.h +++ b/LArCalorimeter/LArRawConditions/LArRawConditions/LArMCSym.h @@ -26,6 +26,7 @@ class LArMCSym { ); HWIdentifier ZPhiSymOfl(const Identifier notSymOffId) const { + if (m_caloCellID->is_tile(notSymOffId)) return HWIdentifier(); const IdentifierHash h=m_caloCellID->calo_cell_hash(notSymOffId); return ZPhiSymOfl(h); } diff --git a/LArCalorimeter/LArRecUtils/CMakeLists.txt b/LArCalorimeter/LArRecUtils/CMakeLists.txt index 03853bd5174f3583c3b91b4d48c2f813e6084a90..7caba479de84b45abc995a4e2d1e997f9058805a 100644 --- a/LArCalorimeter/LArRecUtils/CMakeLists.txt +++ b/LArCalorimeter/LArRecUtils/CMakeLists.txt @@ -69,5 +69,5 @@ atlas_install_joboptions( share/*.py ) atlas_add_test( LArFCalTowerBuilderTool SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/test/LArFCalTowerBuilderTool_test.sh PROPERTIES TIMEOUT 300 - EXTRA_PATTERNS "[0-9] [A-Z]+ 20[123][0-9]|Reading file|^CORAL/Services/ConnectionService (Info|Warning)|^RelationalDatabase Info|^Data source lookup|^DetDescrCnvSvc +INFO|^CORAL/RelationalPlugins/frontier Info|^PluginManager Info|^RalSessionMgr Warning|^DBReplicaSvc +INFO|IOVDbSvc +INFO|^Py:Athena +INFO|^EventInfoMgtInit: Got release|^TEnvRec::ChangeValue|^PoolSvc +INFO|being retired|including file|Deaccess DbDatabase|^IoComponentMgr +INFO|File version|Global positioning|^Domain|duplicate entry|already loaded|RootDbase: all good|frontier.c|^Py:ConfigurableDb +(WARNING|INFO)|ApplicationMgr +INFO|INFO [sS]top|^CaloIdMgrDetDes.*INFO|^TTOnlineIDDetDe.*INFO|^CaloIDHelper_ID.*INFO|^AtlasDetectorID +INFO|^AthenaEventLoopMgrWARNING|^CaloDM_IDDetDes.*INFO|^CaloLVL1_IDDetD.*INFO|^LArFCAL_ID +INFO|^LArMiniFCAL_IDD.*INFO|^LArHEC_ID +INFO|^LArMiniFCAL_ID +INFO|TileTBIdDetDesc.*INFO|^TileIDDetDescrCnv +INFO|CaloCell_IDDetD.*INFO|TileID +INFO|^LArFCAL_IDDetDe.*INFO|^TileTBIDDetDesc.*INFO|^LArEM_ID +INFO|^LArHEC_IDDetDes.*INFO|^LArEM_IDDetDesc.*INFO|^EndcapDMConstru.*INFO|^GeoModelSvc +INFO|U-shape parameter|XMLFileCatalog Info|No IOVSvcTool associated|^RalSessionMgr Info|RDBMS technology|^AthenaRootStre.* INFO|^GUID: Class pool::DbString has GUID|INFO TileDddbManager|^HGTD_ID *INFO|Unable to locate catalog|^CORAL/" + EXTRA_PATTERNS "[0-9] [A-Z]+ 20[123][0-9]|Reading file|^CORAL/Services/ConnectionService (Info|Warning)|^RelationalDatabase Info|^Data source lookup|^DetDescrCnvSvc +INFO|^CORAL/RelationalPlugins/frontier Info|^PluginManager Info|^RalSessionMgr Warning|^DBReplicaSvc +INFO|IOVDbSvc +INFO|^Py:Athena +INFO|^EventInfoMgtInit: Got release|^TEnvRec::ChangeValue|^PoolSvc +INFO|being retired|including file|Deaccess DbDatabase|^IoComponentMgr +INFO|File version|Global positioning|^Domain|duplicate entry|already loaded|RootDbase: all good|frontier.c|^Py:ConfigurableDb +(WARNING|INFO)|ApplicationMgr +INFO|INFO [sS]top|^CaloIdMgrDetDes.*INFO|^TTOnlineIDDetDe.*INFO|^CaloIDHelper_ID.*INFO|^AtlasDetectorID +INFO|^AthenaEventLoopMgrWARNING|^CaloDM_IDDetDes.*INFO|^CaloLVL1_IDDetD.*INFO|^LArFCAL_ID +INFO|^LArMiniFCAL_IDD.*INFO|^LArHEC_ID +INFO|^LArMiniFCAL_ID +INFO|TileTBIdDetDesc.*INFO|^TileIDDetDescrCnv +INFO|CaloCell_IDDetD.*INFO|TileID +INFO|^LArFCAL_IDDetDe.*INFO|^TileTBIDDetDesc.*INFO|^LArEM_ID +INFO|^LArHEC_IDDetDes.*INFO|^LArEM_IDDetDesc.*INFO|^EndcapDMConstru.*INFO|^GeoModelSvc +INFO|U-shape parameter|XMLFileCatalog Info|No IOVSvcTool associated|^RalSessionMgr Info|RDBMS technology|^AthenaRootStre.* INFO|^GUID: Class pool::DbString has GUID|INFO TileDddbManager|^HGTD_ID *INFO|Unable to locate catalog|^CORAL/|TFile::Init" ) diff --git a/LArCalorimeter/LArRecUtils/src/LArOFCCondAlg.cxx b/LArCalorimeter/LArRecUtils/src/LArOFCCondAlg.cxx index 1a4aa81cd3c14fd715f5a5dc203623705423b856..1c1cb9e496f918dd22688369680aadb7ede82434 100644 --- a/LArCalorimeter/LArRecUtils/src/LArOFCCondAlg.cxx +++ b/LArCalorimeter/LArRecUtils/src/LArOFCCondAlg.cxx @@ -221,7 +221,7 @@ StatusCode LArOFCCondAlg::execute() { return StatusCode::FAILURE; } - ATH_MSG_INFO("IOV found from intersection for AutoCorrTotal object: " + ATH_MSG_INFO("IOV found from intersection for LArOFCCondObj object: " << rangeIntersection); // make output object @@ -346,6 +346,10 @@ StatusCode LArOFCCondAlg::execute() { //return (m_OFCtmp); //returns an empty vector } + if (Shape.size()!=ShapeDer.size()) { + ATH_MSG_ERROR("Got invalid shape object: Size=" << Shape.size() << ", DerSize=" << ShapeDer.size()); + return StatusCode::SUCCESS; + } //::::::::::::::::::::::::::::::: unsigned int l,c,i; //::::::::::::::::::::::::::::::: diff --git a/LArCalorimeter/LArTools/LArTools/LArMCSymTool.h b/LArCalorimeter/LArTools/LArTools/LArMCSymTool.h index f5f5eb4f0897fe23f1a67d8132db298c967f9c62..24ff48f0207ceeb73099dccfb07f9442243d693d 100755 --- a/LArCalorimeter/LArTools/LArTools/LArMCSymTool.h +++ b/LArCalorimeter/LArTools/LArTools/LArMCSymTool.h @@ -70,17 +70,6 @@ class LArMCSymTool: public AthAlgTool, virtual public ILArMCSymTool const LArEM_ID* m_lar_em_id; const LArHEC_ID* m_lar_hec_id; const LArFCAL_ID* m_lar_fcal_id; - - // FIXME: mutable - // These are used for memoization. That appears to actually do some good, - // so won't remove these yet; we return the memoized value over half - // the time. This seems to come from LArADC2MeVTool::getADC2MeV, where - // we have an outer loop over ids and an inner loop over gains - // and tools. - mutable HWIdentifier m_hwid; - mutable HWIdentifier m_hwid_sym; - mutable HWIdentifier m_hwid_sym2; - mutable Identifier m_offid; }; diff --git a/LArCalorimeter/LArTools/src/LArMCSymTool.cxx b/LArCalorimeter/LArTools/src/LArMCSymTool.cxx index 50aa8f1137a53472ade839de55a20f24815a0be8..1127fab36db4da62bbd1c75d293c3172bd8e7aac 100755 --- a/LArCalorimeter/LArTools/src/LArMCSymTool.cxx +++ b/LArCalorimeter/LArTools/src/LArMCSymTool.cxx @@ -126,24 +126,18 @@ StatusCode LArMCSymTool::finalize() HWIdentifier LArMCSymTool::symOnline(const HWIdentifier & id) const { - if (id == m_hwid) { - return m_hwid_sym; - } - m_hwid_sym.clear(); + const Identifier offid = m_cablingService->cnvToIdentifier(id); - if (offid.is_valid()) { - m_hwid_sym = symOnline(offid); + if (!offid.is_valid()) { + return HWIdentifier(); } - m_hwid = id; - return m_hwid_sym; + return symOnline(offid); } HWIdentifier LArMCSymTool::symOnline(const Identifier & id) const { - if (id == m_offid) { - return m_hwid_sym2; - } + IdentifierHash idHash; int offset=-1; if(m_lar_em_id->is_lar_em(id)) @@ -163,9 +157,7 @@ HWIdentifier LArMCSymTool::symOnline(const Identifier & id) const } if (offset <0) ATH_MSG_ERROR( "problem offset " << offset ); const unsigned int index = idHash+offset; - m_offid = id; - m_hwid_sym2 = m_listOnline[index]; - return m_hwid_sym2; + return m_listOnline[index]; } diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/MuonEventTPCnv/MuonPrepRawData/MMPrepDataContainerCnv_p1.h b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/MuonEventTPCnv/MuonPrepRawData/MMPrepDataContainerCnv_p1.h index 90a066e69e8ee3c5f619764e4155bb94361a3e30..02a81c18cbcb9a695735264641112d18aaee45f0 100644 --- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/MuonEventTPCnv/MuonPrepRawData/MMPrepDataContainerCnv_p1.h +++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/MuonEventTPCnv/MuonPrepRawData/MMPrepDataContainerCnv_p1.h @@ -11,7 +11,7 @@ #include "MuonEventTPCnv/MuonPrepRawData/MuonPRD_Container_p2.h" -#include "MuonEventTPCnv/CreateTransientTemplates.h" + #include <iostream> class StoreGateSvc; diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/MuonEventTPCnv/MuonRDO/MM_RawDataContainerCnv_p1.h b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/MuonEventTPCnv/MuonRDO/MM_RawDataContainerCnv_p1.h index 22691cffe5c085d2a98fa9db97181bab749c108a..f1ecdd97e6091bdb2a3c937c85f9d9038207ed9c 100644 --- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/MuonEventTPCnv/MuonRDO/MM_RawDataContainerCnv_p1.h +++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/MuonEventTPCnv/MuonRDO/MM_RawDataContainerCnv_p1.h @@ -22,10 +22,10 @@ namespace Muon{ virtual void persToTrans(const Muon::MM_RawDataContainer_p1* persCont, Muon::MM_RawDataContainer* transCont, - MsgStream &log) override; + MsgStream &log) ; virtual void transToPers(const Muon::MM_RawDataContainer* transCont, Muon::MM_RawDataContainer_p1* persCont, - MsgStream &log) override; + MsgStream &log) ; virtual Muon::MM_RawDataContainer* createTransient(const Muon::MM_RawDataContainer_p1* persObj, MsgStream& log) override final; diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/MuonEventTPCnv/MuonRDO/MM_RawData_p1.h b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/MuonEventTPCnv/MuonRDO/MM_RawData_p1.h index d12392da63b36991be7d3ba4faf79aef713b66fd..dd0bce370bfe59fee03dbab5cf70df24f82e8752 100644 --- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/MuonEventTPCnv/MuonRDO/MM_RawData_p1.h +++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/MuonEventTPCnv/MuonRDO/MM_RawData_p1.h @@ -8,13 +8,21 @@ namespace Muon { - class MM_RawData_p1 - { - public: - MM_RawData_p1() : m_id(0) {} - - unsigned int m_id; //!< FIXME! Remove this eventually - }; + class MM_RawData_p1 + { + public: + MM_RawData_p1() : m_id(0), m_channel(0), m_time(0), m_charge(0) {} + + unsigned int m_id; //!< FIXME! Remove this eventually + + /// writing out channel id, time and charge + unsigned int m_channel; + + unsigned int m_time; + + unsigned int m_charge; + + }; } #endif diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/MuonEventTPCnv/MuonRDO/STGC_RawDataContainerCnv_p1.h b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/MuonEventTPCnv/MuonRDO/STGC_RawDataContainerCnv_p1.h index 01325a1c254f19615b5e060965cdb0d1a381ec89..56504a7c2bb80c95398a327a34cead396e939942 100644 --- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/MuonEventTPCnv/MuonRDO/STGC_RawDataContainerCnv_p1.h +++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/MuonEventTPCnv/MuonRDO/STGC_RawDataContainerCnv_p1.h @@ -14,12 +14,6 @@ class sTgcIdHelper; -namespace TPCnv { - template<> class CreateTransient< Muon::STGC_RawDataContainer > { - public: static std::unique_ptr< Muon::STGC_RawDataContainer > create() { return nullptr;} - }; -} - namespace Muon{ class STGC_RawDataContainerCnv_p1 : public T_AthenaPoolTPCnvBase<Muon::STGC_RawDataContainer, Muon::STGC_RawDataContainer_p1> { @@ -28,10 +22,10 @@ namespace Muon{ virtual void persToTrans(const Muon::STGC_RawDataContainer_p1* persCont, Muon::STGC_RawDataContainer* transCont, - MsgStream &log) override; + MsgStream &log) ; virtual void transToPers(const Muon::STGC_RawDataContainer* transCont, Muon::STGC_RawDataContainer_p1* persCont, - MsgStream &log) override; + MsgStream &log) ; virtual Muon::STGC_RawDataContainer* createTransient(const Muon::STGC_RawDataContainer_p1* persObj, MsgStream& log) override final; diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/MuonEventTPCnv/MuonRDO/STGC_RawData_p1.h b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/MuonEventTPCnv/MuonRDO/STGC_RawData_p1.h index 5504cada1b9e255daa7535ba52a16288c0ac9e73..f7916f94c2003483097dc3a5a271a64017495505 100644 --- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/MuonEventTPCnv/MuonRDO/STGC_RawData_p1.h +++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/MuonEventTPCnv/MuonRDO/STGC_RawData_p1.h @@ -11,9 +11,18 @@ namespace Muon class STGC_RawData_p1 { public: - STGC_RawData_p1() : m_id(0) {} + STGC_RawData_p1() : m_id(0), m_time(0), m_charge(0), m_bcTag(0), m_isDead(false) {} unsigned int m_id; //!< FIXME! Remove this eventually + + float m_time; + + float m_charge; + + uint16_t m_bcTag; + + bool m_isDead; + }; } diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonPrepRawData/MMPrepDataContainerCnv_p1.cxx b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonPrepRawData/MMPrepDataContainerCnv_p1.cxx index ed730658a5ff6ec24dcf9449179c865ccad18f50..e30e88040da7915cef50dda40c620bb4cac472be 100644 --- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonPrepRawData/MMPrepDataContainerCnv_p1.cxx +++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonPrepRawData/MMPrepDataContainerCnv_p1.cxx @@ -15,10 +15,13 @@ // Gaudi #include "GaudiKernel/ISvcLocator.h" #include "GaudiKernel/Bootstrap.h" +// #include "GaudiKernel/CnvFactory.h" +// #include "GaudiKernel/StatusCode.h" +// #include "GaudiKernel/Service.h" // Athena #include "StoreGate/StoreGateSvc.h" -#include "MuonEventTPCnv/CreateTransientTemplates.h" + StatusCode Muon::MMPrepDataContainerCnv_p1::initialize(MsgStream &log) { // Do not initialize again: @@ -243,7 +246,7 @@ void Muon::MMPrepDataContainerCnv_p1::persToTrans(const Muon::MMPrepDataContain // int result = m_MMId->get_detectorElement_hash(chan->identify(), deIDHash); // if (result&&log.level() <= MSG::WARNING) // log << MSG::WARNING<< " Muon::MMPrepDataContainerCnv_p1::persToTrans: problem converting Identifier to DE hash "<<endmsg; - // chan->m_detEl = m_muonDetMgr->getMMReadoutElement(deIDHash); + // chan->m_detEl = m_muonDetMgr->getMMReadoutElement(deIDHash);; log << MSG::DEBUG<<"chan identify(): "<<chan->identify()<<endmsg; chan->setHashAndIndex(collIDHash, chanIndex); diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonPrepRawData/sTgcPrepDataContainerCnv_p1.cxx b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonPrepRawData/sTgcPrepDataContainerCnv_p1.cxx index 97489f754b549dc0dae092d8f952df6c73971e8f..29bbf3db79e893bd426e1fa4d06280a58637783d 100644 --- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonPrepRawData/sTgcPrepDataContainerCnv_p1.cxx +++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonPrepRawData/sTgcPrepDataContainerCnv_p1.cxx @@ -15,10 +15,13 @@ // Gaudi #include "GaudiKernel/ISvcLocator.h" #include "GaudiKernel/Bootstrap.h" +// #include "GaudiKernel/CnvFactory.h" +// #include "GaudiKernel/StatusCode.h" +// #include "GaudiKernel/Service.h" // Athena #include "StoreGate/StoreGateSvc.h" -#include "MuonEventTPCnv/CreateTransientTemplates.h" + StatusCode Muon::sTgcPrepDataContainerCnv_p1::initialize(MsgStream &log) { // Do not initialize again: diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonRDO/MM_RawDataCnv_p1.cxx b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonRDO/MM_RawDataCnv_p1.cxx index 11cc296aff29c1a3527d4450545cdb09f09b1f4d..ae0af68ab3dc076b6460999619936f9291e7713d 100644 --- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonRDO/MM_RawDataCnv_p1.cxx +++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonRDO/MM_RawDataCnv_p1.cxx @@ -11,11 +11,18 @@ void Muon::MM_RawDataCnv_p1::persToTrans( const Muon::MM_RawData_p1 *, Muon::MM_ void Muon::MM_RawDataCnv_p1::transToPers( const Muon::MM_RawData *transObj, Muon::MM_RawData_p1 *persObj, MsgStream & /**log*/ ) { persObj->m_id = transObj->m_id.get_identifier32().get_compact(); + persObj->m_channel = transObj->channel(); + persObj->m_time = transObj->time(); + persObj->m_charge = transObj->charge(); } Muon::MM_RawData* Muon::MM_RawDataCnv_p1::createTransient(const Muon::MM_RawData_p1* persObj, MsgStream& /**log*/) { - Muon::MM_RawData* trans = new MM_RawData( Identifier (persObj->m_id) ); - return trans; + Muon::MM_RawData* trans = new MM_RawData( Identifier (persObj->m_id), + persObj->m_channel, + persObj->m_time, + persObj->m_charge ); + + return trans; } diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonRDO/MM_RawDataContainerCnv_p1.cxx b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonRDO/MM_RawDataContainerCnv_p1.cxx index e58c72a3aef687b832125f92011bc9ab6bb10726..d9bab01dc75b9e7fbb05736166f3ce467037ac6e 100644 --- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonRDO/MM_RawDataContainerCnv_p1.cxx +++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonRDO/MM_RawDataContainerCnv_p1.cxx @@ -6,7 +6,6 @@ #include "MuonRDO/MM_RawDataContainer.h" #include "MuonEventTPCnv/MuonRDO/MM_RawDataContainer_p1.h" #include "MuonIdHelpers/MmIdHelper.h" -#include "MuonEventTPCnv/CreateTransientTemplates.h" #define DEBUG 0 @@ -35,13 +34,20 @@ void Muon::MM_RawDataContainerCnv_p1::transToPers(const Muon::MM_RawDataContaine void Muon::MM_RawDataContainerCnv_p1::persToTrans(const Muon::MM_RawDataContainer_p1* persCont, Muon::MM_RawDataContainer* transCont, MsgStream &log) { + size_t numColl = persCont->size(); + if (DEBUG) log<<MSG::VERBOSE<<"MM_RawDataContainerCnv_p1::persToTrans with MM_RawDataContainer_p1 with this many collections "<<numColl<<std::endl; MM_RawDataCollection* coll = nullptr; for ( const MM_RawDataCollection_p1 collection : *persCont){ + coll = new MM_RawDataCollection(collection.m_idHash); - transCont->addCollection(coll,collection.m_idHash); + if ( transCont->addCollection(coll,collection.m_idHash).isFailure() ) { + log << MSG::WARNING << "Could not add the MM RDO collection during persistent -> transient conversion" << std::endl; + return; + } + if (DEBUG) log<<MSG::VERBOSE<<"Have created empty transient collection, now looping over persistent coll with this many entries: "<<collection.size() <<std::endl; for ( unsigned int j=0 ; j < collection.size() ; ++j ){ @@ -59,7 +65,7 @@ void Muon::MM_RawDataContainerCnv_p1::persToTrans(const Muon::MM_RawDataContain //================================================================ Muon::MM_RawDataContainer* Muon::MM_RawDataContainerCnv_p1::createTransient(const Muon::MM_RawDataContainer_p1* persObj, MsgStream& log) { - std::unique_ptr<MM_RawDataContainer> trans(new Muon::MM_RawDataContainer(m_idHelper->module_hash_max())); // FIXME This seems to give a ridiculously large number. Maybe I need to call something else? + std::unique_ptr<MM_RawDataContainer> trans(new Muon::MM_RawDataContainer(m_idHelper->module_hash_max())); if (DEBUG) log<<MSG::VERBOSE<<"MM_RawDataContainerCnv_p1::createTransient() Created new MM_RawDataContainer with this many collections "<<trans->numberOfCollections()<<std::endl; persToTrans(persObj, trans.get(), log); diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonRDO/STGC_RawDataCnv_p1.cxx b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonRDO/STGC_RawDataCnv_p1.cxx index 4f2bd0b79f31c44a4fa8c99bed1d24f8388e277d..bc1a78105411bbd72ce85213d09bb5f5e09a9f87 100644 --- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonRDO/STGC_RawDataCnv_p1.cxx +++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonRDO/STGC_RawDataCnv_p1.cxx @@ -11,11 +11,20 @@ void Muon::STGC_RawDataCnv_p1::persToTrans( const Muon::STGC_RawData_p1 *, Muon: void Muon::STGC_RawDataCnv_p1::transToPers( const Muon::STGC_RawData *transObj, Muon::STGC_RawData_p1 *persObj, MsgStream & /**log*/ ) { persObj->m_id = transObj->m_id.get_identifier32().get_compact(); + persObj->m_bcTag = transObj->bcTag(); + persObj->m_time = transObj->time(); + persObj->m_charge = transObj->charge(); + persObj->m_isDead = transObj->isDead(); } Muon::STGC_RawData* Muon::STGC_RawDataCnv_p1::createTransient(const Muon::STGC_RawData_p1* persObj, MsgStream& /**log*/) { - Muon::STGC_RawData* trans = new STGC_RawData( Identifier (persObj->m_id) ); - return trans; + Muon::STGC_RawData* trans = new STGC_RawData( Identifier (persObj->m_id), + persObj->m_bcTag, + persObj->m_time, + persObj->m_charge, + persObj->m_isDead); + + return trans; } diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonRDO/STGC_RawDataContainerCnv_p1.cxx b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonRDO/STGC_RawDataContainerCnv_p1.cxx index a0ddbdb08c57e7958ce5f5ae34abff92afc143be..ece37a850d4f8056067d99163ceb83c21c47e545 100644 --- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonRDO/STGC_RawDataContainerCnv_p1.cxx +++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonRDO/STGC_RawDataContainerCnv_p1.cxx @@ -6,7 +6,6 @@ #include "MuonRDO/STGC_RawDataContainer.h" #include "MuonEventTPCnv/MuonRDO/STGC_RawDataContainer_p1.h" #include "MuonIdHelpers/sTgcIdHelper.h" -#include "MuonEventTPCnv/CreateTransientTemplates.h" #define DEBUG 0 @@ -42,7 +41,10 @@ void Muon::STGC_RawDataContainerCnv_p1::persToTrans(const Muon::STGC_RawDataCon STGC_RawDataCollection* coll = nullptr; for ( const STGC_RawDataCollection_p1 collection : *persCont){ coll = new STGC_RawDataCollection(collection.m_idHash); - transCont->addCollection(coll,collection.m_idHash); + if ( transCont->addCollection(coll,collection.m_idHash).isFailure() ) { + log << MSG::WARNING << "Could not add the sTGC collection during persistent->transient conversion" << std::endl; + return; + } if (DEBUG) log<<MSG::VERBOSE<<"Have created empty transient collection, now looping over persistent coll with this many entries: "<<collection.size() <<std::endl; for ( unsigned int j=0 ; j < collection.size() ; ++j ){ @@ -60,7 +62,7 @@ void Muon::STGC_RawDataContainerCnv_p1::persToTrans(const Muon::STGC_RawDataCon //================================================================ Muon::STGC_RawDataContainer* Muon::STGC_RawDataContainerCnv_p1::createTransient(const Muon::STGC_RawDataContainer_p1* persObj, MsgStream& log) { - std::unique_ptr<STGC_RawDataContainer> trans(new Muon::STGC_RawDataContainer(m_idHelper->module_hash_max())); // FIXME This seems to give a ridiculously large number. Maybe I need to call something else? + std::unique_ptr<STGC_RawDataContainer> trans(new Muon::STGC_RawDataContainer(m_idHelper->module_hash_max())); if (DEBUG) log<<MSG::VERBOSE<<"STGC_RawDataContainerCnv_p1::createTransient() Created new STGC_RawDataContainer with this many collections "<<trans->numberOfCollections()<<std::endl; persToTrans(persObj, trans.get(), log); diff --git a/MuonSpectrometer/MuonCnv/MuonMM_CnvTools/src/MmRdoToPrepDataTool.cxx b/MuonSpectrometer/MuonCnv/MuonMM_CnvTools/src/MmRdoToPrepDataTool.cxx index f19a01c4865d507a52f5e0b54b476ecc60363330..b532d77cc06c94ec03af9598e863a6d397db79e1 100644 --- a/MuonSpectrometer/MuonCnv/MuonMM_CnvTools/src/MmRdoToPrepDataTool.cxx +++ b/MuonSpectrometer/MuonCnv/MuonMM_CnvTools/src/MmRdoToPrepDataTool.cxx @@ -147,14 +147,17 @@ StatusCode Muon::MmRdoToPrepDataTool::processCollection(const MM_RawDataCollecti const Identifier rdoId = rdo->identify(); // const Identifier elementId = m_mmIdHelper->elementID(rdoId); ATH_MSG_DEBUG(" dump rdo " << m_idHelperTool->toString(rdoId )); + const int time = rdo->time(); const int charge = rdo->charge(); std::vector<Identifier> rdoList; rdoList.push_back(rdoId); + Identifier parentID = m_mmIdHelper->parentID(rdoId); Identifier layid = m_mmIdHelper->channelID(parentID, m_mmIdHelper->multilayer(rdoId), m_mmIdHelper->gasGap(rdoId),1); // get the local and global positions const MuonGM::MMReadoutElement* detEl = m_muonMgr->getMMReadoutElement(layid); + Amg::Vector2D localPos; bool getLocalPos = detEl->stripPosition(rdoId,localPos); diff --git a/MuonSpectrometer/MuonCnv/MuonMM_CnvTools/src/MmRdoToPrepDataTool.h b/MuonSpectrometer/MuonCnv/MuonMM_CnvTools/src/MmRdoToPrepDataTool.h index 90a3d5666dac2129734a88298154d9d5a98eafee..ab70729e8554ce69a21ff6e06e3918aa6fb11275 100644 --- a/MuonSpectrometer/MuonCnv/MuonMM_CnvTools/src/MmRdoToPrepDataTool.h +++ b/MuonSpectrometer/MuonCnv/MuonMM_CnvTools/src/MmRdoToPrepDataTool.h @@ -94,6 +94,7 @@ namespace Muon std::string m_outputCollectionLocation; bool m_merge; + }; } // end of namespace diff --git a/MuonSpectrometer/MuonCnv/MuonRdoToPrepData/MuonRdoToPrepData/MdtRdoToMdtPrepData.h b/MuonSpectrometer/MuonCnv/MuonRdoToPrepData/MuonRdoToPrepData/MdtRdoToMdtPrepData.h index 23b165584b35b34f90bc1f566b300b725699342e..932c0194a60dab04100cbd8c134f550cf1dad464 100755 --- a/MuonSpectrometer/MuonCnv/MuonRdoToPrepData/MuonRdoToPrepData/MdtRdoToMdtPrepData.h +++ b/MuonSpectrometer/MuonCnv/MuonRdoToPrepData/MuonRdoToPrepData/MdtRdoToMdtPrepData.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef MDTRDOTOMDTPREPDATA_H diff --git a/MuonSpectrometer/MuonCnv/MuonRdoToPrepData/src/MdtRdoToMdtPrepData.cxx b/MuonSpectrometer/MuonCnv/MuonRdoToPrepData/src/MdtRdoToMdtPrepData.cxx index 9366d88d154eb52c1f867a61446b93d9d9538af9..65526b8143348dfd1069ceec10692d127c26fc14 100755 --- a/MuonSpectrometer/MuonCnv/MuonRdoToPrepData/src/MdtRdoToMdtPrepData.cxx +++ b/MuonSpectrometer/MuonCnv/MuonRdoToPrepData/src/MdtRdoToMdtPrepData.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ /// Author: Davide Costanzo diff --git a/MuonSpectrometer/MuonCnv/MuonRdoToPrepData/src/StgcRdoToStgcPrepData.cxx b/MuonSpectrometer/MuonCnv/MuonRdoToPrepData/src/StgcRdoToStgcPrepData.cxx index adcfee4778dc1bfe911e5f4f2daab1c99919083b..ef03632fc9dbd1bcd6955d6f5f91112242cf2d4d 100755 --- a/MuonSpectrometer/MuonCnv/MuonRdoToPrepData/src/StgcRdoToStgcPrepData.cxx +++ b/MuonSpectrometer/MuonCnv/MuonRdoToPrepData/src/StgcRdoToStgcPrepData.cxx @@ -7,7 +7,7 @@ StgcRdoToStgcPrepData::StgcRdoToStgcPrepData(const std::string& name, ISvcLocator* pSvcLocator) : AthAlgorithm(name, pSvcLocator), - m_decoderTool ("Muon::StgcRdoToStgcPrepDataTool/StgcRdoToStgcPrepDataTool", this), + m_decoderTool ("Muon::sTgcRdoToPrepDataTool/STGC_PrepDataProviderTool"), m_prdContainer("STGC_Measurements") { declareProperty("OutputCollection", m_prdContainer); diff --git a/MuonSpectrometer/MuonCnv/MuonSTGC_CnvTools/src/STGC_RawDataToPrepDataTool.cxx b/MuonSpectrometer/MuonCnv/MuonSTGC_CnvTools/src/STGC_RawDataToPrepDataTool.cxx deleted file mode 100644 index ef3af13728e48ca0a26b880577221e6c891fe9d6..0000000000000000000000000000000000000000 --- a/MuonSpectrometer/MuonCnv/MuonSTGC_CnvTools/src/STGC_RawDataToPrepDataTool.cxx +++ /dev/null @@ -1,166 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// TGC_CnvTool.cxx, (c) ATLAS Detector software -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "STGC_RawDataToPrepDataTool.h" - -#include "GaudiKernel/ISvcLocator.h" - -#include "MuonReadoutGeometry/MuonDetectorManager.h" -#include "MuonReadoutGeometry/sTgcReadoutElement.h" - -#include "TrkSurfaces/Surface.h" - -#include "MuonCnvToolInterfaces/IDC_Helper.h" - -#include "EventPrimitives/EventPrimitives.h" -// BS access -#include "MuonCnvToolInterfaces/IMuonRawDataProviderTool.h" - -#include <cfloat> -#include <algorithm> - -//================ Constructor ================================================= - -Muon::STGC_RawDataToPrepDataTool::STGC_RawDataToPrepDataTool(const std::string& t, const std::string& n, const IInterface* p) - : AthAlgTool(t, n, p), - m_muonMgr(0), - m_rawDataProviderTool("Muon::sTGC_RawDataProviderTool/sTGC_RawDataProviderTool"), - m_RDO_Key("sTGCRDO"), - m_PRD_Key("sTGC_Measurements") -{ - declareProperty("RawDataProviderTool", m_rawDataProviderTool); - declareProperty("RDOContainer", m_RDO_Key); - declareProperty("OutputCollection", m_PRD_Key); -} - -//================ Destructor ================================================= - -Muon::STGC_RawDataToPrepDataTool::~STGC_RawDataToPrepDataTool() -{} - -//___________________________________________________________________________ -StatusCode Muon::STGC_RawDataToPrepDataTool::queryInterface(const InterfaceID& riid, void** ppvIf) -{ - if(riid==IMuonRdoToPrepDataTool::interfaceID()) { - *ppvIf = (IMuonRdoToPrepDataTool*)this; - addRef(); - return StatusCode::SUCCESS; - } - - return AthAlgTool::queryInterface(riid, ppvIf); -} - - -//================ Initialization ================================================= - -StatusCode Muon::STGC_RawDataToPrepDataTool::initialize() -{ - StatusCode sc = AthAlgTool::initialize(); - if(sc.isFailure()) return sc; - - sc = detStore()->retrieve(m_muonMgr); - if(sc.isFailure()) { - ATH_MSG_FATAL("Cannot retrieve MuonDetectorManager"); - return sc; - } - - m_rawDataProviderTool.disable(); // never used??? - - /// get tgcIdHelper from muonMgr - m_sTGC_Helper = m_muonMgr->stgcIdHelper(); - - ATH_CHECK(m_RDO_Key.initialize()); - ATH_CHECK(m_PRD_Key.initialize()); - - ATH_MSG_INFO("initialize() successful in " << name()); - return StatusCode::SUCCESS; -} - -//================ Finalization ================================================= - -StatusCode Muon::STGC_RawDataToPrepDataTool::finalize() -{ - StatusCode sc = AthAlgTool::finalize(); - return sc; -} - -//================ Decoding ================================================= -StatusCode Muon::STGC_RawDataToPrepDataTool::decode(std::vector<IdentifierHash>& requestedIdHashVect, - std::vector<IdentifierHash>& /*selectedIdHashVect*/) -{ - int sizeVectorRequested = requestedIdHashVect.size(); - ATH_MSG_DEBUG("decode for " << sizeVectorRequested << " offline collections called"); - - // clear output vector of selected data collections containing data - // selectedIdHashVect.clear(); - // - // if(!evtStore()->contains<Muon::sTgcPrepDataContainer>( m_PRD_Key )) { - // // initialize with false - // // std::fill(m_decodedOnlineId.begin(), m_decodedOnlineId.end(), false); - // SG::WriteHandle<sTgcPrepDataContainer> handle(m_PRD_Key); - // - // // record the container in storeGate - // auto prds = std::make_unique<sTgcPrepDataContainer> (m_sTGC_Helper->module_hash_max()); - // ATH_CHECK( handle.record (std::move (prds)) ); - // - // // cache the pointer, storegate retains ownership - // sTgcPrepDataContainer* stgcPrepDataContainer = handle.ptr(); - // } - - // seeded or unseeded decoding - // if (sizeVectorRequested != 0) { - // processPRDHashes(idVect,idWithDataVect, *stgcPrepDataContainer); - // } else { - // processRDOContainer(idWithDataVect, *stgcPrepDataContainer); - // } - - return StatusCode::SUCCESS; -} - -void Muon::STGC_RawDataToPrepDataTool::processPRDHashes( const std::vector<IdentifierHash>& chamberHashInRobs, std::vector<IdentifierHash>& idWithDataVect, sTgcPrepDataContainer& prds ){ - - // get RDO container - - SG::ReadHandle<STGC_RawDataContainer> rdos(m_RDO_Key); - const STGC_RawDataContainer* rdoContainer = rdos.get(); - - if(!rdoContainer) { - return; - } - - for( auto it = chamberHashInRobs.begin(); it != chamberHashInRobs.end(); ++it ){ - if(!handlePRDHash(*it,*rdoContainer,idWithDataVect, prds) ) { - ATH_MSG_DEBUG("Failed to process hash " << *it ); - } - }//ends loop over chamberhash -} - -bool Muon::STGC_RawDataToPrepDataTool::handlePRDHash( IdentifierHash /*hash*/, const STGC_RawDataContainer& /*rdoContainer*/, std::vector<IdentifierHash>& /*idWithDataVect*/, sTgcPrepDataContainer& /*prds*/ ) { - - // if in prep data the chamber already exists ... do nothing - // if( m_mdtPrepDataContainer->indexFind(hash) != m_mdtPrepDataContainer->end() ) return true; - // - // IdentifierHash rdoHash = hash; // before BMEs were installed, RDOs were indexed by offline hashes (same as PRD) - // // process CSM if data was found - // STGC_RawDataContainer::const_iterator rdoColli = rdoContainer.indexFind(rdoHash); - // if( rdoColli != rdoContainer.end() ) { - // rdoColli->push_back(new STGC_RawData() ); - // } else { - // ATH_MSG_DEBUG("handlePRDHash: hash id " << (unsigned int)(hash) << " not found in RDO container"); - // } - return true; -} - -void Muon::STGC_RawDataToPrepDataTool::printPrepData() { - -} - -void Muon::STGC_RawDataToPrepDataTool::printInputRdo() { - -} - diff --git a/MuonSpectrometer/MuonCnv/MuonSTGC_CnvTools/src/STGC_RawDataToPrepDataTool.h b/MuonSpectrometer/MuonCnv/MuonSTGC_CnvTools/src/STGC_RawDataToPrepDataTool.h deleted file mode 100644 index 36215e66e76185b51693a34342c1d542c363785f..0000000000000000000000000000000000000000 --- a/MuonSpectrometer/MuonCnv/MuonSTGC_CnvTools/src/STGC_RawDataToPrepDataTool.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -/////////////////////////////////////////////////////////////////// -// STGC_RawDataToPrepDataTool.h, (c) ATLAS Detector software -/////////////////////////////////////////////////////////////////// -#ifndef MUONATGC_CNVTOOLS_STGC_RAWDATATOPREPDATATOOL -#define MUONATGC_CNVTOOLS_STGC_RAWDATATOPREPDATATOOL - -#include "AthenaBaseComps/AthAlgTool.h" -#include "MuonCnvToolInterfaces/IMuonRdoToPrepDataTool.h" -#include <string> - -#include "GaudiKernel/ToolHandle.h" -#include "MuonRDO/STGC_RawDataContainer.h" -#include "MuonPrepRawData/sTgcPrepDataContainer.h" - -class AtlasDetectorID; -class Identifier; - -class ITGCcablingSvc; -class sTgcIdHelper; - -namespace MuonGM -{ - class MuonDetectorManager; - class TgcReadoutElement; -} - -namespace Muon -{ - class IMuonRawDataProviderTool; - - /** @class STGC_RawDataToPrepDataTool - * This is the algorithm that convert STGC Raw data To STGC PRD as a tool. - */ - - class STGC_RawDataToPrepDataTool : virtual public IMuonRdoToPrepDataTool, virtual public AthAlgTool - { - public: - /** Constructor */ - STGC_RawDataToPrepDataTool(const std::string& t, const std::string& n, const IInterface* p); - - /** Destructor */ - virtual ~STGC_RawDataToPrepDataTool(); - - /** Query the IMuonRdoToPrepDataTool interface */ - virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvIf) override; - - /** Standard AthAlgTool initialize method */ - virtual StatusCode initialize() override; - /** Standard AthAlgTool finalize method */ - virtual StatusCode finalize() override; - - /** Decode RDO to PRD - * A vector of IdentifierHash are passed in, and the data corresponding to this list (i.e. in a Region of Interest) are converted. - * @param requestedIdHashVect Vector of hashes to convert i.e. the hashes of ROD collections in a 'Region of Interest' - * @return selectedIdHashVect This is the subset of requestedIdVect which were actually found to contain data - * (i.e. if you want you can use this vector of hashes to optimise the retrieval of data in subsequent steps.) */ - virtual StatusCode decode(std::vector<IdentifierHash>& idVect, std::vector<IdentifierHash>& idWithDataVect) override; - - virtual void printPrepData() override; - virtual void printInputRdo() override; - - /** Resolve possible conflicts with IProperty::interfaceID() */ - static const InterfaceID& interfaceID() { return IMuonRdoToPrepDataTool::interfaceID(); } - - private: - - void processPRDHashes( const std::vector<IdentifierHash>& chamberHashInRobs, std::vector<IdentifierHash>& idWithDataVect, sTgcPrepDataContainer& prds ); - bool handlePRDHash( IdentifierHash hash, const STGC_RawDataContainer& rdoContainer, std::vector<IdentifierHash>& idWithDataVect, sTgcPrepDataContainer& prds ); - - /** muon detector manager */ - const MuonGM::MuonDetectorManager * m_muonMgr; - - /** TGC identifier helper */ - const sTgcIdHelper* m_sTGC_Helper; - - /** TgcPrepRawData container key for current BC */ - std::string m_outputCollectionLocation; - - /** ToolHandle of the TGC_RawDataProviderTool */ - ToolHandle<IMuonRawDataProviderTool> m_rawDataProviderTool; - - SG::ReadHandleKey<STGC_RawDataContainer> m_RDO_Key;//"TGCRDO" - SG::WriteHandleKey<sTgcPrepDataContainer> m_PRD_Key; - - /** Aboid compiler warning **/ - virtual StatusCode decode( const std::vector<uint32_t>& /*robIds*/ ) override {return StatusCode::FAILURE;} - }; -} // end of namespace - -#endif // MUONTGC_CNVTOOLS_TGCRDOTOPREPDATATOOL_H diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/CMakeLists.txt b/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/CMakeLists.txt index 89f5eb2eeb23da78a3f02d1cc6a754069cc7711a..06bed786bed53599309dd6b39e7bae34d668fce4 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/CMakeLists.txt +++ b/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/CMakeLists.txt @@ -21,7 +21,7 @@ atlas_depends_on_subdirs( PUBLIC # Component(s) in the package: atlas_add_poolcnv_library( MuonSimEventAthenaPoolPoolCnv src/*.cxx - FILES MuonSimEvent/CSCSimHitCollection.h MuonSimEvent/MDTSimHitCollection.h MuonSimEvent/RPCSimHitCollection.h MuonSimEvent/TGCSimHitCollection.h MuonSimEvent/GenericMuonSimHitCollection.h + FILES MuonSimEvent/CSCSimHitCollection.h MuonSimEvent/MDTSimHitCollection.h MuonSimEvent/RPCSimHitCollection.h MuonSimEvent/TGCSimHitCollection.h MuonSimEvent/GenericMuonSimHitCollection.h MuonSimEvent/sTGCSimHitCollection.h LINK_LIBRARIES AthenaPoolUtilities AtlasSealCLHEP StoreGateLib SGtests AthenaPoolCnvSvcLib GaudiKernel MuonSimEventTPCnv MuonSimEvent HitManagement ) # Install files from the package: diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/src/sTGCSimHitCollectionCnv.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/src/sTGCSimHitCollectionCnv.cxx new file mode 100644 index 0000000000000000000000000000000000000000..1a40012864915373472378da6c1d5bf048674c65 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/src/sTGCSimHitCollectionCnv.cxx @@ -0,0 +1,56 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#include "sTGCSimHitCollectionCnv.h" + +// Gaudi +#include "GaudiKernel/StatusCode.h" +#include "GaudiKernel/MsgStream.h" + +// Athena +#include "StoreGate/StoreGateSvc.h" + +#include "MuonSimEvent/sTGCSimHitCollection.h" +#include "MuonSimEventTPCnv/sTGCSimHitCollection_p2.h" +#include "HitManagement/AthenaHitsVector.h" //for back-compatibility + + +sTGCSimHitCollectionCnv::sTGCSimHitCollectionCnv(ISvcLocator* svcloc) : + sTGCSimHitCollectionCnvBase(svcloc) +{ +} + +sTGCSimHitCollectionCnv::~sTGCSimHitCollectionCnv() { +} + +sTGCSimHitCollection_PERS* sTGCSimHitCollectionCnv::createPersistent (sTGCSimHitCollection* transCont) { + MsgStream log(msgSvc(), "sTGCSimHitCollectionCnv" ); + ATH_MSG_DEBUG("createPersistent(): main converter"); + sTGCSimHitCollection_PERS *pixdc_p= m_TPConverter_p1.createPersistent( transCont, log ); + return pixdc_p; +} + +sTGCSimHitCollection* sTGCSimHitCollectionCnv::createTransient() { + MsgStream log(msgSvc(), "sTGCSimHitCollectionCnv" ); + static pool::Guid p1_guid("f8b975d2-8130-11e8-abf4-4b4a6a2b6ee5"); + static pool::Guid p2_guid("b9521cc6-6e3b-11e8-adbb-02163e01bddd"); + + ATH_MSG_DEBUG("createTransient(): main converter"); + sTGCSimHitCollection* p_collection(0); + if( compareClassGuid(p2_guid) ) { + ATH_MSG_DEBUG("createTransient(): T/P version 2 detected"); + std::auto_ptr< Muon::sTGCSimHitCollection_p2 > col_vect( this->poolReadObject< Muon::sTGCSimHitCollection_p2 >() ); + p_collection = m_TPConverter_p2.createTransient( col_vect.get(), log ); + } else if( compareClassGuid(p1_guid) ) { + ATH_MSG_DEBUG("createTransient(): T/P version 1 detected"); + std::auto_ptr< Muon::sTGCSimHitCollection_p1 > col_vect( this->poolReadObject< Muon::sTGCSimHitCollection_p1 >() ); + p_collection = m_TPConverter_p1.createTransient( col_vect.get(), log ); + } + //---------------------------------------------------------------- + else { + throw std::runtime_error("Unsupported persistent version of sTGCSimHitCollection"); + + } + return p_collection; +} diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/src/sTGCSimHitCollectionCnv.h b/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/src/sTGCSimHitCollectionCnv.h new file mode 100644 index 0000000000000000000000000000000000000000..8af520f0ae76e69a3070c438fffc02b1cb0e0056 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/src/sTGCSimHitCollectionCnv.h @@ -0,0 +1,48 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef MUONSIMEVENTATHENAPOOL_STGCSIMHITCOLLECTIONCNV_H +#define MUONSIMEVENTATHENAPOOL_STGCSIMHITCOLLECTIONCNV_H + +#include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" +#include "MuonSimEvent/sTGCSimHitCollection.h" + +#include "MuonSimEventTPCnv/sTGCSimHitCollectionCnv_p1.h" +#include "MuonSimEventTPCnv/sTGCSimHitCollectionCnv_p2.h" + +/** + ** The _p2 converter was added to support HepMcParticleLink_p2 in 21.3. + ** As of 2018-09-24, HepMcParticleLink_p2 is not fully supported in master. + ** Therefore, the default is set to _p2, while the _p2 is provided + ** in case of it is needed in the future. + ** -chav.chhiv.Chau@cern.ch + **/ + +// the latest persistent representation type of DataCollection: +typedef Muon::sTGCSimHitCollection_p1 sTGCSimHitCollection_PERS; +typedef T_AthenaPoolCustomCnv<sTGCSimHitCollection, sTGCSimHitCollection_PERS > sTGCSimHitCollectionCnvBase; + +/** + ** Create derived converter to customize the saving of identifiable + ** container + **/ +class sTGCSimHitCollectionCnv : + public sTGCSimHitCollectionCnvBase +{ + + friend class CnvFactory<sTGCSimHitCollectionCnv>; + +public: + sTGCSimHitCollectionCnv(ISvcLocator* svcloc); + virtual ~sTGCSimHitCollectionCnv(); + + virtual sTGCSimHitCollection_PERS* createPersistent (sTGCSimHitCollection* transCont); + virtual sTGCSimHitCollection* createTransient (); + +private: + sTGCSimHitCollectionCnv_p1 m_TPConverter_p1; + sTGCSimHitCollectionCnv_p2 m_TPConverter_p2; +}; + +#endif diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/CMakeLists.txt b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/CMakeLists.txt index 7af2c991716e4f63b75cfdb96b5665129c32f438..e8888b3c98a4e120c50ba1bb5762efc49a1b50f0 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/CMakeLists.txt +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/CMakeLists.txt @@ -100,3 +100,20 @@ 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( sTGCSimHitCollectionCnv_p1_test + SOURCES + test/sTGCSimHitCollectionCnv_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( sTGCSimHitCollectionCnv_p2_test + SOURCES + test/sTGCSimHitCollectionCnv_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 ) diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/MuonSimEventTPCnv/MuonSimEventTPCnvDict.h b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/MuonSimEventTPCnv/MuonSimEventTPCnvDict.h index 221ccb5464b4cfa36c6bbb32b781fbbfe205ce80..5d9bf5a5b8a7d61bce75ab1fe1327f7ba2c030c5 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/MuonSimEventTPCnv/MuonSimEventTPCnvDict.h +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/MuonSimEventTPCnv/MuonSimEventTPCnvDict.h @@ -26,5 +26,7 @@ #include "MuonSimEventTPCnv/MDTSimHitCollection_p3.h" #include "MuonSimEventTPCnv/GenericMuonSimHitCollection_p1.h" #include "MuonSimEventTPCnv/GenericMuonSimHitCollection_p2.h" +#include "MuonSimEventTPCnv/sTGCSimHitCollection_p1.h" +#include "MuonSimEventTPCnv/sTGCSimHitCollection_p2.h" #endif // MUONSIMEVENTTPCNV_MUONSIMEVENTTPCNVDICT_H diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/MuonSimEventTPCnv/sTGCSimHitCollectionCnv_p1.h b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/MuonSimEventTPCnv/sTGCSimHitCollectionCnv_p1.h new file mode 100644 index 0000000000000000000000000000000000000000..71de9ab1444342e4eb1ea19804a044141c4d7309 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/MuonSimEventTPCnv/sTGCSimHitCollectionCnv_p1.h @@ -0,0 +1,29 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef sTGCSimHitCOLLECTIONCNV_P1_H +#define sTGCSimHitCOLLECTIONCNV_P1_H + +#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h" +#include "MuonSimEvent/sTGCSimHitCollection.h" +#include "sTGCSimHitCollection_p1.h" + +class sTGCSimHitCollectionCnv_p1 : public T_AthenaPoolTPCnvBase<sTGCSimHitCollection, Muon::sTGCSimHitCollection_p1> +{ + public: + + sTGCSimHitCollectionCnv_p1() {}; + + virtual sTGCSimHitCollection* createTransient(const Muon::sTGCSimHitCollection_p1* persObj, MsgStream &log); + virtual void persToTrans(const Muon::sTGCSimHitCollection_p1* persCont, + sTGCSimHitCollection* transCont, + MsgStream &log) ; + virtual void transToPers(const sTGCSimHitCollection* transCont, + Muon::sTGCSimHitCollection_p1* persCont, + MsgStream &log) ; + +}; + +#endif + diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/MuonSimEventTPCnv/sTGCSimHitCollectionCnv_p2.h b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/MuonSimEventTPCnv/sTGCSimHitCollectionCnv_p2.h new file mode 100644 index 0000000000000000000000000000000000000000..ca26114f46eadbc042d99f265ab9c550c89821ec --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/MuonSimEventTPCnv/sTGCSimHitCollectionCnv_p2.h @@ -0,0 +1,37 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef sTGCSimHitCOLLECTIONCNV_P2_H +#define sTGCSimHitCOLLECTIONCNV_P2_H + +#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h" +#include "MuonSimEvent/sTGCSimHitCollection.h" +#include "sTGCSimHitCollection_p2.h" + +/** + ** The _p2 converter was added to support HepMcParticleLink_p2 in 21.3. + ** As of 2018-09-24, HepMcParticleLink_p2 is not fully supported in master. + ** Therefore, the default is set to _p2, while the _p2 is provided + ** in case of it is needed in the future. + ** -chav.chhiv.Chau@cern.ch + **/ + +class sTGCSimHitCollectionCnv_p2 : public T_AthenaPoolTPCnvBase<sTGCSimHitCollection, Muon::sTGCSimHitCollection_p2> +{ + public: + + sTGCSimHitCollectionCnv_p2() {}; + + virtual sTGCSimHitCollection* createTransient(const Muon::sTGCSimHitCollection_p2* persObj, MsgStream &log); + virtual void persToTrans(const Muon::sTGCSimHitCollection_p2* persCont, + sTGCSimHitCollection* transCont, + MsgStream &log) ; + virtual void transToPers(const sTGCSimHitCollection* transCont, + Muon::sTGCSimHitCollection_p2* persCont, + MsgStream &log) ; + +}; + +#endif + diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/MuonSimEventTPCnv/sTGCSimHitCollection_p1.h b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/MuonSimEventTPCnv/sTGCSimHitCollection_p1.h new file mode 100644 index 0000000000000000000000000000000000000000..6e114a4ce4d56e97ab57b7ee247eaea31c3a820a --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/MuonSimEventTPCnv/sTGCSimHitCollection_p1.h @@ -0,0 +1,28 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef STGCSIMHITCOLLECTION_P1_H +#define STGCSIMHITCOLLECTION_P1_H + +#include <vector> +#include "GeneratorObjectsTPCnv/HepMcParticleLink_p1.h" + +namespace Muon { + class sTGCSimHitCollection_p1 + { + public: + std::vector<int> m_sTGCId; + std::vector<float> m_globalTime; + //postStep + std::vector<float> m_stX, m_stY, m_stZ; //!< Represents m_globalPosition in transient class + std::vector<int> m_particleEncoding; + std::vector<float> m_ptX, m_ptY, m_ptZ; + std::vector<float> m_depositEnergy; + + std::vector<HepMcParticleLink_p1> m_partLink; + }; +} + +#endif + diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/MuonSimEventTPCnv/sTGCSimHitCollection_p2.h b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/MuonSimEventTPCnv/sTGCSimHitCollection_p2.h new file mode 100644 index 0000000000000000000000000000000000000000..183f94bb0f65a2241fc0c6e074cf3522e790c71a --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/MuonSimEventTPCnv/sTGCSimHitCollection_p2.h @@ -0,0 +1,28 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef STGCSIMHITCOLLECTION_P2_H +#define STGCSIMHITCOLLECTION_P2_H + +#include <vector> +#include "GeneratorObjectsTPCnv/HepMcParticleLink_p2.h" + +namespace Muon { + class sTGCSimHitCollection_p2 + { + public: + std::vector<int> m_sTGCId; + std::vector<float> m_globalTime; + //postStep + std::vector<float> m_stX, m_stY, m_stZ; //!< Represents m_globalPosition in transient class + std::vector<int> m_particleEncoding; + std::vector<float> m_ptX, m_ptY, m_ptZ; + std::vector<float> m_depositEnergy; + + std::vector<HepMcParticleLink_p2> m_partLink; + }; +} + +#endif + diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/MuonSimEventTPCnv/selection.xml b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/MuonSimEventTPCnv/selection.xml index d74f21e15d50135ea329a2737b1e1268aa546fcb..7f677273108c9f4fa066180d8b6030406bf07fbd 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/MuonSimEventTPCnv/selection.xml +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/MuonSimEventTPCnv/selection.xml @@ -18,5 +18,7 @@ <class name="Muon::MDTSimHitCollection_p3" id="0E9EEEE2-304F-44B8-B1DF-E75297183A02"/> <class name="Muon::GenericMuonSimHitCollection_p1" id="C2D5D558-2671-11E1-AAFA-001E4F3E5646"/> <class name="Muon::GenericMuonSimHitCollection_p2" id="3760C0D8-C7EA-42C7-925A-E841196F2138"/> + <class name="Muon::sTGCSimHitCollection_p1" id="f8b975d2-8130-11e8-abf4-4b4a6a2b6ee5"/> + <class name="Muon::sTGCSimHitCollection_p2" id="b9521cc6-6e3b-11e8-adbb-02163e01bddd"/> </lcgdict> diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/sTGCSimHitCollectionCnv_p1.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/sTGCSimHitCollectionCnv_p1.cxx new file mode 100644 index 0000000000000000000000000000000000000000..1742c906ccbf0f6e80b41e2ea2a7f7f38753da7a --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/sTGCSimHitCollectionCnv_p1.cxx @@ -0,0 +1,86 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#include "MuonSimEvent/sTGCSimHit.h" +#include "MuonSimEventTPCnv/sTGCSimHitCollectionCnv_p1.h" +#include "MuonSimEventTPCnv/sTGCSimHitCollection_p1.h" +#include "GeneratorObjectsTPCnv/HepMcParticleLinkCnv_p1.h" + +//#include <cmath> +#include "GeoPrimitives/GeoPrimitives.h" + +// Gaudi +#include "GaudiKernel/MsgStream.h" +// Athena +#include "StoreGate/StoreGateSvc.h" + +void sTGCSimHitCollectionCnv_p1::transToPers(const sTGCSimHitCollection* transCont, Muon::sTGCSimHitCollection_p1* persCont, MsgStream &log) +{ + // 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_p1 hepMcPLCnv; + HepMcParticleLink_p1 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); + + } +} + + +sTGCSimHitCollection* sTGCSimHitCollectionCnv_p1::createTransient(const Muon::sTGCSimHitCollection_p1* persObj, MsgStream &log) { + std::auto_ptr<sTGCSimHitCollection> trans(new sTGCSimHitCollection("DefaultCollectionName",persObj->m_globalTime.size())); + persToTrans(persObj, trans.get(), log); + return(trans.release()); +} + + +void sTGCSimHitCollectionCnv_p1::persToTrans(const Muon::sTGCSimHitCollection_p1* persCont, sTGCSimHitCollection* transCont, MsgStream &log) +{ + HepMcParticleLinkCnv_p1 hepMcPLCnv; + + //transCont->reserve(persCont->m_sTGCId.size());//done in createTransient + 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]); + + HepMcParticleLink link; + 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/src/sTGCSimHitCollectionCnv_p2.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/sTGCSimHitCollectionCnv_p2.cxx new file mode 100644 index 0000000000000000000000000000000000000000..759962a38052f55a83108f5fae54717b170e5b2d --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/sTGCSimHitCollectionCnv_p2.cxx @@ -0,0 +1,50 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#include "MuonSimEvent/sTGCSimHit.h" +#include "MuonSimEventTPCnv/sTGCSimHitCollectionCnv_p2.h" +#include "MuonSimEventTPCnv/sTGCSimHitCollection_p2.h" +#include "GeneratorObjectsTPCnv/HepMcParticleLinkCnv_p2.h" + +//#include <cmath> +#include "GeoPrimitives/GeoPrimitives.h" + +// Gaudi +#include "GaudiKernel/MsgStream.h" +// Athena +#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*/ ) +{ + throw std::runtime_error("sTGCSimHitCollectionCnv_p2::transToPers is not supported in this release!"); +} + + +sTGCSimHitCollection* sTGCSimHitCollectionCnv_p2::createTransient(const Muon::sTGCSimHitCollection_p2* persObj, MsgStream &log) { + std::auto_ptr<sTGCSimHitCollection> trans(new sTGCSimHitCollection("DefaultCollectionName",persObj->m_globalTime.size())); + persToTrans(persObj, trans.get(), log); + return(trans.release()); +} + + +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++) { + //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]); + + HepMcParticleLink link; + 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/sTGCSimHitCollectionCnv_p1_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/sTGCSimHitCollectionCnv_p1_test.cxx new file mode 100644 index 0000000000000000000000000000000000000000..7e5f395c4a07d71db57f58dcabe4b531dbc7f34c --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/sTGCSimHitCollectionCnv_p1_test.cxx @@ -0,0 +1,108 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id$ +/** + * @file MuonSimEventTPCnv/test/sTGCSimHitCollectionCnv_p1_test.cxx + * @author Jing Chen <jing.chen@cern.ch> + * @date Jul, 2018 + * @brief Tests for sTGCSimHitCollectionCnv_p1. + */ + + +#undef NDEBUG +#include "MuonSimEventTPCnv/sTGCSimHitCollectionCnv_p1.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 sTGCSimHit& p1, + const sTGCSimHit& p2) +{ + assert (p1.sTGCId() == p2.sTGCId()); + assert (p1.globalTime() == p2.globalTime()); + assert (p1.globalPosition() == p2.globalPosition()); + assert (p1.particleEncoding() == p2.particleEncoding()); + assert (p1.globalDirection() == p2.globalDirection()); + assert (p1.depositEnergy() == p2.depositEnergy()); + compare(p1.particleLink(), p2.particleLink()); + assert (p1.particleLink() == p2.particleLink()); +} + + +void compare (const sTGCSimHitCollection& p1, + const sTGCSimHitCollection& 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 sTGCSimHitCollection& trans1) +{ + MsgStream log (0, "test"); + sTGCSimHitCollectionCnv_p1 cnv; + Muon::sTGCSimHitCollection_p1 pers; + cnv.transToPers (&trans1, &pers, log); + sTGCSimHitCollection 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. + sTGCSimHitCollection dum ("coll"); + Athena_test::Leakcheck check; + + sTGCSimHitCollection trans1 ("coll"); + for (int i=0; i < 10; i++) { + const HepMC::GenParticle* pGenParticle = genPartVector.at(i); + 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() + ); + } + + 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_p2_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/sTGCSimHitCollectionCnv_p2_test.cxx new file mode 100644 index 0000000000000000000000000000000000000000..6e753630b8dde5254b249b9c7b9669186b1dc4e7 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/sTGCSimHitCollectionCnv_p2_test.cxx @@ -0,0 +1,117 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id$ +/** + * @file MuonSimEventTPCnv/test/sTGCSimHitCollectionCnv_p2_test.cxx + * @author Jing Chen <jing.chen@cern.ch> + * @date Jul, 2018 + * @brief Tests for sTGCSimHitCollectionCnv_p2. + */ + +/** + ** The _p2 converter was added to support HepMcParticleLink_p2 in 21.3. + ** As of 2018-09-24, HepMcParticleLink_p2 is not fully supported in master. + ** Therefore, the default is set to _p2, while the _p2 is provided + ** in case of it is needed in the future. + ** -chav.chhiv.Chau@cern.ch + **/ + + +#undef NDEBUG +#include "MuonSimEventTPCnv/sTGCSimHitCollectionCnv_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 sTGCSimHit& p1, + const sTGCSimHit& p2) +{ + assert (p1.sTGCId() == p2.sTGCId()); + assert (p1.globalTime() == p2.globalTime()); + assert (p1.globalPosition() == p2.globalPosition()); + assert (p1.particleEncoding() == p2.particleEncoding()); + assert (p1.globalDirection() == p2.globalDirection()); + assert (p1.depositEnergy() == p2.depositEnergy()); + compare(p1.particleLink(), p2.particleLink()); + assert (p1.particleLink() == p2.particleLink()); +} + + +void compare (const sTGCSimHitCollection& p1, + const sTGCSimHitCollection& 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]); +} + +//** The test is empty because sTGCSimHitCollectionCnv_p2 +//** is not supported yet +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); +} + + +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. + sTGCSimHitCollection dum ("coll"); + Athena_test::Leakcheck check; + + sTGCSimHitCollection trans1 ("coll"); + for (int i=0; i < 10; i++) { + const HepMC::GenParticle* pGenParticle = genPartVector.at(i); + 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() + ); + } + + 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/MuonDigitization/sTGC_Digitization/python/sTGC_DigitizationConfig.py b/MuonSpectrometer/MuonDigitization/sTGC_Digitization/python/sTGC_DigitizationConfig.py index 56d94f91ae3a4c62f8c432fdf295c8c639179658..d156a5f5c42a2b57b9008554316594a41ff60a9c 100644 --- a/MuonSpectrometer/MuonDigitization/sTGC_Digitization/python/sTGC_DigitizationConfig.py +++ b/MuonSpectrometer/MuonDigitization/sTGC_Digitization/python/sTGC_DigitizationConfig.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration # # Import sTGC_Digitization job properties @@ -38,5 +38,5 @@ def getSTGCRange(name="sTgcRange", **kwargs): kwargs.setdefault('FirstXing', sTGC_FirstXing() ) kwargs.setdefault('LastXing', sTGC_LastXing() ) kwargs.setdefault('CacheRefreshFrequency', 1.0 ) #default 0 no dataproxy reset - kwargs.setdefault('ItemList', ["GenericMuonSimHitCollection#sTGCSensitiveDetector"] ) + kwargs.setdefault('ItemList', ["sTGCSimHitCollection#sTGCSensitiveDetector"] ) return CfgMgr.PileUpXingFolder(name, **kwargs) diff --git a/MuonSpectrometer/MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcDigitMaker.h b/MuonSpectrometer/MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcDigitMaker.h index 3a4f47939307a3e5895917d3c750d8925be31512..8bdfb26d849ca222af6a4a31ef6b79ad2231cc53 100644 --- a/MuonSpectrometer/MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcDigitMaker.h +++ b/MuonSpectrometer/MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcDigitMaker.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ // sTgcDigitMaker.h @@ -36,7 +36,7 @@ namespace MuonGM { class sTgcDigitCollection; class sTgcHitIdHelper; class sTgcIdHelper; -class GenericMuonSimHit; +class sTGCSimHit; //--- class description class sTgcDigitMaker { @@ -53,7 +53,7 @@ class sTgcDigitMaker { */ StatusCode initialize(CLHEP::HepRandomEngine* m_rndmEngine, const int channelTypes); - sTgcDigitCollection* executeDigi(const GenericMuonSimHit* hit, const float globalHitTime); + sTgcDigitCollection* executeDigi(const sTGCSimHit* hit, const float globalHitTime); //Declaring the Message method for further use MsgStream& msg(const MSG::Level lvl) const { return m_msg << lvl ; } diff --git a/MuonSpectrometer/MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcDigitizationTool.h b/MuonSpectrometer/MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcDigitizationTool.h index ba65c4567016f5c43479acd39825cba7559551d2..5a0a89192da37188495d4cf2bea8e1cdae8be170 100644 --- a/MuonSpectrometer/MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcDigitizationTool.h +++ b/MuonSpectrometer/MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcDigitizationTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef MUONDIGITIZATION_STGC_DIGITIZATIONTOOL_H @@ -20,8 +20,8 @@ #include "AthenaKernel/IAtRndmGenSvc.h" #include "HitManagement/TimedHitCollection.h" #include "Identifier/Identifier.h" -#include "MuonSimEvent/GenericMuonSimHitCollection.h" -#include "MuonSimEvent/GenericMuonSimHit.h" +#include "MuonSimEvent/sTGCSimHitCollection.h" +#include "MuonSimEvent/sTGCSimHit.h" #include "xAODEventInfo/EventInfo.h" #include "xAODEventInfo/EventAuxInfo.h" @@ -135,9 +135,9 @@ private: const sTgcIdHelper* m_idHelper; const MuonGM::MuonDetectorManager* m_mdManager; sTgcDigitMaker* m_digitizer; - TimedHitCollection<GenericMuonSimHit>* m_thpcsTGC; + TimedHitCollection<sTGCSimHit>* m_thpcsTGC; MuonSimDataCollection* m_sdoContainer; - std::list<GenericMuonSimHitCollection*> m_STGCHitCollList; + std::list<sTGCSimHitCollection*> m_STGCHitCollList; std::string m_inputHitCollectionName; // name of the input objects std::string m_outputDigitCollectionName; // name of the output digits diff --git a/MuonSpectrometer/MuonDigitization/sTGC_Digitization/src/sTgcDigitMaker.cxx b/MuonSpectrometer/MuonDigitization/sTGC_Digitization/src/sTgcDigitMaker.cxx index 13b0a9df94ca11581813c6717194b0f391461db1..2028934a2a6a7f0e629f531f8c3037b69bd97ce6 100644 --- a/MuonSpectrometer/MuonDigitization/sTGC_Digitization/src/sTgcDigitMaker.cxx +++ b/MuonSpectrometer/MuonDigitization/sTGC_Digitization/src/sTgcDigitMaker.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ //////////////////////////////////////////////////////////////////////////////// @@ -19,7 +19,7 @@ #include <fstream> #include "MuonDigitContainer/sTgcDigitCollection.h" -#include "MuonSimEvent/GenericMuonSimHit.h" +#include "MuonSimEvent/sTGCSimHit.h" #include "MuonSimEvent/sTgcHitIdHelper.h" #include "MuonSimEvent/sTgcSimIdToOfflineId.h" #include "MuonIdHelpers/sTgcIdHelper.h" @@ -119,7 +119,7 @@ StatusCode sTgcDigitMaker::initialize(CLHEP::HepRandomEngine *rndmEngine, const //--------------------------------------------------- // Execute Digitization //--------------------------------------------------- -sTgcDigitCollection* sTgcDigitMaker::executeDigi(const GenericMuonSimHit* hit, const float /*globalHitTime*/) +sTgcDigitCollection* sTgcDigitMaker::executeDigi(const sTGCSimHit* hit, const float /*globalHitTime*/) { // check the digitization channel type @@ -133,7 +133,7 @@ sTgcDigitCollection* sTgcDigitMaker::executeDigi(const GenericMuonSimHit* hit, c ////////// convert ID for this digitizer system sTgcSimIdToOfflineId simToOffline(*m_idHelper); - int simId = hit->GenericId(); + int simId = hit->sTGCId(); Identifier layid = simToOffline.convert(simId); ATH_MSG_VERBOSE("sTgc hit: time " << hit->globalTime() << " position " << hit->globalPosition().x() << " " << hit->globalPosition().y() << " " << hit->globalPosition().z() << " mclink " << hit->particleLink() << " PDG ID " << hit->particleEncoding() ); diff --git a/MuonSpectrometer/MuonDigitization/sTGC_Digitization/src/sTgcDigitizationTool.cxx b/MuonSpectrometer/MuonDigitization/sTGC_Digitization/src/sTgcDigitizationTool.cxx index 90fdd5104ab5e677ffcce9037749fd924955c24e..71b8681379ea89fd0ff3aee45c51ef125b563096 100644 --- a/MuonSpectrometer/MuonDigitization/sTGC_Digitization/src/sTgcDigitizationTool.cxx +++ b/MuonSpectrometer/MuonDigitization/sTGC_Digitization/src/sTgcDigitizationTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ //////////////////////////////////////////////////////////////////////////////// @@ -79,7 +79,7 @@ typedef struct { } structReadoutElement; typedef std::map<Identifier,std::pair<structReadoutElement, std::vector<tempDigitType> > > tempDigitCollectionType; // map<ReadoutElementID, pair< read or not, all DigitObject with the identical ReadoutElementId but at different time>>; for the int(read or not) : 0 --> do not read this strip, 1 --> turned on by neighborOn mode; 2 --> this channel has signal over threshold typedef std::map<IdentifierHash, tempDigitCollectionType> tempDigitContainerType; // use IdentifierHashId, similar structure as the <sTgcDigitCollection> -typedef std::map<GenericMuonSimHit*, int> tempHitEventMap; // use IdentifierHashId, similar structure as the <sTgcDigitCollection> +typedef std::map<sTGCSimHit*, int> tempHitEventMap; // use IdentifierHashId, similar structure as the <sTgcDigitCollection> inline bool sort_EarlyToLate(tempDigitType a, tempDigitType b){ return a.first < b.first; @@ -285,15 +285,6 @@ StatusCode sTgcDigitizationTool::prepareEvent(unsigned int nInputEvents) { ATH_MSG_DEBUG("sTgcDigitizationTool::prepareEvent() called for " << nInputEvents << " input events" ); m_STGCHitCollList.clear(); - //m_thpcsTGC = new TimedHitCollection<GenericMuonSimHit>(); - - //Perform null check on m_thpcsTGC. If pointer is not null throw error - // if(!m_thpcsTGC) { - // m_thpcsTGC = new TimedHitCollection<GenericMuonSimHit>(); - //}else{ - // ATH_MSG_ERROR ( "m_thpcsTGC is not null" ); - // return StatusCode::FAILURE; - //} return StatusCode::SUCCESS; } @@ -304,10 +295,10 @@ StatusCode sTgcDigitizationTool::processBunchXing(int bunchXing, SubEventIterator eSubEvents) { ATH_MSG_DEBUG ( "sTgcDigitizationTool::in processBunchXing()" ); if(!m_thpcsTGC) { - m_thpcsTGC = new TimedHitCollection<GenericMuonSimHit>(); + m_thpcsTGC = new TimedHitCollection<sTGCSimHit>(); } - typedef PileUpMergeSvc::TimedList<GenericMuonSimHitCollection>::type TimedHitCollList; + typedef PileUpMergeSvc::TimedList<sTGCSimHitCollection>::type TimedHitCollList; TimedHitCollList hitCollList; if (!(m_mergeSvc->retrieveSubSetEvtData(m_inputHitCollectionName, hitCollList, bunchXing, @@ -316,7 +307,7 @@ StatusCode sTgcDigitizationTool::processBunchXing(int bunchXing, ATH_MSG_ERROR("Could not fill TimedHitCollList"); return StatusCode::FAILURE; } else { - ATH_MSG_VERBOSE(hitCollList.size() << " GenericMuonSimHitCollection with key " << + ATH_MSG_VERBOSE(hitCollList.size() << " sTGCSimHitCollection with key " << m_inputHitCollectionName << " found"); } @@ -326,10 +317,10 @@ StatusCode sTgcDigitizationTool::processBunchXing(int bunchXing, // Iterating over the list of collections for( ; iColl != endColl; iColl++){ - GenericMuonSimHitCollection *hitCollPtr = new GenericMuonSimHitCollection(*iColl->second); + sTGCSimHitCollection *hitCollPtr = new sTGCSimHitCollection(*iColl->second); PileUpTimeEventIndex timeIndex(iColl->first); - ATH_MSG_DEBUG("GenericMuonSimHitCollection found with " << hitCollPtr->size() << + ATH_MSG_DEBUG("sTGCSimHitCollection found with " << hitCollPtr->size() << " hits"); ATH_MSG_VERBOSE("time index info. time: " << timeIndex.time() << " index: " << timeIndex.index() @@ -360,9 +351,9 @@ StatusCode sTgcDigitizationTool::getNextEvent() { //m_thpcsTGC = 0; // get the container(s) - typedef PileUpMergeSvc::TimedList<GenericMuonSimHitCollection>::type TimedHitCollList; + typedef PileUpMergeSvc::TimedList<sTGCSimHitCollection>::type TimedHitCollList; - //this is a list<info<time_t, DataLink<GenericMuonSimHitCollection> > > + //this is a list<info<time_t, DataLink<sTGCSimHitCollection> > > TimedHitCollList hitCollList; if (!(m_mergeSvc->retrieveSubEvtsData(m_inputHitCollectionName, hitCollList).isSuccess()) ) { @@ -378,11 +369,11 @@ StatusCode sTgcDigitizationTool::getNextEvent() { } // create a new hits collection - //m_thpcsTGC = new TimedHitCollection<GenericMuonSimHit>() ; + //m_thpcsTGC = new TimedHitCollection<sTGCSimHit>() ; //Perform null check on m_thpcsTGC. If pointer is not null throw error if(!m_thpcsTGC) { - m_thpcsTGC = new TimedHitCollection<GenericMuonSimHit>(); + m_thpcsTGC = new TimedHitCollection<sTGCSimHit>(); }else{ ATH_MSG_ERROR ( "m_thpcsTGC is not null" ); return StatusCode::FAILURE; @@ -392,7 +383,7 @@ StatusCode sTgcDigitizationTool::getNextEvent() { TimedHitCollList::iterator iColl(hitCollList.begin()); TimedHitCollList::iterator endColl(hitCollList.end()); while (iColl != endColl) { - const GenericMuonSimHitCollection* p_collection(iColl->second); + const sTGCSimHitCollection* p_collection(iColl->second); m_thpcsTGC->insert(iColl->first, p_collection); ATH_MSG_DEBUG ( "sTGC SimHitCollection found with " << p_collection->size() << " hits" ); ++iColl; @@ -425,8 +416,8 @@ StatusCode sTgcDigitizationTool::mergeEvent() { m_thpcsTGC = 0; - std::list<GenericMuonSimHitCollection*>::iterator STGCHitColl = m_STGCHitCollList.begin(); - std::list<GenericMuonSimHitCollection*>::iterator STGCHitCollEnd = m_STGCHitCollList.end(); + std::list<sTGCSimHitCollection*>::iterator STGCHitColl = m_STGCHitCollList.begin(); + std::list<sTGCSimHitCollection*>::iterator STGCHitCollEnd = m_STGCHitCollList.end(); while(STGCHitColl!=STGCHitCollEnd) { delete (*STGCHitColl); ++STGCHitColl; @@ -481,7 +472,7 @@ StatusCode sTgcDigitizationTool::digitize() { StatusCode sTgcDigitizationTool::processAllSubEvents() { // StatusCode status = StatusCode::SUCCESS; - //m_thpcsTGC = new TimedHitCollection<GenericMuonSimHit>(); + //m_thpcsTGC = new TimedHitCollection<sTGCSimHit>(); ATH_MSG_DEBUG (" sTgcDigitizationTool::processAllSubEvents()" ); status = recordDigitAndSdoContainers(); @@ -534,7 +525,7 @@ StatusCode sTgcDigitizationTool::doDigitization() { ATH_MSG_DEBUG ("sTgcDigitizationTool::doDigitization()" ); - TimedHitCollection<GenericMuonSimHit>::const_iterator i, e; + TimedHitCollection<sTGCSimHit>::const_iterator i, e; // Collections of digits by digit type associated with a detector element //std::map< IdentifierHash, std::map< Identifier, std::vector<sTgcDigit> > > unmergedPadDigits; @@ -559,16 +550,16 @@ StatusCode sTgcDigitizationTool::doDigitization() { // nextDetectorElement-->sets an iterator range with the hits of current detector element , returns a bool when done while(m_thpcsTGC->nextDetectorElement(i, e)) { -// std::map< Identifier, std::pair< std::pair<double, Amg::Vector3D>, const GenericMuonSimHit*> > merged_SimHit; - std::map< const GenericMuonSimHit*, int > SimHits; //std::map container to associate if this hit came from the signal (0) or pileup (!0) simEvent +// std::map< Identifier, std::pair< std::pair<double, Amg::Vector3D>, const sTGCSimHit*> > merged_SimHit; + std::map< const sTGCSimHit*, int > SimHits; //std::map container to associate if this hit came from the signal (0) or pileup (!0) simEvent int nhits = 0; ATH_MSG_VERBOSE("Next Detector Element"); while(i != e){ //loop through the hits on this Detector Element ATH_MSG_VERBOSE("Looping over hit " << nhits+1 << " on this Detector Element." ); nhits++; - TimedHitPtr<GenericMuonSimHit> phit = *i++; - const GenericMuonSimHit& hit = *phit; + TimedHitPtr<sTGCSimHit> phit = *i++; + const sTGCSimHit& hit = *phit; ATH_MSG_VERBOSE("Hit Particle ID : " << hit.particleEncoding() ); float eventTime = phit.eventTime(); if(eventTime < earliestEventTime) earliestEventTime = eventTime; @@ -584,7 +575,7 @@ StatusCode sTgcDigitizationTool::doDigitization() { msg(MSG::DEBUG) << "This hit came from the in time bunch." << endmsg; } sTgcSimIdToOfflineId simToOffline(*m_idHelper); - const int idHit = hit.GenericId(); + const int idHit = hit.sTGCId(); ATH_MSG_VERBOSE("Hit ID " << idHit ); Identifier layid = simToOffline.convert(idHit); ATH_MSG_VERBOSE("Layer ID[" << layid.getString() << "]"); @@ -652,7 +643,7 @@ StatusCode sTgcDigitizationTool::doDigitization() { ATH_MSG_VERBOSE("Local Hit on Wire Surface " << HITONSURFACE_WIRE ); ATH_MSG_VERBOSE("Global Hit on Wire Surface " << G_HITONSURFACE_WIRE ); - GenericMuonSimHit* wireHit = new GenericMuonSimHit(idHit, (hit.globalTime() + eventTime), eventTime, G_HITONSURFACE_WIRE, HITONSURFACE_WIRE, hit.globalPrePosition(), hit.localPrePosition(), hit.particleEncoding(), hit.kineticEnergy(), hit.globalDirection(), hit.depositEnergy(), hit.StepLength(), hit.trackNumber() ); + sTGCSimHit* wireHit = new sTGCSimHit(idHit, (hit.globalTime() + eventTime), G_HITONSURFACE_WIRE, hit.particleEncoding(), hit.globalDirection(), hit.depositEnergy() , hit.trackNumber() ); SimHits[wireHit] = eventId; //Associate the sub event the hit came from ATH_MSG_VERBOSE("Put hit number " << nhits << " into the map with eventID " << eventId ); } // end of while(i != e) @@ -662,7 +653,7 @@ StatusCode sTgcDigitizationTool::doDigitization() { // Loop over the hits: int hitNum = 0; - typedef std::map< const GenericMuonSimHit*, int >::iterator it_SimHits; + typedef std::map< const sTGCSimHit*, int >::iterator it_SimHits; ATH_MSG_VERBOSE("Digitizing " << SimHits.size() << " hits."); @@ -673,19 +664,15 @@ StatusCode sTgcDigitizationTool::doDigitization() { msg(MSG::ERROR) << "Invalid depositEnergy value " << depositEnergy <<endmsg; continue; } - const GenericMuonSimHit temp_hit = *(it_SimHit->first); - - const GenericMuonSimHit hit(temp_hit.GenericId(), temp_hit.globalTime(), temp_hit.globalpreTime(), - temp_hit.globalPosition(), - temp_hit.localPosition(), - temp_hit.globalPrePosition(), - temp_hit.localPrePosition(), - temp_hit.particleEncoding(), - temp_hit.kineticEnergy(), - temp_hit.globalDirection(), - depositEnergy, - temp_hit.StepLength(), - temp_hit.trackNumber()); + const sTGCSimHit temp_hit = *(it_SimHit->first); + + const sTGCSimHit hit(temp_hit.sTGCId(), temp_hit.globalTime(), + temp_hit.globalPosition(), + temp_hit.particleEncoding(), + temp_hit.globalDirection(), + depositEnergy, + temp_hit.particleLink() + ); float globalHitTime = hit.globalTime(); diff --git a/MuonSpectrometer/MuonG4/MuonG4SD/src/sTGCSensitiveDetector.cxx b/MuonSpectrometer/MuonG4/MuonG4SD/src/sTGCSensitiveDetector.cxx index 3e6fce927f4b3daefe0de11712f0d2de105d8db4..4457342bb306ceccb24e3c59951841a78afb43d0 100755 --- a/MuonSpectrometer/MuonG4/MuonG4SD/src/sTGCSensitiveDetector.cxx +++ b/MuonSpectrometer/MuonG4/MuonG4SD/src/sTGCSensitiveDetector.cxx @@ -18,7 +18,8 @@ // construction/destruction sTGCSensitiveDetector::sTGCSensitiveDetector(const std::string& name, const std::string& hitCollectionName) : G4VSensitiveDetector( name ) - , m_GenericMuonHitCollection( hitCollectionName ) + , m_sTGCSimHitCollection( hitCollectionName ) + , m_GenericMuonHitCollection( hitCollectionName ) // Also generate GenericMuonSimHit { m_muonHelper = sTgcHitIdHelper::GetHelper(); //m_muonHelper->PrintFields(); @@ -27,7 +28,8 @@ sTGCSensitiveDetector::sTGCSensitiveDetector(const std::string& name, const std: // Implemenation of memebr functions void sTGCSensitiveDetector::Initialize(G4HCofThisEvent*) { - if (!m_GenericMuonHitCollection.isValid()) m_GenericMuonHitCollection = CxxUtils::make_unique<GenericMuonSimHitCollection>(); + if (!m_sTGCSimHitCollection.isValid()) m_sTGCSimHitCollection = CxxUtils::make_unique<sTGCSimHitCollection>(); + if (!m_GenericMuonHitCollection.isValid()) m_GenericMuonHitCollection = CxxUtils::make_unique<GenericMuonSimHitCollection>(); // Required to generate both HIT containers } G4bool sTGCSensitiveDetector::ProcessHits(G4Step* aStep,G4TouchableHistory* /*ROHist*/) @@ -40,26 +42,29 @@ G4bool sTGCSensitiveDetector::ProcessHits(G4Step* aStep,G4TouchableHistory* /*RO if (!charge && (!geantinoHit)) return false; // G4cout << "\t\t sTGCSD: Hit in a sensitive layer!!!!! " << G4endl; - const G4AffineTransform trans = currentTrack->GetTouchable()->GetHistory()->GetTopTransform(); // from global to local G4StepPoint* postStep=aStep->GetPostStepPoint(); - G4StepPoint* preStep=aStep->GetPreStepPoint(); const G4Step* post_Step=aStep->GetTrack()->GetStep(); - Amg::Vector3D position = Amg::Hep3VectorToEigen(postStep->GetPosition()); + const G4AffineTransform trans = currentTrack->GetTouchable()->GetHistory()->GetTopTransform(); // from global to local + G4StepPoint* preStep=aStep->GetPreStepPoint(); Amg::Vector3D local_position = Amg::Hep3VectorToEigen( trans.TransformPoint( postStep->GetPosition() ) ); + // These few lines are added once again to allow both sTGC and Generic Sim HIT containers to be filled Amg::Vector3D preposition = Amg::Hep3VectorToEigen( preStep->GetPosition() ); Amg::Vector3D local_preposition = Amg::Hep3VectorToEigen( trans.TransformPoint( preStep->GetPosition() ) ); + float globalpreTime=preStep->GetGlobalTime(); + float eKin=postStep->GetKineticEnergy(); + float StepLength=post_Step->GetStepLength(); + + + Amg::Vector3D position = Amg::Hep3VectorToEigen(postStep->GetPosition()); int pdgCode=currentTrack->GetDefinition()->GetPDGEncoding(); float globalTime=postStep->GetGlobalTime(); - float globalpreTime=preStep->GetGlobalTime(); - float eKin=postStep->GetKineticEnergy(); Amg::Vector3D direction= Amg::Hep3VectorToEigen( postStep->GetMomentumDirection() ); float depositEnergy=post_Step->GetTotalEnergyDeposit(); - float StepLength=post_Step->GetStepLength(); if (depositEnergy<0.0001 && (!geantinoHit)) return false; @@ -108,8 +113,10 @@ G4bool sTGCSensitiveDetector::ProcessHits(G4Step* aStep,G4TouchableHistory* /*RO int sTgcId = m_muonHelper->BuildsTgcHitId(subType, iPhi, iRing, mLayer,nLayer, iSide); TrackHelper trHelp(aStep->GetTrack()); + //int barcode = trHelp.GetBarcode(); // Added for GenericMuonSimHIT m_GenericMuonHitCollection->Emplace(sTgcId,globalTime,globalpreTime,position,local_position,preposition,local_preposition,pdgCode,eKin,direction,depositEnergy,StepLength,trHelp.GetParticleLink()); + m_sTGCSimHitCollection->Emplace(sTgcId,globalTime,position,pdgCode,direction,depositEnergy,trHelp.GetParticleLink()); return true; } diff --git a/MuonSpectrometer/MuonG4/MuonG4SD/src/sTGCSensitiveDetector.h b/MuonSpectrometer/MuonG4/MuonG4SD/src/sTGCSensitiveDetector.h index c81ff378aa1b809e8dac8fcc81e8ea1f35744782..4cce4642fdb1f1ddd1de6a558e52fb24e75f95a8 100755 --- a/MuonSpectrometer/MuonG4/MuonG4SD/src/sTGCSensitiveDetector.h +++ b/MuonSpectrometer/MuonG4/MuonG4SD/src/sTGCSensitiveDetector.h @@ -8,6 +8,7 @@ #include "G4VSensitiveDetector.hh" #include "StoreGate/WriteHandle.h" #include "MuonSimEvent/GenericMuonSimHitCollection.h" +#include "MuonSimEvent/sTGCSimHitCollection.h" class sTgcHitIdHelper; @@ -24,6 +25,7 @@ public: private: + SG::WriteHandle<sTGCSimHitCollection> m_sTGCSimHitCollection; SG::WriteHandle<GenericMuonSimHitCollection> m_GenericMuonHitCollection; sTgcHitIdHelper* m_muonHelper; diff --git a/MuonSpectrometer/MuonGeoModel/CMakeLists.txt b/MuonSpectrometer/MuonGeoModel/CMakeLists.txt index 24a0da40e45205f4a5d9a66d6d7572e6104c4aa1..9ded36db091cd38e085f079865d640a2bd29a1b9 100644 --- a/MuonSpectrometer/MuonGeoModel/CMakeLists.txt +++ b/MuonSpectrometer/MuonGeoModel/CMakeLists.txt @@ -17,8 +17,6 @@ atlas_depends_on_subdirs( PUBLIC MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry MuonSpectrometer/MuonGMdbObjects PRIVATE - Control/CLIDSvc - Control/SGTools Database/AthenaPOOL/AthenaPoolUtilities Database/RDBAccessSvc DetectorDescription/AGDD/AGDDKernel @@ -40,12 +38,12 @@ atlas_add_library( MuonGeoModelLib PRIVATE_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} DEFINITIONS ${CLHEP_DEFINITIONS} LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaKernel GeoModelKernel GeoModelUtilities GaudiKernel MuonCondInterface MuonReadoutGeometry MuonGMdbObjects StoreGateLib SGtests MuonIdHelpersLib - PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} SGTools AthenaPoolUtilities AGDDKernel IdDictDetDescr MuonAGDDDescription MuonDetDescrUtils ) + PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} AthenaPoolUtilities AGDDKernel IdDictDetDescr MuonAGDDDescription MuonDetDescrUtils ) atlas_add_component( MuonGeoModel src/components/*.cxx INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} ${CLHEP_LIBRARIES} AthenaKernel StoreGateLib SGtests GeoModelKernel GeoModelUtilities GaudiKernel MuonCondInterface MuonReadoutGeometry MuonGMdbObjects SGTools AthenaPoolUtilities AGDDKernel IdDictDetDescr MuonAGDDDescription MuonDetDescrUtils MuonIdHelpersLib MuonGeoModelLib ) + LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} ${CLHEP_LIBRARIES} AthenaKernel StoreGateLib SGtests GeoModelKernel GeoModelUtilities GaudiKernel MuonCondInterface MuonReadoutGeometry MuonGMdbObjects AthenaPoolUtilities AGDDKernel IdDictDetDescr MuonAGDDDescription MuonDetDescrUtils MuonIdHelpersLib MuonGeoModelLib ) # Install files from the package: atlas_install_joboptions( share/*.py ) diff --git a/MuonSpectrometer/MuonGeoModel/src/MuonDetectorTool.cxx b/MuonSpectrometer/MuonGeoModel/src/MuonDetectorTool.cxx index c7f0e62a301a917e1ab400609af14e3a6e55e624..b5b0fc811714e6542ce50d32887cbd1c4074d2c4 100755 --- a/MuonSpectrometer/MuonGeoModel/src/MuonDetectorTool.cxx +++ b/MuonSpectrometer/MuonGeoModel/src/MuonDetectorTool.cxx @@ -22,7 +22,7 @@ #include "AthenaPoolUtilities/CondAttrListCollection.h" #include <fstream> -#include "CLIDSvc/tools/ClassID_traits.h" +#include "AthenaKernel/ClassID_traits.h" using namespace MuonGM; diff --git a/MuonSpectrometer/MuonRDO/MuonRDO/MM_RawDataContainer.h b/MuonSpectrometer/MuonRDO/MuonRDO/MM_RawDataContainer.h index 42e6b48a50112631fa9c7a02c299e85aed4ebcf4..339fc829e1490617f59a6bad54eb4145563018ff 100755 --- a/MuonSpectrometer/MuonRDO/MuonRDO/MM_RawDataContainer.h +++ b/MuonSpectrometer/MuonRDO/MuonRDO/MM_RawDataContainer.h @@ -17,6 +17,7 @@ class MM_RawDataContainer { public: MM_RawDataContainer(unsigned int hashmax); + MM_RawDataContainer(); virtual ~MM_RawDataContainer(); /// class ID diff --git a/MuonSpectrometer/MuonRDO/MuonRDO/STGC_RawDataContainer.h b/MuonSpectrometer/MuonRDO/MuonRDO/STGC_RawDataContainer.h index b394af3ef3bb8b12add9d64ec8aeaaeae31774f4..5283fd3c5304d577e341406fe0beceaec797911b 100755 --- a/MuonSpectrometer/MuonRDO/MuonRDO/STGC_RawDataContainer.h +++ b/MuonSpectrometer/MuonRDO/MuonRDO/STGC_RawDataContainer.h @@ -16,6 +16,7 @@ class STGC_RawDataContainer : public IdentifiableContainer<STGC_RawDataCollection> { public: + STGC_RawDataContainer(); STGC_RawDataContainer(unsigned int hashmax); ~STGC_RawDataContainer(); diff --git a/MuonSpectrometer/MuonRDO/src/MM_RawDataContainer.cxx b/MuonSpectrometer/MuonRDO/src/MM_RawDataContainer.cxx index 5633cce5cb9370474ad7ff1b88d08e10176fb37d..869216a5ec0c780e8a285b4cb3afa36d2b00a532 100755 --- a/MuonSpectrometer/MuonRDO/src/MM_RawDataContainer.cxx +++ b/MuonSpectrometer/MuonRDO/src/MM_RawDataContainer.cxx @@ -6,6 +6,11 @@ #include <iostream> #include "EventContainers/SelectAllObject.h" +Muon::MM_RawDataContainer::MM_RawDataContainer() +: IdentifiableContainer<MM_RawDataCollection>(0) +{ +} + Muon::MM_RawDataContainer::MM_RawDataContainer(unsigned int hashmax) : IdentifiableContainer<MM_RawDataCollection>(hashmax) { diff --git a/MuonSpectrometer/MuonRDO/src/STGC_RawDataContainer.cxx b/MuonSpectrometer/MuonRDO/src/STGC_RawDataContainer.cxx index 65dce06fd14ed74f07595eb55a625c5500a403be..3db6dae06e772a8e91fd843e698b6a9b62ff0257 100755 --- a/MuonSpectrometer/MuonRDO/src/STGC_RawDataContainer.cxx +++ b/MuonSpectrometer/MuonRDO/src/STGC_RawDataContainer.cxx @@ -5,6 +5,11 @@ #include "MuonRDO/STGC_RawDataContainer.h" #include <iostream> +Muon::STGC_RawDataContainer::STGC_RawDataContainer() + : IdentifiableContainer<STGC_RawDataCollection>(0) +{ +} + Muon::STGC_RawDataContainer::STGC_RawDataContainer(unsigned int hashmax) : IdentifiableContainer<STGC_RawDataCollection>(hashmax) { diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/MuonPrepRawData/MuonPrepDataContainer.h b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/MuonPrepRawData/MuonPrepDataContainer.h index 315065061a9d6435d128d7f596b498c9ee84c069..2cd3041e7525dd9d83ee5065a601bcc84c3ecfe3 100755 --- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/MuonPrepRawData/MuonPrepDataContainer.h +++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/MuonPrepRawData/MuonPrepDataContainer.h @@ -26,6 +26,9 @@ #include "MuonPrepRawData/MdtPrepData.h" #include "MuonPrepRawData/RpcPrepData.h" #include "MuonPrepRawData/TgcPrepData.h" +// New Small Wheel +#include "MuonPrepRawData/MMPrepData.h" +#include "MuonPrepRawData/sTgcPrepData.h" #include "MuonPrepRawData/MuonPrepDataCollection.h" @@ -39,6 +42,9 @@ class MuonPrepDataContainer : public IdentifiableContainer<CollectionT> { // Public methods: /////////////////////////////////////////////////////////////////// public: + + //default for POOL + MuonPrepDataContainer(); // Constructor with parameters: MuonPrepDataContainer(unsigned int max); @@ -90,7 +96,7 @@ private: /////////////////////////////////////////////////////////////////// // Inline methods: /////////////////////////////////////////////////////////////////// - + typedef MuonPrepDataCollection< MdtPrepData > MdtPrepDataCollection; typedef MuonPrepDataContainer< MdtPrepDataCollection > MdtPrepDataContainer; @@ -100,6 +106,13 @@ typedef MuonPrepDataContainer< RpcPrepDataCollection > RpcPrepDataContainer; typedef MuonPrepDataCollection< TgcPrepData > TgcPrepDataCollection; typedef MuonPrepDataContainer< TgcPrepDataCollection > TgcPrepDataContainer; +// New Small Wheel +typedef MuonPrepDataCollection< sTgcPrepData > sTgcPrepDataCollection; +typedef MuonPrepDataContainer< sTgcPrepDataCollection > sTgcPrepDataContainer; + +typedef MuonPrepDataCollection< MMPrepData > MMPrepDataCollection; +typedef MuonPrepDataContainer< MMPrepDataCollection > MMPrepDataContainer; + // member functions that use Collection T #include "MuonPrepRawData/MuonPrepDataContainer.icc" @@ -110,6 +123,9 @@ typedef MuonPrepDataContainer< TgcPrepDataCollection > TgcPrepDataContainer; #include "MuonPrepRawData/RpcPrepDataContainer.h" #include "MuonPrepRawData/TgcPrepDataContainer.h" #include "MuonPrepRawData/MdtPrepDataContainer.h" +// New Small Wheel +#include "MuonPrepRawData/sTgcPrepDataContainer.h" +#include "MuonPrepRawData/MMPrepDataContainer.h" #endif // TRKPREPRAWDATA_PREPRAWDATACONTAINER_H diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/MuonPrepRawData/MuonPrepDataContainer.icc b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/MuonPrepRawData/MuonPrepDataContainer.icc index 1bad1c5c8caa08a4d8b594ad010ad159d3d16a6a..3d25d2b38141cdfbc3bc0d9fe779a6322b0c839c 100755 --- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/MuonPrepRawData/MuonPrepDataContainer.icc +++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/MuonPrepRawData/MuonPrepDataContainer.icc @@ -12,6 +12,12 @@ /////////////////////////////////////////////////////////////////// +/// constructor for POOL with no parameters +template< class CollectionT> +MuonPrepDataContainer< CollectionT>::MuonPrepDataContainer() : + IdentifiableContainer<CollectionT>(0) +{ +} template< class CollectionT> // Constructor with parameters: diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/MuonPrepRawData/sTgcPrepData.h b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/MuonPrepRawData/sTgcPrepData.h index 499d45a91b63b73dc95176e6d76e9c00d7e00c7e..7846ba76202cac0ed426a3ae2a5585c8d0113f7b 100755 --- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/MuonPrepRawData/sTgcPrepData.h +++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/MuonPrepRawData/sTgcPrepData.h @@ -52,6 +52,7 @@ namespace Muon const std::vector<Identifier>& rdoList, const Amg::MatrixX* locErrMat, const MuonGM::sTgcReadoutElement* detEl, + const int charge = 0, const uint16_t bcBitMap=0); @@ -74,6 +75,7 @@ namespace Muon /** @brief Returns the bcBitMap of this PRD bit2 for Previous BC, bit1 for Current BC, bit0 for Next BC */ + int charge() const; uint16_t getBcBitMap() const; enum {BCBIT_UNDEFINED=0, BCBIT_NEXT=1, BCBIT_CURRENT=2, BCBIT_PREVIOUS=4}; @@ -81,6 +83,7 @@ namespace Muon /** Cached pointer to the detector element - should never be zero.*/ const MuonGM::sTgcReadoutElement* m_detEl; + int m_charge; uint16_t m_bcBitMap; }; @@ -98,6 +101,11 @@ namespace Muon return *m_globalPosition; } + inline int sTgcPrepData::charge() const + { + return m_charge; + } + inline uint16_t sTgcPrepData::getBcBitMap() const { return m_bcBitMap; diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/src/MMPrepData.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/src/MMPrepData.cxx index 760428b969722b12845a5b69c24e7f19c3e53302..f9ae7e52319844d0b014b425bc2d0341a2009fe5 100755 --- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/src/MMPrepData.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/src/MMPrepData.cxx @@ -52,16 +52,16 @@ namespace Muon MMPrepData::MMPrepData(const MMPrepData& RIO): MuonCluster(RIO), m_detEl( RIO.m_detEl ), - m_time(0), - m_charge(0) + m_time(RIO.m_time), + m_charge(RIO.m_charge) { } //move constructor: MMPrepData::MMPrepData(MMPrepData&& RIO): MuonCluster(std::move(RIO)), m_detEl( RIO.m_detEl ), - m_time(0), - m_charge(0) + m_time(RIO.m_time), + m_charge(RIO.m_charge) { } //assignment operator @@ -72,6 +72,8 @@ namespace Muon { MuonCluster::operator=(RIO); m_detEl = RIO.m_detEl ; + m_time = RIO.m_time; + m_charge = RIO.m_charge; } return *this; @@ -84,6 +86,8 @@ namespace Muon { MuonCluster::operator=(std::move(RIO)); m_detEl = RIO.m_detEl ; + m_time = RIO.m_time ; + m_charge = RIO.m_charge ; } return *this; diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/src/sTgcPrepData.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/src/sTgcPrepData.cxx index c89b406ba05f6be55b88641194362aaab3bfaaa3..c284a3cff173628a8d33325266f93c176064df7d 100755 --- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/src/sTgcPrepData.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/src/sTgcPrepData.cxx @@ -14,12 +14,15 @@ namespace Muon const std::vector<Identifier>& rdoList, const Amg::MatrixX* locErrMat, const MuonGM::sTgcReadoutElement* detEl, + const int charge, const uint16_t bcBitMap ) : MuonCluster(RDOId, idDE, locpos, rdoList, locErrMat), //call base class constructor m_detEl(detEl), + m_charge(charge), m_bcBitMap(bcBitMap) { } + // Destructor: sTgcPrepData::~sTgcPrepData() { @@ -30,6 +33,7 @@ namespace Muon sTgcPrepData::sTgcPrepData(): MuonCluster(), m_detEl(0), + m_charge(0), m_bcBitMap(0) { } @@ -37,6 +41,7 @@ namespace Muon sTgcPrepData::sTgcPrepData(const sTgcPrepData& RIO): MuonCluster(RIO), m_detEl( RIO.m_detEl ), + m_charge( RIO.m_charge ), m_bcBitMap( RIO.m_bcBitMap ) { } @@ -44,6 +49,7 @@ namespace Muon sTgcPrepData::sTgcPrepData(sTgcPrepData&& RIO): MuonCluster(std::move(RIO)), m_detEl( RIO.m_detEl ), + m_charge( RIO.m_charge ), m_bcBitMap( RIO.m_bcBitMap ) { } @@ -55,6 +61,7 @@ namespace Muon { MuonCluster::operator=(RIO); m_detEl = RIO.m_detEl ; + m_charge = RIO.m_charge; m_bcBitMap = RIO.m_bcBitMap; } return *this; @@ -69,6 +76,7 @@ namespace Muon { MuonCluster::operator=(std::move(RIO)); m_detEl = RIO.m_detEl ; + m_charge = RIO.m_charge; m_bcBitMap = RIO.m_bcBitMap; } return *this; diff --git a/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/TGC_LinearSegmentMakerTool/src/TGC_LinearSegmentMakerTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/TGC_LinearSegmentMakerTool/src/TGC_LinearSegmentMakerTool.cxx index 67fd83e9d93fb443a80422c518f00a7172f87bd9..3ef66949c5ab7adabee489ee5e37b69fa98ddb48 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/TGC_LinearSegmentMakerTool/src/TGC_LinearSegmentMakerTool.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/TGC_LinearSegmentMakerTool/src/TGC_LinearSegmentMakerTool.cxx @@ -255,7 +255,7 @@ TGC_LinearSegmentMakerTool::find(const Trk::TrackRoad& road, goto done; } Trk::TrackSurfaceIntersection baseIsect(pos, dir, 0.0); - const Trk::TrackSurfaceIntersection* pNewBaseIsect = m_pIntersector->intersectSurface(surface, &baseIsect, 0.0); + const Trk::TrackSurfaceIntersection* pNewBaseIsect = m_pIntersector.unConst()->intersectSurface(surface, &baseIsect, 0.0); Amg::Vector2D pSegPos; bool loc_pos_ok(false); if(pNewBaseIsect) { diff --git a/MuonSpectrometer/MuonSimEvent/MuonSimEvent/MuonSimEventDict.h b/MuonSpectrometer/MuonSimEvent/MuonSimEvent/MuonSimEventDict.h index d04b788918de6f23210f56affe4b14ed5f826521..e7173c51d30b5c9d9755c6fe5def28e6a30b11d8 100644 --- a/MuonSpectrometer/MuonSimEvent/MuonSimEvent/MuonSimEventDict.h +++ b/MuonSpectrometer/MuonSimEvent/MuonSimEvent/MuonSimEventDict.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef MUONSIMEVENT_MUONSIMEVENTDICT_H @@ -10,5 +10,6 @@ #include "MuonSimEvent/RPCSimHitCollection.h" #include "MuonSimEvent/TGCSimHitCollection.h" #include "MuonSimEvent/GenericMuonSimHitCollection.h" +#include "MuonSimEvent/sTGCSimHitCollection.h" #endif diff --git a/MuonSpectrometer/MuonSimEvent/MuonSimEvent/sTGCSimHit.h b/MuonSpectrometer/MuonSimEvent/MuonSimEvent/sTGCSimHit.h new file mode 100644 index 0000000000000000000000000000000000000000..2f35332cdb3e5b40321fcb94b1d97b32ac43f24a --- /dev/null +++ b/MuonSpectrometer/MuonSimEvent/MuonSimEvent/sTGCSimHit.h @@ -0,0 +1,86 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef MUONSIMEVENT_sTGCSimHit_H +#define MUONSIMEVENT_sTGCSimHit_H 1 + +#include "GeoPrimitives/GeoPrimitives.h" +#include "GeneratorObjects/HepMcParticleLink.h" + +#include <string> + +typedef int HitID; + +class sTGCSimHit { + public: + // + // construction/destruction + // + // needed by athenaRoot + sTGCSimHit(); + + // Destructor: + virtual ~sTGCSimHit(); + sTGCSimHit(HitID id, double time, const Amg::Vector3D& position, const int particleEncoding, const Amg::Vector3D& direction, const double depositEnergy, const int trackNumber); + sTGCSimHit(HitID id, double time, const Amg::Vector3D& position, const int particleEncoding, const Amg::Vector3D& direction, const double depositEnergy, const HepMcParticleLink hmpl); + + // + // member functions + // + + //postStep globalTime + double globalTime() const { return (double) m_globalTime; } + + //postStep Global and Local Position + const Amg::Vector3D& globalPosition() const { return m_globalPosition; } + int particleEncoding() const { return m_particleEncoding; } + const Amg::Vector3D& globalDirection() const { return m_globalDirection; } + double depositEnergy() const { return (double) m_depositEnergy; } + + HitID sTGCId() const { return m_sTGCId; } + std::string print() const; + + bool operator< (const sTGCSimHit& rhs) const + { return m_sTGCId < rhs.m_sTGCId; } + + double meanTime() const; + + void setGlobalTime( const double time ) { m_globalTime = time; } + void setDepositEnergy ( const double depositEnergy ) { m_depositEnergy = depositEnergy ;} + void setGlobalPosition ( const Amg::Vector3D& globalPosition ) { m_globalPosition = globalPosition ;} //!< sets the position expressed in global coordinates + void setGlobalDirection ( const Amg::Vector3D& globalDirection ) { m_globalDirection = globalDirection ;} //!< sets the direction expressed in global coordinates + + // number of track which released this energy: + int trackNumber() const; + + // link to the particle generating the hit + const HepMcParticleLink& particleLink() const; + + private: + // + // member data + // + HitID m_sTGCId; + float m_globalTime; + // postStep + Amg::Vector3D m_globalPosition; + + int m_particleEncoding; // PDG id + + Amg::Vector3D m_globalDirection; + float m_depositEnergy; + + HepMcParticleLink m_partLink; +}; + +//inline methods + +inline const HepMcParticleLink& sTGCSimHit::particleLink() const +{ return m_partLink; } +inline double sTGCSimHit::meanTime() const +{ return (double) m_globalTime; } +inline float hitTime(const sTGCSimHit& hit) +{ return (float) hit.meanTime(); } + +#endif diff --git a/MuonSpectrometer/MuonSimEvent/MuonSimEvent/sTGCSimHitCollection.h b/MuonSpectrometer/MuonSimEvent/MuonSimEvent/sTGCSimHitCollection.h new file mode 100644 index 0000000000000000000000000000000000000000..bb6cba5330b7d149b9baeed135caeff77b9d31a8 --- /dev/null +++ b/MuonSpectrometer/MuonSimEvent/MuonSimEvent/sTGCSimHitCollection.h @@ -0,0 +1,28 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef sTGCSimHitCollection_H +#define sTGCSimHitCollection_H + +#include "MuonSimEvent/sTGCSimHit.h" +#include "HitManagement/AtlasHitsVector.h" +#include "HitManagement/AthenaHitsVector.h" + +#ifndef __CINT__ + #include "CLIDSvc/CLASS_DEF.h" +#endif + +typedef AthenaHitsVector<sTGCSimHit> OldsTGCSimHitCollection; + +typedef AtlasHitsVector<sTGCSimHit> sTGCSimHitCollection; +typedef AtlasHitsVector<sTGCSimHit>::iterator sTGCSimHitIterator; +typedef AtlasHitsVector<sTGCSimHit>::const_iterator sTGCSimHitConstIterator; + +#ifndef __CINT__ +CLASS_DEF( sTGCSimHitCollection , 20180530 , 1 ) +CLASS_DEF( OldsTGCSimHitCollection , 20180529 , 1 ) +#endif + +#endif + diff --git a/MuonSpectrometer/MuonSimEvent/MuonSimEvent/selection.xml b/MuonSpectrometer/MuonSimEvent/MuonSimEvent/selection.xml index b61a20e2931298672c4e7aa2b31043c0d64d57f6..7df146db287d20ee4130ff8b391e091c9d12248b 100644 --- a/MuonSpectrometer/MuonSimEvent/MuonSimEvent/selection.xml +++ b/MuonSpectrometer/MuonSimEvent/MuonSimEvent/selection.xml @@ -14,6 +14,9 @@ <class name="AtlasHitsVector<GenericMuonSimHit>" /> <class name="std::vector<GenericMuonSimHit>" /> + <class name="AtlasHitsVector<sTGCSimHit>" /> + <class name="std::vector<sTGCSimHit>" /> + <class name="AthenaHitsVector<MDTSimHit>" id="D76D06CC-C15F-43E6-BBC3-480DE5DA065D" /> <class name="std::vector<MDTSimHit*>" /> @@ -29,6 +32,9 @@ <class name="AthenaHitsVector<GenericMuonSimHit>" id="5745A192-1438-11E1-9AE4-001E4F3DA869" /> <class name="std::vector<GenericMuonSimHit*>" /> + <class name="AthenaHitsVector<sTGCSimHit>" id="9ae1805a-6e3c-11e8-9b02-02163e01bddd" /> + <class name="std::vector<sTGCSimHit*>" /> + <class name="MDTSimHit" /> <class name="CSCSimHit" /> <class name="RPCSimHit" /> diff --git a/MuonSpectrometer/MuonSimEvent/src/sTGCSimHit.cxx b/MuonSpectrometer/MuonSimEvent/src/sTGCSimHit.cxx new file mode 100644 index 0000000000000000000000000000000000000000..190c2caf06acc5a33ebcfa9980222652b4bd8051 --- /dev/null +++ b/MuonSpectrometer/MuonSimEvent/src/sTGCSimHit.cxx @@ -0,0 +1,72 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#include "MuonSimEvent/sTGCSimHit.h" +#include <sstream> +/*******************************************************************************/ +sTGCSimHit::sTGCSimHit(): + m_sTGCId(0xffff), + m_globalTime(0.), + m_particleEncoding(0),// PDG_ID + m_depositEnergy(-9999.),//Geant4 deposited energy + m_partLink() +{ +} +/*******************************************************************************/ +//virtual destructor required by Pool +sTGCSimHit::~sTGCSimHit() +{ +} +/*******************************************************************************/ +sTGCSimHit::sTGCSimHit(HitID id, double time, + const Amg::Vector3D& position, + const int particleEncoding, + const Amg::Vector3D& direction, + const double depositEnergy, + const int trackNumber) + : m_sTGCId(id), m_globalTime(time) + , m_globalPosition(position) + , m_particleEncoding(particleEncoding) + , m_globalDirection(direction) + , m_depositEnergy(depositEnergy) + , m_partLink(trackNumber) +{ +} + +sTGCSimHit::sTGCSimHit(HitID id, double time, + const Amg::Vector3D& position, + const int particleEncoding, + const Amg::Vector3D& direction, + const double depositEnergy, + const HepMcParticleLink hmpl) + : m_sTGCId(id), m_globalTime(time) + , m_globalPosition(position) + , m_particleEncoding(particleEncoding) + , m_globalDirection(direction) + , m_depositEnergy(depositEnergy) + , m_partLink(hmpl) +{ +} + +/*******************************************************************************/ +std::string sTGCSimHit::print() const { + + std::stringstream ss; + + ss << "-------------------------------------------------------------" << std::endl; + ss << "sTGCSimHit:"<<std::endl; + ss << " identifier: " << m_sTGCId; + ss << " t: " << m_globalTime; + ss << " x : (" << m_globalPosition.x() + << "," << m_globalPosition.y() + << "," << m_globalPosition.z() + << ")"<<std::endl; + ss << " pdgId: "<<m_particleEncoding<<std::endl; + + return ss.str(); +} +/*******************************************************************************/ +int sTGCSimHit::trackNumber() const +{ return m_partLink.barcode(); } +/*******************************************************************************/ diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/CMakeLists.txt b/MuonSpectrometer/MuonValidation/MuonPRDTest/CMakeLists.txt index 829f1e253cfffe8868c2df8d214dd3ba4e897b28..6a8d6412406dac005b752a9176cd33364e3812cf 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/CMakeLists.txt +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/CMakeLists.txt @@ -18,6 +18,7 @@ atlas_depends_on_subdirs( PUBLIC MuonSpectrometer/MuonDetDescr/MuonAGDDDescription MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry MuonSpectrometer/MuonDigitContainer + MuonSpectrometer/MuonRDO MuonSpectrometer/MuonIdHelpers MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonRIO_OnTrack @@ -31,7 +32,6 @@ atlas_depends_on_subdirs( PUBLIC Tracking/TrkExtrapolation/TrkExInterfaces ) # External dependencies: -find_package( CLHEP ) find_package( HepMC ) find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread ) @@ -40,7 +40,7 @@ atlas_add_component( MuonPRDTest src/*.cxx src/components/*.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${HEPMC_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} ${HEPMC_LIBRARIES} GaudiKernel AthenaBaseComps AthenaKernel StoreGateLib SGtests Identifier xAODEventInfo GeneratorObjects MuonAGDDDescription MuonReadoutGeometry MuonDigitContainer MuonIdHelpersLib MuonPrepRawData MuonRIO_OnTrack MuonRecToolInterfaces MuonSimData MuonSimEvent TrkGeometry TrkSurfaces TrkParameters TrkExInterfaces ) + LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} ${HEPMC_LIBRARIES} GaudiKernel AthenaBaseComps AthenaKernel StoreGateLib SGtests Identifier xAODEventInfo GeneratorObjects MuonAGDDDescription MuonReadoutGeometry MuonDigitContainer MuonRDO MuonIdHelpersLib MuonPrepRawData MuonRIO_OnTrack MuonRecToolInterfaces MuonSimData MuonSimEvent TrkGeometry TrkSurfaces TrkParameters TrkExInterfaces ) # Install files from the package: atlas_install_joboptions( share/*.py ) diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/CSCDigitVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/CSCDigitVariables.cxx index 0fcb7da296de515551ef83d1db5447024ff7052b..652cd30ea4f01bc1efa2cfd7d7923ec9249d0a5c 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/CSCDigitVariables.cxx +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/CSCDigitVariables.cxx @@ -199,7 +199,7 @@ StatusCode CSCDigitVariables::initializeVariables() /** ---------- freeing resources and resetting pointers */ /** ---------- to be called on finalize level of main alg */ -StatusCode CSCDigitVariables::deleteVariables() +void CSCDigitVariables::deleteVariables() { delete m_CSC_dig_stationName; delete m_CSC_dig_stationEta; @@ -234,5 +234,5 @@ StatusCode CSCDigitVariables::deleteVariables() m_CSC_dig_truth_globalPosZ = nullptr; m_CSC_dig_truth_charge = nullptr; - return StatusCode::SUCCESS; + return; } diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/CSCDigitVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/CSCDigitVariables.h index 36c9a2e8484bee44b9dd3326fdc195f69815abd6..4d91705a9cf2e606dfd724c337e0f3e46fcd1c50 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/CSCDigitVariables.h +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/CSCDigitVariables.h @@ -41,10 +41,7 @@ class CSCDigitVariables : public ValAlgVariables ~CSCDigitVariables() { - if( (this->deleteVariables()).isFailure() ){ - ATH_MSG_ERROR("Failing to delete CSCDigitVariables."); - std::terminate(); - } + deleteVariables(); } StatusCode initializeVariables(); @@ -60,7 +57,7 @@ class CSCDigitVariables : public ValAlgVariables } } - StatusCode deleteVariables(); + void deleteVariables(); StatusCode clearVariables(); const CscIdHelper* m_CscIdHelper; diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MDTPRDValAlg.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MDTPRDValAlg.h index 0532ad30598922d828da4e1fb985e2f48c21f5ef..3345136468ebe54cc02e0845ceb172502a6cc08e 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MDTPRDValAlg.h +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MDTPRDValAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef MDTPRDValAlg_H diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMDigitVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMDigitVariables.cxx index 3dcd5d51242d8057d39f87521e872d56c7d1358a..365ef9a48df3ea653f9af03794f1375761707632 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMDigitVariables.cxx +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMDigitVariables.cxx @@ -5,8 +5,6 @@ #include "MMDigitVariables.h" #include "AthenaKernel/errorcheck.h" -#include "MuonSimData/MuonSimDataCollection.h" - #include "MuonDigitContainer/MmDigitContainer.h" #include "MuonDigitContainer/MmDigit.h" @@ -23,10 +21,6 @@ StatusCode MMDigitVariables::fillVariables() // clear variables CHECK( this->clearVariables() ); - // get truth information container of digitization - const MuonSimDataCollection* nsw_MmSdoContainer = nullptr; - CHECK( m_evtStore->retrieve(nsw_MmSdoContainer, "MM_SDO") ); - // get digit container (a container corresponds to a multilayer of a module) const MmDigitContainer *nsw_MmDigitContainer = nullptr; CHECK( m_evtStore->retrieve(nsw_MmDigitContainer, m_ContainerName.c_str()) ); @@ -243,44 +237,6 @@ StatusCode MMDigitVariables::fillVariables() m_NSWMM_dig_sr_stripGposY->push_back(sr_globalPosY); m_NSWMM_dig_sr_stripGposZ->push_back(sr_globalPosZ); - - // retrieve the MC truth associated with the digit (means the Geant4 hit information) - if (nsw_MmSdoContainer && nsw_MmSdoContainer->size()>0) { - // search the truth container with the Id of the digit - const MuonSimData mm_sdo = (nsw_MmSdoContainer->find(Id))->second; - std::vector<MuonSimData::Deposit> deposits; - // get the truth deposits - mm_sdo.deposits(deposits); - - // use the information of the first deposit - int truth_barcode = deposits[0].first.barcode(); - double truth_localPosX = deposits[0].second.firstEntry(); - double truth_localPosY = deposits[0].second.secondEntry(); - float truth_angle = mm_sdo.word()/1000.; - - // get global and local coordinates of this first deposit - Amg::Vector2D hit_on_surface(truth_localPosX, truth_localPosY); - Amg::Vector3D hit_gpos(0., 0., 0.); - rdoEl->surface(Id).localToGlobal(hit_on_surface, Amg::Vector3D(0., 0., 0.), hit_gpos); - - ATH_MSG_DEBUG("MicroMegas Digit, truth barcode=" << truth_barcode); - ATH_MSG_DEBUG("MicroMegas Digit, truth localPosX=" << std::setw(9) << std::setprecision(2) << truth_localPosX - << ", truth localPosY=" << std::setw(9) << std::setprecision(2) << truth_localPosY - << ", truth XZ angle=" << std::setw(8) << std::setprecision(5) << truth_angle); - - // truth information like positions and barcode - // to be stored in the ntuple - m_NSWMM_dig_truth_barcode->push_back( truth_barcode ); - m_NSWMM_dig_truth_localPosX->push_back( truth_localPosX ); - m_NSWMM_dig_truth_localPosY->push_back( truth_localPosY ); - m_NSWMM_dig_truth_XZ_angle->push_back( truth_angle ); - - m_NSWMM_dig_truth_globalPosX->push_back( hit_gpos[0] ); - m_NSWMM_dig_truth_globalPosY->push_back( hit_gpos[1] ); - m_NSWMM_dig_truth_globalPosZ->push_back( hit_gpos[2] ); - - } - // some more information of the digit to be stored in the ntuple m_NSWMM_dig_time_trigger->push_back(time_trigger); m_NSWMM_dig_charge_trigger->push_back(charge_trigger); @@ -337,16 +293,6 @@ StatusCode MMDigitVariables::clearVariables() m_NSWMM_dig_sr_stripGposY->clear(); m_NSWMM_dig_sr_stripGposZ->clear(); - // truth information of the (1st) Geant4 hit that caused this - // digit to be recorded (size is m_NSWMM_nDigits) - m_NSWMM_dig_truth_barcode->clear(); - m_NSWMM_dig_truth_localPosX->clear(); - m_NSWMM_dig_truth_localPosY->clear(); - m_NSWMM_dig_truth_XZ_angle->clear(); - m_NSWMM_dig_truth_globalPosX->clear(); - m_NSWMM_dig_truth_globalPosY->clear(); - m_NSWMM_dig_truth_globalPosZ->clear(); - // more information for trigger m_NSWMM_dig_time_trigger->clear(); m_NSWMM_dig_charge_trigger->clear(); @@ -388,14 +334,6 @@ StatusCode MMDigitVariables::initializeVariables() m_NSWMM_dig_sr_stripGposY = new std::vector< std::vector<double> >; m_NSWMM_dig_sr_stripGposZ = new std::vector< std::vector<double> >; - m_NSWMM_dig_truth_barcode = new std::vector<int>; - m_NSWMM_dig_truth_localPosX = new std::vector<double>; - m_NSWMM_dig_truth_localPosY = new std::vector<double>; - m_NSWMM_dig_truth_XZ_angle = new std::vector<float>; - m_NSWMM_dig_truth_globalPosX = new std::vector<double>; - m_NSWMM_dig_truth_globalPosY = new std::vector<double>; - m_NSWMM_dig_truth_globalPosZ = new std::vector<double>; - m_NSWMM_dig_time_trigger = new std::vector< std::vector<float> >; m_NSWMM_dig_charge_trigger = new std::vector< std::vector<float> >; m_NSWMM_dig_position_trigger = new std::vector< std::vector<int> >; @@ -428,14 +366,6 @@ StatusCode MMDigitVariables::initializeVariables() m_tree->Branch("Digits_MM_stripresponse_stripGposX", &m_NSWMM_dig_sr_stripGposX); m_tree->Branch("Digits_MM_stripResponse_stripGposY", &m_NSWMM_dig_sr_stripGposY); m_tree->Branch("Digits_MM_stripResponse_stripGposZ", &m_NSWMM_dig_sr_stripGposZ); - - m_tree->Branch("Digits_MM_truth_barcode", &m_NSWMM_dig_truth_barcode); - m_tree->Branch("Digits_MM_truth_localPosX", &m_NSWMM_dig_truth_localPosX); - m_tree->Branch("Digits_MM_truth_localPosY", &m_NSWMM_dig_truth_localPosY); - m_tree->Branch("Digits_MM_truth_XZ_angle", &m_NSWMM_dig_truth_XZ_angle); - m_tree->Branch("Digits_MM_truth_globalPosX", &m_NSWMM_dig_truth_globalPosX); - m_tree->Branch("Digits_MM_truth_globalPosY", &m_NSWMM_dig_truth_globalPosY); - m_tree->Branch("Digits_MM_truth_globalPosZ", &m_NSWMM_dig_truth_globalPosZ); m_tree->Branch("Digits_MM_time_trigger", &m_NSWMM_dig_time_trigger); m_tree->Branch("Digits_MM_charge_trigger", &m_NSWMM_dig_charge_trigger); @@ -450,7 +380,7 @@ StatusCode MMDigitVariables::initializeVariables() /** ---------- freeing resources and resetting pointers */ /** ---------- to be called on finalize level of main alg */ -StatusCode MMDigitVariables::deleteVariables() +void MMDigitVariables::deleteVariables() { delete m_NSWMM_dig_stationName; delete m_NSWMM_dig_stationEta; @@ -477,14 +407,6 @@ StatusCode MMDigitVariables::deleteVariables() delete m_NSWMM_dig_sr_stripGposY; delete m_NSWMM_dig_sr_stripGposZ; - delete m_NSWMM_dig_truth_barcode; - delete m_NSWMM_dig_truth_localPosX; - delete m_NSWMM_dig_truth_localPosY; - delete m_NSWMM_dig_truth_XZ_angle; - delete m_NSWMM_dig_truth_globalPosX; - delete m_NSWMM_dig_truth_globalPosY; - delete m_NSWMM_dig_truth_globalPosZ; - delete m_NSWMM_dig_time_trigger; delete m_NSWMM_dig_charge_trigger; delete m_NSWMM_dig_position_trigger; @@ -517,19 +439,11 @@ StatusCode MMDigitVariables::deleteVariables() m_NSWMM_dig_sr_stripGposY = nullptr; m_NSWMM_dig_sr_stripGposZ = nullptr; - m_NSWMM_dig_truth_barcode = nullptr; - m_NSWMM_dig_truth_localPosX = nullptr; - m_NSWMM_dig_truth_localPosY = nullptr; - m_NSWMM_dig_truth_XZ_angle = nullptr; - m_NSWMM_dig_truth_globalPosX = nullptr; - m_NSWMM_dig_truth_globalPosY = nullptr; - m_NSWMM_dig_truth_globalPosZ = nullptr; - m_NSWMM_dig_time_trigger = nullptr; m_NSWMM_dig_charge_trigger = nullptr; m_NSWMM_dig_position_trigger = nullptr; m_NSWMM_dig_MMFE_VMM_id_trigger = nullptr; m_NSWMM_dig_VMM_id_trigger = nullptr; - return StatusCode::SUCCESS; + return; } diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMDigitVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMDigitVariables.h index a17cf294e6da7ad8e894cdc026ab7e4f89455fd8..a0d057815c6c3fa92ccf96e68144e12f9648c3aa 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMDigitVariables.h +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMDigitVariables.h @@ -43,13 +43,6 @@ class MMDigitVariables : public ValAlgVariables m_NSWMM_dig_sr_stripGposX(0), m_NSWMM_dig_sr_stripGposY(0), m_NSWMM_dig_sr_stripGposZ(0), - m_NSWMM_dig_truth_barcode(0), - m_NSWMM_dig_truth_localPosX(0), - m_NSWMM_dig_truth_localPosY(0), - m_NSWMM_dig_truth_globalPosX(0), - m_NSWMM_dig_truth_globalPosY(0), - m_NSWMM_dig_truth_globalPosZ(0), - m_NSWMM_dig_truth_XZ_angle(0), m_NSWMM_dig_time_trigger(0), m_NSWMM_dig_charge_trigger(0), m_NSWMM_dig_position_trigger(0), @@ -62,10 +55,7 @@ class MMDigitVariables : public ValAlgVariables ~MMDigitVariables() { - if( (this->deleteVariables()).isFailure() ){ - ATH_MSG_ERROR("Failing to delete MMDigitVariables."); - std::terminate(); - } + deleteVariables(); } StatusCode initializeVariables(); @@ -81,7 +71,7 @@ class MMDigitVariables : public ValAlgVariables } } - StatusCode deleteVariables(); + void deleteVariables(); StatusCode clearVariables(); const MmIdHelper* m_MmIdHelper; @@ -111,14 +101,6 @@ class MMDigitVariables : public ValAlgVariables std::vector< std::vector<double> > *m_NSWMM_dig_sr_stripGposY; std::vector< std::vector<double> > *m_NSWMM_dig_sr_stripGposZ; - std::vector< int > *m_NSWMM_dig_truth_barcode; - std::vector< double > *m_NSWMM_dig_truth_localPosX; - std::vector< double > *m_NSWMM_dig_truth_localPosY; - std::vector< double > *m_NSWMM_dig_truth_globalPosX; - std::vector< double > *m_NSWMM_dig_truth_globalPosY; - std::vector< double > *m_NSWMM_dig_truth_globalPosZ; - std::vector< float > *m_NSWMM_dig_truth_XZ_angle; - std::vector< std::vector<float> > *m_NSWMM_dig_time_trigger; std::vector< std::vector<float> > *m_NSWMM_dig_charge_trigger; std::vector< std::vector<int> > *m_NSWMM_dig_position_trigger; diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMFastDigitVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMFastDigitVariables.cxx deleted file mode 100644 index 0876c4cc20b2cfbd1967e28062ddc96c3d5907d8..0000000000000000000000000000000000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMFastDigitVariables.cxx +++ /dev/null @@ -1,221 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#include "MMFastDigitVariables.h" -#include "AthenaKernel/errorcheck.h" - -#include "MuonPrepRawData/MMPrepDataContainer.h" -#include "MuonPrepRawData/MMPrepData.h" - -#include "MuonReadoutGeometry/MMReadoutElement.h" -#include "MuonSimData/MuonSimDataCollection.h" - -#include "TTree.h" - - -StatusCode MMFastDigitVariables::fillVariables() -{ - ATH_MSG_INFO(" do fillNSWMMFastDigitVariables()"); - - CHECK( this->clearVariables() ); - - const MuonSimDataCollection* nsw_MmSdoContainer = nullptr; - CHECK( m_evtStore->retrieve(nsw_MmSdoContainer, "MM_SDO") ); - - const Muon::MMPrepDataContainer *nsw_MMPrepDataContainer = nullptr; - CHECK( m_evtStore->retrieve(nsw_MMPrepDataContainer, m_ContainerName.c_str()) ); - - if(nsw_MMPrepDataContainer->size()==0) ATH_MSG_WARNING(" MM Fast DigitContainer empty "); - - for(auto it : *nsw_MMPrepDataContainer) { - const Muon::MMPrepDataCollection* coll = it; - - for (unsigned int item=0; item<coll->size(); item++) { - const Muon::MMPrepData* fast_digit = coll->at(item); - Identifier Id = fast_digit->identify(); - - std::string stName = m_MmIdHelper->stationNameString(m_MmIdHelper->stationName(Id)); - int stationEta = m_MmIdHelper->stationEta(Id); - int stationPhi = m_MmIdHelper->stationPhi(Id); - int multiplet = m_MmIdHelper->multilayer(Id); - int gas_gap = m_MmIdHelper->gasGap(Id); - int channel = m_MmIdHelper->channel(Id); - - - ATH_MSG_DEBUG( "MicroMegas Fast Digit Offline id: Station Name [" << stName << " ]" - << " Station Eta [" << stationEta << "]" - << " Station Phi [" << stationPhi << "]" - << " Multiplet [" << multiplet << "]" - << " GasGap [" << gas_gap << "]" - << " ChNr [" << channel << "]" ); - - m_NSWMM_fdg_stationName->push_back(stName); - m_NSWMM_fdg_stationEta->push_back(stationEta); - m_NSWMM_fdg_stationPhi->push_back(stationPhi); - m_NSWMM_fdg_multiplet->push_back(multiplet); - m_NSWMM_fdg_gas_gap->push_back(gas_gap); - m_NSWMM_fdg_channel->push_back(channel); - - const MuonGM::MMReadoutElement* det = fast_digit->detectorElement(); - Amg::Vector3D pos = fast_digit->globalPosition(); - const Amg::MatrixX & cov = fast_digit->localCovariance(); - Amg::Vector2D loc_pos(0., 0.); - det->surface(Id).globalToLocal(pos, Amg::Vector3D(0., 0., 0.), loc_pos); - - ATH_MSG_DEBUG( "MicroMegas Fast Digit local pos.: x=" << std::setw(6) << std::setprecision(2) << loc_pos[0] - << ", ex=" << std::setw(6) << std::setprecision(2) << cov(0,0) - << ", y=" << std::setw(6) << std::setprecision(2) << loc_pos[1] ); - - m_NSWMM_fdg_globalPosX->push_back(pos.x()); - m_NSWMM_fdg_globalPosY->push_back(pos.y()); - m_NSWMM_fdg_globalPosZ->push_back(pos.z()); - - m_NSWMM_fdg_localPosX->push_back(loc_pos[0]); - m_NSWMM_fdg_localPosY->push_back(loc_pos[1]); - m_NSWMM_fdg_covMatrix_1_1->push_back(cov(0,0)); - - if (nsw_MmSdoContainer) { - const MuonSimData mm_sdo = (nsw_MmSdoContainer->find(Id))->second; - std::vector<MuonSimData::Deposit> deposits; - mm_sdo.deposits(deposits); - - int truth_barcode = deposits[0].first.barcode(); - double truth_hitOnSurfaceX = deposits[0].second.firstEntry(); - double truth_hitOnSurfaceY = deposits[0].second.secondEntry(); - - ATH_MSG_DEBUG("MicroMegas Fast Digit, truth barcode=" << truth_barcode); - ATH_MSG_DEBUG("MicroMegas Fast Digit, truth hitOnSurfaceX=" << std::setw(9) << std::setprecision(2) << truth_hitOnSurfaceX - << ", truth hitOnSurfaceY=" << std::setw(9) << std::setprecision(2) << truth_hitOnSurfaceY); - - m_NSWMM_fdg_truth_barcode->push_back( truth_barcode ); - m_NSWMM_fdg_truth_hitOnSurfaceX->push_back( truth_hitOnSurfaceX ); - m_NSWMM_fdg_truth_hitOnSurfaceY->push_back( truth_hitOnSurfaceY ); - } - - m_NSWMM_nFastDigits++; - } - } - - ATH_MSG_INFO("processed " << m_NSWMM_nFastDigits << " MicroMegas fast digitis"); - return StatusCode::SUCCESS; -} - -StatusCode MMFastDigitVariables::deleteVariables() -{ - delete m_NSWMM_fdg_stationName; - delete m_NSWMM_fdg_stationEta; - delete m_NSWMM_fdg_stationPhi; - delete m_NSWMM_fdg_multiplet; - delete m_NSWMM_fdg_gas_gap; - delete m_NSWMM_fdg_channel; - - delete m_NSWMM_fdg_globalPosX; - delete m_NSWMM_fdg_globalPosY; - delete m_NSWMM_fdg_globalPosZ; - - delete m_NSWMM_fdg_localPosX; - delete m_NSWMM_fdg_localPosY; - delete m_NSWMM_fdg_covMatrix_1_1; - - delete m_NSWMM_fdg_truth_barcode; - delete m_NSWMM_fdg_truth_hitOnSurfaceX; - delete m_NSWMM_fdg_truth_hitOnSurfaceY; - - m_NSWMM_nFastDigits = 0; - m_NSWMM_fdg_stationName= nullptr; - m_NSWMM_fdg_stationEta = nullptr; - m_NSWMM_fdg_stationPhi = nullptr; - m_NSWMM_fdg_multiplet = nullptr; - m_NSWMM_fdg_gas_gap = nullptr; - m_NSWMM_fdg_channel = nullptr; - - m_NSWMM_fdg_globalPosX = nullptr; - m_NSWMM_fdg_globalPosY = nullptr; - m_NSWMM_fdg_globalPosZ = nullptr; - - m_NSWMM_fdg_localPosX = nullptr; - m_NSWMM_fdg_localPosY = nullptr; - m_NSWMM_fdg_covMatrix_1_1 = nullptr; - - m_NSWMM_fdg_truth_barcode = nullptr; - m_NSWMM_fdg_truth_hitOnSurfaceX = nullptr; - m_NSWMM_fdg_truth_hitOnSurfaceY = nullptr; - - return StatusCode::SUCCESS; -} - - -StatusCode MMFastDigitVariables::clearVariables() -{ - m_NSWMM_nFastDigits = 0; - m_NSWMM_fdg_stationName->clear(); - m_NSWMM_fdg_stationEta->clear(); - m_NSWMM_fdg_stationPhi->clear(); - m_NSWMM_fdg_multiplet->clear(); - m_NSWMM_fdg_gas_gap->clear(); - m_NSWMM_fdg_channel->clear(); - - m_NSWMM_fdg_globalPosX->clear(); - m_NSWMM_fdg_globalPosY->clear(); - m_NSWMM_fdg_globalPosZ->clear(); - - m_NSWMM_fdg_localPosX->clear(); - m_NSWMM_fdg_localPosY->clear(); - m_NSWMM_fdg_covMatrix_1_1->clear(); - - m_NSWMM_fdg_truth_barcode->clear(); - m_NSWMM_fdg_truth_hitOnSurfaceX->clear(); - m_NSWMM_fdg_truth_hitOnSurfaceY->clear(); - - return StatusCode::SUCCESS; -} - - -StatusCode MMFastDigitVariables::initializeVariables() -{ - m_NSWMM_nFastDigits = 0; - m_NSWMM_fdg_stationName = new std::vector<std::string>(); - m_NSWMM_fdg_stationEta = new std::vector<int>(); - m_NSWMM_fdg_stationPhi = new std::vector<int>(); - m_NSWMM_fdg_multiplet = new std::vector<int>(); - m_NSWMM_fdg_gas_gap = new std::vector<int>(); - m_NSWMM_fdg_channel = new std::vector<int>(); - - m_NSWMM_fdg_globalPosX = new std::vector<double>(); - m_NSWMM_fdg_globalPosY = new std::vector<double>(); - m_NSWMM_fdg_globalPosZ = new std::vector<double>(); - - m_NSWMM_fdg_localPosX = new std::vector<double>(); - m_NSWMM_fdg_localPosY = new std::vector<double>(); - m_NSWMM_fdg_covMatrix_1_1 = new std::vector<double>(); - - m_NSWMM_fdg_truth_barcode = new std::vector<int>(); - m_NSWMM_fdg_truth_hitOnSurfaceX = new std::vector<double>(); - m_NSWMM_fdg_truth_hitOnSurfaceY = new std::vector<double>(); - - if(m_tree) { - m_tree->Branch("FastDigit_MM", &m_NSWMM_nFastDigits, "FastDigits_MM_n/i"); - m_tree->Branch("FastDigit_MM_stationName", &m_NSWMM_fdg_stationName); - m_tree->Branch("FastDigit_MM_stationEta", &m_NSWMM_fdg_stationEta); - m_tree->Branch("FastDigit_MM_stationPhi", &m_NSWMM_fdg_stationPhi); - m_tree->Branch("FastDigit_MM_multiplet", &m_NSWMM_fdg_multiplet); - m_tree->Branch("FastDigit_MM_gas_gap", &m_NSWMM_fdg_gas_gap); - m_tree->Branch("FastDigit_MM_channel", &m_NSWMM_fdg_channel); - - m_tree->Branch("FastDigit_MM_globalPosX", &m_NSWMM_fdg_globalPosX); - m_tree->Branch("FastDigit_MM_globalPosY", &m_NSWMM_fdg_globalPosY); - m_tree->Branch("FastDigit_MM_globalPosZ", &m_NSWMM_fdg_globalPosZ); - - m_tree->Branch("FastDigit_MM_localPosX", &m_NSWMM_fdg_localPosX); - m_tree->Branch("FastDigit_MM_localPosY", &m_NSWMM_fdg_localPosY); - m_tree->Branch("FastDigit_MM_covMatrix_1_1", &m_NSWMM_fdg_covMatrix_1_1); - - m_tree->Branch("FastDigit_MM_truth_barcode", &m_NSWMM_fdg_truth_barcode); - m_tree->Branch("FastDigit_MM_truth_hitOnSurfaceX", &m_NSWMM_fdg_truth_hitOnSurfaceX); - m_tree->Branch("FastDigit_MM_truth_hitOnSurfaceY", &m_NSWMM_fdg_truth_hitOnSurfaceY); - } - - return StatusCode::SUCCESS; -} - diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMFastDigitVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMFastDigitVariables.h deleted file mode 100644 index d978b62bd387527eca8c0cf3812a86d42b743203..0000000000000000000000000000000000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMFastDigitVariables.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef MMFASTDIGITVARIABLES_H -#define MMFASTDIGITVARIABLES_H - -#include "ValAlgVariables.h" -#include "MuonIdHelpers/MmIdHelper.h" -#include "AthenaBaseComps/AthMsgStreamMacros.h" -#include <vector> - -class MMFastDigitVariables : public ValAlgVariables -{ - public: - MMFastDigitVariables(StoreGateSvc* evtStore, - const MuonGM::MuonDetectorManager* detManager, - const MuonIdHelper* idhelper, - TTree* tree, - std::string containername) : - ValAlgVariables(evtStore, detManager, tree, containername, "MMFastDigitVariables"), - m_MmIdHelper(0), - m_NSWMM_nFastDigits(0), - m_NSWMM_fdg_stationName(0), - m_NSWMM_fdg_stationEta(0), - m_NSWMM_fdg_stationPhi(0), - m_NSWMM_fdg_multiplet(0), - m_NSWMM_fdg_gas_gap(0), - m_NSWMM_fdg_channel(0), - m_NSWMM_fdg_globalPosX(0), - m_NSWMM_fdg_globalPosY(0), - m_NSWMM_fdg_globalPosZ(0), - m_NSWMM_fdg_localPosX(0), - m_NSWMM_fdg_localPosY(0), - m_NSWMM_fdg_covMatrix_1_1(0), - m_NSWMM_fdg_truth_barcode(0), - m_NSWMM_fdg_truth_hitOnSurfaceX(0), - m_NSWMM_fdg_truth_hitOnSurfaceY(0) - { - setHelper(idhelper); - } - - ~MMFastDigitVariables() - { - if( (this->deleteVariables()).isFailure() ){ - ATH_MSG_ERROR("Failing to delete MMFastDigitVariables."); - std::terminate(); - } - } - - StatusCode initializeVariables(); - StatusCode fillVariables(); - - private: - - void setHelper(const MuonIdHelper* idhelper){ - m_MmIdHelper = dynamic_cast<const MmIdHelper*>(idhelper); - if(m_MmIdHelper == 0) { - ATH_MSG_ERROR("casting IdHelper to MmIdhelper failed"); - throw; - } - } - - StatusCode deleteVariables(); - StatusCode clearVariables(); - - const MmIdHelper* m_MmIdHelper; - - int m_NSWMM_nFastDigits; - std::vector<std::string> *m_NSWMM_fdg_stationName; - std::vector<int> *m_NSWMM_fdg_stationEta; - std::vector<int> *m_NSWMM_fdg_stationPhi; - std::vector<int> *m_NSWMM_fdg_multiplet; - std::vector<int> *m_NSWMM_fdg_gas_gap; - std::vector<int> *m_NSWMM_fdg_channel; - - std::vector<double> *m_NSWMM_fdg_globalPosX; - std::vector<double> *m_NSWMM_fdg_globalPosY; - std::vector<double> *m_NSWMM_fdg_globalPosZ; - - std::vector<double> *m_NSWMM_fdg_localPosX; - std::vector<double> *m_NSWMM_fdg_localPosY; - std::vector<double> *m_NSWMM_fdg_covMatrix_1_1; - - std::vector<int> *m_NSWMM_fdg_truth_barcode; - std::vector<double> *m_NSWMM_fdg_truth_hitOnSurfaceX; - std::vector<double> *m_NSWMM_fdg_truth_hitOnSurfaceY; - -}; - -#endif // MMDIGITVARIABLE_H diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMPRDVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMPRDVariables.cxx new file mode 100644 index 0000000000000000000000000000000000000000..7fbb6f2c0b8c29b0fb720a49a96c14a197d65306 --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMPRDVariables.cxx @@ -0,0 +1,181 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#include "MMPRDVariables.h" +#include "AthenaKernel/errorcheck.h" + +#include "MuonPrepRawData/MMPrepDataContainer.h" +#include "MuonPrepRawData/MMPrepData.h" + +#include "MuonReadoutGeometry/MMReadoutElement.h" +#include "MuonSimData/MuonSimDataCollection.h" + +#include "TTree.h" + + +StatusCode MMPRDVariables::fillVariables() +{ + ATH_MSG_DEBUG(" do fillNSWMMPRDVariables()"); + + CHECK( this->clearVariables() ); + + const Muon::MMPrepDataContainer *nsw_MMPrepDataContainer = nullptr; + CHECK( m_evtStore->retrieve(nsw_MMPrepDataContainer, m_ContainerName.c_str()) ); + + if(nsw_MMPrepDataContainer->size()==0) ATH_MSG_WARNING(" MM PRD Container empty "); + + for(const Muon::MMPrepDataCollection* coll : *nsw_MMPrepDataContainer) { + + for (unsigned int item=0; item<coll->size(); item++) { + const Muon::MMPrepData* prd = coll->at(item); + Identifier Id = prd->identify(); + + std::string stName = m_MmIdHelper->stationNameString(m_MmIdHelper->stationName(Id)); + int stationEta = m_MmIdHelper->stationEta(Id); + int stationPhi = m_MmIdHelper->stationPhi(Id); + int multiplet = m_MmIdHelper->multilayer(Id); + int gas_gap = m_MmIdHelper->gasGap(Id); + int channel = m_MmIdHelper->channel(Id); + + + ATH_MSG_DEBUG( "MicroMegas PRD Offline id: Station Name [" << stName << " ]" + << " Station Eta [" << stationEta << "]" + << " Station Phi [" << stationPhi << "]" + << " Multiplet [" << multiplet << "]" + << " GasGap [" << gas_gap << "]" + << " ChNr [" << channel << "]" ); + + m_NSWMM_prd_stationName->push_back(stName); + m_NSWMM_prd_stationEta->push_back(stationEta); + m_NSWMM_prd_stationPhi->push_back(stationPhi); + m_NSWMM_prd_multiplet->push_back(multiplet); + m_NSWMM_prd_gas_gap->push_back(gas_gap); + m_NSWMM_prd_channel->push_back(channel); + + const MuonGM::MMReadoutElement* det = prd->detectorElement(); + Amg::Vector3D pos = prd->globalPosition(); + const Amg::MatrixX & cov = prd->localCovariance(); + Amg::Vector2D loc_pos(0., 0.); + det->surface(Id).globalToLocal(pos, Amg::Vector3D(0., 0., 0.), loc_pos); + + ATH_MSG_DEBUG( "MicroMegas PRD local pos.: x=" << std::setw(6) << std::setprecision(2) << loc_pos[0] + << ", ex=" << std::setw(6) << std::setprecision(2) << cov(0,0) + << ", y=" << std::setw(6) << std::setprecision(2) << loc_pos[1] ); + + m_NSWMM_prd_globalPosX->push_back(pos.x()); + m_NSWMM_prd_globalPosY->push_back(pos.y()); + m_NSWMM_prd_globalPosZ->push_back(pos.z()); + + m_NSWMM_prd_localPosX->push_back(loc_pos[0]); + m_NSWMM_prd_localPosY->push_back(loc_pos[1]); + m_NSWMM_prd_covMatrix_1_1->push_back(cov(0,0)); + + m_NSWMM_nPRDs++; + } + } + + ATH_MSG_DEBUG("processed " << m_NSWMM_nPRDs << " MicroMegas PRD's"); + return StatusCode::SUCCESS; +} + +void MMPRDVariables::deleteVariables() +{ + delete m_NSWMM_prd_stationName; + delete m_NSWMM_prd_stationEta; + delete m_NSWMM_prd_stationPhi; + delete m_NSWMM_prd_multiplet; + delete m_NSWMM_prd_gas_gap; + delete m_NSWMM_prd_channel; + + delete m_NSWMM_prd_globalPosX; + delete m_NSWMM_prd_globalPosY; + delete m_NSWMM_prd_globalPosZ; + + delete m_NSWMM_prd_localPosX; + delete m_NSWMM_prd_localPosY; + delete m_NSWMM_prd_covMatrix_1_1; + + + m_NSWMM_nPRDs = 0; + m_NSWMM_prd_stationName= nullptr; + m_NSWMM_prd_stationEta = nullptr; + m_NSWMM_prd_stationPhi = nullptr; + m_NSWMM_prd_multiplet = nullptr; + m_NSWMM_prd_gas_gap = nullptr; + m_NSWMM_prd_channel = nullptr; + + m_NSWMM_prd_globalPosX = nullptr; + m_NSWMM_prd_globalPosY = nullptr; + m_NSWMM_prd_globalPosZ = nullptr; + + m_NSWMM_prd_localPosX = nullptr; + m_NSWMM_prd_localPosY = nullptr; + m_NSWMM_prd_covMatrix_1_1 = nullptr; + + return; +} + + +StatusCode MMPRDVariables::clearVariables() +{ + m_NSWMM_nPRDs = 0; + m_NSWMM_prd_stationName->clear(); + m_NSWMM_prd_stationEta->clear(); + m_NSWMM_prd_stationPhi->clear(); + m_NSWMM_prd_multiplet->clear(); + m_NSWMM_prd_gas_gap->clear(); + m_NSWMM_prd_channel->clear(); + + m_NSWMM_prd_globalPosX->clear(); + m_NSWMM_prd_globalPosY->clear(); + m_NSWMM_prd_globalPosZ->clear(); + + m_NSWMM_prd_localPosX->clear(); + m_NSWMM_prd_localPosY->clear(); + m_NSWMM_prd_covMatrix_1_1->clear(); + + return StatusCode::SUCCESS; +} + + +StatusCode MMPRDVariables::initializeVariables() +{ + m_NSWMM_nPRDs = 0; + m_NSWMM_prd_stationName = new std::vector<std::string>(); + m_NSWMM_prd_stationEta = new std::vector<int>(); + m_NSWMM_prd_stationPhi = new std::vector<int>(); + m_NSWMM_prd_multiplet = new std::vector<int>(); + m_NSWMM_prd_gas_gap = new std::vector<int>(); + m_NSWMM_prd_channel = new std::vector<int>(); + + m_NSWMM_prd_globalPosX = new std::vector<double>(); + m_NSWMM_prd_globalPosY = new std::vector<double>(); + m_NSWMM_prd_globalPosZ = new std::vector<double>(); + + m_NSWMM_prd_localPosX = new std::vector<double>(); + m_NSWMM_prd_localPosY = new std::vector<double>(); + m_NSWMM_prd_covMatrix_1_1 = new std::vector<double>(); + + if(m_tree) { + m_tree->Branch("PRD_MM", &m_NSWMM_nPRDs, "PRDs_MM_n/i"); + m_tree->Branch("PRD_MM_stationName", &m_NSWMM_prd_stationName); + m_tree->Branch("PRD_MM_stationEta", &m_NSWMM_prd_stationEta); + m_tree->Branch("PRD_MM_stationPhi", &m_NSWMM_prd_stationPhi); + m_tree->Branch("PRD_MM_multiplet", &m_NSWMM_prd_multiplet); + m_tree->Branch("PRD_MM_gas_gap", &m_NSWMM_prd_gas_gap); + m_tree->Branch("PRD_MM_channel", &m_NSWMM_prd_channel); + + m_tree->Branch("PRD_MM_globalPosX", &m_NSWMM_prd_globalPosX); + m_tree->Branch("PRD_MM_globalPosY", &m_NSWMM_prd_globalPosY); + m_tree->Branch("PRD_MM_globalPosZ", &m_NSWMM_prd_globalPosZ); + + m_tree->Branch("PRD_MM_localPosX", &m_NSWMM_prd_localPosX); + m_tree->Branch("PRD_MM_localPosY", &m_NSWMM_prd_localPosY); + m_tree->Branch("PRD_MM_covMatrix_1_1", &m_NSWMM_prd_covMatrix_1_1); + + } + + return StatusCode::SUCCESS; +} + diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMPRDVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMPRDVariables.h new file mode 100644 index 0000000000000000000000000000000000000000..4c4fbdc5bbdf524a5416117821b40024f6d28de9 --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMPRDVariables.h @@ -0,0 +1,81 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef MMPRDVARIABLES_H +#define MMPRDVARIABLES_H + +#include "ValAlgVariables.h" +#include "MuonIdHelpers/MmIdHelper.h" +#include "AthenaBaseComps/AthMsgStreamMacros.h" +#include <vector> + +class MMPRDVariables : public ValAlgVariables +{ + public: + MMPRDVariables(StoreGateSvc* evtStore, + const MuonGM::MuonDetectorManager* detManager, + const MuonIdHelper* idhelper, + TTree* tree, + std::string containername) : + ValAlgVariables(evtStore, detManager, tree, containername, "MMPRDVariables"), + m_MmIdHelper(0), + m_NSWMM_nPRDs(0), + m_NSWMM_prd_stationName(0), + m_NSWMM_prd_stationEta(0), + m_NSWMM_prd_stationPhi(0), + m_NSWMM_prd_multiplet(0), + m_NSWMM_prd_gas_gap(0), + m_NSWMM_prd_channel(0), + m_NSWMM_prd_globalPosX(0), + m_NSWMM_prd_globalPosY(0), + m_NSWMM_prd_globalPosZ(0), + m_NSWMM_prd_localPosX(0), + m_NSWMM_prd_localPosY(0), + m_NSWMM_prd_covMatrix_1_1(0) + { + setHelper(idhelper); + } + + ~MMPRDVariables() + { + deleteVariables(); + } + + StatusCode initializeVariables(); + StatusCode fillVariables(); + + private: + + void setHelper(const MuonIdHelper* idhelper){ + m_MmIdHelper = dynamic_cast<const MmIdHelper*>(idhelper); + if(m_MmIdHelper == 0) { + ATH_MSG_ERROR("casting IdHelper to MmIdhelper failed"); + throw; + } + } + + void deleteVariables(); + StatusCode clearVariables(); + + const MmIdHelper* m_MmIdHelper; + + int m_NSWMM_nPRDs; + std::vector<std::string> *m_NSWMM_prd_stationName; + std::vector<int> *m_NSWMM_prd_stationEta; + std::vector<int> *m_NSWMM_prd_stationPhi; + std::vector<int> *m_NSWMM_prd_multiplet; + std::vector<int> *m_NSWMM_prd_gas_gap; + std::vector<int> *m_NSWMM_prd_channel; + + std::vector<double> *m_NSWMM_prd_globalPosX; + std::vector<double> *m_NSWMM_prd_globalPosY; + std::vector<double> *m_NSWMM_prd_globalPosZ; + + std::vector<double> *m_NSWMM_prd_localPosX; + std::vector<double> *m_NSWMM_prd_localPosY; + std::vector<double> *m_NSWMM_prd_covMatrix_1_1; + +}; + +#endif // MMPRDVARIABLE_H diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMRDOVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMRDOVariables.cxx new file mode 100644 index 0000000000000000000000000000000000000000..2b965366b218a79f8766227f0cdadf75bb9910a7 --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMRDOVariables.cxx @@ -0,0 +1,163 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#include "MMRDOVariables.h" +#include "AthenaKernel/errorcheck.h" + +#include "MuonSimData/MuonSimDataCollection.h" + +#include "MuonRDO/MM_RawDataContainer.h" + +#include "MuonReadoutGeometry/MMReadoutElement.h" + +#include "TTree.h" + +using namespace Muon; + +/** ---------- filling of variables */ +/** ---------- to be called on each evt i.e. execute level of main alg */ +StatusCode MMRDOVariables::fillVariables() +{ + ATH_MSG_DEBUG("do fillNSWMMRDOVariables()"); + + // clear variables + CHECK( this->clearVariables() ); + + // get the rdo (a container corresponds to a multilayer of a module) + const MM_RawDataContainer* rdo_container = nullptr; + CHECK( m_evtStore->retrieve(rdo_container, m_ContainerName.c_str()) ); + + if(rdo_container->size()==0) ATH_MSG_WARNING(" MM RDO Container empty "); + + // iteration on all containers, i.e. all multilayers of all modules + for(auto it : *rdo_container) { + // a digit collection is instanciated for each container, i.e. holds all digits of a multilayer + const MM_RawDataCollection* coll = it; + + // loop on all digits inside a collection, i.e. multilayer + for (unsigned int item=0; item<coll->size(); item++) { + + // get specific digit and identify it + const MM_RawData* rdo = coll->at(item); + Identifier Id = rdo->identify(); + + std::string stName = m_MmIdHelper->stationNameString(m_MmIdHelper->stationName(Id)); + int stationEta = m_MmIdHelper->stationEta(Id); + int stationPhi = m_MmIdHelper->stationPhi(Id); + int multiplet = m_MmIdHelper->multilayer(Id); + int gas_gap = m_MmIdHelper->gasGap(Id); + int channel = m_MmIdHelper->channel(Id); + + ATH_MSG_DEBUG( "MicroMegas RDO Offline id: Station Name [" << stName << " ]" + << " Station Eta [" << stationEta << "]" + << " Station Phi [" << stationPhi << "]" + << " Multiplet [" << multiplet << "]" + << " GasGap [" << gas_gap << "]" + << " ChNr [" << channel << "]" ); + + // module details down to the level of channel which is closest to the Geant4 hit + // to be stored in the ntuple + m_NSWMM_rdo_stationName->push_back(stName); + m_NSWMM_rdo_stationEta->push_back(stationEta); + m_NSWMM_rdo_stationPhi->push_back(stationPhi); + m_NSWMM_rdo_multiplet->push_back(multiplet); + m_NSWMM_rdo_gas_gap->push_back(gas_gap); + m_NSWMM_rdo_channel->push_back(channel); + m_NSWMM_rdo_time->push_back(rdo->time()); + m_NSWMM_rdo_charge->push_back(rdo->charge()); + + // get the readout element class where the RDO is recorded + // int isSmall = (stName[2] == 'S'); + // const MuonGM::MMReadoutElement* rdoEl = m_detManager->getMMRElement_fromIdFields(isSmall, stationEta, stationPhi, multiplet ); + + + // rdo counter for the ntuple + m_NSWMM_nrdo++; + } + } + + ATH_MSG_DEBUG("processed " << m_NSWMM_nrdo << " MicroMegas rdo"); + return StatusCode::SUCCESS; +} + + +/** ---------- clearing of variables */ +/** ---------- to be called inside filling method before filling starts */ +StatusCode MMRDOVariables::clearVariables() +{ + m_NSWMM_nrdo = 0; + + // information of the module down to the channel closest to the initial G4 hit + // size of vector is m_NSWMM_rdo + m_NSWMM_rdo_stationName->clear(); + m_NSWMM_rdo_stationEta->clear(); + m_NSWMM_rdo_stationPhi->clear(); + m_NSWMM_rdo_multiplet->clear(); + m_NSWMM_rdo_gas_gap->clear(); + m_NSWMM_rdo_channel->clear(); + m_NSWMM_rdo_time->clear(); + m_NSWMM_rdo_charge->clear(); + + return StatusCode::SUCCESS; +} + + +/** ---------- creating variables and associate them to branches */ +/** ---------- to be called on initialization level of main alg */ +StatusCode MMRDOVariables::initializeVariables() +{ + + m_NSWMM_nrdo = 0; + m_NSWMM_rdo_stationName = new std::vector<std::string>(); + m_NSWMM_rdo_stationEta = new std::vector<int>(); + m_NSWMM_rdo_stationPhi = new std::vector<int>(); + m_NSWMM_rdo_multiplet = new std::vector<int>(); + m_NSWMM_rdo_gas_gap = new std::vector<int>(); + m_NSWMM_rdo_channel = new std::vector<int>(); + m_NSWMM_rdo_time = new std::vector<int>(); + m_NSWMM_rdo_charge = new std::vector<int>(); + + + if(m_tree) { + m_tree->Branch("RDO_MM_n", &m_NSWMM_nrdo); + m_tree->Branch("RDO_MM_stationName", &m_NSWMM_rdo_stationName); + m_tree->Branch("RDO_MM_stationEta", &m_NSWMM_rdo_stationEta); + m_tree->Branch("RDO_MM_stationPhi", &m_NSWMM_rdo_stationPhi); + m_tree->Branch("RDO_MM_multiplet", &m_NSWMM_rdo_multiplet); + m_tree->Branch("RDO_MM_gas_gap", &m_NSWMM_rdo_gas_gap); + m_tree->Branch("RDO_MM_channel", &m_NSWMM_rdo_channel); + m_tree->Branch("RDO_MM_time", &m_NSWMM_rdo_time); + m_tree->Branch("RDO_MM_charge", &m_NSWMM_rdo_charge); + } + + return StatusCode::SUCCESS; +} + + +/** ---------- freeing resources and resetting pointers */ +/** ---------- to be called on finalize level of main alg */ +void MMRDOVariables::deleteVariables() +{ + delete m_NSWMM_rdo_stationName; + delete m_NSWMM_rdo_stationEta; + delete m_NSWMM_rdo_stationPhi; + delete m_NSWMM_rdo_multiplet; + delete m_NSWMM_rdo_gas_gap; + delete m_NSWMM_rdo_channel; + delete m_NSWMM_rdo_time; + delete m_NSWMM_rdo_charge; + + + m_NSWMM_nrdo = 0; + m_NSWMM_rdo_stationName = nullptr; + m_NSWMM_rdo_stationEta = nullptr; + m_NSWMM_rdo_stationPhi = nullptr; + m_NSWMM_rdo_multiplet = nullptr; + m_NSWMM_rdo_gas_gap = nullptr; + m_NSWMM_rdo_channel = nullptr; + m_NSWMM_rdo_time = nullptr; + m_NSWMM_rdo_charge = nullptr; + + return; +} diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMRDOVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMRDOVariables.h new file mode 100644 index 0000000000000000000000000000000000000000..b3a5b68511dd3e553eee715c345ba1c16fee7de9 --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMRDOVariables.h @@ -0,0 +1,71 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef MMRDOVARIABLES_H +#define MMRDOVARIABLES_H + +#include "ValAlgVariables.h" +#include "MuonIdHelpers/MmIdHelper.h" +#include "AthenaBaseComps/AthMsgStreamMacros.h" +#include <vector> + +class MMRDOVariables : public ValAlgVariables +{ + public: + MMRDOVariables(StoreGateSvc* evtStore, + const MuonGM::MuonDetectorManager* detManager, + const MuonIdHelper* idhelper, + TTree* tree, + std::string containername) : + ValAlgVariables(evtStore, detManager, tree, containername, "MMRDOVariables"), + m_MmIdHelper(0), + m_NSWMM_nrdo(0), + m_NSWMM_rdo_stationName(0), + m_NSWMM_rdo_stationEta(0), + m_NSWMM_rdo_stationPhi(0), + m_NSWMM_rdo_multiplet(0), + m_NSWMM_rdo_gas_gap(0), + m_NSWMM_rdo_channel(0), + m_NSWMM_rdo_time(0), + m_NSWMM_rdo_charge(0) + { + setHelper(idhelper); + } + + ~MMRDOVariables() + { + deleteVariables(); + } + + StatusCode initializeVariables(); + StatusCode fillVariables(); + + private: + + void setHelper(const MuonIdHelper* idhelper){ + m_MmIdHelper = dynamic_cast<const MmIdHelper*>(idhelper); + if(m_MmIdHelper == 0) { + ATH_MSG_ERROR("casting IdHelper to MmIdhelper failed"); + throw; + } + } + + void deleteVariables(); + StatusCode clearVariables(); + + const MmIdHelper* m_MmIdHelper; + + int m_NSWMM_nrdo; + std::vector<std::string> *m_NSWMM_rdo_stationName; + std::vector<int> *m_NSWMM_rdo_stationEta; + std::vector<int> *m_NSWMM_rdo_stationPhi; + std::vector<int> *m_NSWMM_rdo_multiplet; + std::vector<int> *m_NSWMM_rdo_gas_gap; + std::vector<int> *m_NSWMM_rdo_channel; + std::vector<int> *m_NSWMM_rdo_time; + std::vector<int> *m_NSWMM_rdo_charge; + +}; + +#endif // MMRDOVARIABLES_H diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMSDOVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMSDOVariables.cxx new file mode 100644 index 0000000000000000000000000000000000000000..e63b03c8fbbfd26d80afded4e03c79a911c6fc55 --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMSDOVariables.cxx @@ -0,0 +1,189 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#include "MMSDOVariables.h" + +#include "AthenaBaseComps/AthAlgorithm.h" +#include "MuonSimData/MuonSimDataCollection.h" + +#include "TTree.h" + + +StatusCode MMSDOVariables::fillVariables() +{ + ATH_MSG_DEBUG(" do fillNSWMMSDOVariables()"); + + ATH_CHECK( this->clearVariables() ); + + ATH_MSG_DEBUG( "Retrieve MM SDO container with name = " << m_ContainerName.c_str() ); + const MuonSimDataCollection* nsw_MmSdoContainer = nullptr; + ATH_CHECK( m_evtStore->retrieve(nsw_MmSdoContainer, m_ContainerName.c_str()) ); + + for ( auto coll : *nsw_MmSdoContainer ) { + + Identifier Id = coll.first; + const MuonSimData mm_sdo = coll.second; + + // Get information on the SDO + std::string stName = m_MmIdHelper->stationNameString(m_MmIdHelper->stationName(Id)); + int stationEta = m_MmIdHelper->stationEta(Id); + int stationPhi = m_MmIdHelper->stationPhi(Id); + int multiplet = m_MmIdHelper->multilayer(Id); + int gas_gap = m_MmIdHelper->gasGap(Id); + int channel = m_MmIdHelper->channel(Id); + + + ATH_MSG_DEBUG( "MicroMegas SDO: Station Name [" << stName << " ]" + << " Station Eta [" << stationEta << "]" + << " Station Phi [" << stationPhi << "]" + << " Multiplet [" << multiplet << "]" + << " GasGap [" << gas_gap << "]" + << " ChNr [" << channel << "]" ); + + m_NSWMM_sdo_stationName->push_back(stName); + m_NSWMM_sdo_stationEta->push_back(stationEta); + m_NSWMM_sdo_stationPhi->push_back(stationPhi); + m_NSWMM_sdo_multiplet->push_back(multiplet); + m_NSWMM_sdo_gas_gap->push_back(gas_gap); + m_NSWMM_sdo_channel->push_back(channel); + + ATH_MSG_DEBUG( "Get the truth deposits from the SDO." ); + std::vector<MuonSimData::Deposit> deposits; + mm_sdo.deposits(deposits); + + const Amg::Vector3D hit_gpos = mm_sdo.globalPosition(); + m_NSWMM_sdo_globalPosX->push_back( hit_gpos.x() ); + m_NSWMM_sdo_globalPosY->push_back( hit_gpos.y() ); + m_NSWMM_sdo_globalPosZ->push_back( hit_gpos.z() ); + + m_NSWMM_sdo_globaltime->push_back( mm_sdo.getTime() ); + m_NSWMM_sdo_word->push_back( mm_sdo.word() ); + + // use the information of the first deposit + int barcode = deposits[0].first.barcode(); + double MuonMCdata_firstentry = deposits[0].second.firstEntry(); + double MuonMCdata_secondentry = deposits[0].second.secondEntry(); + + ATH_MSG_DEBUG("MicroMegas SDO barcode=" << barcode); + ATH_MSG_DEBUG("MicroMegas SDO localPosX=" << std::setw(9) << std::setprecision(2) << MuonMCdata_firstentry + << ", localPosY=" << std::setw(9) << std::setprecision(2) << MuonMCdata_secondentry); + + m_NSWMM_sdo_barcode->push_back( barcode ); + m_NSWMM_sdo_localPosX->push_back( MuonMCdata_firstentry ); + m_NSWMM_sdo_localPosY->push_back( MuonMCdata_secondentry ); + + m_NSWMM_nsdo++; + } + + ATH_MSG_DEBUG("Processed " << m_NSWMM_nsdo << " MicroMegas SDOs"); + return StatusCode::SUCCESS; +} + + +void MMSDOVariables::deleteVariables() +{ + delete m_NSWMM_sdo_stationName; + delete m_NSWMM_sdo_stationEta; + delete m_NSWMM_sdo_stationPhi; + delete m_NSWMM_sdo_multiplet; + delete m_NSWMM_sdo_gas_gap; + delete m_NSWMM_sdo_channel; + + delete m_NSWMM_sdo_word; + delete m_NSWMM_sdo_barcode; + delete m_NSWMM_sdo_globalPosX; + delete m_NSWMM_sdo_globalPosY; + delete m_NSWMM_sdo_globalPosZ; + delete m_NSWMM_sdo_globaltime; + + delete m_NSWMM_sdo_localPosX; + delete m_NSWMM_sdo_localPosY; + + m_NSWMM_nsdo = 0; + m_NSWMM_sdo_stationName= nullptr; + m_NSWMM_sdo_stationEta = nullptr; + m_NSWMM_sdo_stationPhi = nullptr; + m_NSWMM_sdo_multiplet = nullptr; + m_NSWMM_sdo_gas_gap = nullptr; + m_NSWMM_sdo_channel = nullptr; + + m_NSWMM_sdo_word = nullptr; + m_NSWMM_sdo_barcode = nullptr; + m_NSWMM_sdo_globalPosX = nullptr; + m_NSWMM_sdo_globalPosY = nullptr; + m_NSWMM_sdo_globalPosZ = nullptr; + m_NSWMM_sdo_globaltime = nullptr; + + m_NSWMM_sdo_localPosX = nullptr; + m_NSWMM_sdo_localPosY = nullptr; + + return; +} + + +StatusCode MMSDOVariables::clearVariables() +{ + m_NSWMM_nsdo = 0; + m_NSWMM_sdo_stationName->clear(); + m_NSWMM_sdo_stationEta->clear(); + m_NSWMM_sdo_stationPhi->clear(); + m_NSWMM_sdo_multiplet->clear(); + m_NSWMM_sdo_gas_gap->clear(); + m_NSWMM_sdo_channel->clear(); + + m_NSWMM_sdo_word->clear(); + m_NSWMM_sdo_barcode->clear(); + m_NSWMM_sdo_globalPosX->clear(); + m_NSWMM_sdo_globalPosY->clear(); + m_NSWMM_sdo_globalPosZ->clear(); + m_NSWMM_sdo_globaltime->clear(); + m_NSWMM_sdo_localPosX->clear(); + m_NSWMM_sdo_localPosY->clear(); + + return StatusCode::SUCCESS; +} + + +StatusCode MMSDOVariables::initializeVariables() +{ + m_NSWMM_nsdo = 0; + m_NSWMM_sdo_stationName = new std::vector<std::string>(); + m_NSWMM_sdo_stationEta = new std::vector<int>(); + m_NSWMM_sdo_stationPhi = new std::vector<int>(); + m_NSWMM_sdo_multiplet = new std::vector<int>(); + m_NSWMM_sdo_gas_gap = new std::vector<int>(); + m_NSWMM_sdo_channel = new std::vector<int>(); + + m_NSWMM_sdo_word = new std::vector<int>(); + m_NSWMM_sdo_barcode = new std::vector<int>(); + m_NSWMM_sdo_globalPosX = new std::vector<double>(); + m_NSWMM_sdo_globalPosY = new std::vector<double>(); + m_NSWMM_sdo_globalPosZ = new std::vector<double>(); + m_NSWMM_sdo_globaltime = new std::vector<double>(); + + m_NSWMM_sdo_localPosX = new std::vector<double>(); + m_NSWMM_sdo_localPosY = new std::vector<double>(); + + if(m_tree) { + m_tree->Branch("SDO_MM", &m_NSWMM_nsdo, "SDOs_MM_n/i"); + m_tree->Branch("SDO_MM_stationName", &m_NSWMM_sdo_stationName); + m_tree->Branch("SDO_MM_stationEta", &m_NSWMM_sdo_stationEta); + m_tree->Branch("SDO_MM_stationPhi", &m_NSWMM_sdo_stationPhi); + m_tree->Branch("SDO_MM_multiplet", &m_NSWMM_sdo_multiplet); + m_tree->Branch("SDO_MM_gas_gap", &m_NSWMM_sdo_gas_gap); + m_tree->Branch("SDO_MM_channel", &m_NSWMM_sdo_channel); + + m_tree->Branch("SDO_MM_word", &m_NSWMM_sdo_word); + m_tree->Branch("SDO_MM_barcode", &m_NSWMM_sdo_barcode); + m_tree->Branch("SDO_MM_globalPosX", &m_NSWMM_sdo_globalPosX); + m_tree->Branch("SDO_MM_globalPosY", &m_NSWMM_sdo_globalPosY); + m_tree->Branch("SDO_MM_globalPosZ", &m_NSWMM_sdo_globalPosZ); + m_tree->Branch("SDO_MM_global_time", &m_NSWMM_sdo_globaltime); + m_tree->Branch("SDO_MM_localPosX", &m_NSWMM_sdo_localPosX); + m_tree->Branch("SDO_MM_localPosY", &m_NSWMM_sdo_localPosY); + + } + + return StatusCode::SUCCESS; +} \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMSDOVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMSDOVariables.h new file mode 100644 index 0000000000000000000000000000000000000000..2c8499f93d3103c9feb358fb1fc1c0cafd0ad9d3 --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMSDOVariables.h @@ -0,0 +1,86 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef MMSDOVARIABLES_H +#define MMSDOVARIABLES_H + +#include <vector> + +#include "ValAlgVariables.h" +#include "MuonIdHelpers/MmIdHelper.h" +#include "AthenaBaseComps/AthMsgStreamMacros.h" + +class MMSDOVariables : public ValAlgVariables +{ + public: + MMSDOVariables(StoreGateSvc* evtStore, + const MuonGM::MuonDetectorManager* detManager, + const MuonIdHelper* idhelper, + TTree* tree, + std::string containername) : + ValAlgVariables(evtStore, detManager, tree, containername, "MMSDOVariables"), + m_MmIdHelper(0), + m_NSWMM_nsdo(0), + m_NSWMM_sdo_stationName(0), + m_NSWMM_sdo_stationEta(0), + m_NSWMM_sdo_stationPhi(0), + m_NSWMM_sdo_multiplet(0), + m_NSWMM_sdo_gas_gap(0), + m_NSWMM_sdo_channel(0), + m_NSWMM_sdo_word(0), + m_NSWMM_sdo_barcode(0), + m_NSWMM_sdo_globalPosX(0), + m_NSWMM_sdo_globalPosY(0), + m_NSWMM_sdo_globalPosZ(0), + m_NSWMM_sdo_globaltime(0), + m_NSWMM_sdo_localPosX(0), + m_NSWMM_sdo_localPosY(0) + { + setHelper(idhelper); + } + + ~MMSDOVariables() + { + deleteVariables(); + } + + StatusCode initializeVariables(); + StatusCode fillVariables(); + + private: + + void setHelper(const MuonIdHelper* idhelper){ + m_MmIdHelper = dynamic_cast<const MmIdHelper*>(idhelper); + if(m_MmIdHelper == 0) { + ATH_MSG_ERROR("casting IdHelper to MmIdhelper failed"); + throw; + } + } + + void deleteVariables(); + StatusCode clearVariables(); + + const MmIdHelper* m_MmIdHelper; + + int m_NSWMM_nsdo; + std::vector<std::string> *m_NSWMM_sdo_stationName; + std::vector<int> *m_NSWMM_sdo_stationEta; + std::vector<int> *m_NSWMM_sdo_stationPhi; + std::vector<int> *m_NSWMM_sdo_multiplet; + std::vector<int> *m_NSWMM_sdo_gas_gap; + std::vector<int> *m_NSWMM_sdo_channel; + + std::vector<int> *m_NSWMM_sdo_word; + std::vector<int> *m_NSWMM_sdo_barcode; + std::vector<double> *m_NSWMM_sdo_globalPosX; + std::vector<double> *m_NSWMM_sdo_globalPosY; + std::vector<double> *m_NSWMM_sdo_globalPosZ; + std::vector<double> *m_NSWMM_sdo_globaltime; + + std::vector<double> *m_NSWMM_sdo_localPosX; + std::vector<double> *m_NSWMM_sdo_localPosY; + +}; + +#endif // MMSDOVARIABLE_H diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMSimHitVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMSimHitVariables.cxx index dd9169d5af758ab916f0afd57bff2d834b572925..d6180277b17e2fabaa3021ac202864d7fafa4fe9 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMSimHitVariables.cxx +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMSimHitVariables.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #include "MMSimHitVariables.h" @@ -34,17 +34,10 @@ StatusCode MMSimHitVariables::fillVariables() const GenericMuonSimHit hit = it; if(hit.depositEnergy()==0.) continue; // SimHits without energy loss are not recorded. - // if( hit.kineticEnergy()<m_energyThreshold && abs(hit.particleEncoding())==11) continue ; // connect the hit with the MC truth -// int barcode = hit.particleLink().barcode(); -// m_NSWMM_trackId->push_back(barcode); -// for (unsigned int tr=0;tr<m_Truth_particleBarcode->size();tr++) { -// if (barcode==m_Truth_particleBarcode->at(tr)) { -// m_NSWMM_truthEl->push_back(tr); -// } -// } - + int barcode = hit.particleLink().barcode(); + m_NSWMM_trackId->push_back(barcode); m_NSWMM_globalTime->push_back(hit.globalTime()); @@ -145,17 +138,9 @@ StatusCode MMSimHitVariables::fillVariables() ATH_MSG_DEBUG("MicroMegas geometry, retrieving detector element for: isSmall " << isSmall << " eta " << m_MmIdHelper->stationEta(offId) << " phi " << m_MmIdHelper->stationPhi(offId) << " ml " << m_MmIdHelper->multilayer(offId) ); - int phiCor = m_MmIdHelper->stationPhi(offId); - int mlCor = m_MmIdHelper->multilayer(offId); - - const MuonGM::MMReadoutElement* detEl = m_detManager->getMMRElement_fromIdFields(isSmall, m_MmIdHelper->stationEta(offId), phiCor, mlCor ); - // const MuonGM::MMReadoutElement* detEl = m_detManager->getMMReadoutElement(offId); + const MuonGM::MMReadoutElement* detEl = m_detManager->getMMReadoutElement(offId); if( !detEl ){ - /* - ATH_MSG_WARNING("MicroMegas geometry, failed to retrieve detector element for: isSmall " << isSmall << " eta " << m_MmIdHelper->stationEta(offId) - << " phi " << m_MmIdHelper->stationPhi(offId) << " ml " << m_MmIdHelper->multiplet(offId) ); - */ ATH_MSG_WARNING("MicroMegas geometry, failed to retrieve detector element for: " << m_MmIdHelper->print_to_string(offId) ); continue; } @@ -171,14 +156,11 @@ StatusCode MMSimHitVariables::fillVariables() Amg::Vector3D rSurface_pos = surf.transform().inverse()*hpos; Amg::Vector2D posOnSurfUnProjected(rSurface_pos.x(),rSurface_pos.y()); -// double gasGapThickness = detEl->getDesign(offId)->gasGapThickness(); + // double gasGapThickness = detEl->getDesign(offId)->gasGapThickness(); // check where the readout plane is located and compute the local direction accordingly Amg::Vector3D ldir(0., 0., 0.); - if ((roParam.stereoAngel).at(m_MmIdHelper->gasGap(offId)-1)==1) - ldir = surf.transform().inverse().linear()*Amg::Vector3D(hit.globalDirection().x(), hit.globalDirection().y(), hit.globalDirection().z()); - else - ldir = surf.transform().inverse().linear()*Amg::Vector3D(hit.globalDirection().x(), hit.globalDirection().y(), -hit.globalDirection().z()); + ldir = surf.transform().inverse().linear()*Amg::Vector3D(hit.globalDirection().x(), hit.globalDirection().y(), hit.globalDirection().z()); double scale, scaletop; double gasgap = 5.; @@ -194,7 +176,7 @@ StatusCode MMSimHitVariables::fillVariables() int stripNumber = detEl->stripNumber(posOnSurf,offId); -// int LastStripNumber = detEl->stripNumber(posOnTopSurf, offId); + // int LastStripNumber = detEl->stripNumber(posOnTopSurf, offId); // perform bound check if( !surf.insideBounds(posOnSurf) ) continue; @@ -235,6 +217,9 @@ StatusCode MMSimHitVariables::fillVariables() m_NSWMM_off_stationPhi ->push_back(off_stationPhi); m_NSWMM_off_multiplet ->push_back(off_multiplet); m_NSWMM_off_gas_gap ->push_back(off_gas_gap); + // The offline IdHelper class will be updated to assign wiregroup ID to SimHit. + // As a temporary solution stripnumber is used directly (also in sTGC) + off_channel = stripNumber; m_NSWMM_off_channel ->push_back(off_channel); @@ -270,7 +255,6 @@ StatusCode MMSimHitVariables::clearVariables() { m_NSWMM_nSimHits = 0; m_NSWMM_trackId->clear(); - m_NSWMM_truthEl->clear(); m_NSWMM_globalTime->clear(); m_NSWMM_hitGlobalPositionX->clear(); m_NSWMM_hitGlobalPositionY->clear(); @@ -302,13 +286,11 @@ StatusCode MMSimHitVariables::clearVariables() m_NSWMM_FastDigitRsurfacePositionX->clear(); m_NSWMM_FastDigitRsurfacePositionY->clear(); - m_NSWMM_particleEncoding->clear(); m_NSWMM_kineticEnergy->clear(); m_NSWMM_depositEnergy->clear(); m_NSWMM_StepLength->clear(); - m_NSWMM_sim_stationName->clear(); m_NSWMM_sim_stationEta->clear(); m_NSWMM_sim_stationPhi->clear(); @@ -326,8 +308,10 @@ StatusCode MMSimHitVariables::clearVariables() return StatusCode::SUCCESS; } -StatusCode MMSimHitVariables::deleteVariables() +void MMSimHitVariables::deleteVariables() { + delete m_NSWMM_trackId; + delete m_NSWMM_globalTime; delete m_NSWMM_hitGlobalPositionX; delete m_NSWMM_hitGlobalPositionY; @@ -381,6 +365,7 @@ StatusCode MMSimHitVariables::deleteVariables() m_NSWMM_nSimHits = 0; + m_NSWMM_trackId = nullptr; m_NSWMM_globalTime = nullptr; m_NSWMM_hitGlobalPositionX = nullptr; m_NSWMM_hitGlobalPositionY = nullptr; @@ -432,14 +417,13 @@ StatusCode MMSimHitVariables::deleteVariables() m_NSWMM_off_gas_gap = nullptr; m_NSWMM_off_channel = nullptr; - return StatusCode::SUCCESS; + return; } StatusCode MMSimHitVariables::initializeVariables() { m_NSWMM_nSimHits = 0; m_NSWMM_trackId = new std::vector<int>; - m_NSWMM_truthEl = new std::vector<int>; m_NSWMM_globalTime = new std::vector<double>; m_NSWMM_hitGlobalPositionX = new std::vector<double>; m_NSWMM_hitGlobalPositionY = new std::vector<double>; @@ -495,7 +479,6 @@ StatusCode MMSimHitVariables::initializeVariables() if(m_tree) { m_tree->Branch("Hits_MM_n", &m_NSWMM_nSimHits, "Hits_MM_n/i"); m_tree->Branch("Hits_MM_trackId", &m_NSWMM_trackId); - m_tree->Branch("Hits_MM_truthEl", &m_NSWMM_truthEl); m_tree->Branch("Hits_MM_globalTime", &m_NSWMM_globalTime); m_tree->Branch("Hits_MM_hitGlobalPositionX", &m_NSWMM_hitGlobalPositionX); m_tree->Branch("Hits_MM_hitGlobalPositionY", &m_NSWMM_hitGlobalPositionY); diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMSimHitVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMSimHitVariables.h index bed164413de86be4372d87561b75b8c9a228c591..9cc59c14d5685740f446ea15206f857e50c34cf2 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMSimHitVariables.h +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMSimHitVariables.h @@ -22,7 +22,6 @@ class MMSimHitVariables : public ValAlgVariables m_MmIdHelper(0), m_NSWMM_nSimHits(0), m_NSWMM_trackId(0), - m_NSWMM_truthEl(0), m_NSWMM_globalTime(0), m_NSWMM_hitGlobalPositionX(0), m_NSWMM_hitGlobalPositionY(0), @@ -70,10 +69,7 @@ class MMSimHitVariables : public ValAlgVariables ~MMSimHitVariables() { - if( (this->deleteVariables()).isFailure() ){ - ATH_MSG_ERROR("Failing to delete MMSimHitVariables."); - std::terminate(); - } + deleteVariables(); } StatusCode initializeVariables(); @@ -89,14 +85,13 @@ class MMSimHitVariables : public ValAlgVariables } } - StatusCode deleteVariables(); + void deleteVariables(); StatusCode clearVariables(); const MmIdHelper* m_MmIdHelper; int m_NSWMM_nSimHits; std::vector<int> *m_NSWMM_trackId; - std::vector<int> *m_NSWMM_truthEl; std::vector<double> *m_NSWMM_globalTime; std::vector<double> *m_NSWMM_hitGlobalPositionX; std::vector<double> *m_NSWMM_hitGlobalPositionY; diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MuEntryVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MuEntryVariables.cxx index 8cfbcd37b4e17719ec69444dbd5a9b875207877f..4e26777f27db1d3e524866c6cfcc9edcef935de4 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MuEntryVariables.cxx +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MuEntryVariables.cxx @@ -100,7 +100,7 @@ StatusCode MuEntryVariables::initializeVariables() /** ---------- freeing resources and resetting pointers */ /** ---------- to be called on finalize level of main alg */ -StatusCode MuEntryVariables::deleteVariables() +void MuEntryVariables::deleteVariables() { m_MuEntry_nParticles = 0; @@ -127,5 +127,5 @@ StatusCode MuEntryVariables::deleteVariables() m_MuEntry_positionY = nullptr; m_MuEntry_positionZ = nullptr; - return StatusCode::SUCCESS; + return; } diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MuEntryVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MuEntryVariables.h index b4226cdcbf50be7f54a5949fa5e4b2c08d1e2c6b..b7d8eb51a9dc2b0f1417c28d10ab3ca218837aa9 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MuEntryVariables.h +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MuEntryVariables.h @@ -35,10 +35,7 @@ class MuEntryVariables : public ValAlgVariables ~MuEntryVariables() { - if( (this->deleteVariables()).isFailure() ){ - ATH_MSG_ERROR("Failing to delete MuEntryVariables."); - std::terminate(); - } + deleteVariables(); } StatusCode initializeVariables(); @@ -50,7 +47,7 @@ class MuEntryVariables : public ValAlgVariables ATH_MSG_ERROR("No Helper for MuEntryVariables."); } - StatusCode deleteVariables(); + void deleteVariables(); StatusCode clearVariables(); int m_MuEntry_nParticles; diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/NSWPRDValAlg.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/NSWPRDValAlg.cxx index de86feae22c424833426b8fabe10358ac7b52235..7c206f97f9617fde530f6fedd8c7103cabaeb959 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/NSWPRDValAlg.cxx +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/NSWPRDValAlg.cxx @@ -1,16 +1,20 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #include "NSWPRDValAlg.h" #include "MMDigitVariables.h" #include "MMSimHitVariables.h" -#include "MMFastDigitVariables.h" +#include "MMSDOVariables.h" +#include "MMRDOVariables.h" +#include "MMPRDVariables.h" #include "sTGCDigitVariables.h" #include "sTGCSimHitVariables.h" -#include "sTGCFastDigitVariables.h" +#include "sTGCRDOVariables.h" +#include "sTGCSDOVariables.h" +#include "sTGCPRDVariables.h" #include "CSCDigitVariables.h" @@ -26,18 +30,25 @@ #include "MuonIdHelpers/sTgcIdHelper.h" #include "MuonIdHelpers/CscIdHelper.h" -#include "xAODEventInfo/EventInfo.h" +#include "EventInfo/EventInfo.h" +#include "EventInfo/EventID.h" NSWPRDValAlg::NSWPRDValAlg(const std::string& name, ISvcLocator* pSvcLocator) : AthAlgorithm(name, pSvcLocator), m_TruthVar(nullptr), m_MuEntryVar(nullptr), m_sTgcSimHitVar(nullptr), - m_sTgcFastDigitVar(nullptr), + m_sTgcRdoVar(nullptr), + m_sTgcSdoVar(nullptr), + m_sTgcFastSdoVar(nullptr), m_sTgcDigitVar(nullptr), + m_sTgcPrdVar(nullptr), m_MmSimHitVar(nullptr), - m_MmFastDigitVar(nullptr), + m_MmSdoVar(nullptr), + m_MmFastSdoVar(nullptr), m_MmDigitVar(nullptr), + m_MmRdoVar(nullptr), + m_MmPrdVar(nullptr), m_CscDigitVar(nullptr), m_thistSvc(nullptr), m_tree(nullptr), @@ -48,24 +59,32 @@ NSWPRDValAlg::NSWPRDValAlg(const std::string& name, ISvcLocator* pSvcLocator) m_runNumber(0), m_eventNumber(0) { - declareProperty("Truth_ContainerName", m_Truth_ContainerName="TruthEvent"); - declareProperty("MuonEntryLayer_ContainerName", m_MuEntry_ContainerName="MuonEntryLayer"); - declareProperty("NSWsTGC_ContainerName", m_NSWsTGC_ContainerName="sTGCSensitiveDetector"); - declareProperty("NSWsTGC_FastDigitContainerName", m_NSWsTGC_FastDigitContainerName="STGC_Measurements"); - declareProperty("NSWsTGC_DigitContainerName", m_NSWsTGC_DigitContainerName=""); - declareProperty("NSWMM_ContainerName", m_NSWMM_ContainerName="MicromegasSensitiveDetector"); - declareProperty("NSWMM_FastDigitContainerName", m_NSWMM_FastDigitContainerName="MM_Measurements"); - declareProperty("NSWMM_DigitContainerName", m_NSWMM_DigitContainerName="MM_DIGITS"); - declareProperty("CSC_DigitContainerName", m_CSC_DigitContainerName="CSC_DIGITS"); + declareProperty("Truth_ContainerName", m_Truth_ContainerName="TruthEvent"); + declareProperty("MuonEntryLayer_ContainerName", m_MuEntry_ContainerName="MuonEntryLayer"); + declareProperty("NSWsTGC_ContainerName", m_NSWsTGC_ContainerName="sTGCSensitiveDetector"); + declareProperty("NSWsTGC_DigitContainerName", m_NSWsTGC_DigitContainerName="sTGC_DIGITS"); + declareProperty("NSWsTGC_SDOContainerName", m_NSWsTGC_SDOContainerName="sTGC_SDO"); + declareProperty("NSWsTGC_RDOContainerName", m_NSWsTGC_RDOContainerName="sTGCRDO"); + declareProperty("NSWsTGC_PRDContainerName", m_NSWsTGC_PRDContainerName="STGC_Measurements"); + declareProperty("NSWMM_ContainerName", m_NSWMM_ContainerName="MicromegasSensitiveDetector"); + declareProperty("NSWMM_DigitContainerName", m_NSWMM_DigitContainerName="MM_DIGITS"); + declareProperty("NSWMM_SDOContainerName", m_NSWMM_SDOContainerName="MM_SDO"); + declareProperty("NSWMM_RDOContainerName", m_NSWMM_RDOContainerName="MMRDO"); + declareProperty("NSWMM_PRDContainerName", m_NSWMM_PRDContainerName="MM_Measurements"); + declareProperty("CSC_DigitContainerName", m_CSC_DigitContainerName="CSC_DIGITS"); declareProperty("doTruth", m_doTruth=false); declareProperty("doMuEntry", m_doMuEntry=false); declareProperty("doSTGCHit", m_doSTGCHit=false); - declareProperty("doSTGCFastDigit", m_doSTGCFastDigit=false); declareProperty("doSTGCDigit", m_doSTGCDigit=false); + declareProperty("doSTGCFastDigit", m_doSTGCFastDigit=false); + declareProperty("doSTGCRDO", m_doSTGCRDO=false); + declareProperty("doSTGCPRD", m_doSTGCPRD=false); declareProperty("doMMHit", m_doMMHit=false); - declareProperty("doMMFastDigit", m_doMMFastDigit=false); declareProperty("doMMDigit", m_doMMDigit=false); + declareProperty("doMMFastDigit", m_doMMFastDigit=false); + declareProperty("doMMRDO", m_doMMRDO=false); + declareProperty("doMMPRD", m_doMMPRD=false); declareProperty("doCSCDigit", m_doCSCDigit=false); } @@ -91,7 +110,7 @@ StatusCode NSWPRDValAlg::initialize() { if (m_doTruth){ m_TruthVar = new TruthVariables(&(*(evtStore())), m_detManager, - m_tree, m_Truth_ContainerName); + m_tree, m_Truth_ContainerName); CHECK( m_TruthVar->initializeVariables() ); } @@ -103,43 +122,111 @@ StatusCode NSWPRDValAlg::initialize() { if (m_doSTGCHit){ m_sTgcSimHitVar = new sTGCSimHitVariables(&(*(evtStore())), m_detManager, - m_sTgcIdHelper, m_tree, m_NSWsTGC_ContainerName); + m_sTgcIdHelper, m_tree, m_NSWsTGC_ContainerName); ATH_CHECK( m_sTgcSimHitVar->initializeVariables() ); } + + if (m_doSTGCDigit){ + m_sTgcDigitVar = new sTGCDigitVariables(&(*(evtStore())), m_detManager, + m_sTgcIdHelper, m_tree, m_NSWsTGC_DigitContainerName); + ATH_CHECK( m_sTgcDigitVar->initializeVariables() ); + } - if (m_doSTGCFastDigit){ - m_sTgcFastDigitVar = new sTGCFastDigitVariables(&(*(evtStore())), m_detManager, - m_sTgcIdHelper, m_tree, m_NSWsTGC_FastDigitContainerName); - ATH_CHECK( m_sTgcFastDigitVar->initializeVariables() ); + if (m_doSTGCRDO){ + m_sTgcRdoVar = new sTGCRDOVariables(&(*(evtStore())), m_detManager, + m_sTgcIdHelper, m_tree, m_NSWsTGC_RDOContainerName); + ATH_CHECK( m_sTgcRdoVar->initializeVariables() ); } if (m_doSTGCDigit){ m_sTgcDigitVar = new sTGCDigitVariables(&(*(evtStore())), m_detManager, m_sTgcIdHelper, m_tree, m_NSWsTGC_DigitContainerName); ATH_CHECK( m_sTgcDigitVar->initializeVariables() ); + + // Take SDO conainer + m_sTgcSdoVar = new sTGCSDOVariables(&(*(evtStore())), m_detManager, + m_sTgcIdHelper, m_tree, m_NSWsTGC_SDOContainerName); + ATH_CHECK( m_sTgcSdoVar->initializeVariables() ); + } + + if (m_doSTGCFastDigit){ + // Take the "fast_SDO" instead of the SDOs from full sim + m_sTgcFastSdoVar = new sTGCSDOVariables(&(*(evtStore())), m_detManager, + m_sTgcIdHelper, m_tree, "sTGCfast_SDO"); + ATH_CHECK( m_sTgcFastSdoVar->initializeVariables() ); + + // Fast digits = PRD + m_doSTGCPRD = true; + } + + if (m_doSTGCRDO){ + m_sTgcRdoVar = new sTGCRDOVariables(&(*(evtStore())), m_detManager, + m_sTgcIdHelper, m_tree, m_NSWsTGC_RDOContainerName); + ATH_CHECK( m_sTgcRdoVar->initializeVariables() ); + } + + if (m_doSTGCPRD){ + m_sTgcPrdVar = new sTGCPRDVariables(&(*(evtStore())), m_detManager, + m_sTgcIdHelper, m_tree, m_NSWsTGC_PRDContainerName); + ATH_CHECK( m_sTgcPrdVar->initializeVariables() ); } if (m_doMMHit) { m_MmSimHitVar = new MMSimHitVariables(&(*(evtStore())), m_detManager, - m_MmIdHelper, m_tree, m_NSWMM_ContainerName); + m_MmIdHelper, m_tree, m_NSWMM_ContainerName); ATH_CHECK( m_MmSimHitVar->initializeVariables() ); } if (m_doMMDigit) { m_MmDigitVar = new MMDigitVariables(&(*(evtStore())), m_detManager, - m_MmIdHelper, m_tree, m_NSWMM_DigitContainerName); + m_MmIdHelper, m_tree, m_NSWMM_DigitContainerName); ATH_CHECK( m_MmDigitVar->initializeVariables() ); + + // Take SDO conainer + m_MmSdoVar = new MMSDOVariables(&(*(evtStore())), m_detManager, + m_MmIdHelper, m_tree, m_NSWMM_SDOContainerName); + ATH_CHECK( m_MmSdoVar->initializeVariables() ); + } + + if (m_doMMRDO) { + + m_MmRdoVar = new MMRDOVariables(&(*(evtStore())), m_detManager, + m_MmIdHelper, m_tree, m_NSWMM_RDOContainerName); + ATH_CHECK( m_MmRdoVar->initializeVariables() ); } if (m_doMMFastDigit){ - m_MmFastDigitVar = new MMFastDigitVariables(&(*(evtStore())), m_detManager, - m_MmIdHelper, m_tree, m_NSWMM_FastDigitContainerName); - ATH_CHECK( m_MmFastDigitVar->initializeVariables() ); + // Take the "fast_SDO" instead of the SDOs from full sim + m_MmFastSdoVar = new MMSDOVariables(&(*(evtStore())), m_detManager, + m_MmIdHelper, m_tree, "MMfast_SDO"); + ATH_CHECK( m_MmFastSdoVar->initializeVariables() ); + + // Fast digits = PRD + m_doMMPRD = true; + } + + if (m_doMMRDO) { + + m_MmRdoVar = new MMRDOVariables(&(*(evtStore())), m_detManager, + m_MmIdHelper, m_tree, m_NSWMM_RDOContainerName); + ATH_CHECK( m_MmRdoVar->initializeVariables() ); + } + + if (m_doMMPRD){ + m_MmPrdVar = new MMPRDVariables(&(*(evtStore())), m_detManager, + m_MmIdHelper, m_tree, m_NSWMM_PRDContainerName); + ATH_CHECK( m_MmPrdVar->initializeVariables() ); + } + + if (m_doMMPRD){ + m_MmPrdVar = new MMPRDVariables(&(*(evtStore())), m_detManager, + m_MmIdHelper, m_tree, m_NSWMM_PRDContainerName); + ATH_CHECK( m_MmPrdVar->initializeVariables() ); } if (m_doCSCDigit){ m_CscDigitVar = new CSCDigitVariables(&(*(evtStore())), m_detManager, - m_CscIdHelper, m_tree, m_CSC_DigitContainerName); + m_CscIdHelper, m_tree, m_CSC_DigitContainerName); ATH_CHECK( m_CscDigitVar->initializeVariables() ); } @@ -153,11 +240,17 @@ StatusCode NSWPRDValAlg::finalize() if (m_TruthVar) { delete m_TruthVar; m_TruthVar=0;} if (m_doMuEntry) { delete m_MuEntryVar; m_MuEntryVar=0;} if (m_sTgcSimHitVar) { delete m_sTgcSimHitVar; m_sTgcSimHitVar=0;} - if (m_sTgcFastDigitVar) { delete m_sTgcFastDigitVar; m_sTgcFastDigitVar=0;} + if (m_sTgcRdoVar) { delete m_sTgcRdoVar; m_sTgcRdoVar=0;} + if (m_sTgcSdoVar) { delete m_sTgcSdoVar; m_sTgcSdoVar=0;} + if (m_sTgcFastSdoVar) { delete m_sTgcSdoVar; m_sTgcSdoVar=0;} if (m_sTgcDigitVar) { delete m_sTgcDigitVar; m_sTgcDigitVar=0;} + if (m_sTgcPrdVar) { delete m_sTgcPrdVar; m_sTgcPrdVar=0;} if (m_MmSimHitVar) { delete m_MmSimHitVar; m_MmSimHitVar=0;} - if (m_MmFastDigitVar) { delete m_MmFastDigitVar; m_MmFastDigitVar=0;} + if (m_MmSdoVar) { delete m_MmSdoVar; m_MmSdoVar=0;} + if (m_MmFastSdoVar) { delete m_MmSdoVar; m_MmSdoVar=0;} if (m_MmDigitVar) { delete m_MmDigitVar; m_MmDigitVar=0;} + if (m_MmRdoVar) { delete m_MmRdoVar; m_MmRdoVar=0;} + if (m_MmPrdVar) { delete m_MmPrdVar; m_MmPrdVar=0;} if (m_CscDigitVar) { delete m_CscDigitVar; m_CscDigitVar=0;} return StatusCode::SUCCESS; @@ -168,14 +261,15 @@ StatusCode NSWPRDValAlg::execute() ATH_MSG_INFO("execute()"); // Event information - const xAOD::EventInfo *pevt = nullptr; - if( ! ( evtStore()->retrieve(pevt).isSuccess() ) ) { - ATH_MSG_WARNING("Could not retrieve event info!"); - m_runNumber = -999999; - m_eventNumber = -999999; + const EventInfo* pevt(0); + if( evtStore()->retrieve(pevt).isSuccess() ) { + m_runNumber = pevt->event_ID()->run_number(); + m_eventNumber = pevt->event_ID()->event_number(); + ATH_MSG_DEBUG("Now processing event number:" << m_eventNumber << ", run number:" << m_runNumber); } else { - m_runNumber = pevt->runNumber(); - m_eventNumber = pevt->eventNumber(); + ATH_MSG_WARNING("Could not retrieve event info!"); + m_runNumber = -1; + m_eventNumber = -1; } if (m_doTruth) ATH_CHECK( m_TruthVar->fillVariables() ); @@ -184,15 +278,23 @@ StatusCode NSWPRDValAlg::execute() if (m_doSTGCHit) ATH_CHECK( m_sTgcSimHitVar->fillVariables() ); - if (m_doSTGCFastDigit) ATH_CHECK( m_sTgcDigitVar->fillVariables() ); + if (m_doSTGCDigit) { ATH_CHECK( m_sTgcDigitVar->fillVariables() ); ATH_CHECK( m_sTgcSdoVar->fillVariables() ); } - if (m_doSTGCDigit) ATH_CHECK( m_sTgcDigitVar->fillVariables() ); + if (m_doSTGCFastDigit) ATH_CHECK( m_sTgcFastSdoVar->fillVariables() ); + + if (m_doSTGCRDO) ATH_CHECK( m_sTgcRdoVar->fillVariables() ); + + if (m_doSTGCPRD) ATH_CHECK( m_sTgcPrdVar->fillVariables() ); if (m_doMMHit) ATH_CHECK( m_MmSimHitVar->fillVariables() ); - if (m_doMMFastDigit) ATH_CHECK( m_MmFastDigitVar->fillVariables() ); + if (m_doMMDigit) { ATH_CHECK( m_MmDigitVar->fillVariables() ); ATH_CHECK( m_MmSdoVar->fillVariables() ); } + + if (m_doMMFastDigit) ATH_CHECK( m_MmFastSdoVar->fillVariables() ); + + if (m_doMMRDO) ATH_CHECK( m_MmRdoVar->fillVariables() ); - if (m_doMMDigit) ATH_CHECK( m_MmDigitVar->fillVariables() ); + if (m_doMMPRD) ATH_CHECK( m_MmPrdVar->fillVariables() ); if (m_doCSCDigit) ATH_CHECK( m_CscDigitVar->fillVariables() ); diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/NSWPRDValAlg.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/NSWPRDValAlg.h index 19117fba125d53ca5529695e39accaebd0235d91..8dd43410e0901d0586030780361d073867fe9c7e 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/NSWPRDValAlg.h +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/NSWPRDValAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef NSWPRDVALALG_H @@ -11,11 +11,15 @@ class MMDigitVariables; class MMSimHitVariables; -class MMFastDigitVariables; +class MMSDOVariables; +class MMRDOVariables; +class MMPRDVariables; class sTGCDigitVariables; class sTGCSimHitVariables; -class sTGCFastDigitVariables; +class sTGCSDOVariables; +class sTGCRDOVariables; +class sTGCPRDVariables; class CSCDigitVariables; @@ -45,11 +49,17 @@ class NSWPRDValAlg:public AthAlgorithm TruthVariables* m_TruthVar; MuEntryVariables* m_MuEntryVar; sTGCSimHitVariables* m_sTgcSimHitVar; - sTGCFastDigitVariables* m_sTgcFastDigitVar; + sTGCRDOVariables* m_sTgcRdoVar; + sTGCSDOVariables* m_sTgcSdoVar; + sTGCSDOVariables* m_sTgcFastSdoVar; sTGCDigitVariables* m_sTgcDigitVar; + sTGCPRDVariables* m_sTgcPrdVar; MMSimHitVariables* m_MmSimHitVar; - MMFastDigitVariables* m_MmFastDigitVar; + MMSDOVariables* m_MmSdoVar; + MMSDOVariables* m_MmFastSdoVar; MMDigitVariables* m_MmDigitVar; + MMRDOVariables* m_MmRdoVar; + MMPRDVariables* m_MmPrdVar; CSCDigitVariables* m_CscDigitVar; ITHistSvc *m_thistSvc; @@ -65,10 +75,14 @@ class NSWPRDValAlg:public AthAlgorithm BooleanProperty m_doSTGCHit; // switch on the output of the Small TGC data BooleanProperty m_doSTGCFastDigit; // switch on the output of the Small TGC fast digitization BooleanProperty m_doSTGCDigit; // swicth on the output of the Small TGC digit + BooleanProperty m_doSTGCRDO; // switch on the output of the Small TGC RDO + BooleanProperty m_doSTGCPRD; // swicth on the output of the Small TGC prepdata BooleanProperty m_doMMHit; // switch on the output of the MicroMegas data BooleanProperty m_doMMFastDigit; // switch on the output of the MicroMegas fast digitization BooleanProperty m_doMMDigit; // switch on the output of the MicroMegas digitization - BooleanProperty m_doCSCDigit; // switch on the output of the MicroMegas digitization + BooleanProperty m_doMMRDO; // switch on the output of the MicroMegas RDO + BooleanProperty m_doMMPRD; // switch on the output of the MicroMegas prepdata + BooleanProperty m_doCSCDigit; // switch on the output of the MicroMegas digitization unsigned int m_runNumber; unsigned int m_eventNumber; @@ -76,12 +90,16 @@ class NSWPRDValAlg:public AthAlgorithm std::string m_Truth_ContainerName; std::string m_MuEntry_ContainerName; std::string m_NSWsTGC_ContainerName; - std::string m_NSWsTGC_FastDigitContainerName; + std::string m_NSWsTGC_SDOContainerName; std::string m_NSWsTGC_DigitContainerName; + std::string m_NSWsTGC_RDOContainerName; + std::string m_NSWsTGC_PRDContainerName; std::string m_NSWMM_ContainerName; - std::string m_NSWMM_FastDigitContainerName; + std::string m_NSWMM_SDOContainerName; std::string m_NSWMM_DigitContainerName; + std::string m_NSWMM_RDOContainerName; + std::string m_NSWMM_PRDContainerName; std::string m_CSC_DigitContainerName; }; -#endif // NSWHITSDUMPALG_H +#endif // NSWPRDVALALG_H diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/TruthVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/TruthVariables.cxx index c7edf9c11f2503d8abe3e41b7c6df21c9fdb8c6c..125adc707a6f4a23aa2afee7c3ffe3aab9da51c2 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/TruthVariables.cxx +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/TruthVariables.cxx @@ -142,7 +142,7 @@ StatusCode TruthVariables::initializeVariables() /** ---------- freeing resources and resetting pointers */ /** ---------- to be called in the destructor */ -StatusCode TruthVariables::deleteVariables() +void TruthVariables::deleteVariables() { m_Truth_nVertices = 0; @@ -182,5 +182,5 @@ StatusCode TruthVariables::deleteVariables() m_Truth_particleProduction_vertex_id = nullptr; m_Truth_particleEnd_vertex_id = nullptr; - return StatusCode::SUCCESS; + return; } diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/TruthVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/TruthVariables.h index dc6ae08acb3d08512c88ce157d7fc39bac8e91ec..008c847ca93bf05179d7d6e047499ba093c532b0 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/TruthVariables.h +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/TruthVariables.h @@ -41,10 +41,7 @@ class TruthVariables : public ValAlgVariables ~TruthVariables() { - if( (this->deleteVariables()).isFailure() ){ - ATH_MSG_ERROR("Failing to delete TruthVariables."); - std::terminate(); - } + deleteVariables(); } StatusCode initializeVariables(); @@ -56,7 +53,7 @@ class TruthVariables : public ValAlgVariables ATH_MSG_ERROR("No Helper for TruthVariables."); } - StatusCode deleteVariables(); + void deleteVariables(); StatusCode clearVariables(); int m_Truth_nVertices; diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/ValAlgVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/ValAlgVariables.h index d7b757a9d898afb9e46760f6c9fc0fd2656c11b0..264735a55f14348d9da38f920eef7d582e834746 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/ValAlgVariables.h +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/ValAlgVariables.h @@ -44,7 +44,7 @@ class ValAlgVariables virtual void setHelper(const MuonIdHelper* ) = 0; - virtual StatusCode deleteVariables() = 0; + virtual void deleteVariables() = 0; virtual StatusCode clearVariables() = 0; StoreGateSvc* m_evtStore; diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCDigitVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCDigitVariables.cxx index fd362b7d90406ea0cf96cd46cac02556acc72c68..c1bd81b7721d8872b97bdadaf21ebb7833f5f89c 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCDigitVariables.cxx +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCDigitVariables.cxx @@ -1,12 +1,10 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #include "sTGCDigitVariables.h" #include "AthenaKernel/errorcheck.h" -#include "MuonSimData/MuonSimDataCollection.h" - #include "MuonDigitContainer/sTgcDigitContainer.h" #include "MuonDigitContainer/sTgcDigit.h" @@ -26,143 +24,128 @@ StatusCode sTGCDigitVariables::fillVariables() CHECK( this->clearVariables() ); - // get truth information container of digitization - const MuonSimDataCollection* nsw_sTgcSdoContainer = nullptr; -// CHECK( m_evtStore->retrieve(nsw_sTgcSdoContainer, "sTGC_SDO") ); - const sTgcDigitContainer* nsw_sTgcDigitContainer = nullptr; - CHECK( m_evtStore->retrieve(nsw_sTgcDigitContainer, "sTGC_DIGITS") ); - + CHECK( m_evtStore->retrieve(nsw_sTgcDigitContainer, m_ContainerName.c_str()) ); + sTgcDigitContainer::const_iterator it = nsw_sTgcDigitContainer->begin(); sTgcDigitContainer::const_iterator it_e = nsw_sTgcDigitContainer->end(); ATH_MSG_DEBUG("retrieved sTGC Digit Container with size "<<nsw_sTgcDigitContainer->digit_size()); if(nsw_sTgcDigitContainer->size()==0) ATH_MSG_WARNING(" sTGC Digit Continer empty "); for(; it!=it_e; ++it) { - const sTgcDigitCollection* coll = *it; - ATH_MSG_DEBUG( "processing collection with size " << coll->size() ); - for (unsigned int digitNum=0; digitNum<coll->size(); digitNum++) { - const sTgcDigit* digit = coll->at(digitNum); - Identifier Id = digit->identify(); - - std::string stName = m_sTgcIdHelper->stationNameString(m_sTgcIdHelper->stationName(Id)); - int stationEta = m_sTgcIdHelper->stationEta(Id); - int stationPhi = m_sTgcIdHelper->stationPhi(Id); - int multiplet = m_sTgcIdHelper->multilayer(Id); - int gas_gap = m_sTgcIdHelper->gasGap(Id); - int channel = m_sTgcIdHelper->channel(Id); - int stationEtaMin = m_sTgcIdHelper->stationEtaMin(Id); - int stationEtaMax = m_sTgcIdHelper->stationEtaMax(Id); - int stationPhiMin = m_sTgcIdHelper->stationPhiMin(Id); - int stationPhiMax = m_sTgcIdHelper->stationPhiMax(Id); - int gas_gapMin = m_sTgcIdHelper->gasGapMin(Id); - int gas_gapMax = m_sTgcIdHelper->gasGapMax(Id); - int padEta = m_sTgcIdHelper->padEta(Id); - int padPhi = m_sTgcIdHelper->padPhi(Id); - int NofMultilayers = m_sTgcIdHelper->numberOfMultilayers(Id); - int multilayerMin = m_sTgcIdHelper->multilayerMin(Id); - int multilayerMax = m_sTgcIdHelper->multilayerMax(Id); - int channelTypeMin = m_sTgcIdHelper->channelTypeMin(Id); - int channelTypeMax = m_sTgcIdHelper->channelTypeMax(Id); - int channelMin = m_sTgcIdHelper->channelMin(Id); - int channelMax = m_sTgcIdHelper->channelMax(Id); - int channelType = m_sTgcIdHelper->channelType(Id); - - ATH_MSG_DEBUG( "sTGC Digit Offline id: Station Name [" << stName << " ]" - << " Station Eta [" << stationEta << "]" - << " Station Phi [" << stationPhi << "]" - << " Multiplet [" << multiplet << "]" - << " GasGap [" << gas_gap << "]" - << " ChNr [" << channel << "]" - << " Station EtaMin [" << stationEtaMin << "]" - << " Station EtaMax [" << stationEtaMax << "]" - << " Station PhiMin [" << stationPhiMin << "]" - << " Station PhiMax [" << stationPhiMax << "]"); - - int isSmall = stName[2] == 'S'; - const MuonGM::sTgcReadoutElement* rdoEl = m_detManager->getsTgcRElement_fromIdFields(isSmall, stationEta, stationPhi, multiplet ); - - int channelNumber = 0; - const Identifier phiId, etaId; - Amg::Vector3D gpos(0.,0.,0.); - Amg::Vector2D lpos(0.,0.); - - rdoEl->stripPosition(Id,lpos); - rdoEl->surface(Id).localToGlobal(lpos, gpos,gpos); - - - m_NSWsTGC_dig_globalPosX->push_back( gpos.x() ); - m_NSWsTGC_dig_globalPosY->push_back( gpos.y() ); - m_NSWsTGC_dig_globalPosZ->push_back( gpos.z() ); - m_NSWsTGC_dig_localPosX->push_back( lpos.x() ); - m_NSWsTGC_dig_localPosY->push_back( lpos.y() ); - channelNumber = rdoEl->stripNumber(lpos,Id); - m_NSWsTGC_dig_channelPosX->push_back( lpos.x() ); - m_NSWsTGC_dig_channelPosY->push_back( lpos.y() ); - - m_NSWsTGC_dig_channel_type->push_back(channelType); - m_NSWsTGC_dig_stationName->push_back(stName); - m_NSWsTGC_dig_stationEta->push_back(stationEta); - m_NSWsTGC_dig_stationPhi->push_back(stationPhi); - m_NSWsTGC_dig_multiplet->push_back(multiplet); - m_NSWsTGC_dig_gas_gap->push_back(gas_gap); - m_NSWsTGC_dig_channel->push_back(channel); - m_NSWsTGC_dig_stationEtaMin->push_back(stationEtaMin); - m_NSWsTGC_dig_stationEtaMax->push_back(stationEtaMax); - m_NSWsTGC_dig_stationPhiMin->push_back(stationPhiMin); - m_NSWsTGC_dig_stationPhiMax->push_back(stationPhiMax); - m_NSWsTGC_dig_gas_gapMin->push_back(gas_gapMin); - m_NSWsTGC_dig_gas_gapMax->push_back(gas_gapMax); - m_NSWsTGC_dig_padEta->push_back(padEta); - m_NSWsTGC_dig_padPhi->push_back(padPhi); - m_NSWsTGC_dig_numberOfMultilayers->push_back(NofMultilayers); - m_NSWsTGC_dig_multilayerMin->push_back(multilayerMin); - m_NSWsTGC_dig_multilayerMax->push_back(multilayerMax); - m_NSWsTGC_dig_channelTypeMin->push_back(channelTypeMin); - m_NSWsTGC_dig_channelTypeMax->push_back(channelTypeMax); - m_NSWsTGC_dig_channelMin->push_back(channelMin); - m_NSWsTGC_dig_channelMax->push_back(channelMax); - m_NSWsTGC_dig_channelNumber->push_back(channelNumber); - - m_NSWsTGC_dig_bctag->push_back(digit->bcTag()); - m_NSWsTGC_dig_time->push_back(digit->time()); - m_NSWsTGC_dig_charge->push_back(digit->charge()); - m_NSWsTGC_dig_isDead->push_back(digit->isDead()); - m_NSWsTGC_dig_isPileup->push_back(digit->isPileup()); - - - // retrieve the MC truth associated with the digit (means the Geant4 hit information) - if (nsw_sTgcSdoContainer) { - - const MuonSimData sTgc_sdo = (nsw_sTgcSdoContainer->find(Id))->second; - std::vector<MuonSimData::Deposit> deposits; - sTgc_sdo.deposits(deposits); - - int truth_barcode = deposits[0].first.barcode(); - double truth_localPosX = deposits[0].second.firstEntry(); - double truth_localPosY = deposits[0].second.secondEntry(); - float truth_angle = sTgc_sdo.word()/1000.; - Amg::Vector2D hit_on_surface(truth_localPosX, truth_localPosY); - Amg::Vector3D hit_gpos(0., 0., 0.); - rdoEl->surface(Id).localToGlobal(hit_on_surface, Amg::Vector3D(0., 0., 0.), hit_gpos); - ATH_MSG_DEBUG(" sTGC Digit, truth barcode=" << truth_barcode); - ATH_MSG_DEBUG(" sTGC Digit, truth localPosX=" << std::setw(9) << std::setprecision(2) << truth_localPosX - << ", truth localPosY=" << std::setw(9) << std::setprecision(2) << truth_localPosY - << ", truth XZ angle=" << std::setw(8) << std::setprecision(5) << truth_angle); - - - m_NSWsTGC_dig_truth_barcode->push_back( truth_barcode ); - m_NSWsTGC_dig_truth_localPosX->push_back( truth_localPosX ); - m_NSWsTGC_dig_truth_localPosY->push_back( truth_localPosY ); - m_NSWsTGC_dig_truth_XZ_angle->push_back( truth_angle ); - m_NSWsTGC_dig_truth_globalPosX->push_back( hit_gpos[0] ); - m_NSWsTGC_dig_truth_globalPosY->push_back( hit_gpos[1] ); - m_NSWsTGC_dig_truth_globalPosZ->push_back( hit_gpos[2] ); - } - if(channelType == 0) m_NSWsTGC_nPadDigits++; - m_NSWsTGC_nDigits++; - } -} + const sTgcDigitCollection* coll = *it; + ATH_MSG_DEBUG( "processing collection with size " << coll->size() ); + for (unsigned int digitNum=0; digitNum<coll->size(); digitNum++) { + const sTgcDigit* digit = coll->at(digitNum); + Identifier Id = digit->identify(); + + std::string stName = m_sTgcIdHelper->stationNameString(m_sTgcIdHelper->stationName(Id)); + int stationEta = m_sTgcIdHelper->stationEta(Id); + int stationPhi = m_sTgcIdHelper->stationPhi(Id); + int multiplet = m_sTgcIdHelper->multilayer(Id); + int gas_gap = m_sTgcIdHelper->gasGap(Id); + int channel = m_sTgcIdHelper->channel(Id); + int stationEtaMin = m_sTgcIdHelper->stationEtaMin(Id); + int stationEtaMax = m_sTgcIdHelper->stationEtaMax(Id); + int stationPhiMin = m_sTgcIdHelper->stationPhiMin(Id); + int stationPhiMax = m_sTgcIdHelper->stationPhiMax(Id); + int gas_gapMin = m_sTgcIdHelper->gasGapMin(Id); + int gas_gapMax = m_sTgcIdHelper->gasGapMax(Id); + int padEta = m_sTgcIdHelper->padEta(Id); + int padPhi = m_sTgcIdHelper->padPhi(Id); + int NofMultilayers = m_sTgcIdHelper->numberOfMultilayers(Id); + int multilayerMin = m_sTgcIdHelper->multilayerMin(Id); + int multilayerMax = m_sTgcIdHelper->multilayerMax(Id); + int channelTypeMin = m_sTgcIdHelper->channelTypeMin(Id); + int channelTypeMax = m_sTgcIdHelper->channelTypeMax(Id); + int channelMin = m_sTgcIdHelper->channelMin(Id); + int channelMax = m_sTgcIdHelper->channelMax(Id); + int channelType = m_sTgcIdHelper->channelType(Id); + + ATH_MSG_DEBUG( "sTGC Digit Offline id: Station Name [" << stName << " ]" + << " Station Eta [" << stationEta << "]" + << " Station Phi [" << stationPhi << "]" + << " Multiplet [" << multiplet << "]" + << " GasGap [" << gas_gap << "]" + << " ChNr [" << channel << "]" + << " Station EtaMin [" << stationEtaMin << "]" + << " Station EtaMax [" << stationEtaMax << "]" + << " Station PhiMin [" << stationPhiMin << "]" + << " Station PhiMax [" << stationPhiMax << "]"); + + int isSmall = stName[2] == 'S'; + const MuonGM::sTgcReadoutElement* rdoEl = m_detManager->getsTgcRElement_fromIdFields(isSmall, stationEta, stationPhi, multiplet ); + + int channelNumber = 0; + const Identifier phiId, etaId; + Amg::Vector3D gpos(0.,0.,0.); + Amg::Vector2D lpos(0.,0.); + + rdoEl->stripPosition(Id,lpos); + rdoEl->surface(Id).localToGlobal(lpos, gpos,gpos); + + std::vector<Amg::Vector2D> local_pad_corners; + rdoEl->padCorners(Id,local_pad_corners); + std::vector<Amg::Vector3D> global_pad_corners; + + for(auto& local_corner : local_pad_corners) { + Amg::Vector3D global_corner; + rdoEl->surface(Id).localToGlobal(local_corner, global_corner, global_corner); + global_pad_corners.push_back(global_corner); + } + + + m_NSWsTGC_dig_globalPosX->push_back( gpos.x() ); + m_NSWsTGC_dig_globalPosY->push_back( gpos.y() ); + m_NSWsTGC_dig_globalPosZ->push_back( gpos.z() ); + m_NSWsTGC_dig_localPosX->push_back( lpos.x() ); + m_NSWsTGC_dig_localPosY->push_back( lpos.y() ); + for(auto corner : global_pad_corners) { + if(channelType ==0 ) { + m_NSWsTGC_dig_PadglobalCornerPosX->push_back(corner.x()); + m_NSWsTGC_dig_PadglobalCornerPosY->push_back(corner.y()); + m_NSWsTGC_dig_PadglobalCornerPosZ->push_back(corner.z()); + } + } + channelNumber = rdoEl->stripNumber(lpos,Id); + m_NSWsTGC_dig_channelPosX->push_back( lpos.x() ); + m_NSWsTGC_dig_channelPosY->push_back( lpos.y() ); + + m_NSWsTGC_dig_channel_type->push_back(channelType); + m_NSWsTGC_dig_stationName->push_back(stName); + m_NSWsTGC_dig_stationEta->push_back(stationEta); + m_NSWsTGC_dig_stationPhi->push_back(stationPhi); + m_NSWsTGC_dig_multiplet->push_back(multiplet); + m_NSWsTGC_dig_gas_gap->push_back(gas_gap); + m_NSWsTGC_dig_channel->push_back(channel); + m_NSWsTGC_dig_stationEtaMin->push_back(stationEtaMin); + m_NSWsTGC_dig_stationEtaMax->push_back(stationEtaMax); + m_NSWsTGC_dig_stationPhiMin->push_back(stationPhiMin); + m_NSWsTGC_dig_stationPhiMax->push_back(stationPhiMax); + m_NSWsTGC_dig_gas_gapMin->push_back(gas_gapMin); + m_NSWsTGC_dig_gas_gapMax->push_back(gas_gapMax); + m_NSWsTGC_dig_padEta->push_back(padEta); + m_NSWsTGC_dig_padPhi->push_back(padPhi); + m_NSWsTGC_dig_numberOfMultilayers->push_back(NofMultilayers); + m_NSWsTGC_dig_multilayerMin->push_back(multilayerMin); + m_NSWsTGC_dig_multilayerMax->push_back(multilayerMax); + m_NSWsTGC_dig_channelTypeMin->push_back(channelTypeMin); + m_NSWsTGC_dig_channelTypeMax->push_back(channelTypeMax); + m_NSWsTGC_dig_channelMin->push_back(channelMin); + m_NSWsTGC_dig_channelMax->push_back(channelMax); + m_NSWsTGC_dig_channelNumber->push_back(channelNumber); + + m_NSWsTGC_dig_bctag->push_back(digit->bcTag()); + m_NSWsTGC_dig_time->push_back(digit->time()); + m_NSWsTGC_dig_charge->push_back(digit->charge()); + m_NSWsTGC_dig_isDead->push_back(digit->isDead()); + m_NSWsTGC_dig_isPileup->push_back(digit->isPileup()); + + if(channelType == 0) m_NSWsTGC_nPadDigits++; + m_NSWsTGC_nDigits++; + } + } + ATH_MSG_INFO(" finished fillNSWsTGCDigitVariables()"); return StatusCode::SUCCESS; } @@ -210,14 +193,6 @@ StatusCode sTGCDigitVariables::clearVariables() m_NSWsTGC_dig_globalPosY->clear(); m_NSWsTGC_dig_globalPosZ->clear(); - m_NSWsTGC_dig_truth_barcode->clear(); - m_NSWsTGC_dig_truth_localPosX->clear(); - m_NSWsTGC_dig_truth_localPosY->clear(); - m_NSWsTGC_dig_truth_globalPosX->clear(); - m_NSWsTGC_dig_truth_globalPosY->clear(); - m_NSWsTGC_dig_truth_globalPosZ->clear(); - m_NSWsTGC_dig_truth_XZ_angle->clear(); - return StatusCode::SUCCESS; } @@ -227,13 +202,14 @@ StatusCode sTGCDigitVariables::clearVariables() StatusCode sTGCDigitVariables::initializeVariables() { - m_NSWsTGC_nDigits = 0; - m_NSWsTGC_nPadDigits = 0; - m_NSWsTGC_dig_time = new std::vector<double>(); - m_NSWsTGC_dig_bctag = new std::vector<int>(); - m_NSWsTGC_dig_charge = new std::vector<double>(); - m_NSWsTGC_dig_isDead = new std::vector<bool>(); - m_NSWsTGC_dig_isPileup = new std::vector<bool>(); + m_NSWsTGC_nDigits = 0; + m_NSWsTGC_nPadDigits = 0; + m_NSWsTGC_dig_time = new std::vector<double>(); + m_NSWsTGC_dig_bctag = new std::vector<int>(); + m_NSWsTGC_dig_charge = new std::vector<double>(); + m_NSWsTGC_dig_isDead = new std::vector<bool>(); + m_NSWsTGC_dig_isPileup = new std::vector<bool>(); + m_NSWsTGC_dig_stationName = new std::vector<std::string>(); m_NSWsTGC_dig_stationEta = new std::vector<int>(); m_NSWsTGC_dig_stationPhi = new std::vector<int>(); @@ -268,45 +244,38 @@ StatusCode sTGCDigitVariables::initializeVariables() m_NSWsTGC_dig_globalPosY = new std::vector<double>(); m_NSWsTGC_dig_globalPosZ = new std::vector<double>(); - m_NSWsTGC_dig_truth_barcode = new std::vector<int>(); - m_NSWsTGC_dig_truth_localPosX = new std::vector<double>(); - m_NSWsTGC_dig_truth_localPosY = new std::vector<double>(); - m_NSWsTGC_dig_truth_globalPosX = new std::vector<double>(); - m_NSWsTGC_dig_truth_globalPosY = new std::vector<double>(); - m_NSWsTGC_dig_truth_globalPosZ = new std::vector<double>(); - m_NSWsTGC_dig_truth_XZ_angle = new std::vector<float>(); - if(m_tree) { - m_tree->Branch("Digit_sTGC", &m_NSWsTGC_nDigits, "Digits_sTGC_n/i"); - m_tree->Branch("Digit_sTGC_Pad_Digits", &m_NSWsTGC_nPadDigits, "Digit_sTGC_Pad_Digits_n/i"); - m_tree->Branch("Digit_sTGC_time", "std::vector< double >", &m_NSWsTGC_dig_time); - m_tree->Branch("Digit_sTGC_bctag", "std::vector< int >", &m_NSWsTGC_dig_bctag); - m_tree->Branch("Digit_sTGC_charge", "std::vector< double >", &m_NSWsTGC_dig_charge); - m_tree->Branch("Digit_sTGC_isDead", "std::vector< bool >", &m_NSWsTGC_dig_isDead); - m_tree->Branch("Digit_sTGC_isPileup", "std::vector< bool >", &m_NSWsTGC_dig_isPileup); - m_tree->Branch("Digit_sTGC_stationName", &m_NSWsTGC_dig_stationName); - m_tree->Branch("Digit_sTGC_stationEta", &m_NSWsTGC_dig_stationEta); - m_tree->Branch("Digit_sTGC_stationPhi", &m_NSWsTGC_dig_stationPhi); - m_tree->Branch("Digit_sTGC_multiplet", &m_NSWsTGC_dig_multiplet); - m_tree->Branch("Digit_sTGC_gas_gap", &m_NSWsTGC_dig_gas_gap); - m_tree->Branch("Digit_sTGC_channel_type",&m_NSWsTGC_dig_channel_type); - m_tree->Branch("Digit_sTGC_channel", &m_NSWsTGC_dig_channel); - m_tree->Branch("Digit_sTGC_stationEtaMin", &m_NSWsTGC_dig_stationEtaMin); - m_tree->Branch("Digit_sTGC_stationEtaMax", &m_NSWsTGC_dig_stationEtaMax); - m_tree->Branch("Digit_sTGC_stationPhiMin", &m_NSWsTGC_dig_stationPhiMin); - m_tree->Branch("Digit_sTGC_stationPhiMax", &m_NSWsTGC_dig_stationPhiMax); - m_tree->Branch("Digit_sTGC_gas_gapMin", &m_NSWsTGC_dig_gas_gapMin); - m_tree->Branch("Digit_sTGC_gas_gapMax", &m_NSWsTGC_dig_gas_gapMax); - m_tree->Branch("Digit_sTGC_padEta", &m_NSWsTGC_dig_padEta); - m_tree->Branch("Digit_sTGC_padPhi", &m_NSWsTGC_dig_padPhi); - m_tree->Branch("Digit_sTGC_numberOfMultilayers", &m_NSWsTGC_dig_numberOfMultilayers); - m_tree->Branch("Digit_sTGC_multilayerMin", &m_NSWsTGC_dig_multilayerMin); - m_tree->Branch("Digit_sTGC_multilayerMax", &m_NSWsTGC_dig_multilayerMax); - m_tree->Branch("Digit_sTGC_channelTypeMin", &m_NSWsTGC_dig_channelTypeMin); - m_tree->Branch("Digit_sTGC_channelTypeMax", &m_NSWsTGC_dig_channelTypeMax); - m_tree->Branch("Digit_sTGC_channelMin", &m_NSWsTGC_dig_channelMin); - m_tree->Branch("Digit_sTGC_channelMax", &m_NSWsTGC_dig_channelMax); - m_tree->Branch("Digit_sTGC_channelNumber", &m_NSWsTGC_dig_channelNumber); + ATH_MSG_DEBUG("sTGC digit: init m_tree "); + m_tree->Branch("Digits_sTGC", &m_NSWsTGC_nDigits, "Digits_sTGC_n/i"); + m_tree->Branch("Digits_sTGC_Pad_Digits", &m_NSWsTGC_nPadDigits, "Digits_sTGC_Pad_Digits_n/i"); + m_tree->Branch("Digits_sTGC_time", "std::vector< double >", &m_NSWsTGC_dig_time); + m_tree->Branch("Digits_sTGC_bctag", "std::vector< int >", &m_NSWsTGC_dig_bctag); + m_tree->Branch("Digits_sTGC_charge", "std::vector< double >", &m_NSWsTGC_dig_charge); + m_tree->Branch("Digits_sTGC_isDead", "std::vector< bool >", &m_NSWsTGC_dig_isDead); + m_tree->Branch("Digits_sTGC_isPileup", "std::vector< bool >", &m_NSWsTGC_dig_isPileup); + m_tree->Branch("Digits_sTGC_stationName", &m_NSWsTGC_dig_stationName); + m_tree->Branch("Digits_sTGC_stationEta", &m_NSWsTGC_dig_stationEta); + m_tree->Branch("Digits_sTGC_stationPhi", &m_NSWsTGC_dig_stationPhi); + m_tree->Branch("Digits_sTGC_multiplet", &m_NSWsTGC_dig_multiplet); + m_tree->Branch("Digits_sTGC_gas_gap", &m_NSWsTGC_dig_gas_gap); + m_tree->Branch("Digits_sTGC_channel_type",&m_NSWsTGC_dig_channel_type); + m_tree->Branch("Digits_sTGC_channel", &m_NSWsTGC_dig_channel); + m_tree->Branch("Digits_sTGC_stationEtaMin", &m_NSWsTGC_dig_stationEtaMin); + m_tree->Branch("Digits_sTGC_stationEtaMax", &m_NSWsTGC_dig_stationEtaMax); + m_tree->Branch("Digits_sTGC_stationPhiMin", &m_NSWsTGC_dig_stationPhiMin); + m_tree->Branch("Digits_sTGC_stationPhiMax", &m_NSWsTGC_dig_stationPhiMax); + m_tree->Branch("Digits_sTGC_gas_gapMin", &m_NSWsTGC_dig_gas_gapMin); + m_tree->Branch("Digits_sTGC_gas_gapMax", &m_NSWsTGC_dig_gas_gapMax); + m_tree->Branch("Digits_sTGC_padEta", &m_NSWsTGC_dig_padEta); + m_tree->Branch("Digits_sTGC_padPhi", &m_NSWsTGC_dig_padPhi); + m_tree->Branch("Digits_sTGC_numberOfMultilayers", &m_NSWsTGC_dig_numberOfMultilayers); + m_tree->Branch("Digits_sTGC_multilayerMin", &m_NSWsTGC_dig_multilayerMin); + m_tree->Branch("Digits_sTGC_multilayerMax", &m_NSWsTGC_dig_multilayerMax); + m_tree->Branch("Digits_sTGC_channelTypeMin", &m_NSWsTGC_dig_channelTypeMin); + m_tree->Branch("Digits_sTGC_channelTypeMax", &m_NSWsTGC_dig_channelTypeMax); + m_tree->Branch("Digits_sTGC_channelMin", &m_NSWsTGC_dig_channelMin); + m_tree->Branch("Digits_sTGC_channelMax", &m_NSWsTGC_dig_channelMax); + m_tree->Branch("Digits_sTGC_channelNumber", &m_NSWsTGC_dig_channelNumber); m_tree->Branch("Digits_sTGC_channelPosX", "std::vector< double >", &m_NSWsTGC_dig_channelPosX); m_tree->Branch("Digits_sTGC_channelPosY", "std::vector< double >", &m_NSWsTGC_dig_channelPosY); @@ -315,14 +284,9 @@ StatusCode sTGCDigitVariables::initializeVariables() m_tree->Branch("Digits_sTGC_globalPosX", "std::vector< double >", &m_NSWsTGC_dig_globalPosX); m_tree->Branch("Digits_sTGC_globalPosY", "std::vector< double >", &m_NSWsTGC_dig_globalPosY); m_tree->Branch("Digits_sTGC_globalPosZ", "std::vector< double >", &m_NSWsTGC_dig_globalPosZ); - - m_tree->Branch("Digits_sTGC_truth_barcode", "std::vector< int >", &m_NSWsTGC_dig_truth_barcode); - m_tree->Branch("Digits_sTGC_truth_localPosX", "std::vector< double >", &m_NSWsTGC_dig_truth_localPosX); - m_tree->Branch("Digits_sTGC_truth_localPosY", "std::vector< double >", &m_NSWsTGC_dig_truth_localPosY); - m_tree->Branch("Digits_sTGC_truth_globalPosX", "std::vector< double >", &m_NSWsTGC_dig_truth_globalPosX); - m_tree->Branch("Digits_sTGC_truth_globalPosY", "std::vector< double >", &m_NSWsTGC_dig_truth_globalPosY); - m_tree->Branch("Digits_sTGC_truth_globalPosZ", "std::vector< double >", &m_NSWsTGC_dig_truth_globalPosZ); - m_tree->Branch("Digits_sTGC_truth_XZ_angle", "std::vector< float >", &m_NSWsTGC_dig_truth_XZ_angle); + m_tree->Branch("Digits_sTGC_PadglobalCornerPosX", "std::vector< double >", &m_NSWsTGC_dig_PadglobalCornerPosX); + m_tree->Branch("Digits_sTGC_PadglobalCornerPosY", "std::vector< double >", &m_NSWsTGC_dig_PadglobalCornerPosY); + m_tree->Branch("Digits_sTGC_PadglobalCornerPosZ", "std::vector< double >", &m_NSWsTGC_dig_PadglobalCornerPosZ); } return StatusCode::SUCCESS; @@ -331,7 +295,7 @@ StatusCode sTGCDigitVariables::initializeVariables() /** ---------- freeing resources and resetting pointers */ /** ---------- to be called on finalize level of main alg */ -StatusCode sTGCDigitVariables::deleteVariables() +void sTGCDigitVariables::deleteVariables() { delete m_NSWsTGC_dig_stationName; @@ -365,14 +329,6 @@ StatusCode sTGCDigitVariables::deleteVariables() delete m_NSWsTGC_dig_globalPosY; delete m_NSWsTGC_dig_globalPosZ; - delete m_NSWsTGC_dig_truth_barcode; - delete m_NSWsTGC_dig_truth_localPosX; - delete m_NSWsTGC_dig_truth_localPosY; - delete m_NSWsTGC_dig_truth_XZ_angle; - delete m_NSWsTGC_dig_truth_globalPosX; - delete m_NSWsTGC_dig_truth_globalPosY; - delete m_NSWsTGC_dig_truth_globalPosZ; - delete m_NSWsTGC_dig_time; delete m_NSWsTGC_dig_bctag; delete m_NSWsTGC_dig_charge; @@ -418,13 +374,5 @@ StatusCode sTGCDigitVariables::deleteVariables() m_NSWsTGC_dig_globalPosY = nullptr; m_NSWsTGC_dig_globalPosZ = nullptr; - m_NSWsTGC_dig_truth_barcode = nullptr; - m_NSWsTGC_dig_truth_localPosX = nullptr; - m_NSWsTGC_dig_truth_localPosY = nullptr; - m_NSWsTGC_dig_truth_globalPosX = nullptr; - m_NSWsTGC_dig_truth_globalPosY = nullptr; - m_NSWsTGC_dig_truth_globalPosZ = nullptr; - m_NSWsTGC_dig_truth_XZ_angle = nullptr; - - return StatusCode::SUCCESS; + return; } diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCDigitVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCDigitVariables.h index 1c74d61bd2a8bcf9cd8fd83f6eb61aa9b5f81bbb..cd61668af7b4d9c2bbbd592d08c0cffc9e9153ed 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCDigitVariables.h +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCDigitVariables.h @@ -56,24 +56,16 @@ class sTGCDigitVariables : public ValAlgVariables m_NSWsTGC_dig_globalPosX(0), m_NSWsTGC_dig_globalPosY(0), m_NSWsTGC_dig_globalPosZ(0), - - m_NSWsTGC_dig_truth_barcode(0), - m_NSWsTGC_dig_truth_localPosX(0), - m_NSWsTGC_dig_truth_localPosY(0), - m_NSWsTGC_dig_truth_globalPosX(0), - m_NSWsTGC_dig_truth_globalPosY(0), - m_NSWsTGC_dig_truth_globalPosZ(0), - m_NSWsTGC_dig_truth_XZ_angle(0) + m_NSWsTGC_dig_PadglobalCornerPosX(0), + m_NSWsTGC_dig_PadglobalCornerPosY(0), + m_NSWsTGC_dig_PadglobalCornerPosZ(0) { setHelper(idhelper); } ~sTGCDigitVariables() { - if( (this->deleteVariables()).isFailure() ){ - ATH_MSG_ERROR("Failing to delete sTGCDigitVariables."); - std::terminate(); - } + deleteVariables(); } StatusCode initializeVariables(); @@ -89,7 +81,7 @@ class sTGCDigitVariables : public ValAlgVariables } } - StatusCode deleteVariables(); + void deleteVariables(); StatusCode clearVariables(); const sTgcIdHelper* m_sTgcIdHelper; @@ -132,14 +124,9 @@ class sTGCDigitVariables : public ValAlgVariables std::vector< double > *m_NSWsTGC_dig_globalPosX; std::vector< double > *m_NSWsTGC_dig_globalPosY; std::vector< double > *m_NSWsTGC_dig_globalPosZ; - - std::vector< int > *m_NSWsTGC_dig_truth_barcode; - std::vector< double > *m_NSWsTGC_dig_truth_localPosX; - std::vector< double > *m_NSWsTGC_dig_truth_localPosY; - std::vector< double > *m_NSWsTGC_dig_truth_globalPosX; - std::vector< double > *m_NSWsTGC_dig_truth_globalPosY; - std::vector< double > *m_NSWsTGC_dig_truth_globalPosZ; - std::vector< float > *m_NSWsTGC_dig_truth_XZ_angle; + std::vector< double > *m_NSWsTGC_dig_PadglobalCornerPosX; + std::vector< double > *m_NSWsTGC_dig_PadglobalCornerPosY; + std::vector< double > *m_NSWsTGC_dig_PadglobalCornerPosZ; }; diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCFastDigitVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCFastDigitVariables.cxx deleted file mode 100644 index 8294689ac4247d6b12c617e1416f15e9acfa30d3..0000000000000000000000000000000000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCFastDigitVariables.cxx +++ /dev/null @@ -1,238 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#include "sTGCFastDigitVariables.h" -#include "AthenaKernel/errorcheck.h" -#include "MuonSimData/MuonSimDataCollection.h" -#include "MuonPrepRawData/sTgcPrepDataContainer.h" - -#include "TTree.h" - - -StatusCode sTGCFastDigitVariables::fillVariables() -{ - ATH_MSG_INFO("do fillNSWsTGCFastDigitVariables()"); - CHECK( this->clearVariables() ); - - const MuonSimDataCollection* nsw_sTgcSdoContainer = nullptr; - CHECK( m_evtStore->retrieve(nsw_sTgcSdoContainer, "STGC_SDO") ); - - const Muon::sTgcPrepDataContainer *nsw_sTgcPrepDataContainer = nullptr; - CHECK( m_evtStore->retrieve(nsw_sTgcPrepDataContainer, m_ContainerName.c_str()) ); - - if(nsw_sTgcPrepDataContainer->size()==0) ATH_MSG_WARNING(" sTgc Fast DigitContainer empty "); - - for(auto it : *nsw_sTgcPrepDataContainer ) { - const Muon::sTgcPrepDataCollection* coll = it; - - for (unsigned int item=0; item<coll->size(); item++) { - const Muon::sTgcPrepData* fast_digit = coll->at(item); - Identifier Id = fast_digit->identify(); - - std::string stName = m_sTgcIdHelper->stationNameString(m_sTgcIdHelper->stationName(Id)); - int stationEta = m_sTgcIdHelper->stationEta(Id); - int stationPhi = m_sTgcIdHelper->stationPhi(Id); - int multiplet = m_sTgcIdHelper->multilayer(Id); - int gas_gap = m_sTgcIdHelper->gasGap(Id); - int channel_type = m_sTgcIdHelper->channelType(Id); - int channel = m_sTgcIdHelper->channel(Id); - - ATH_MSG_DEBUG( "sTGC Fast Digit Offline id: Station Name [" << stName << "]" - << " Station Eta [" << stationEta << "]" - << " Station Phi [" << stationPhi << "]" - << " Multiplet [" << multiplet << "]" - << " GasGap [" << gas_gap << "]" - << " Type [" << channel_type << "]" - << " ChNr [" << channel << "]" ); - - m_NSWsTGC_fdg_stationName->push_back(stName); - m_NSWsTGC_fdg_stationEta->push_back(stationEta); - m_NSWsTGC_fdg_stationPhi->push_back(stationPhi); - m_NSWsTGC_fdg_multiplet->push_back(multiplet); - m_NSWsTGC_fdg_gas_gap->push_back(gas_gap); - m_NSWsTGC_fdg_channel_type->push_back(channel_type); - m_NSWsTGC_fdg_channel->push_back(channel); - - const MuonGM::sTgcReadoutElement* det = fast_digit->detectorElement(); - Amg::Vector3D pos = fast_digit->globalPosition(); - Amg::Vector2D loc_pos(0., 0.); - det->surface(Id).globalToLocal(pos, Amg::Vector3D(0., 0., 0.), loc_pos); - - double err_x = fast_digit->localCovariance()(0,0); - double err_y = ( fast_digit->localCovariance().rows()==2)? fast_digit->localCovariance()(1,1) : 0.; - - ATH_MSG_DEBUG( "sTgc Fast Digit local pos.: x=" << std::setw(6) << std::setprecision(2) << loc_pos[0] - << ", ex=" << std::setw(6) << std::setprecision(2) << err_x - << ", y=" << std::setw(6) << std::setprecision(2) << loc_pos[1] - << ", ey=" << std::setw(6) << std::setprecision(2) << err_y ); - - m_NSWsTGC_fdg_globalPosX->push_back(pos.x()); - m_NSWsTGC_fdg_globalPosY->push_back(pos.y()); - m_NSWsTGC_fdg_globalPosZ->push_back(pos.z()); - - m_NSWsTGC_fdg_localPosX->push_back(loc_pos[0]); - m_NSWsTGC_fdg_localPosY->push_back(loc_pos[1]); - m_NSWsTGC_fdg_covMatrix_1_1->push_back(err_x); - m_NSWsTGC_fdg_covMatrix_2_2->push_back(err_y); - - - if (nsw_sTgcSdoContainer) { - const MuonSimData stgc_sdo = (nsw_sTgcSdoContainer->find(Id))->second; - std::vector<MuonSimData::Deposit> deposits; - stgc_sdo.deposits(deposits); - - int truth_barcode = deposits[0].first.barcode(); - double truth_hitOnSurfaceX = deposits[0].second.firstEntry(); - double truth_hitOnSurfaceY = deposits[0].second.secondEntry(); - - ATH_MSG_DEBUG("sTGC Fast Digit, truth barcode=" << truth_barcode); - ATH_MSG_DEBUG("sTGC Fast Digit, truth hitOnSurfaceX=" << std::setw(9) << std::setprecision(2) << truth_hitOnSurfaceX - << ", truth hitOnSurfaceY=" << std::setw(9) << std::setprecision(2) << truth_hitOnSurfaceY); - - m_NSWsTGC_fdg_truth_barcode->push_back( truth_barcode ); - m_NSWsTGC_fdg_truth_hitOnSurfaceX->push_back( truth_hitOnSurfaceX ); - m_NSWsTGC_fdg_truth_hitOnSurfaceY->push_back( truth_hitOnSurfaceY ); - } - - - m_NSWsTGC_nFastDigits++; - } - } - - ATH_MSG_INFO("processed " << m_NSWsTGC_nFastDigits << " sTGC fast digitis"); - - return StatusCode::SUCCESS; -} - -StatusCode sTGCFastDigitVariables::deleteVariables() -{ - delete m_NSWsTGC_fdg_stationName; - delete m_NSWsTGC_fdg_stationEta; - delete m_NSWsTGC_fdg_stationPhi; - delete m_NSWsTGC_fdg_multiplet; - delete m_NSWsTGC_fdg_gas_gap; - delete m_NSWsTGC_fdg_channel_type; - delete m_NSWsTGC_fdg_channel; - - delete m_NSWsTGC_fdg_globalPosX; - delete m_NSWsTGC_fdg_globalPosY; - delete m_NSWsTGC_fdg_globalPosZ; - - delete m_NSWsTGC_fdg_localPosX; - delete m_NSWsTGC_fdg_localPosY; - delete m_NSWsTGC_fdg_covMatrix_1_1; - delete m_NSWsTGC_fdg_covMatrix_2_2; - - delete m_NSWsTGC_fdg_truth_barcode; - delete m_NSWsTGC_fdg_truth_hitOnSurfaceX; - delete m_NSWsTGC_fdg_truth_hitOnSurfaceY; - - - m_NSWsTGC_nFastDigits = 0; - m_NSWsTGC_fdg_stationName = nullptr; - m_NSWsTGC_fdg_stationEta = nullptr; - m_NSWsTGC_fdg_stationPhi = nullptr; - m_NSWsTGC_fdg_multiplet = nullptr; - m_NSWsTGC_fdg_gas_gap = nullptr; - m_NSWsTGC_fdg_channel_type = nullptr; - m_NSWsTGC_fdg_channel = nullptr; - - m_NSWsTGC_fdg_globalPosX = nullptr; - m_NSWsTGC_fdg_globalPosY = nullptr; - m_NSWsTGC_fdg_globalPosZ = nullptr; - - m_NSWsTGC_fdg_localPosX = nullptr; - m_NSWsTGC_fdg_localPosY = nullptr; - m_NSWsTGC_fdg_covMatrix_1_1 = nullptr; - m_NSWsTGC_fdg_covMatrix_2_2 = nullptr; - - m_NSWsTGC_fdg_truth_barcode = nullptr; - m_NSWsTGC_fdg_truth_hitOnSurfaceX = nullptr; - m_NSWsTGC_fdg_truth_hitOnSurfaceY = nullptr; - - return StatusCode::SUCCESS; -} - - -StatusCode sTGCFastDigitVariables::clearVariables() -{ - - m_NSWsTGC_nFastDigits = 0; - m_NSWsTGC_fdg_stationName->clear(); - m_NSWsTGC_fdg_stationEta ->clear(); - m_NSWsTGC_fdg_stationPhi ->clear(); - m_NSWsTGC_fdg_multiplet ->clear(); - m_NSWsTGC_fdg_gas_gap ->clear(); - m_NSWsTGC_fdg_channel_type->clear(); - m_NSWsTGC_fdg_channel ->clear(); - - m_NSWsTGC_fdg_globalPosX ->clear(); - m_NSWsTGC_fdg_globalPosY ->clear(); - m_NSWsTGC_fdg_globalPosZ ->clear(); - - m_NSWsTGC_fdg_localPosX ->clear(); - m_NSWsTGC_fdg_localPosY ->clear(); - m_NSWsTGC_fdg_covMatrix_1_1 ->clear(); - m_NSWsTGC_fdg_covMatrix_2_2 ->clear(); - - m_NSWsTGC_fdg_truth_barcode->clear(); - m_NSWsTGC_fdg_truth_hitOnSurfaceX->clear(); - m_NSWsTGC_fdg_truth_hitOnSurfaceY->clear(); - - return StatusCode::SUCCESS; -} - - -StatusCode sTGCFastDigitVariables::initializeVariables() -{ - m_NSWsTGC_nFastDigits = 0; - m_NSWsTGC_fdg_stationName = new std::vector<std::string>; - m_NSWsTGC_fdg_stationEta = new std::vector<int>; - m_NSWsTGC_fdg_stationPhi = new std::vector<int>; - m_NSWsTGC_fdg_multiplet = new std::vector<int>; - m_NSWsTGC_fdg_gas_gap = new std::vector<int>; - m_NSWsTGC_fdg_channel_type = new std::vector<int>; - m_NSWsTGC_fdg_channel = new std::vector<int>; - - m_NSWsTGC_fdg_globalPosX = new std::vector<double>; - m_NSWsTGC_fdg_globalPosY = new std::vector<double>; - m_NSWsTGC_fdg_globalPosZ = new std::vector<double>; - - m_NSWsTGC_fdg_localPosX = new std::vector<double>; - m_NSWsTGC_fdg_localPosY = new std::vector<double>; - m_NSWsTGC_fdg_covMatrix_1_1 = new std::vector<double>; - m_NSWsTGC_fdg_covMatrix_2_2 = new std::vector<double>; - - m_NSWsTGC_fdg_truth_barcode = new std::vector<int>; - m_NSWsTGC_fdg_truth_hitOnSurfaceX = new std::vector<double>; - m_NSWsTGC_fdg_truth_hitOnSurfaceY = new std::vector<double>; - - if(m_tree) { - m_tree->Branch("FastDigit_sTGC", &m_NSWsTGC_nFastDigits, "FastDigits_sTGC_n/i"); - m_tree->Branch("FastDigit_sTGC_stationName", &m_NSWsTGC_fdg_stationName); - m_tree->Branch("FastDigit_sTGC_stationEta", &m_NSWsTGC_fdg_stationEta); - m_tree->Branch("FastDigit_sTGC_stationPhi", &m_NSWsTGC_fdg_stationPhi); - m_tree->Branch("FastDigit_sTGC_multiplet", &m_NSWsTGC_fdg_multiplet); - m_tree->Branch("FastDigit_sTGC_gas_gap", &m_NSWsTGC_fdg_gas_gap); - m_tree->Branch("FastDigit_sTGC_channel_type",&m_NSWsTGC_fdg_channel_type); - m_tree->Branch("FastDigit_sTGC_channel", &m_NSWsTGC_fdg_channel); - - m_tree->Branch("FastDigit_sTGC_globalPosX", &m_NSWsTGC_fdg_globalPosX); - m_tree->Branch("FastDigit_sTGC_globalPosY", &m_NSWsTGC_fdg_globalPosY); - m_tree->Branch("FastDigit_sTGC_globalPosZ", &m_NSWsTGC_fdg_globalPosZ); - - m_tree->Branch("FastDigit_sTGC_localPosX", &m_NSWsTGC_fdg_localPosX); - m_tree->Branch("FastDigit_sTGC_localPosY", &m_NSWsTGC_fdg_localPosY); - m_tree->Branch("FastDigit_sTGC_covMatrix_1_1", &m_NSWsTGC_fdg_covMatrix_1_1); - m_tree->Branch("FastDigit_sTGC_covMatrix_2_2", &m_NSWsTGC_fdg_covMatrix_2_2); - - - m_tree->Branch("FastDigit_sTGC_truth_barcode", &m_NSWsTGC_fdg_truth_barcode); - m_tree->Branch("FastDigit_sTGC_truth_hitOnSurfaceX", &m_NSWsTGC_fdg_truth_hitOnSurfaceX); - m_tree->Branch("FastDigit_sTGC_truth_hitOnSurfaceY", &m_NSWsTGC_fdg_truth_hitOnSurfaceY); - } - - return StatusCode::SUCCESS; -} - diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCFastDigitVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCFastDigitVariables.h deleted file mode 100644 index cb8580b362f2222be7adeac4ea1b5d0336dd3702..0000000000000000000000000000000000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCFastDigitVariables.h +++ /dev/null @@ -1,97 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef STGCFASTDIGITVARIABLES_H -#define STGCFASTDIGITVARIABLES_H - -#include "ValAlgVariables.h" -#include "MuonIdHelpers/sTgcIdHelper.h" -#include "AthenaBaseComps/AthMsgStreamMacros.h" -#include <vector> - -class sTGCFastDigitVariables : public ValAlgVariables -{ - public: - sTGCFastDigitVariables(StoreGateSvc* evtStore, - const MuonGM::MuonDetectorManager* detManager, - const MuonIdHelper* idhelper, - TTree* tree, - std::string containername) : - ValAlgVariables(evtStore, detManager, tree, containername, "sTGCFastDigitVariables"), - m_sTgcIdHelper(0), - m_NSWsTGC_nFastDigits(0), - m_NSWsTGC_fdg_stationName(0), - m_NSWsTGC_fdg_stationEta(0), - m_NSWsTGC_fdg_stationPhi(0), - m_NSWsTGC_fdg_multiplet(0), - m_NSWsTGC_fdg_gas_gap(0), - m_NSWsTGC_fdg_channel_type(0), - m_NSWsTGC_fdg_channel(0), - m_NSWsTGC_fdg_globalPosX(0), - m_NSWsTGC_fdg_globalPosY(0), - m_NSWsTGC_fdg_globalPosZ(0), - m_NSWsTGC_fdg_localPosX(0), - m_NSWsTGC_fdg_localPosY(0), - m_NSWsTGC_fdg_covMatrix_1_1(0), - m_NSWsTGC_fdg_covMatrix_2_2(0), - m_NSWsTGC_fdg_truth_barcode(0), - m_NSWsTGC_fdg_truth_hitOnSurfaceX(0), - m_NSWsTGC_fdg_truth_hitOnSurfaceY(0) - { - setHelper(idhelper); - } - - ~sTGCFastDigitVariables() - { - if( (this->deleteVariables()).isFailure() ){ - ATH_MSG_ERROR("Failing to delete sTGCFastDigitVariables."); - std::terminate(); - } - } - - StatusCode initializeVariables(); - StatusCode fillVariables(); - - private: - - void setHelper(const MuonIdHelper* idhelper){ - m_sTgcIdHelper = dynamic_cast<const sTgcIdHelper*>(idhelper); - if(m_sTgcIdHelper == 0) { - ATH_MSG_ERROR("casting IdHelper to sTgcIdhelper failed"); - throw; - } - } - - StatusCode deleteVariables(); - StatusCode clearVariables(); - - const sTgcIdHelper* m_sTgcIdHelper; - - int m_NSWsTGC_nFastDigits; - std::vector<std::string> *m_NSWsTGC_fdg_stationName; - std::vector<int> *m_NSWsTGC_fdg_stationEta; - std::vector<int> *m_NSWsTGC_fdg_stationPhi; - std::vector<int> *m_NSWsTGC_fdg_multiplet; - std::vector<int> *m_NSWsTGC_fdg_gas_gap; - std::vector<int> *m_NSWsTGC_fdg_channel_type; - std::vector<int> *m_NSWsTGC_fdg_channel; - - std::vector<double> *m_NSWsTGC_fdg_globalPosX; - std::vector<double> *m_NSWsTGC_fdg_globalPosY; - std::vector<double> *m_NSWsTGC_fdg_globalPosZ; - - std::vector<double> *m_NSWsTGC_fdg_localPosX; - std::vector<double> *m_NSWsTGC_fdg_localPosY; - std::vector<double> *m_NSWsTGC_fdg_covMatrix_1_1; - std::vector<double> *m_NSWsTGC_fdg_covMatrix_2_2; - - - std::vector<int> *m_NSWsTGC_fdg_truth_barcode; - std::vector<double> *m_NSWsTGC_fdg_truth_hitOnSurfaceX; - std::vector<double> *m_NSWsTGC_fdg_truth_hitOnSurfaceY; - - -}; - -#endif // STGCFASTDIGITVARIABLE_H diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCPRDVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCPRDVariables.cxx new file mode 100644 index 0000000000000000000000000000000000000000..a1ef967b1cc26696c0e89e3f6031b656cfee4584 --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCPRDVariables.cxx @@ -0,0 +1,193 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#include "sTGCPRDVariables.h" +#include "AthenaKernel/errorcheck.h" +#include "MuonSimData/MuonSimDataCollection.h" +#include "MuonPrepRawData/sTgcPrepDataContainer.h" + +#include "TTree.h" + + +StatusCode sTGCPRDVariables::fillVariables() +{ + ATH_MSG_DEBUG("do fillNSWsTGCPRDVariables()"); + CHECK( this->clearVariables() ); + + const Muon::sTgcPrepDataContainer *nsw_sTgcPrepDataContainer = nullptr; + CHECK( m_evtStore->retrieve(nsw_sTgcPrepDataContainer, m_ContainerName.c_str()) ); + + if(nsw_sTgcPrepDataContainer->size()==0) ATH_MSG_WARNING(" sTgc PRD Container empty "); + + for(const Muon::sTgcPrepDataCollection* coll : *nsw_sTgcPrepDataContainer ) { + + for (unsigned int item=0; item<coll->size(); item++) { + const Muon::sTgcPrepData* prd = coll->at(item); + Identifier Id = prd->identify(); + + std::string stName = m_sTgcIdHelper->stationNameString(m_sTgcIdHelper->stationName(Id)); + int stationEta = m_sTgcIdHelper->stationEta(Id); + int stationPhi = m_sTgcIdHelper->stationPhi(Id); + int multiplet = m_sTgcIdHelper->multilayer(Id); + int gas_gap = m_sTgcIdHelper->gasGap(Id); + int channel_type = m_sTgcIdHelper->channelType(Id); + int channel = m_sTgcIdHelper->channel(Id); + + ATH_MSG_DEBUG( "sTGC PRD Offline id: Station Name [" << stName << "]" + << " Station Eta [" << stationEta << "]" + << " Station Phi [" << stationPhi << "]" + << " Multiplet [" << multiplet << "]" + << " GasGap [" << gas_gap << "]" + << " Type [" << channel_type << "]" + << " ChNr [" << channel << "]" ); + + m_NSWsTGC_prd_stationName->push_back(stName); + m_NSWsTGC_prd_stationEta->push_back(stationEta); + m_NSWsTGC_prd_stationPhi->push_back(stationPhi); + m_NSWsTGC_prd_multiplet->push_back(multiplet); + m_NSWsTGC_prd_gas_gap->push_back(gas_gap); + m_NSWsTGC_prd_channel_type->push_back(channel_type); + m_NSWsTGC_prd_channel->push_back(channel); + + const MuonGM::sTgcReadoutElement* det = prd->detectorElement(); + Amg::Vector3D pos = prd->globalPosition(); + Amg::Vector2D loc_pos(0., 0.); + det->surface(Id).globalToLocal(pos, Amg::Vector3D(0., 0., 0.), loc_pos); + + double err_x = prd->localCovariance()(0,0); + double err_y = ( prd->localCovariance().rows()==2)? prd->localCovariance()(1,1) : 0.; + + ATH_MSG_DEBUG( "sTgc PRD local pos.: x=" << std::setw(6) << std::setprecision(2) << loc_pos[0] + << ", ex=" << std::setw(6) << std::setprecision(2) << err_x + << ", y=" << std::setw(6) << std::setprecision(2) << loc_pos[1] + << ", ey=" << std::setw(6) << std::setprecision(2) << err_y ); + + m_NSWsTGC_prd_globalPosX->push_back(pos.x()); + m_NSWsTGC_prd_globalPosY->push_back(pos.y()); + m_NSWsTGC_prd_globalPosZ->push_back(pos.z()); + + m_NSWsTGC_prd_localPosX->push_back(loc_pos[0]); + m_NSWsTGC_prd_localPosY->push_back(loc_pos[1]); + m_NSWsTGC_prd_covMatrix_1_1->push_back(err_x); + m_NSWsTGC_prd_covMatrix_2_2->push_back(err_y); + + m_NSWsTGC_nPRDs++; + } + } + + ATH_MSG_DEBUG("processed " << m_NSWsTGC_nPRDs << " sTGC PRD's"); + + return StatusCode::SUCCESS; +} + +void sTGCPRDVariables::deleteVariables() +{ + delete m_NSWsTGC_prd_stationName; + delete m_NSWsTGC_prd_stationEta; + delete m_NSWsTGC_prd_stationPhi; + delete m_NSWsTGC_prd_multiplet; + delete m_NSWsTGC_prd_gas_gap; + delete m_NSWsTGC_prd_channel_type; + delete m_NSWsTGC_prd_channel; + + delete m_NSWsTGC_prd_globalPosX; + delete m_NSWsTGC_prd_globalPosY; + delete m_NSWsTGC_prd_globalPosZ; + + delete m_NSWsTGC_prd_localPosX; + delete m_NSWsTGC_prd_localPosY; + delete m_NSWsTGC_prd_covMatrix_1_1; + delete m_NSWsTGC_prd_covMatrix_2_2; + + m_NSWsTGC_nPRDs = 0; + m_NSWsTGC_prd_stationName = nullptr; + m_NSWsTGC_prd_stationEta = nullptr; + m_NSWsTGC_prd_stationPhi = nullptr; + m_NSWsTGC_prd_multiplet = nullptr; + m_NSWsTGC_prd_gas_gap = nullptr; + m_NSWsTGC_prd_channel_type = nullptr; + m_NSWsTGC_prd_channel = nullptr; + + m_NSWsTGC_prd_globalPosX = nullptr; + m_NSWsTGC_prd_globalPosY = nullptr; + m_NSWsTGC_prd_globalPosZ = nullptr; + + m_NSWsTGC_prd_localPosX = nullptr; + m_NSWsTGC_prd_localPosY = nullptr; + m_NSWsTGC_prd_covMatrix_1_1 = nullptr; + m_NSWsTGC_prd_covMatrix_2_2 = nullptr; + + return; +} + + +StatusCode sTGCPRDVariables::clearVariables() +{ + + m_NSWsTGC_nPRDs = 0; + m_NSWsTGC_prd_stationName->clear(); + m_NSWsTGC_prd_stationEta ->clear(); + m_NSWsTGC_prd_stationPhi ->clear(); + m_NSWsTGC_prd_multiplet ->clear(); + m_NSWsTGC_prd_gas_gap ->clear(); + m_NSWsTGC_prd_channel_type->clear(); + m_NSWsTGC_prd_channel ->clear(); + + m_NSWsTGC_prd_globalPosX ->clear(); + m_NSWsTGC_prd_globalPosY ->clear(); + m_NSWsTGC_prd_globalPosZ ->clear(); + + m_NSWsTGC_prd_localPosX ->clear(); + m_NSWsTGC_prd_localPosY ->clear(); + m_NSWsTGC_prd_covMatrix_1_1 ->clear(); + m_NSWsTGC_prd_covMatrix_2_2 ->clear(); + + return StatusCode::SUCCESS; +} + + +StatusCode sTGCPRDVariables::initializeVariables() +{ + m_NSWsTGC_nPRDs = 0; + m_NSWsTGC_prd_stationName = new std::vector<std::string>; + m_NSWsTGC_prd_stationEta = new std::vector<int>; + m_NSWsTGC_prd_stationPhi = new std::vector<int>; + m_NSWsTGC_prd_multiplet = new std::vector<int>; + m_NSWsTGC_prd_gas_gap = new std::vector<int>; + m_NSWsTGC_prd_channel_type = new std::vector<int>; + m_NSWsTGC_prd_channel = new std::vector<int>; + + m_NSWsTGC_prd_globalPosX = new std::vector<double>; + m_NSWsTGC_prd_globalPosY = new std::vector<double>; + m_NSWsTGC_prd_globalPosZ = new std::vector<double>; + + m_NSWsTGC_prd_localPosX = new std::vector<double>; + m_NSWsTGC_prd_localPosY = new std::vector<double>; + m_NSWsTGC_prd_covMatrix_1_1 = new std::vector<double>; + m_NSWsTGC_prd_covMatrix_2_2 = new std::vector<double>; + + if(m_tree) { + m_tree->Branch("PRD_sTGC", &m_NSWsTGC_nPRDs, "PRDs_sTGC_n/i"); + m_tree->Branch("PRD_sTGC_stationName", &m_NSWsTGC_prd_stationName); + m_tree->Branch("PRD_sTGC_stationEta", &m_NSWsTGC_prd_stationEta); + m_tree->Branch("PRD_sTGC_stationPhi", &m_NSWsTGC_prd_stationPhi); + m_tree->Branch("PRD_sTGC_multiplet", &m_NSWsTGC_prd_multiplet); + m_tree->Branch("PRD_sTGC_gas_gap", &m_NSWsTGC_prd_gas_gap); + m_tree->Branch("PRD_sTGC_channel_type",&m_NSWsTGC_prd_channel_type); + m_tree->Branch("PRD_sTGC_channel", &m_NSWsTGC_prd_channel); + + m_tree->Branch("PRD_sTGC_globalPosX", &m_NSWsTGC_prd_globalPosX); + m_tree->Branch("PRD_sTGC_globalPosY", &m_NSWsTGC_prd_globalPosY); + m_tree->Branch("PRD_sTGC_globalPosZ", &m_NSWsTGC_prd_globalPosZ); + + m_tree->Branch("PRD_sTGC_localPosX", &m_NSWsTGC_prd_localPosX); + m_tree->Branch("PRD_sTGC_localPosY", &m_NSWsTGC_prd_localPosY); + m_tree->Branch("PRD_sTGC_covMatrix_1_1", &m_NSWsTGC_prd_covMatrix_1_1); + m_tree->Branch("PRD_sTGC_covMatrix_2_2", &m_NSWsTGC_prd_covMatrix_2_2); + + } + + return StatusCode::SUCCESS; +} + diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCPRDVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCPRDVariables.h new file mode 100644 index 0000000000000000000000000000000000000000..ddda572b53ef7b336d749cc6ac8716f4367dadbc --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCPRDVariables.h @@ -0,0 +1,85 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef STGCPRDVARIABLES_H +#define STGCPRDVARIABLES_H + +#include "ValAlgVariables.h" +#include "MuonIdHelpers/sTgcIdHelper.h" +#include "AthenaBaseComps/AthMsgStreamMacros.h" +#include <vector> + +class sTGCPRDVariables : public ValAlgVariables +{ + public: + sTGCPRDVariables(StoreGateSvc* evtStore, + const MuonGM::MuonDetectorManager* detManager, + const MuonIdHelper* idhelper, + TTree* tree, + std::string containername) : + ValAlgVariables(evtStore, detManager, tree, containername, "sTGCPRDVariables"), + m_sTgcIdHelper(0), + m_NSWsTGC_nPRDs(0), + m_NSWsTGC_prd_stationName(0), + m_NSWsTGC_prd_stationEta(0), + m_NSWsTGC_prd_stationPhi(0), + m_NSWsTGC_prd_multiplet(0), + m_NSWsTGC_prd_gas_gap(0), + m_NSWsTGC_prd_channel_type(0), + m_NSWsTGC_prd_channel(0), + m_NSWsTGC_prd_globalPosX(0), + m_NSWsTGC_prd_globalPosY(0), + m_NSWsTGC_prd_globalPosZ(0), + m_NSWsTGC_prd_localPosX(0), + m_NSWsTGC_prd_localPosY(0), + m_NSWsTGC_prd_covMatrix_1_1(0), + m_NSWsTGC_prd_covMatrix_2_2(0) + { + setHelper(idhelper); + } + + ~sTGCPRDVariables() + { + deleteVariables(); + } + + StatusCode initializeVariables(); + StatusCode fillVariables(); + + private: + + void setHelper(const MuonIdHelper* idhelper){ + m_sTgcIdHelper = dynamic_cast<const sTgcIdHelper*>(idhelper); + if(m_sTgcIdHelper == 0) { + ATH_MSG_ERROR("casting IdHelper to sTgcIdhelper failed"); + throw; + } + } + + void deleteVariables(); + StatusCode clearVariables(); + + const sTgcIdHelper* m_sTgcIdHelper; + + int m_NSWsTGC_nPRDs; + std::vector<std::string> *m_NSWsTGC_prd_stationName; + std::vector<int> *m_NSWsTGC_prd_stationEta; + std::vector<int> *m_NSWsTGC_prd_stationPhi; + std::vector<int> *m_NSWsTGC_prd_multiplet; + std::vector<int> *m_NSWsTGC_prd_gas_gap; + std::vector<int> *m_NSWsTGC_prd_channel_type; + std::vector<int> *m_NSWsTGC_prd_channel; + + std::vector<double> *m_NSWsTGC_prd_globalPosX; + std::vector<double> *m_NSWsTGC_prd_globalPosY; + std::vector<double> *m_NSWsTGC_prd_globalPosZ; + + std::vector<double> *m_NSWsTGC_prd_localPosX; + std::vector<double> *m_NSWsTGC_prd_localPosY; + std::vector<double> *m_NSWsTGC_prd_covMatrix_1_1; + std::vector<double> *m_NSWsTGC_prd_covMatrix_2_2; + +}; + +#endif // STGCPRDVARIABLE_H diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCRDOVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCRDOVariables.cxx new file mode 100644 index 0000000000000000000000000000000000000000..02760eb31faded040d481a3905e7b0cd63a6e1bc --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCRDOVariables.cxx @@ -0,0 +1,175 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#include "sTGCRDOVariables.h" +#include "AthenaBaseComps/AthAlgorithm.h" + +#include "MuonSimData/MuonSimDataCollection.h" + +#include "MuonRDO/STGC_RawDataContainer.h" + +#include "TTree.h" + +using namespace Muon; + +/** ---------- filling of variables */ +/** ---------- to be called on each evt i.e. execute level of main alg */ +StatusCode sTGCRDOVariables::fillVariables() +{ + ATH_MSG_DEBUG("do fillNSWsTGCRDOVariables()"); + + // clear variables + ATH_CHECK( this->clearVariables() ); + + ATH_MSG_DEBUG("Retrieve RDO container with name " << m_ContainerName); + // get the rdo (a container corresponds to a multilayer of a module) + const STGC_RawDataContainer* rdo_container = nullptr; + ATH_CHECK( m_evtStore->retrieve(rdo_container, m_ContainerName.c_str()) ); + + if(rdo_container->size()==0) ATH_MSG_WARNING(" sTGC RDO Container empty "); + + // iteration on all containers, i.e. all multilayers of all modules + for(const STGC_RawDataCollection* coll : *rdo_container) { + + // a digit collection is instanciated for each container, i.e. holds all digits of a multilayer + // loop on all digits inside a collection, i.e. multilayer + for (unsigned int item=0; item<coll->size(); item++) { + + // get specific digit and identify it + const STGC_RawData* rdo = coll->at(item); + Identifier Id = rdo->identify(); + + std::string stName = m_sTgcIdHelper->stationNameString(m_sTgcIdHelper->stationName(Id)); + int stationEta = m_sTgcIdHelper->stationEta(Id); + int stationPhi = m_sTgcIdHelper->stationPhi(Id); + int multiplet = m_sTgcIdHelper->multilayer(Id); + int gas_gap = m_sTgcIdHelper->gasGap(Id); + int channel = m_sTgcIdHelper->channel(Id); + int channel_type = m_sTgcIdHelper->channelType(Id); + + ATH_MSG_DEBUG( "small TGC RDO Offline id: Station Name [" << stName << " ]" + << " Station Eta [" << stationEta << "]" + << " Station Phi [" << stationPhi << "]" + << " Multiplet [" << multiplet << "]" + << " GasGap [" << gas_gap << "]" + << " ChNr [" << channel << "]" + << " ChType [" << channel_type << "]" ); + + // module details down to the level of channel which is closest to the Geant4 hit + // to be stored in the ntuple + m_NSWsTGC_rdo_stationName->push_back(stName); + m_NSWsTGC_rdo_stationEta->push_back(stationEta); + m_NSWsTGC_rdo_stationPhi->push_back(stationPhi); + m_NSWsTGC_rdo_multiplet->push_back(multiplet); + m_NSWsTGC_rdo_gas_gap->push_back(gas_gap); + m_NSWsTGC_rdo_channel->push_back(channel); + m_NSWsTGC_rdo_channel_type->push_back(channel_type); + m_NSWsTGC_rdo_time->push_back(rdo->time()); + m_NSWsTGC_rdo_charge->push_back(rdo->charge()); + m_NSWsTGC_rdo_bcTag->push_back(rdo->bcTag()); + m_NSWsTGC_rdo_isDead->push_back(rdo->isDead()); + + // rdo counter for the ntuple + m_NSWsTGC_nrdo++; + } + } + + ATH_MSG_DEBUG("processed " << m_NSWsTGC_nrdo << " sTGC RDOs"); + return StatusCode::SUCCESS; +} + + +/** ---------- clearing of variables */ +/** ---------- to be called inside filling method before filling starts */ +StatusCode sTGCRDOVariables::clearVariables() +{ + m_NSWsTGC_nrdo = 0; + + // information of the module down to the channel closest to the initial G4 hit + // size of vector is m_NSWsTGC_rdo + m_NSWsTGC_rdo_stationName->clear(); + m_NSWsTGC_rdo_stationEta->clear(); + m_NSWsTGC_rdo_stationPhi->clear(); + m_NSWsTGC_rdo_multiplet->clear(); + m_NSWsTGC_rdo_gas_gap->clear(); + m_NSWsTGC_rdo_channel->clear(); + m_NSWsTGC_rdo_channel_type->clear(); + m_NSWsTGC_rdo_time->clear(); + m_NSWsTGC_rdo_charge->clear(); + m_NSWsTGC_rdo_bcTag->clear(); + m_NSWsTGC_rdo_isDead->clear(); + + return StatusCode::SUCCESS; +} + + +/** ---------- creating variables and associate them to branches */ +/** ---------- to be called on initialization level of main alg */ +StatusCode sTGCRDOVariables::initializeVariables() +{ + + m_NSWsTGC_nrdo = 0; + m_NSWsTGC_rdo_stationName = new std::vector<std::string>(); + m_NSWsTGC_rdo_stationEta = new std::vector<int>(); + m_NSWsTGC_rdo_stationPhi = new std::vector<int>(); + m_NSWsTGC_rdo_multiplet = new std::vector<int>(); + m_NSWsTGC_rdo_gas_gap = new std::vector<int>(); + m_NSWsTGC_rdo_channel = new std::vector<int>(); + m_NSWsTGC_rdo_channel_type= new std::vector<int>(); + m_NSWsTGC_rdo_time = new std::vector<double>(); + m_NSWsTGC_rdo_charge = new std::vector<double>(); + m_NSWsTGC_rdo_bcTag = new std::vector<uint16_t>(); + m_NSWsTGC_rdo_isDead = new std::vector<bool>(); + + + if(m_tree) { + m_tree->Branch("RDO_sTGC_n", &m_NSWsTGC_nrdo); + m_tree->Branch("RDO_sTGC_stationName", &m_NSWsTGC_rdo_stationName); + m_tree->Branch("RDO_sTGC_stationEta", &m_NSWsTGC_rdo_stationEta); + m_tree->Branch("RDO_sTGC_stationPhi", &m_NSWsTGC_rdo_stationPhi); + m_tree->Branch("RDO_sTGC_multiplet", &m_NSWsTGC_rdo_multiplet); + m_tree->Branch("RDO_sTGC_gas_gap", &m_NSWsTGC_rdo_gas_gap); + m_tree->Branch("RDO_sTGC_channel", &m_NSWsTGC_rdo_channel); + m_tree->Branch("RDO_sTGC_channel_type", &m_NSWsTGC_rdo_channel_type); + m_tree->Branch("RDO_sTGC_time", &m_NSWsTGC_rdo_time); + m_tree->Branch("RDO_sTGC_charge", &m_NSWsTGC_rdo_charge); + m_tree->Branch("RDO_sTGC_bcTag", &m_NSWsTGC_rdo_bcTag); + m_tree->Branch("RDO_sTGC_isDead", &m_NSWsTGC_rdo_isDead); + } + + return StatusCode::SUCCESS; +} + + +/** ---------- freeing resources and resetting pointers */ +/** ---------- to be called on finalize level of main alg */ +void sTGCRDOVariables::deleteVariables() +{ + delete m_NSWsTGC_rdo_stationName; + delete m_NSWsTGC_rdo_stationEta; + delete m_NSWsTGC_rdo_stationPhi; + delete m_NSWsTGC_rdo_multiplet; + delete m_NSWsTGC_rdo_gas_gap; + delete m_NSWsTGC_rdo_channel; + delete m_NSWsTGC_rdo_channel_type; + delete m_NSWsTGC_rdo_time; + delete m_NSWsTGC_rdo_charge; + delete m_NSWsTGC_rdo_bcTag; + delete m_NSWsTGC_rdo_isDead; + + m_NSWsTGC_nrdo = 0; + m_NSWsTGC_rdo_stationName = nullptr; + m_NSWsTGC_rdo_stationEta = nullptr; + m_NSWsTGC_rdo_stationPhi = nullptr; + m_NSWsTGC_rdo_multiplet = nullptr; + m_NSWsTGC_rdo_gas_gap = nullptr; + m_NSWsTGC_rdo_channel = nullptr; + m_NSWsTGC_rdo_channel_type = nullptr; + m_NSWsTGC_rdo_time = nullptr; + m_NSWsTGC_rdo_charge = nullptr; + m_NSWsTGC_rdo_bcTag = nullptr; + m_NSWsTGC_rdo_isDead = nullptr; + + return; +} diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCRDOVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCRDOVariables.h new file mode 100644 index 0000000000000000000000000000000000000000..36b00eb62bf15e1ad7e8993d390b162cddd42d10 --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCRDOVariables.h @@ -0,0 +1,74 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef STGCRDOVARIABLES_H +#define STGCRDOVARIABLES_H + +#include "ValAlgVariables.h" +#include "MuonIdHelpers/sTgcIdHelper.h" +#include "AthenaBaseComps/AthMsgStreamMacros.h" +#include <vector> + +class sTGCRDOVariables : public ValAlgVariables +{ + public: + sTGCRDOVariables(StoreGateSvc* evtStore, + const MuonGM::MuonDetectorManager* detManager, + const MuonIdHelper* idhelper, + TTree* tree, + std::string containername) : + ValAlgVariables(evtStore, detManager, tree, containername, "sTGCRDOVariables"), + m_sTgcIdHelper(0), + m_NSWsTGC_nrdo(0), + m_NSWsTGC_rdo_stationName(0), + m_NSWsTGC_rdo_stationEta(0), + m_NSWsTGC_rdo_stationPhi(0), + m_NSWsTGC_rdo_multiplet(0), + m_NSWsTGC_rdo_gas_gap(0), + m_NSWsTGC_rdo_channel(0), + m_NSWsTGC_rdo_channel_type(0), + m_NSWsTGC_rdo_time(0), + m_NSWsTGC_rdo_charge(0), + m_NSWsTGC_rdo_bcTag(0), + m_NSWsTGC_rdo_isDead(0) + { + setHelper(idhelper); + } + + ~sTGCRDOVariables() override final { deleteVariables(); } + + StatusCode initializeVariables() override final; + StatusCode fillVariables() override final; + + private: + + void setHelper(const MuonIdHelper* idhelper) override final{ + m_sTgcIdHelper = dynamic_cast<const sTgcIdHelper*>(idhelper); + if(m_sTgcIdHelper == 0) { + ATH_MSG_ERROR("casting IdHelper to sTgcIdHelper failed"); + throw; + } + } + + void deleteVariables() override final; + StatusCode clearVariables() override final; + + const sTgcIdHelper* m_sTgcIdHelper; + + int m_NSWsTGC_nrdo; + std::vector<std::string> *m_NSWsTGC_rdo_stationName; + std::vector<int> *m_NSWsTGC_rdo_stationEta; + std::vector<int> *m_NSWsTGC_rdo_stationPhi; + std::vector<int> *m_NSWsTGC_rdo_multiplet; + std::vector<int> *m_NSWsTGC_rdo_gas_gap; + std::vector<int> *m_NSWsTGC_rdo_channel; + std::vector<int> *m_NSWsTGC_rdo_channel_type; + std::vector<double> *m_NSWsTGC_rdo_time; + std::vector<double> *m_NSWsTGC_rdo_charge; + std::vector<uint16_t> *m_NSWsTGC_rdo_bcTag; + std::vector<bool> *m_NSWsTGC_rdo_isDead; + +}; + +#endif // STGCRDOVARIABLES_H diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSDOVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSDOVariables.cxx new file mode 100644 index 0000000000000000000000000000000000000000..49af391d4a47a49d3904cf6fc70ba62d90ac8549 --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSDOVariables.cxx @@ -0,0 +1,198 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#include "sTGCSDOVariables.h" + +#include "AthenaBaseComps/AthAlgorithm.h" +#include "MuonSimData/MuonSimDataCollection.h" + +#include "TTree.h" + + +StatusCode sTGCSDOVariables::fillVariables() +{ + ATH_MSG_DEBUG(" do fillNSWsTGCSDOVariables()"); + + ATH_CHECK( this->clearVariables() ); + + ATH_MSG_DEBUG( "Retrieve sTGC SDO container with name = " << m_ContainerName.c_str() ); + const MuonSimDataCollection* nsw_sTgcSdoContainer = nullptr; + ATH_CHECK( m_evtStore->retrieve(nsw_sTgcSdoContainer, m_ContainerName.c_str()) ); + + for ( auto coll : *nsw_sTgcSdoContainer ) { + + Identifier Id = coll.first; + const MuonSimData mm_sdo = coll.second; + + // Get information on the SDO + std::string stName = m_sTgcIdHelper->stationNameString(m_sTgcIdHelper->stationName(Id)); + int stationEta = m_sTgcIdHelper->stationEta(Id); + int stationPhi = m_sTgcIdHelper->stationPhi(Id); + int multiplet = m_sTgcIdHelper->multilayer(Id); + int gas_gap = m_sTgcIdHelper->gasGap(Id); + int channel = m_sTgcIdHelper->channel(Id); + int channel_type = m_sTgcIdHelper->channelType(Id); + + + ATH_MSG_DEBUG( "sTGC SDO: Station Name [" << stName << " ]" + << " Station Eta [" << stationEta << "]" + << " Station Phi [" << stationPhi << "]" + << " Multiplet [" << multiplet << "]" + << " GasGap [" << gas_gap << "]" + << " ChNr [" << channel << "]" + << " ChType [" << channel_type << "]" ); + + m_NSWsTGC_sdo_stationName->push_back(stName); + m_NSWsTGC_sdo_stationEta->push_back(stationEta); + m_NSWsTGC_sdo_stationPhi->push_back(stationPhi); + m_NSWsTGC_sdo_multiplet->push_back(multiplet); + m_NSWsTGC_sdo_gas_gap->push_back(gas_gap); + m_NSWsTGC_sdo_channel->push_back(channel); + m_NSWsTGC_sdo_channel_type->push_back(channel_type); + + ATH_MSG_DEBUG( "Get the truth deposits from the SDO." ); + std::vector<MuonSimData::Deposit> deposits; + mm_sdo.deposits(deposits); + + const Amg::Vector3D hit_gpos = mm_sdo.globalPosition(); + m_NSWsTGC_sdo_globalPosX->push_back( hit_gpos.x() ); + m_NSWsTGC_sdo_globalPosY->push_back( hit_gpos.y() ); + m_NSWsTGC_sdo_globalPosZ->push_back( hit_gpos.z() ); + + m_NSWsTGC_sdo_globaltime->push_back( mm_sdo.getTime() ); + m_NSWsTGC_sdo_word->push_back( mm_sdo.word() ); + + // use the information of the first deposit + int barcode = deposits[0].first.barcode(); + double MuonMCdata_firstentry = deposits[0].second.firstEntry(); + double MuonMCdata_secondentry = deposits[0].second.secondEntry(); + + ATH_MSG_DEBUG("MicroMegas SDO barcode=" << barcode); + ATH_MSG_DEBUG("MicroMegas SDO localPosX=" << std::setw(9) << std::setprecision(2) << MuonMCdata_firstentry + << ", localPosY=" << std::setw(9) << std::setprecision(2) << MuonMCdata_secondentry); + + m_NSWsTGC_sdo_barcode->push_back( barcode ); + m_NSWsTGC_sdo_E->push_back( MuonMCdata_firstentry ); + m_NSWsTGC_sdo_tof->push_back( MuonMCdata_secondentry ); + + m_NSWsTGC_nsdo++; + } + + ATH_MSG_DEBUG("Processed " << m_NSWsTGC_nsdo << " MicroMegas SDOs"); + return StatusCode::SUCCESS; +} + + +void sTGCSDOVariables::deleteVariables() +{ + delete m_NSWsTGC_sdo_stationName; + delete m_NSWsTGC_sdo_stationEta; + delete m_NSWsTGC_sdo_stationPhi; + delete m_NSWsTGC_sdo_multiplet; + delete m_NSWsTGC_sdo_gas_gap; + delete m_NSWsTGC_sdo_channel; + delete m_NSWsTGC_sdo_channel_type; + + delete m_NSWsTGC_sdo_word; + delete m_NSWsTGC_sdo_barcode; + delete m_NSWsTGC_sdo_globalPosX; + delete m_NSWsTGC_sdo_globalPosY; + delete m_NSWsTGC_sdo_globalPosZ; + delete m_NSWsTGC_sdo_globaltime; + + delete m_NSWsTGC_sdo_E; + delete m_NSWsTGC_sdo_tof; + + m_NSWsTGC_nsdo = 0; + m_NSWsTGC_sdo_stationName = nullptr; + m_NSWsTGC_sdo_stationEta = nullptr; + m_NSWsTGC_sdo_stationPhi = nullptr; + m_NSWsTGC_sdo_multiplet = nullptr; + m_NSWsTGC_sdo_gas_gap = nullptr; + m_NSWsTGC_sdo_channel = nullptr; + m_NSWsTGC_sdo_channel_type = nullptr; + + m_NSWsTGC_sdo_word = nullptr; + m_NSWsTGC_sdo_barcode = nullptr; + m_NSWsTGC_sdo_globalPosX = nullptr; + m_NSWsTGC_sdo_globalPosY = nullptr; + m_NSWsTGC_sdo_globalPosZ = nullptr; + m_NSWsTGC_sdo_globaltime = nullptr; + + m_NSWsTGC_sdo_E = nullptr; + m_NSWsTGC_sdo_tof = nullptr; + + return; +} + + +StatusCode sTGCSDOVariables::clearVariables() +{ + m_NSWsTGC_nsdo = 0; + m_NSWsTGC_sdo_stationName->clear(); + m_NSWsTGC_sdo_stationEta->clear(); + m_NSWsTGC_sdo_stationPhi->clear(); + m_NSWsTGC_sdo_multiplet->clear(); + m_NSWsTGC_sdo_gas_gap->clear(); + m_NSWsTGC_sdo_channel->clear(); + m_NSWsTGC_sdo_channel_type->clear(); + + m_NSWsTGC_sdo_word->clear(); + m_NSWsTGC_sdo_barcode->clear(); + m_NSWsTGC_sdo_globalPosX->clear(); + m_NSWsTGC_sdo_globalPosY->clear(); + m_NSWsTGC_sdo_globalPosZ->clear(); + m_NSWsTGC_sdo_globaltime->clear(); + m_NSWsTGC_sdo_E->clear(); + m_NSWsTGC_sdo_tof->clear(); + + return StatusCode::SUCCESS; +} + + +StatusCode sTGCSDOVariables::initializeVariables() +{ + m_NSWsTGC_nsdo = 0; + m_NSWsTGC_sdo_stationName = new std::vector<std::string>(); + m_NSWsTGC_sdo_stationEta = new std::vector<int>(); + m_NSWsTGC_sdo_stationPhi = new std::vector<int>(); + m_NSWsTGC_sdo_multiplet = new std::vector<int>(); + m_NSWsTGC_sdo_gas_gap = new std::vector<int>(); + m_NSWsTGC_sdo_channel = new std::vector<int>(); + m_NSWsTGC_sdo_channel_type = new std::vector<int>(); + + m_NSWsTGC_sdo_word = new std::vector<int>(); + m_NSWsTGC_sdo_barcode = new std::vector<int>(); + m_NSWsTGC_sdo_globalPosX = new std::vector<double>(); + m_NSWsTGC_sdo_globalPosY = new std::vector<double>(); + m_NSWsTGC_sdo_globalPosZ = new std::vector<double>(); + m_NSWsTGC_sdo_globaltime = new std::vector<double>(); + + m_NSWsTGC_sdo_E = new std::vector<double>(); + m_NSWsTGC_sdo_tof = new std::vector<double>(); + + if(m_tree) { + + m_tree->Branch("SDO_sTGC", &m_NSWsTGC_nsdo, "SDOs_sTGC_n/i"); + m_tree->Branch("SDO_sTGC_stationName", &m_NSWsTGC_sdo_stationName); + m_tree->Branch("SDO_sTGC_stationEta", &m_NSWsTGC_sdo_stationEta); + m_tree->Branch("SDO_sTGC_stationPhi", &m_NSWsTGC_sdo_stationPhi); + m_tree->Branch("SDO_sTGC_multiplet", &m_NSWsTGC_sdo_multiplet); + m_tree->Branch("SDO_sTGC_gas_gap", &m_NSWsTGC_sdo_gas_gap); + m_tree->Branch("SDO_sTGC_channel", &m_NSWsTGC_sdo_channel); + m_tree->Branch("SDO_sTGC_channel_type", &m_NSWsTGC_sdo_channel_type); + + m_tree->Branch("SDO_sTGC_word", &m_NSWsTGC_sdo_word); + m_tree->Branch("SDO_sTGC_barcode", &m_NSWsTGC_sdo_barcode); + m_tree->Branch("SDO_sTGC_globalPosX", &m_NSWsTGC_sdo_globalPosX); + m_tree->Branch("SDO_sTGC_globalPosY", &m_NSWsTGC_sdo_globalPosY); + m_tree->Branch("SDO_sTGC_globalPosZ", &m_NSWsTGC_sdo_globalPosZ); + m_tree->Branch("SDO_sTGC_global_time", &m_NSWsTGC_sdo_globaltime); + m_tree->Branch("SDO_sTGC_Energy", &m_NSWsTGC_sdo_E); + m_tree->Branch("SDO_sTGC_tof", &m_NSWsTGC_sdo_tof); + + } + + return StatusCode::SUCCESS; +} \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSDOVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSDOVariables.h new file mode 100644 index 0000000000000000000000000000000000000000..2e2f2f5f8aa46daa14f48f74b66b8fe030168900 --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSDOVariables.h @@ -0,0 +1,88 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef STGCSDOVARIABLES_H +#define STGCSDOVARIABLES_H + +#include <vector> + +#include "ValAlgVariables.h" +#include "MuonIdHelpers/sTgcIdHelper.h" +#include "AthenaBaseComps/AthMsgStreamMacros.h" + +class sTGCSDOVariables : public ValAlgVariables +{ + public: + sTGCSDOVariables(StoreGateSvc* evtStore, + const MuonGM::MuonDetectorManager* detManager, + const MuonIdHelper* idhelper, + TTree* tree, + std::string containername) : + ValAlgVariables(evtStore, detManager, tree, containername, "sTGCSDOVariables"), + m_sTgcIdHelper(0), + m_NSWsTGC_nsdo(0), + m_NSWsTGC_sdo_stationName(0), + m_NSWsTGC_sdo_stationEta(0), + m_NSWsTGC_sdo_stationPhi(0), + m_NSWsTGC_sdo_multiplet(0), + m_NSWsTGC_sdo_gas_gap(0), + m_NSWsTGC_sdo_channel(0), + m_NSWsTGC_sdo_channel_type(0), + m_NSWsTGC_sdo_word(0), + m_NSWsTGC_sdo_barcode(0), + m_NSWsTGC_sdo_globalPosX(0), + m_NSWsTGC_sdo_globalPosY(0), + m_NSWsTGC_sdo_globalPosZ(0), + m_NSWsTGC_sdo_globaltime(0), + m_NSWsTGC_sdo_E(0), + m_NSWsTGC_sdo_tof(0) + { + setHelper(idhelper); + } + + ~sTGCSDOVariables() + { + deleteVariables(); + } + + StatusCode initializeVariables(); + StatusCode fillVariables(); + + private: + + void setHelper(const MuonIdHelper* idhelper){ + m_sTgcIdHelper = dynamic_cast<const sTgcIdHelper*>(idhelper); + if(m_sTgcIdHelper == 0) { + ATH_MSG_ERROR("casting IdHelper to MmIdhelper failed"); + throw; + } + } + + void deleteVariables(); + StatusCode clearVariables(); + + const sTgcIdHelper* m_sTgcIdHelper; + + int m_NSWsTGC_nsdo; + std::vector<std::string> *m_NSWsTGC_sdo_stationName; + std::vector<int> *m_NSWsTGC_sdo_stationEta; + std::vector<int> *m_NSWsTGC_sdo_stationPhi; + std::vector<int> *m_NSWsTGC_sdo_multiplet; + std::vector<int> *m_NSWsTGC_sdo_gas_gap; + std::vector<int> *m_NSWsTGC_sdo_channel; + std::vector<int> *m_NSWsTGC_sdo_channel_type; + + std::vector<int> *m_NSWsTGC_sdo_word; + std::vector<int> *m_NSWsTGC_sdo_barcode; + std::vector<double> *m_NSWsTGC_sdo_globalPosX; + std::vector<double> *m_NSWsTGC_sdo_globalPosY; + std::vector<double> *m_NSWsTGC_sdo_globalPosZ; + std::vector<double> *m_NSWsTGC_sdo_globaltime; + + std::vector<double> *m_NSWsTGC_sdo_E; + std::vector<double> *m_NSWsTGC_sdo_tof; + +}; + +#endif // STGCSDOVARIABLE_H diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSimHitVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSimHitVariables.cxx index 4d434507135b9a7d6215b0dfa20c0694e28b53af..8d41d96e1fa0a3ab2c21cc77d4418e570ea1c3aa 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSimHitVariables.cxx +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSimHitVariables.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #include "sTGCSimHitVariables.h" @@ -32,227 +32,230 @@ StatusCode sTGCSimHitVariables::fillVariables() const GenericMuonSimHit hit = it; if(hit.depositEnergy()==0.) continue; // SimHits without energy loss are not recorded. - // connect the hit with the MC truth - int barcode = hit.particleLink().barcode(); - m_NSWsTGC_trackId->push_back(barcode); -// for (unsigned int tr=0;tr<m_Truth_particleBarcode->size();tr++) { -// if (barcode==m_Truth_particleBarcode->at(tr)) { -// m_NSWsTGC_truthEl->push_back(tr); -// } -// } - - m_NSWsTGC_globalTime->push_back(hit.globalTime()); - const Amg::Vector3D globalPosition = hit.globalPosition(); - m_NSWsTGC_hitGlobalPositionX->push_back(globalPosition.x()); - m_NSWsTGC_hitGlobalPositionY->push_back(globalPosition.y()); - m_NSWsTGC_hitGlobalPositionZ->push_back(globalPosition.z()); - m_NSWsTGC_hitGlobalPositionR->push_back(globalPosition.perp()); - m_NSWsTGC_hitGlobalPositionP->push_back(globalPosition.phi()); - const Amg::Vector3D globalDirection = hit.globalDirection(); - m_NSWsTGC_hitGlobalDirectionX->push_back(globalDirection.x()); - m_NSWsTGC_hitGlobalDirectionY->push_back(globalDirection.y()); - m_NSWsTGC_hitGlobalDirectionZ->push_back(globalDirection.z()); - - const Amg::Vector3D localPosition = hit.localPosition(); - m_NSWsTGC_hitLocalPositionX->push_back(localPosition.x()); - m_NSWsTGC_hitLocalPositionY->push_back(localPosition.y()); - m_NSWsTGC_hitLocalPositionZ->push_back(localPosition.z()); - - m_NSWsTGC_particleEncoding->push_back(hit.particleEncoding()); - m_NSWsTGC_kineticEnergy->push_back(hit.kineticEnergy()); - m_NSWsTGC_depositEnergy->push_back(hit.depositEnergy()); - m_NSWsTGC_StepLength->push_back(hit.StepLength()); - - // Read information about the sTGC hits; make sanity checks and printout - int simId = hit.GenericId(); - std::string sim_stationName = hitHelper->GetStationName(simId); - int sim_stationEta = hitHelper->GetZSector(simId); - int sim_stationPhi = hitHelper->GetPhiSector(simId); - int sim_multilayer = hitHelper->GetMultiLayer(simId); - int sim_layer = hitHelper->GetLayer(simId); - int sim_side = hitHelper->GetSide(simId); - - ATH_MSG_DEBUG( "sTGC SimHit id: Station Name [" << sim_stationName << " ]" - << " Station Eta [" << sim_stationEta << "]" - << " Station Phi [" << sim_stationPhi << "]" - << " MultiLayer [" << sim_multilayer << "]" - << " Layer [" << sim_layer << "]" - << " Side [" << sim_side << "]" ); - - if ( sim_stationPhi==0 ) { - ATH_MSG_ERROR("unexpected phi range: " << sim_stationPhi); - return StatusCode::FAILURE; + // SimHits do not have channel type (1 is assigned as dummy value). + // Compute channel type in Val Alg to be able to validate + for( int type=0;type<=2;++type ){ + + // Read information about the sTGC hits; make sanity checks and printout + int simId = hit.GenericId(); + std::string sim_stationName = hitHelper->GetStationName(simId); + int sim_stationEta = hitHelper->GetZSector(simId); + int sim_stationPhi = hitHelper->GetPhiSector(simId); + int sim_multilayer = hitHelper->GetMultiLayer(simId); + int sim_layer = hitHelper->GetLayer(simId); + int sim_side = hitHelper->GetSide(simId); + + ATH_MSG_DEBUG( "sTGC SimHit id: Station Name [" << sim_stationName << " ]" + << " Station Eta [" << sim_stationEta << "]" + << " Station Phi [" << sim_stationPhi << "]" + << " MultiLayer [" << sim_multilayer << "]" + << " Layer [" << sim_layer << "]" + << " Side [" << sim_side << "]" ); + + if ( sim_stationPhi==0 ) { + ATH_MSG_ERROR("unexpected phi range: " << sim_stationPhi); + return StatusCode::FAILURE; + } + // Current [7/12/12] implementation of the Station Name is: T[0-3][L/S][P/C] + int detNumber = -999, wedgeId = -999, wedgeType = -999; + if(sim_stationName.length()!=4) { + ATH_MSG_WARNING("sTGC validation: station Name exceeds 4 charactes, filling dummy information for detNumber, wedgeId and wedgeType"); + } + else { + detNumber = atoi(sim_stationName.substr(1,1).c_str()); + wedgeId = (sim_stationName.substr(2,1).compare("L")) ? 0 : 1; + wedgeType = (sim_stationName.substr(3,1).compare("P")) ? 0 : 1; + } + + + // convert simHit id to offline id; make sanity checks; retrieve the associated detector element. + Identifier offId = simToOffline.convert(hit.GenericId()); + + std::string stName = m_sTgcIdHelper->stationNameString(m_sTgcIdHelper->stationName(offId)); + int off_stationEta = m_sTgcIdHelper->stationEta(offId); + int off_stationPhi = m_sTgcIdHelper->stationPhi(offId); + int off_multiplet = m_sTgcIdHelper->multilayer(offId); + int off_gas_gap = m_sTgcIdHelper->gasGap(offId); + int off_channel_type = m_sTgcIdHelper->channelType(offId); + int off_channel = m_sTgcIdHelper->channel(offId); + + int isSmall = stName[2] == 'S'; + + if( type == 2 && off_channel == 63) { + ATH_MSG_DEBUG("Found sTGC Wire Sim Hit with channel number 63 (dead region), skipping this hit"); + continue; + } + + const MuonGM::sTgcReadoutElement* detEl = m_detManager->getsTgcReadoutElement(offId); + if( !detEl ){ + ATH_MSG_WARNING("sTGC geometry, failed to retrieve detector element for: isSmall " << isSmall << " eta " << m_sTgcIdHelper->stationEta(offId) + << " phi " << m_sTgcIdHelper->stationPhi(offId) << " ml " << m_sTgcIdHelper->multilayer(offId) ); + } + + if( !m_sTgcIdHelper->is_stgc(offId) ){ + ATH_MSG_WARNING("sTgc id is not a stgc id! " << m_sTgcIdHelper->print_to_string(offId)); + } + if( !m_sTgcIdHelper->is_muon(offId) ){ + ATH_MSG_WARNING("sTgc id is not a muon id! " << m_sTgcIdHelper->print_to_string(offId)); + } + if( m_sTgcIdHelper->is_mdt(offId)||m_sTgcIdHelper->is_rpc(offId)||m_sTgcIdHelper->is_tgc(offId)||m_sTgcIdHelper->is_csc(offId)||m_sTgcIdHelper->is_mm(offId) ){ + ATH_MSG_WARNING("sTgc id has wrong technology type! " << m_sTgcIdHelper->is_mdt(offId) << " " << m_sTgcIdHelper->is_rpc(offId) + << " " << m_sTgcIdHelper->is_tgc(offId) << " " << m_sTgcIdHelper->is_csc(offId) << " " << m_sTgcIdHelper->is_mm(offId) ); + } + if( m_sTgcIdHelper->gasGap(offId) != sim_layer ) { + ATH_MSG_WARNING("sTgc id has bad layer field! " << m_sTgcIdHelper->print_to_string(offId) ); + } + // connect the hit with the MC truth + int barcode = hit.particleLink().barcode(); + m_NSWsTGC_trackId->push_back(barcode); + + m_NSWsTGC_globalTime->push_back(hit.globalTime()); + const Amg::Vector3D globalPosition = hit.globalPosition(); + m_NSWsTGC_hitGlobalPositionX->push_back(globalPosition.x()); + m_NSWsTGC_hitGlobalPositionY->push_back(globalPosition.y()); + m_NSWsTGC_hitGlobalPositionZ->push_back(globalPosition.z()); + m_NSWsTGC_hitGlobalPositionR->push_back(globalPosition.perp()); + m_NSWsTGC_hitGlobalPositionP->push_back(globalPosition.phi()); + const Amg::Vector3D globalDirection = hit.globalDirection(); + m_NSWsTGC_hitGlobalDirectionX->push_back(globalDirection.x()); + m_NSWsTGC_hitGlobalDirectionY->push_back(globalDirection.y()); + m_NSWsTGC_hitGlobalDirectionZ->push_back(globalDirection.z()); + + const Amg::Vector3D localPosition = hit.localPosition(); + m_NSWsTGC_hitLocalPositionX->push_back(localPosition.x()); + m_NSWsTGC_hitLocalPositionY->push_back(localPosition.y()); + m_NSWsTGC_hitLocalPositionZ->push_back(localPosition.z()); + + m_NSWsTGC_particleEncoding->push_back(hit.particleEncoding()); + m_NSWsTGC_kineticEnergy->push_back(hit.kineticEnergy()); + m_NSWsTGC_depositEnergy->push_back(hit.depositEnergy()); + m_NSWsTGC_StepLength->push_back(hit.StepLength()); + + + // Fill Ntuple with SimId data + m_NSWsTGC_sim_stationName ->push_back(sim_stationName); + m_NSWsTGC_sim_stationEta ->push_back(sim_stationEta); + m_NSWsTGC_sim_stationPhi ->push_back(sim_stationPhi); + m_NSWsTGC_wedgeId ->push_back(wedgeId); + m_NSWsTGC_wedgeType ->push_back(wedgeType); + m_NSWsTGC_detectorNumber ->push_back(detNumber); + m_NSWsTGC_sim_multilayer ->push_back(sim_multilayer); + m_NSWsTGC_sim_layer ->push_back(sim_layer); + m_NSWsTGC_sim_side ->push_back(sim_side); + + ATH_MSG_DEBUG( "sTGC Offline id: Station Name [" << stName << "]" + << " Station Eta [" << off_stationEta << "]" + << " Station Phi [" << off_stationPhi << "]" + << " Multiplet [" << off_multiplet << "]" + << " GasGap [" << off_gas_gap << "]" + << " Type [" << off_channel_type << "]" + << " ChNr [" << off_channel << "]" ); + + ATH_MSG_DEBUG("sTGC geometry, retrieving detector element for: isSmall " << isSmall << " eta " << m_sTgcIdHelper->stationEta(offId) + << " phi " << m_sTgcIdHelper->stationPhi(offId) << " ml " << m_sTgcIdHelper->multilayer(offId) ); + + + Identifier newId = m_sTgcIdHelper->channelID(m_sTgcIdHelper->parentID(offId), m_sTgcIdHelper->multilayer(offId), m_sTgcIdHelper->gasGap(offId),type,1,0); + + // compute hit position within the detector element/surfaces + const Trk::PlaneSurface& surf = detEl->surface(newId); + Amg::Transform3D gToL = detEl->absTransform().inverse(); + Amg::Vector3D hpos(hit.globalPosition().x(),hit.globalPosition().y(),hit.globalPosition().z()); + Amg::Vector3D dSurface_pos = gToL*hpos; + + // compute the hit position on the readout plane (same as in MuonFastDigitization) + Amg::Vector3D rSurface_pos = surf.transform().inverse()*hpos; + Amg::Vector3D ldir = surf.transform().inverse().linear()*Amg::Vector3D(hit.globalDirection().x(),hit.globalDirection().y(),hit.globalDirection().z()); + + ATH_MSG_DEBUG("sTGC channel type:" << type); + + double scale = -rSurface_pos.z()/ldir.z(); + Amg::Vector3D hitOnSurface = rSurface_pos + scale*ldir; + + // hitOnSurface.x() will be susequent smeared to simulate the detector resolution, here we do not apply any smearing + Amg::Vector2D posOnSurf(hitOnSurface.x(), rSurface_pos.y()); + + int stripNumber = detEl->stripNumber(posOnSurf,newId); + if( stripNumber == -1 ){ + ATH_MSG_WARNING("sTGC validation: failed to obtain strip number " << m_sTgcIdHelper->print_to_string(offId) ); + ATH_MSG_WARNING(" pos " << posOnSurf << " z " << rSurface_pos.z() ); + //stripNumber = 1; + } + Identifier oldId = offId; + offId = m_sTgcIdHelper->channelID(offId, m_sTgcIdHelper->multilayer(offId), m_sTgcIdHelper->gasGap(offId),1,stripNumber); + if( m_sTgcIdHelper->gasGap(offId) != sim_layer ) { + ATH_MSG_WARNING("sTGC validation: sTgc id has bad layer field(2)! " << std::endl << " " << m_sTgcIdHelper->print_to_string(offId) << std::endl + << " " << m_sTgcIdHelper->print_to_string(oldId) << " stripN " << stripNumber ); + } + + Amg::Vector2D fastDigitPos(0,0); + if( !detEl->stripPosition(offId,fastDigitPos) ){ + ATH_MSG_WARNING("sTGC validation: failed to obtain local position for identifier " << m_sTgcIdHelper->print_to_string(offId) ); + } + + Amg::Vector3D detpos = detEl->globalPosition(); + ATH_MSG_DEBUG("sTGC Global hit: r " << hit.globalPosition().perp() << ", phi " << hit.globalPosition().phi() << ", z " << hit.globalPosition().z() + << "; detEl: r " << detpos.perp() << ", phi " << detpos.phi() << ", z " << detpos.z() + << "; surf z " << surf.center().z() << ", ml " << sim_multilayer << ", l " << sim_layer ); + + ATH_MSG_DEBUG("sTGC Local hit : x " << hit.localPosition().x() << " y " << hit.localPosition().y() << " z " << hit.localPosition().z() + << " detEl: x " << dSurface_pos.x() << " y " << dSurface_pos.y() << " z " << dSurface_pos.z()); + ATH_MSG_DEBUG("sTGC Fast digit: x " << fastDigitPos.x() << " y " << fastDigitPos.y() + << ", gToL: x " << rSurface_pos.x() << " y " << rSurface_pos.y() << " z " << rSurface_pos.z() ); + + + + // Fill Ntuple with offline ID data + m_NSWsTGC_off_stationName ->push_back(stName); + m_NSWsTGC_off_stationEta ->push_back(off_stationEta); + m_NSWsTGC_off_stationPhi ->push_back(off_stationPhi); + m_NSWsTGC_off_multiplet ->push_back(off_multiplet); + m_NSWsTGC_off_gas_gap ->push_back(off_gas_gap); + m_NSWsTGC_off_channel_type ->push_back(type); + // The offline IdHelper class will be updated to assign wiregroup ID to SimHit. + // As a temporary solution stripnumber is used directly (also in MM) + off_channel = stripNumber; + m_NSWsTGC_off_channel ->push_back(off_channel); + + + // Fill ntuple with the hit/surface/digit positions + m_NSWsTGC_detector_globalPositionX->push_back( detpos.x() ); + m_NSWsTGC_detector_globalPositionY->push_back( detpos.y() ); + m_NSWsTGC_detector_globalPositionZ->push_back( detpos.z() ); + m_NSWsTGC_detector_globalPositionR->push_back( detpos.perp() ); + m_NSWsTGC_detector_globalPositionP->push_back( detpos.phi() ); + + m_NSWsTGC_hitToDsurfacePositionX->push_back( dSurface_pos.x() ); + m_NSWsTGC_hitToDsurfacePositionY->push_back( dSurface_pos.y() ); + m_NSWsTGC_hitToDsurfacePositionZ->push_back( dSurface_pos.z() ); + + m_NSWsTGC_hitToRsurfacePositionX->push_back( rSurface_pos.x() ); + m_NSWsTGC_hitToRsurfacePositionY->push_back( rSurface_pos.y() ); + m_NSWsTGC_hitToRsurfacePositionZ->push_back( rSurface_pos.z() ); + + m_NSWsTGC_FastDigitRsurfacePositionX->push_back( posOnSurf.x() ); + m_NSWsTGC_FastDigitRsurfacePositionY->push_back( posOnSurf.y() ); + + + + m_NSWsTGC_stripNumber->push_back(stripNumber); + m_NSWsTGC_wireNumber->push_back(-999); + + ATH_MSG_DEBUG("---------- Hit processing ends!"); + /* + ATH_MSG_DEBUG( " NSW Hits E = " << hit.depositEnergy() + << ", Global X sTGC = " << globalPosition.x() + << ", Global Y sTGC = " << globalPosition.y() + << ", Global Z sTGC = " << globalPosition.z() + << ", Local X sTGC = " << localPosition.x() + << ", Local Y sTGC = " << localPosition.y() + << ", Local Z sTGC = " << localPosition.z() + << ", time = " << hit.globalTime() + << ", step length = " << hit.StepLength() ); + */ + m_NSWsTGC_nSimHits++; } - // Current [7/12/12] implementation of the Station Name is: T[0-3][L/S][P/C] - int detNumber = -999, wedgeId = -999, wedgeType = -999; - if(sim_stationName.length()!=4) { - ATH_MSG_WARNING("sTGC validation: station Name exceeds 4 charactes, filling dummy information for detNumber, wedgeId and wedgeType"); - } - else { - detNumber = atoi(sim_stationName.substr(1,1).c_str()); - wedgeId = (sim_stationName.substr(2,1).compare("L")) ? 0 : 1; - wedgeType = (sim_stationName.substr(3,1).compare("P")) ? 0 : 1; - } - - // Fill Ntuple with SimId data - m_NSWsTGC_sim_stationName ->push_back(sim_stationName); - m_NSWsTGC_sim_stationEta ->push_back(sim_stationEta); - m_NSWsTGC_sim_stationPhi ->push_back(sim_stationPhi); - m_NSWsTGC_wedgeId ->push_back(wedgeId); - m_NSWsTGC_wedgeType ->push_back(wedgeType); - m_NSWsTGC_detectorNumber ->push_back(detNumber); - m_NSWsTGC_sim_multilayer ->push_back(sim_multilayer); - m_NSWsTGC_sim_layer ->push_back(sim_layer); - m_NSWsTGC_sim_side ->push_back(sim_side); - - // convert simHit id to offline id; make sanity checks; retrieve the associated detector element. - Identifier offId = simToOffline.convert(hit.GenericId()); - if( !m_sTgcIdHelper->is_stgc(offId) ){ - ATH_MSG_WARNING("sTgc id is not a stgc id! " << m_sTgcIdHelper->print_to_string(offId)); - } - if( !m_sTgcIdHelper->is_muon(offId) ){ - ATH_MSG_WARNING("sTgc id is not a muon id! " << m_sTgcIdHelper->print_to_string(offId)); - } - if( m_sTgcIdHelper->is_mdt(offId)||m_sTgcIdHelper->is_rpc(offId)||m_sTgcIdHelper->is_tgc(offId)||m_sTgcIdHelper->is_csc(offId)||m_sTgcIdHelper->is_mm(offId) ){ - ATH_MSG_WARNING("sTgc id has wrong technology type! " << m_sTgcIdHelper->is_mdt(offId) << " " << m_sTgcIdHelper->is_rpc(offId) - << " " << m_sTgcIdHelper->is_tgc(offId) << " " << m_sTgcIdHelper->is_csc(offId) << " " << m_sTgcIdHelper->is_mm(offId) ); - } - if( m_sTgcIdHelper->gasGap(offId) != sim_layer ) { - ATH_MSG_WARNING("sTgc id has bad layer field! " << m_sTgcIdHelper->print_to_string(offId) ); - } - - std::string stName = m_sTgcIdHelper->stationNameString(m_sTgcIdHelper->stationName(offId)); - int off_stationEta = m_sTgcIdHelper->stationEta(offId); - int off_stationPhi = m_sTgcIdHelper->stationPhi(offId); - int off_multiplet = m_sTgcIdHelper->multilayer(offId); - int off_gas_gap = m_sTgcIdHelper->gasGap(offId); - int off_channel_type = m_sTgcIdHelper->channelType(offId); - int off_channel = m_sTgcIdHelper->channel(offId); - - ATH_MSG_DEBUG( "sTGC Offline id: Station Name [" << stName << "]" - << " Station Eta [" << off_stationEta << "]" - << " Station Phi [" << off_stationPhi << "]" - << " Multiplet [" << off_multiplet << "]" - << " GasGap [" << off_gas_gap << "]" - << " Type [" << off_channel_type << "]" - << " ChNr [" << off_channel << "]" ); - - int isSmall = stName[2] == 'S'; - - ATH_MSG_DEBUG("sTGC geometry, retrieving detector element for: isSmall " << isSmall << " eta " << m_sTgcIdHelper->stationEta(offId) - << " phi " << m_sTgcIdHelper->stationPhi(offId) << " ml " << m_sTgcIdHelper->multilayer(offId) ); - - int phiCor = m_sTgcIdHelper->stationPhi(offId); - - if( sim_stationPhi == 15 && hit.globalPosition().phi() > -0.4 ) phiCor = 1; - - int mlCor = m_sTgcIdHelper->multilayer(offId); - - if( !isSmall ){ - if( mlCor == 1 ) mlCor = 2; - else mlCor = 1; - } - - const MuonGM::sTgcReadoutElement* detEl = m_detManager->getsTgcRElement_fromIdFields(isSmall,m_sTgcIdHelper->stationEta(offId),phiCor,mlCor ); - if( !detEl ){ - ATH_MSG_WARNING("sTGC geometry, failed to retrieve detector element for: isSmall " << isSmall << " eta " << m_sTgcIdHelper->stationEta(offId) - << " phi " << m_sTgcIdHelper->stationPhi(offId) << " ml " << m_sTgcIdHelper->multilayer(offId) ); - continue; - } - - // compute hit position within the detector element/surfaces - const Trk::PlaneSurface& surf = detEl->surface(offId); - Amg::Transform3D gToL = detEl->absTransform().inverse(); - Amg::Vector3D hpos(hit.globalPosition().x(),hit.globalPosition().y(),hit.globalPosition().z()); - Amg::Vector3D dSurface_pos = gToL*hpos; - - // compute the hit position on the readout plane (same as in MuonFastDigitization) - Amg::Vector3D rSurface_pos = surf.transform().inverse()*hpos; - Amg::Vector3D ldir = surf.transform().inverse().linear()*Amg::Vector3D(hit.globalDirection().x(),hit.globalDirection().y(),hit.globalDirection().z()); - - double scale = -rSurface_pos.z()/ldir.z(); - Amg::Vector3D hitOnSurface = rSurface_pos + scale*ldir; - - // hitOnSurface.x() will be susequent smeared to simulate the detector resolution, here we do not apply any smearing - Amg::Vector2D posOnSurf(hitOnSurface.x(), rSurface_pos.y()); - - int stripNumber = detEl->stripNumber(posOnSurf,offId); - if( stripNumber == -1 ){ - ATH_MSG_WARNING("sTGC validation: failed to obtain strip number " << m_sTgcIdHelper->print_to_string(offId) ); - ATH_MSG_WARNING(" pos " << posOnSurf << " z " << rSurface_pos.z() ); - stripNumber = 1; - } - Identifier oldId = offId; - offId = m_sTgcIdHelper->channelID(offId, m_sTgcIdHelper->multilayer(offId), m_sTgcIdHelper->gasGap(offId),1,stripNumber); - if( m_sTgcIdHelper->gasGap(offId) != sim_layer ) { - ATH_MSG_WARNING("sTGC validation: sTgc id has bad layer field(2)! " << std::endl << " " << m_sTgcIdHelper->print_to_string(offId) << std::endl - << " " << m_sTgcIdHelper->print_to_string(oldId) << " stripN " << stripNumber ); - } - - Amg::Vector2D fastDigitPos(0,0); - if( !detEl->stripPosition(offId,fastDigitPos) ){ - ATH_MSG_WARNING("sTGC validation: failed to obtain local position for identifier " << m_sTgcIdHelper->print_to_string(offId) ); - continue; - } - - Amg::Vector3D detpos = detEl->globalPosition(); - ATH_MSG_DEBUG("sTGC Global hit: r " << hit.globalPosition().perp() << ", phi " << hit.globalPosition().phi() << ", z " << hit.globalPosition().z() - << "; detEl: r " << detpos.perp() << ", phi " << detpos.phi() << ", z " << detpos.z() - << "; surf z " << surf.center().z() << ", ml " << sim_multilayer << ", l " << sim_layer ); - - ATH_MSG_DEBUG("sTGC Local hit : x " << hit.localPosition().x() << " y " << hit.localPosition().y() << " z " << hit.localPosition().z() - << " detEl: x " << dSurface_pos.x() << " y " << dSurface_pos.y() << " z " << dSurface_pos.z()); - ATH_MSG_DEBUG("sTGC Fast digit: x " << fastDigitPos.x() << " y " << fastDigitPos.y() - << ", gToL: x " << rSurface_pos.x() << " y " << rSurface_pos.y() << " z " << rSurface_pos.z() ); - - - - // Fill Ntuple with offline ID data - m_NSWsTGC_off_stationName ->push_back(stName); - m_NSWsTGC_off_stationEta ->push_back(off_stationEta); - m_NSWsTGC_off_stationPhi ->push_back(off_stationPhi); - m_NSWsTGC_off_multiplet ->push_back(off_multiplet); - m_NSWsTGC_off_gas_gap ->push_back(off_gas_gap); - m_NSWsTGC_off_channel_type ->push_back(off_channel_type); - m_NSWsTGC_off_channel ->push_back(off_channel); - - // Fill ntuple with the hit/surface/digit positions - m_NSWsTGC_detector_globalPositionX->push_back( detpos.x() ); - m_NSWsTGC_detector_globalPositionY->push_back( detpos.y() ); - m_NSWsTGC_detector_globalPositionZ->push_back( detpos.z() ); - m_NSWsTGC_detector_globalPositionR->push_back( detpos.perp() ); - m_NSWsTGC_detector_globalPositionP->push_back( detpos.phi() ); - - m_NSWsTGC_hitToDsurfacePositionX->push_back( dSurface_pos.x() ); - m_NSWsTGC_hitToDsurfacePositionY->push_back( dSurface_pos.y() ); - m_NSWsTGC_hitToDsurfacePositionZ->push_back( dSurface_pos.z() ); - - m_NSWsTGC_hitToRsurfacePositionX->push_back( rSurface_pos.x() ); - m_NSWsTGC_hitToRsurfacePositionY->push_back( rSurface_pos.y() ); - m_NSWsTGC_hitToRsurfacePositionZ->push_back( rSurface_pos.z() ); - - m_NSWsTGC_FastDigitRsurfacePositionX->push_back( posOnSurf.x() ); - m_NSWsTGC_FastDigitRsurfacePositionY->push_back( posOnSurf.y() ); - - - - m_NSWsTGC_stripNumber->push_back(stripNumber); - m_NSWsTGC_wireNumber->push_back(-999); - - ATH_MSG_DEBUG("---------- Hit processing ends!"); -/* - ATH_MSG_DEBUG( " NSW Hits E = " << hit.depositEnergy() - << ", Global X sTGC = " << globalPosition.x() - << ", Global Y sTGC = " << globalPosition.y() - << ", Global Z sTGC = " << globalPosition.z() - << ", Local X sTGC = " << localPosition.x() - << ", Local Y sTGC = " << localPosition.y() - << ", Local Z sTGC = " << localPosition.z() - << ", time = " << hit.globalTime() - << ", step length = " << hit.StepLength() ); -*/ - m_NSWsTGC_nSimHits++; - } + } ATH_MSG_INFO("processed " << m_NSWsTGC_nSimHits << " sTGC sim hits"); return StatusCode::SUCCESS; @@ -263,7 +266,6 @@ StatusCode sTGCSimHitVariables::clearVariables() { m_NSWsTGC_nSimHits = 0; m_NSWsTGC_trackId->clear(); - m_NSWsTGC_truthEl->clear(); m_NSWsTGC_globalTime->clear(); m_NSWsTGC_hitGlobalPositionX->clear(); @@ -326,10 +328,9 @@ StatusCode sTGCSimHitVariables::clearVariables() return StatusCode::SUCCESS; } -StatusCode sTGCSimHitVariables::deleteVariables() +void sTGCSimHitVariables::deleteVariables() { delete m_NSWsTGC_trackId; - delete m_NSWsTGC_truthEl; delete m_NSWsTGC_globalTime; delete m_NSWsTGC_hitGlobalPositionX; delete m_NSWsTGC_hitGlobalPositionY; @@ -361,13 +362,11 @@ StatusCode sTGCSimHitVariables::deleteVariables() delete m_NSWsTGC_FastDigitRsurfacePositionX; delete m_NSWsTGC_FastDigitRsurfacePositionY; - delete m_NSWsTGC_particleEncoding; delete m_NSWsTGC_kineticEnergy; delete m_NSWsTGC_depositEnergy; delete m_NSWsTGC_StepLength; - delete m_NSWsTGC_sim_stationName; delete m_NSWsTGC_sim_stationEta; delete m_NSWsTGC_sim_stationPhi; @@ -392,7 +391,6 @@ StatusCode sTGCSimHitVariables::deleteVariables() m_NSWsTGC_nSimHits = 0; m_NSWsTGC_trackId = nullptr; - m_NSWsTGC_truthEl = nullptr; m_NSWsTGC_globalTime = nullptr; m_NSWsTGC_hitGlobalPositionX = nullptr; @@ -450,14 +448,13 @@ StatusCode sTGCSimHitVariables::deleteVariables() m_NSWsTGC_off_channel_type = nullptr; m_NSWsTGC_off_channel = nullptr; - return StatusCode::SUCCESS; + return; } StatusCode sTGCSimHitVariables::initializeVariables() { m_NSWsTGC_nSimHits = 0; m_NSWsTGC_trackId = new std::vector<int>(); - m_NSWsTGC_truthEl = new std::vector<int>(); m_NSWsTGC_globalTime = new std::vector<double>; m_NSWsTGC_hitGlobalPositionX = new std::vector<double>; @@ -519,7 +516,6 @@ StatusCode sTGCSimHitVariables::initializeVariables() if(m_tree) { m_tree->Branch("Hits_sTGC_n", &m_NSWsTGC_nSimHits, "Hits_sTGC_nSimHits/i"); m_tree->Branch("Hits_sTGC_trackId", &m_NSWsTGC_trackId); - m_tree->Branch("Hits_sTGC_truthEl", &m_NSWsTGC_truthEl); m_tree->Branch("Hits_sTGC_globalTime", &m_NSWsTGC_globalTime); m_tree->Branch("Hits_sTGC_hitGlobalPositionX", &m_NSWsTGC_hitGlobalPositionX); diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSimHitVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSimHitVariables.h index 8fa9922abea37181d0dd84faf3f2c2dfae0bcacb..86029f9b9af6b83c25ffda2c3cbee4c0f96ae429 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSimHitVariables.h +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSimHitVariables.h @@ -22,7 +22,6 @@ class sTGCSimHitVariables : public ValAlgVariables m_sTgcIdHelper(0), m_NSWsTGC_nSimHits(0), m_NSWsTGC_trackId(0), - m_NSWsTGC_truthEl(0), m_NSWsTGC_globalTime(0), m_NSWsTGC_hitGlobalPositionX(0), m_NSWsTGC_hitGlobalPositionY(0), @@ -76,10 +75,7 @@ class sTGCSimHitVariables : public ValAlgVariables ~sTGCSimHitVariables() { - if( (this->deleteVariables()).isFailure() ){ - ATH_MSG_ERROR("Failing to delete sTGCSimHitVariables."); - std::terminate(); - } + this->deleteVariables(); } @@ -96,14 +92,13 @@ class sTGCSimHitVariables : public ValAlgVariables } } - StatusCode deleteVariables(); + void deleteVariables(); StatusCode clearVariables(); const sTgcIdHelper* m_sTgcIdHelper; int m_NSWsTGC_nSimHits; std::vector<int> *m_NSWsTGC_trackId; - std::vector<int> *m_NSWsTGC_truthEl; std::vector<double> *m_NSWsTGC_globalTime; std::vector<double> *m_NSWsTGC_hitGlobalPositionX; diff --git a/PhysicsAnalysis/D3PDMaker/MuonD3PDMaker/src/MuonGenParticleAssociationTool.cxx b/PhysicsAnalysis/D3PDMaker/MuonD3PDMaker/src/MuonGenParticleAssociationTool.cxx index 1c506257721a1f2914b4ebce947c280421a893d9..8f3f07aaba7bd0a5de047ee5011732fc85ca97a0 100644 --- a/PhysicsAnalysis/D3PDMaker/MuonD3PDMaker/src/MuonGenParticleAssociationTool.cxx +++ b/PhysicsAnalysis/D3PDMaker/MuonD3PDMaker/src/MuonGenParticleAssociationTool.cxx @@ -75,7 +75,9 @@ StatusCode MuonGenParticleAssociationTool::book () const xAOD::TruthParticle* MuonGenParticleAssociationTool::get (const xAOD::Muon& p) { + IMCTruthClassifier::Cache cache; IMCTruthClassifier::Info info; + info.extrapolationCache = &cache; const xAOD::TruthParticle* out = 0; if (m_classifier->particleTruthClassifier (&p, &info).first != MCTruthPartClassifier::Unknown) diff --git a/PhysicsAnalysis/D3PDMaker/egammaD3PDAnalysis/src/PhotonTruthAlg.cxx b/PhysicsAnalysis/D3PDMaker/egammaD3PDAnalysis/src/PhotonTruthAlg.cxx index 0224819204814941cb8bff3b0ad0888f5f1a4e3f..b0d3886856ffbfb7a5f15c9a6614f6f324473b4d 100644 --- a/PhysicsAnalysis/D3PDMaker/egammaD3PDAnalysis/src/PhotonTruthAlg.cxx +++ b/PhysicsAnalysis/D3PDMaker/egammaD3PDAnalysis/src/PhotonTruthAlg.cxx @@ -65,11 +65,13 @@ StatusCode PhotonTruthAlg::execute() DECOR(bool, truth_isBrem); #undef DECOR + IMCTruthClassifier::Cache cache; + CHECK( m_photonGetter->reset (m_allowMissing) ); while (const xAOD::Photon* g = m_photonGetter->next<xAOD::Photon>()) { - const xAOD::TruthParticle* p = m_truthTool->toTruthParticle (*g); + const xAOD::TruthParticle* p = m_truthTool->toTruthParticle (*g, cache); truth_isConv(*g) = m_truthTool->getMCConv (p, truth_Rconv(*g), diff --git a/PhysicsAnalysis/D3PDMaker/egammaD3PDAnalysis/src/PhotonTruthTool.cxx b/PhysicsAnalysis/D3PDMaker/egammaD3PDAnalysis/src/PhotonTruthTool.cxx index b733da0380314d6bfc01a08b30072482e4c2c66a..7e017c2bc7b2275615f85ec248c760feb586601f 100644 --- a/PhysicsAnalysis/D3PDMaker/egammaD3PDAnalysis/src/PhotonTruthTool.cxx +++ b/PhysicsAnalysis/D3PDMaker/egammaD3PDAnalysis/src/PhotonTruthTool.cxx @@ -73,13 +73,15 @@ PhotonTruthTool::queryInterface( const InterfaceID& riid, void** ppvIf ) /** * @brief Go from a photon to a matching @c TruthParticle. * @param g The input photon. + * @param cache Truth classifier association cache. * @return The matching @c TruthParticle, or null. */ -// Not const due to particleTruthClassifier(). const xAOD::TruthParticle* -PhotonTruthTool::toTruthParticle (const xAOD::Photon& g) /*const*/ +PhotonTruthTool::toTruthParticle (const xAOD::Photon& g, + IMCTruthClassifier::Cache& cache) const { IMCTruthClassifier::Info info; + info.extrapolationCache = &cache; m_classifier->particleTruthClassifier (&g, &info); return info.genPart; } diff --git a/PhysicsAnalysis/D3PDMaker/egammaD3PDAnalysis/src/PhotonTruthTool.h b/PhysicsAnalysis/D3PDMaker/egammaD3PDAnalysis/src/PhotonTruthTool.h index 926d44dacf001a382f348e43eab6cf5dcfb8c6c1..120ae372da05b492cb8edbd9c2eca469fef25c97 100644 --- a/PhysicsAnalysis/D3PDMaker/egammaD3PDAnalysis/src/PhotonTruthTool.h +++ b/PhysicsAnalysis/D3PDMaker/egammaD3PDAnalysis/src/PhotonTruthTool.h @@ -65,10 +65,12 @@ public: /** * @brief Go from a photon to a matching @c TruthParticle. * @param g The input photon. + * @param cache Truth classifier association cache. * @return The matching @c TruthParticle, or null. */ const xAOD::TruthParticle* - toTruthParticle (const xAOD::Photon& g) /*const*/; + toTruthParticle (const xAOD::Photon& g, + IMCTruthClassifier::Cache& cache) const; /** diff --git a/PhysicsAnalysis/D3PDMaker/egammaD3PDMaker/src/egammaGenParticleAssociationTool.cxx b/PhysicsAnalysis/D3PDMaker/egammaD3PDMaker/src/egammaGenParticleAssociationTool.cxx index 57d88a63084750676ed169732119f18a69ad9145..28130e1667610280da82b0242b6a35c097bb074f 100644 --- a/PhysicsAnalysis/D3PDMaker/egammaD3PDMaker/src/egammaGenParticleAssociationTool.cxx +++ b/PhysicsAnalysis/D3PDMaker/egammaD3PDMaker/src/egammaGenParticleAssociationTool.cxx @@ -78,7 +78,9 @@ StatusCode egammaGenParticleAssociationTool::book () const xAOD::TruthParticle* egammaGenParticleAssociationTool::get (const xAOD::Egamma& p) { + IMCTruthClassifier::Cache cache; IMCTruthClassifier::Info info; + info.extrapolationCache = &cache; if (const xAOD::Electron* q = dynamic_cast<const xAOD::Electron*> (&p)) { diff --git a/PhysicsAnalysis/D3PDMaker/egammaD3PDMaker/src/egammaTruthClassificationFillerTool.cxx b/PhysicsAnalysis/D3PDMaker/egammaD3PDMaker/src/egammaTruthClassificationFillerTool.cxx index 89796d1c0ff06046127f0d5b4e4cc40d2585f253..f3f23d1927f4b4e9133d8cc9117c36333048de9e 100644 --- a/PhysicsAnalysis/D3PDMaker/egammaD3PDMaker/src/egammaTruthClassificationFillerTool.cxx +++ b/PhysicsAnalysis/D3PDMaker/egammaD3PDMaker/src/egammaTruthClassificationFillerTool.cxx @@ -92,7 +92,9 @@ StatusCode egammaTruthClassificationFillerTool::fill (const xAOD::Egamma& p) std::pair<MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOrigin> res; + IMCTruthClassifier::Cache cache; IMCTruthClassifier::Info info; + info.extrapolationCache = &cache; if (const xAOD::Electron* q = dynamic_cast<const xAOD::Electron*>(&p)) { diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration.py index a638c6414004c2b7629a42553a7b0fadff7a40b4..2c329e17d688e7809f915c6b4dba2d41924f47f7 100644 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration.py +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration.py @@ -14,6 +14,7 @@ from RecExConfig.RecFlags import rec # Common tools: from BTagging.BTaggingConfiguration_CommonTools import * from BTagging.BTaggingConfiguration_InDetVKalVxInJetTool import * +from BTagging.BTaggingConfiguration_InDetVKalVxTrigInJetTool import * from BTagging.BTaggingConfiguration_InDetVKalVxNegativeTagInJetTool import * from BTagging.BTaggingConfiguration_InDetVKalVxMultiVxInJetTool import * @@ -27,6 +28,7 @@ from BTagging.BTaggingConfiguration_IP2DNegTag import * #from BTagging.BTaggingConfiguration_IP2DSpcPosTag import * #from BTagging.BTaggingConfiguration_IP2DSpcTag import * from BTagging.BTaggingConfiguration_IP2DTag import * +from BTagging.BTaggingConfiguration_IP2DTrigTag import * #from BTagging.BTaggingConfiguration_IP3DFlipTag import * from BTagging.BTaggingConfiguration_IP3DNegTag import * #from BTagging.BTaggingConfiguration_IP3DPosTag import * @@ -35,6 +37,7 @@ from BTagging.BTaggingConfiguration_IP3DNegTag import * #from BTagging.BTaggingConfiguration_IP3DSpcPosTag import * #from BTagging.BTaggingConfiguration_IP3DSpcTag import * from BTagging.BTaggingConfiguration_IP3DTag import * +from BTagging.BTaggingConfiguration_IP3DTrigTag import * from BTagging.BTaggingConfiguration_RNNIPTag import * # Jet fitter taggers @@ -53,6 +56,7 @@ from BTagging.BTaggingConfiguration_RNNIPTag import * ##from BTagging.BTaggingConfiguration_NewJetFitterTag import * from BTagging.BTaggingConfiguration_NewJetFitterCollection import * #I collected all jetfitter functions currently needed for rel. 19 into here (Wouter) +from BTagging.BTaggingConfiguration_NewJetFitterTrigCollection import * #I collected all jetfitter functions currently needed for rel. 19 into here (Wouter) from BTagging.BTaggingConfiguration_NewJetFitterIP3DNegCollection import * # Lepton taggers @@ -67,6 +71,7 @@ from BTagging.BTaggingConfiguration_SoftMuonTag import * from BTagging.BTaggingConfiguration_SV0Tag import * from BTagging.BTaggingConfiguration_SV1FlipTag import * from BTagging.BTaggingConfiguration_SV1Tag import * +from BTagging.BTaggingConfiguration_SV1TrigTag import * #from BTagging.BTaggingConfiguration_SV2FlipTag import * from BTagging.BTaggingConfiguration_SV2Tag import * @@ -89,6 +94,7 @@ from BTagging.BTaggingConfiguration_MV1cFlipTag import * from BTagging.BTaggingConfiguration_MV2c00Tag import * from BTagging.BTaggingConfiguration_MV2c00FlipTag import * from BTagging.BTaggingConfiguration_MV2c10Tag import * +from BTagging.BTaggingConfiguration_MV2c10TrigTag import * from BTagging.BTaggingConfiguration_MV2c10FlipTag import * from BTagging.BTaggingConfiguration_MV2c20Tag import * from BTagging.BTaggingConfiguration_MV2c20FlipTag import * @@ -109,6 +115,7 @@ from BTagging.BTaggingConfiguration_ExKtbbTag import * # MultivariateTagManager from BTagging.BTaggingConfiguration_MultivariateTagManager import * +from BTagging.BTaggingConfiguration_MultivariateTrigTagManager import * from BTagging.BTaggingConfiguration_MultivariateFlipTagManager import * # DL1 tagger @@ -387,13 +394,13 @@ class Configuration: print str(tool)+': ',self._BTaggingConfig_InitializedTools[tool] def updateBTaggers(self, JetCollection): - """Updates the JetBTaggerTool for the selected JetCollection if they already exist. This is in order to keep + """Updates the JetBTaggerAlgs for the selected JetCollection if they already exist. This is in order to keep them up-to-date, as someone might set up a tool after these main tools already exist. And such a tool might require a new associator which we need to add to the main associator tool.""" if JetCollection in self._BTaggingConfig_JetBTaggerAlgs: self.setupJetBTaggerAlgs(JetCollections=JetCollection) - def setupJetBTaggerAlg(self, ToolSvc=None, JetCollection="", TaggerList=[], SetupScheme="", topSequence=None, Verbose = True, AddToToolSvc = True, options={}, StripJetsSuffix = True): + def setupJetBTaggerAlg(self, ToolSvc=None, JetCollection="", TaggerList=[], SetupScheme="", topSequence=None, Verbose = True, options={}, StripJetsSuffix = True): """Convenience function which takes only a single jet collection and returns an instance instead of a list; see setupJetBTaggerAlgs for more info. This function is mainly here for easy calling BTagging. @@ -405,14 +412,14 @@ class Configuration: elif Verbose: print(self.BTagTag()+" - DEBUG - Stripping trailing 'jets' from jet collection '"+JetCollection+"' prior to setup.") JetCollection = JetCollection[:-4] - btagger = self.setupJetBTaggerAlgs(ToolSvc, [JetCollection,], topSequence, Verbose, AddToToolSvc, options, TaggerList, SetupScheme) + btagger = self.setupJetBTaggerAlgs(ToolSvc, [JetCollection,], topSequence, Verbose, options, TaggerList, SetupScheme) return btagger[0] def setupJetBTaggerTool(self, ToolSvc=None, JetCollection="", TaggerList=[], SetupScheme="", topSequence=None, Verbose = None, AddToToolSvc = True, options={}, StripJetsSuffix = True): - """Convenience function which takes only a single jet collection and returns an instance instead - of a list; see setupJetBTaggerTools for more info. This function is mainly here for easy calling for BTagging from JetRec. - - This function also strips any trailing 'Jets' in the JetCollection if StripJetsSuffix=True (which is the default).""" + # """Convenience function which takes only a single jet collection and returns an instance instead + # of a list; see setupJetBTaggerTools for more info. This function is mainly here for easy calling for BTagging from JetRec. + + # This function also strips any trailing 'Jets' in the JetCollection if StripJetsSuffix=True (which is the default).""" if (JetCollection.lower()).endswith("jets"): if Verbose is None: if BTaggingFlags.OutputLevel < 3: @@ -423,7 +430,7 @@ class Configuration: btagger = self.setupJetBTaggerTools(ToolSvc, [JetCollection,], topSequence, Verbose, AddToToolSvc, options, TaggerList, SetupScheme) return btagger[0] - def setupJetBTaggerAlgs(self, ToolSvc=None, JetCollections=[], topSequence=None, Verbose = None, AddToToolSvc = True, options={}, TaggerList=[], SetupScheme = ""): + def setupJetBTaggerAlgs(self, ToolSvc=None, JetCollections=[], topSequence=None, Verbose = None, options={}, TaggerList=[], SetupScheme = ""): """Sets up JetBTaggerAlg tools and adds them to the topSequence (one per jet collection). This function just updates the tool if such a tool already exists for the specified jet collections. This function should only be used for jet collections that one need reconstruction. Note that it is allowed to set topSequence to None, @@ -436,7 +443,6 @@ class Configuration: JetCollections: List of jet collection name (can also accept string in the case of one collection). topSequence: The topSequence. (not needed when updating) Verbose: Whether to print some additional information. If None then BTaggingFlags.OutputLevel will be used. - AddToToolSvc: Whether to add the JetBTaggerAlg to the ToolSvc or not. options: List of options to be passed to the JetBTaggerAlgs. This has the following defaults: OutputLevel: default: BTaggingFlags.OutputLevel @@ -551,6 +557,7 @@ class Configuration: output: List of JetBTaggerTools (this includes those for which no tool was set up because it already existed).""" if len(SetupScheme) == 0: SetupScheme = BTaggingFlags.ConfigurationScheme + from BTagging.BTaggingConfiguration_LoadTools import SetupJetCollection import sys if Verbose is None: @@ -766,9 +773,14 @@ class Configuration: track: The track association. jetcol: The jet collection. output: The name of the tool.""" + + #GeneralToolSuffix() can not be used here because now tagger in Trig scheme are added with the full name tagger_Trig + GeneralToolSuffix = '' + if 'Trig' in self._name and 'Trig' not in tool: + GeneralToolSuffix = '_Trig'; # Some tools only need exactly one in ToolSvc if getToolMetadata(tool, 'OneInTotal'): - return tool+self.GeneralToolSuffix() + return tool+GeneralToolSuffix # Some tools need one per track association if not getToolMetadata(tool, 'OnePerTrackAssociationAndJetCollection'): # Append track association if non-default @@ -776,10 +788,10 @@ class Configuration: if not defaulttracks: defaulttracks = 'BTagTrackToJetAssociator' if track == defaulttracks: - return tool+self.GeneralToolSuffix() - return tool+'_'+track+self.GeneralToolSuffix() + return tool+GeneralToolSuffix + return tool+'_'+track+GeneralToolSuffix # All others require one per track and per jet collection - return jetcol+'_'+tool+'_'+track+self.GeneralToolSuffix() + return jetcol+'_'+tool+'_'+track+GeneralToolSuffix def checkPrerequisites(self, tool_type, TrackCollection="", JetCollection="", CheckOnlyInsideToolCollection=False): """Checks whether all prerequisites are met for the tool/tagger. It returns a list of @@ -1631,14 +1643,14 @@ class Configuration: else: broker = self._BTaggingConfig_InitializedTools.get(self.getToolName('BTagCalibrationBrokerTool',track,jetcol), None) if broker is None: - print self.BTagTag()+' - ERROR - CalibrationBroker not found; calibrations will not function!' - raise ValueError + print self.BTagTag()+' - WARNING - CalibrationBroker not found; The tool is replaced by a condition algorithm' elif not hasattr(broker, 'taggers'): print self.BTagTag()+' - ERROR - CalibrationBroker does not have "taggers" as an attribute; calibrations will not function!' raise ValueError - for tagger in CalibrationTaggers: - if not tagger in broker.taggers: - broker.taggers.append(tagger) + else: + for tagger in CalibrationTaggers: + if not tagger in broker.taggers: + broker.taggers.append(tagger) # Set up the actual tool try: exec('tool = tool'+tool_type+'(**options)') diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_DL1Tag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_DL1Tag.py index d4987c58ac21a4c13cb8576767f70b4caf0412e6..5bdaa02b23c65bb880dcb2e76c39f85b113377c2 100644 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_DL1Tag.py +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_DL1Tag.py @@ -11,10 +11,8 @@ def buildDL1(basename): metaInstance = { 'IsATagger' : False, 'xAODBaseName' : basename, 'DependsOn' : ['AtlasExtrapolator', - 'BTagCalibrationBrokerTool', 'BTagTrackToVertexTool'], 'CalibrationTaggers' : [basename], - 'PassByPointer' : {'calibrationTool' : 'BTagCalibrationBrokerTool'}, 'ToolCollection' : basename+'Tag'} def DL1Instance(name, useBTagFlagsDefaults = True, **options): @@ -51,4 +49,4 @@ def buildDL1(basename): toolDL1muTag, metaDL1muTag = buildDL1("DL1mu") toolDL1Tag, metaDL1Tag = buildDL1("DL1") -toolDL1rnnTag, metaDL1rnnTag = buildDL1("DL1rnn") \ No newline at end of file +toolDL1rnnTag, metaDL1rnnTag = buildDL1("DL1rnn") diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_IP2DTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_IP2DTag.py index 014fd7adb2a87c1722eaae034f95748f9db04ef6..7be97200485952c9eca905c47ed112e2584a16d7 100644 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_IP2DTag.py +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_IP2DTag.py @@ -27,12 +27,8 @@ metaIP2DTag = { 'IsATagger' : True, 'PassByPointer' : {'SVForIPTool' : 'SVForIPTool_IP2D', 'trackSelectorTool' : 'IP2DTrackSelector', 'trackGradeFactory' : 'IP2DDetailedTrackGradeFactory', -# 'trackToVertexTool' : 'BTagTrackToVertexTool', 'TrackToVertexIPEstimator' : 'BTagTrackToVertexIPEstimator', 'LikelihoodTool' : 'IP2DNewLikelihoodTool'}, -# 'PassByName' : {'SecVxFinderNameForV0Removal' : 'InDetVKalVxInJetTool', -# 'SecVxFinderNameForIPSign' : 'InDetVKalVxInJetTool'}, -# 'PassTracksAs' : 'trackAssociation', 'PassTracksAs' : 'trackAssociationName', 'JetCollectionList' : 'jetCollectionList', 'ToolCollection' : 'IP2DTag' } @@ -205,8 +201,6 @@ def toolIP2DTrackSelector(name, useBTagFlagsDefaults = True, **options): #------------------------------------------------------------------ metaIP2DNewLikelihoodTool = { 'CalibrationTaggers' : ['IP2D',], - 'DependsOn' : ['BTagCalibrationBrokerTool',], - 'PassByPointer' : {'calibrationTool' : 'BTagCalibrationBrokerTool'}, 'ToolCollection' : 'IP2DTag' } def toolIP2DNewLikelihoodTool(name, useBTagFlagsDefaults = True, **options): diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_IP2DTrigTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_IP2DTrigTag.py new file mode 100644 index 0000000000000000000000000000000000000000..d980efd2f5194db5fbeb376a9000b3ab7d1ac7ca --- /dev/null +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_IP2DTrigTag.py @@ -0,0 +1,226 @@ +# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + +# Configuration functions for IP2DTag_Trig +# Author: Wouter van den Wollenberg (2013-2014) +from BTagging.BTaggingFlags import BTaggingFlags +from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags as commonGeoFlags +from AtlasGeoModel.InDetGMJobProperties import InDetGeometryFlags as geoFlags +from IOVDbSvc.CondDB import conddb +btagrun1=False +if conddb.dbdata == 'COMP200': + btagrun1=True +elif conddb.isMC: + btagrun1 = (commonGeoFlags.Run() == "RUN1" or (commonGeoFlags.Run() == "UNDEFINED" and geoFlags.isIBL() == False)) + +metaIP2DTag_Trig = { 'IsATagger' : True, + 'xAODBaseName' : 'IP2D', + 'DependsOn' : ['AtlasExtrapolator', + 'BTagTrackToVertexTool', + 'InDetVKalVxInJetTool_Trig', + 'BTagFullLinearizedTrackFactory', + 'BTagTrackToVertexIPEstimator', + 'IP2DNewLikelihoodTool_Trig', + 'IP2DTrackSelector_Trig', + 'SVForIPTool_IP2D_Trig', + 'IP2DBasicTrackGradeFactory_Trig', + 'IP2DDetailedTrackGradeFactory_Trig'], + 'PassByPointer' : {'SVForIPTool' : 'SVForIPTool_IP2D_Trig', + 'trackSelectorTool' : 'IP2DTrackSelector_Trig', + 'trackGradeFactory' : 'IP2DDetailedTrackGradeFactory_Trig', + 'TrackToVertexIPEstimator' : 'BTagTrackToVertexIPEstimator', + 'LikelihoodTool' : 'IP2DNewLikelihoodTool_Trig'}, + 'PassTracksAs' : 'trackAssociationName', + 'JetCollectionList' : 'jetCollectionList', + 'ToolCollection' : 'IP2DTag_Trig' } + +def toolIP2DTag_Trig(name, useBTagFlagsDefaults = True, **options): + """Sets up a IP2DTag_Trig tool and returns it. + + The following options have BTaggingFlags defaults: + + OutputLevel default: BTaggingFlags.OutputLevel + Runmodus default: BTaggingFlags.Runmodus + referenceType default: BTaggingFlags.ReferenceType + impactParameterView default: "2D" + trackGradePartitions default: [ "Good", "BlaShared", "PixShared", "SctShared", "0HitBLayer" ] + RejectBadTracks default: False + originalTPCollectionName default: BTaggingFlags.TrackParticleCollectionName + jetCollectionList default: BTaggingFlags.Jets + unbiasIPEstimation default: False (switch to true (better!) when creating new PDFs) + UseCHypo default: True + SecVxFinderName default: "SV1" + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + if useBTagFlagsDefaults: + grades= [ "0HitIn0HitNInExp2","0HitIn0HitNInExpIn","0HitIn0HitNInExpNIn","0HitIn0HitNIn", + "0HitInExp", "0HitIn", + "0HitNInExp", "0HitNIn", + "InANDNInShared", "PixShared", "SctShared", + "InANDNInSplit", "PixSplit", + "Good"] + if btagrun1: grades=[ "Good", "BlaShared", "PixShared", "SctShared", "0HitBLayer" ] + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, + 'Runmodus' : BTaggingFlags.Runmodus, + 'referenceType' : BTaggingFlags.ReferenceType, + 'jetPtMinRef' : BTaggingFlags.JetPtMinRef, + 'impactParameterView' : '2D', + 'trackGradePartitions' : grades, + 'RejectBadTracks' : True, + 'originalTPCollectionName' : BTaggingFlags.TrackParticleCollectionName, + 'jetCollectionList' : BTaggingFlags.Jets, + 'unbiasIPEstimation' : False, + 'UseCHypo' : True, + 'SecVxFinderName' : 'SV1', + 'storeTrackParticles': True, + 'storeTrackParameters': True, + 'storeIpValues': False, + } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + from JetTagTools.JetTagToolsConf import Analysis__IPTag + return Analysis__IPTag(**options) + +#--------------------------------------------------------------------- + +metaIP2DDetailedTrackGradeFactory_Trig = { 'ToolCollection' : 'IP2DTag_Trig' } + +def toolIP2DDetailedTrackGradeFactory_Trig(name, useBTagFlagsDefaults = True, **options): + """Sets up a IP2DTrigDetailedTrackGradeFactory tool and returns it. + + The following options have BTaggingFlags defaults: + + OutputLevel default: BTaggingFlags.OutputLevel + useSharedHitInfo default: True + useDetailSharedHitInfo default: True + useRun2TrackGrading default: False + hitBLayerGrade default: True + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + if useBTagFlagsDefaults: + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, + 'useSharedHitInfo' : True, + 'useDetailSharedHitInfo' : True, + 'useRun2TrackGrading' : (btagrun1 == False), + 'useInnerLayers0HitInfo' : (btagrun1 == False), + 'useDetailSplitHitInfo' : (btagrun1 == False), + 'hitBLayerGrade' : True, + } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + from JetTagTools.JetTagToolsConf import Analysis__DetailedTrackGradeFactory + return Analysis__DetailedTrackGradeFactory(**options) + +#--------------------------------------------------------------------- + +metaIP2DBasicTrackGradeFactory_Trig = { 'ToolCollection' : 'IP2DTag_Trig' } + +def toolIP2DBasicTrackGradeFactory_Trig(name, useBTagFlagsDefaults = True, **options): + """Sets up a IP2DTrigBasicTrackGradeFactory tool and returns it. + + The following options have BTaggingFlags defaults: + + OutputLevel default: BTaggingFlags.OutputLevel + useSharedHitInfo default: True + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + if useBTagFlagsDefaults: + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, +# 'TrackSummaryTool' : None, + 'useSharedHitInfo' : True } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + from JetTagTools.JetTagToolsConf import Analysis__BasicTrackGradeFactory + return Analysis__BasicTrackGradeFactory(**options) + +#--------------------------------------------------------------------- + +metaSVForIPTool_IP2D_Trig = { 'ToolCollection' : 'IP2DTag_Trig' } + +def toolSVForIPTool_IP2D_Trig(name, useBTagFlagsDefaults = True, **options): + """Sets up a SVForIPTool_IP2DTrig tool and returns it. + + The following options have BTaggingFlags defaults: + + OutputLevel default: BTaggingFlags.OutputLevel + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + if useBTagFlagsDefaults: + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + from JetTagTools.JetTagToolsConf import Analysis__SVForIPTool + return Analysis__SVForIPTool(**options) + +#--------------------------------------------------------------------- + +metaIP2DTrackSelector_Trig = { 'DependsOn' : ['BTagTrackToVertexTool',], + 'PassedByPointer' : {'trackToVertexTool' : 'BTagTrackToVertexTool'}, + 'ToolCollection' : 'IP2DTag_Trig' } + +def toolIP2DTrackSelector_Trig(name, useBTagFlagsDefaults = True, **options): + """Sets up a IP2DTrigTrackSelector tool and returns it. + + The following options have BTaggingFlags defaults: + + OutputLevel default: BTaggingFlags.OutputLevel + useBLayerHitPrediction default: True + usepTDepTrackSel default: False + nHitBLayer default: 0 + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + if useBTagFlagsDefaults: + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, + 'useBLayerHitPrediction' : True, + 'nHitBLayer' : 0, + 'usepTDepTrackSel' : False } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + from JetTagTools.JetTagToolsConf import Analysis__TrackSelector + return Analysis__TrackSelector(**options) + +#--------------------------------------------------------------------- + +metaIP2DNewLikelihoodTool_Trig = { 'CalibrationTaggers' : ['IP2D',], + 'ToolCollection' : 'IP2DTag_Trig' } + +def toolIP2DNewLikelihoodTool_Trig(name, useBTagFlagsDefaults = True, **options): + """Sets up a IP2DTrigNewLikelihoodTool tool and returns it. + + The following options have BTaggingFlags defaults: + + OutputLevel default: BTaggingFlags.OutputLevel + taggerName default: "IP2D" + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + if useBTagFlagsDefaults: + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, + 'HistosKey' : 'TrigJetTagCalibHistosKey', + 'taggerName' : 'IP2D' } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + from JetTagTools.JetTagToolsConf import Analysis__NewLikelihoodTool + return Analysis__NewLikelihoodTool(**options) diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_IP3DTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_IP3DTag.py index a439cfe1a6e02e7c1bb12e625e4fbe0e572a8f55..7f6e109c628be0d122080cf63a7af58fccf72d31 100644 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_IP3DTag.py +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_IP3DTag.py @@ -32,11 +32,8 @@ metaIP3DTag = { 'IsATagger' : True, 'InDetTrackSelectionTool' : 'InDetTrackSelector', 'TrackVertexAssociationTool' : 'SpecialTrackAssociator', 'trackGradeFactory' : 'IP3DDetailedTrackGradeFactory', -# 'trackToVertexTool' : 'BTagTrackToVertexTool', 'TrackToVertexIPEstimator' : 'BTagTrackToVertexIPEstimator', 'LikelihoodTool' : 'IP3DNewLikelihoodTool'}, -# 'PassByName' : {'SecVxFinderNameForV0Removal' : 'InDetVKalVxInJetTool', -# 'SecVxFinderNameForIPSign' : 'InDetVKalVxInJetTool'}, 'PassTracksAs' : 'trackAssociationName', 'JetCollectionList' : 'jetCollectionList', 'ToolCollection' : 'IP3DTag' } @@ -265,8 +262,6 @@ def toolSpecialTrackAssociator(name, useBTagFlagsDefaults = True, **options): #------------------------------------------------------------------ metaIP3DNewLikelihoodTool = { 'CalibrationTaggers' : ['IP3D',], - 'DependsOn' : ['BTagCalibrationBrokerTool',], - 'PassByPointer' : {'calibrationTool' : 'BTagCalibrationBrokerTool'}, 'ToolCollection' : 'IP3DTag' } def toolIP3DNewLikelihoodTool(name, useBTagFlagsDefaults = True, **options): diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_IP3DTrigTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_IP3DTrigTag.py new file mode 100644 index 0000000000000000000000000000000000000000..6953e8c374b1f01130c4916796f96ea3d0b9014b --- /dev/null +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_IP3DTrigTag.py @@ -0,0 +1,229 @@ +# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + +# Configuration functions for IP3DTrigTag +# Author: Wouter van den Wollenberg (2013-2014) +from BTagging.BTaggingFlags import BTaggingFlags +from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags as commonGeoFlags +from AtlasGeoModel.InDetGMJobProperties import InDetGeometryFlags as geoFlags +from IOVDbSvc.CondDB import conddb +btagrun1=False +if conddb.dbdata == 'COMP200': + btagrun1=True +elif conddb.isMC: + btagrun1 = (commonGeoFlags.Run() == "RUN1" or (commonGeoFlags.Run() == "UNDEFINED" and geoFlags.isIBL() == False)) + +metaIP3DTag_Trig = { 'IsATagger' : True, + 'xAODBaseName' : 'IP3D', + 'DependsOn' : ['AtlasExtrapolator', + 'BTagTrackToVertexTool', + 'InDetVKalVxInJetTool_Trig', + 'BTagFullLinearizedTrackFactory', + 'BTagTrackToVertexIPEstimator', + 'IP3DNewLikelihoodTool_Trig', + 'IP3DTrackSelector_Trig', + 'InDetTrackSelector', + 'SpecialTrackAssociator', + 'SVForIPTool_IP3D_Trig', + 'IP3DBasicTrackGradeFactory_Trig', + 'IP3DDetailedTrackGradeFactory_Trig'], + 'PassByPointer' : {'SVForIPTool' : 'SVForIPTool_IP3D_Trig', + 'trackSelectorTool' : 'IP3DTrackSelector_Trig', + 'trackGradeFactory' : 'IP3DDetailedTrackGradeFactory_Trig', + 'TrackToVertexIPEstimator' : 'BTagTrackToVertexIPEstimator', + 'InDetTrackSelectionTool' : 'InDetTrackSelector', + 'TrackVertexAssociationTool' : 'SpecialTrackAssociator', + 'LikelihoodTool' : 'IP3DNewLikelihoodTool_Trig'}, + 'PassTracksAs' : 'trackAssociationName', + 'JetCollectionList' : 'jetCollectionList', + 'ToolCollection' : 'IP3DTag_Trig' } + +def toolIP3DTag_Trig(name, useBTagFlagsDefaults = True, **options): + """Sets up a IP3DTrigTag tool and returns it. + + The following options have BTaggingFlags defaults: + + OutputLevel default: BTaggingFlags.OutputLevel + Runmodus default: BTaggingFlags.Runmodus + referenceType default: BTaggingFlags.ReferenceType + impactParameterView default: "3D" + trackGradePartitions default: [ "Good", "BlaShared", "PixShared", "SctShared", "0HitBLayer" ] + RejectBadTracks default: False + originalTPCollectionName default: BTaggingFlags.TrackParticleCollectionName + jetCollectionList default: BTaggingFlags.Jets + unbiasIPEstimation default: False (switch to true (better!) when creating new PDFs) + UseCHypo default: True + SecVxFinderName default: "SV1" + jetPtMinRef default: BTaggingFlags.JetPtMinRef + + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + if useBTagFlagsDefaults: + grades= [ "0HitIn0HitNInExp2","0HitIn0HitNInExpIn","0HitIn0HitNInExpNIn","0HitIn0HitNIn", + "0HitInExp", "0HitIn", + "0HitNInExp", "0HitNIn", + "InANDNInShared", "PixShared", "SctShared", + "InANDNInSplit", "PixSplit", + "Good"] + if btagrun1: grades=[ "Good", "BlaShared", "PixShared", "SctShared", "0HitBLayer" ] + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, + 'Runmodus' : BTaggingFlags.Runmodus, + 'referenceType' : BTaggingFlags.ReferenceType, + 'impactParameterView' : '3D', + 'trackGradePartitions' : grades, + 'RejectBadTracks' : True, + 'originalTPCollectionName' : BTaggingFlags.TrackParticleCollectionName, + 'jetCollectionList' : BTaggingFlags.Jets, + 'unbiasIPEstimation' : False, + 'UseCHypo' : True, + 'SecVxFinderName' : 'SV1', + 'jetPtMinRef' : BTaggingFlags.JetPtMinRef, + } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + from JetTagTools.JetTagToolsConf import Analysis__IPTag + return Analysis__IPTag(**options) + +#--------------------------------------------------------------------- + +metaIP3DDetailedTrackGradeFactory_Trig = { 'ToolCollection' : 'IP3DTag_Trig' } + +def toolIP3DDetailedTrackGradeFactory_Trig(name, useBTagFlagsDefaults = True, **options): + """Sets up a IP3DTrigDetailedTrackGradeFactory tool and returns it. + + The following options have BTaggingFlags defaults: + + OutputLevel default: BTaggingFlags.OutputLevel + useSharedHitInfo default: True + useDetailSharedHitInfo default: True + hitBLayerGrade default: True + useRun2TrackGrading default: False + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + if useBTagFlagsDefaults: + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, + 'useSharedHitInfo' : True, + 'useDetailSharedHitInfo' : True, + 'hitBLayerGrade' : True, + 'useRun2TrackGrading' : (btagrun1 == False), + 'useInnerLayers0HitInfo' : (btagrun1 == False), + 'useDetailSplitHitInfo' : (btagrun1 == False), + } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + from JetTagTools.JetTagToolsConf import Analysis__DetailedTrackGradeFactory + return Analysis__DetailedTrackGradeFactory(**options) + +#--------------------------------------------------------------------- + +metaIP3DBasicTrackGradeFactory_Trig = { 'ToolCollection' : 'IP3DTag_Trig' } + +def toolIP3DBasicTrackGradeFactory_Trig(name, useBTagFlagsDefaults = True, **options): + """Sets up a IP3DTrigBasicTrackGradeFactory tool and returns it. + + The following options have BTaggingFlags defaults: + + OutputLevel default: BTaggingFlags.OutputLevel + useSharedHitInfo default: True + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + if useBTagFlagsDefaults: + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, + 'useSharedHitInfo' : True } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + from JetTagTools.JetTagToolsConf import Analysis__BasicTrackGradeFactory + return Analysis__BasicTrackGradeFactory(**options) + +#--------------------------------------------------------------------- + +metaSVForIPTool_IP3D_Trig = { 'ToolCollection' : 'IP3DTag_Trig' } + +def toolSVForIPTool_IP3D_Trig(name, useBTagFlagsDefaults = True, **options): + """Sets up a SVForIPTool_IP3DTrig tool and returns it. + + The following options have BTaggingFlags defaults: + + OutputLevel default: BTaggingFlags.OutputLevel + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + if useBTagFlagsDefaults: + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + from JetTagTools.JetTagToolsConf import Analysis__SVForIPTool + return Analysis__SVForIPTool(**options) + +#--------------------------------------------------------------------- + +metaIP3DTrackSelector_Trig = { 'DependsOn' : ['BTagTrackToVertexTool',], + 'PassByPointer' : {'trackToVertexTool' : 'BTagTrackToVertexTool'}, + 'ToolCollection' : 'IP3DTag_Trig' } + +def toolIP3DTrackSelector_Trig(name, useBTagFlagsDefaults = True, **options): + """Sets up a IP3DTrigTrackSelector tool and returns it. + + The following options have BTaggingFlags defaults: + + OutputLevel default: BTaggingFlags.OutputLevel + useBLayerHitPrediction default: True + usepTDepTrackSel default: False + nHitBLayer default: 0 + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + if useBTagFlagsDefaults: + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, + 'useBLayerHitPrediction' : True, + 'nHitBLayer' : 0 , + 'usepTDepTrackSel' : False } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + from JetTagTools.JetTagToolsConf import Analysis__TrackSelector + return Analysis__TrackSelector(**options) + +#--------------------------------------------------------------------- + +metaIP3DNewLikelihoodTool_Trig = { 'CalibrationTaggers' : ['IP3D',], + 'ToolCollection' : 'IP3DTag_Trig' } + +def toolIP3DNewLikelihoodTool_Trig(name, useBTagFlagsDefaults = True, **options): + """Sets up a IP3DTrigNewLikelihoodTool tool and returns it. + + The following options have BTaggingFlags defaults: + + OutputLevel default: BTaggingFlags.OutputLevel + taggerName default: "IP3D" + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + if useBTagFlagsDefaults: + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, + 'HistosKey' : 'TrigJetTagCalibHistosKey', + 'taggerName' : 'IP3D' } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + from JetTagTools.JetTagToolsConf import Analysis__NewLikelihoodTool + return Analysis__NewLikelihoodTool(**options) + diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_InDetVKalVxTrigInJetTool.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_InDetVKalVxTrigInJetTool.py new file mode 100644 index 0000000000000000000000000000000000000000..273d5616e2db2e82b6f20632b772e305ec3ab1de --- /dev/null +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_InDetVKalVxTrigInJetTool.py @@ -0,0 +1,39 @@ +# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + +# Configuration functions for InDetVKalVxInJetTool +# Author: Wouter van den Wollenberg (2013-2014) +# Note: This tool has its own file because it is common to many different taggers +# so deletion of the one tagger that has this function won't break the others. +from BTagging.BTaggingFlags import BTaggingFlags +from AtlasGeoModel.InDetGMJobProperties import InDetGeometryFlags as geoFlags + +metaInDetVKalVxInJetTool_Trig = { 'IsAVertexFinder' : True, + 'VertexFinderxAODBaseName' : 'SV1', + 'OneInTotal' : True, + 'DependsOn' : ['BTagFullLinearizedTrackFactory', + 'BTagTrackToVertexIPEstimator', + 'BTagTrackToVertexTool', + 'AtlasExtrapolator'] } + +def toolInDetVKalVxInJetTool_Trig(name, useBTagFlagsDefaults = True, **options): + """Sets up a InDetVKalVxInJetTool tool and returns it. + + The following options have BTaggingFlags defaults: + + TrackSummaryTool default: None (not needed for b-tagging) + OutputLevel default: BTaggingFlags.OutputLevel + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output. Note however + that this tool also needs to be added to the main B-tagging tool.""" + if useBTagFlagsDefaults: + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, + 'ExistIBL' : geoFlags.isIBL(), + } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + from InDetVKalVxInJetTool.InDetVKalVxInJetToolConf import InDet__InDetVKalVxInJetTool + return InDet__InDetVKalVxInJetTool(**options) diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_JetVertexCharge.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_JetVertexCharge.py index 00d8b63aa07d1be1595b9a7777b57092f0507cab..0295191e08925b67921cd9e8cb6184be2b97747d 100644 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_JetVertexCharge.py +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_JetVertexCharge.py @@ -9,13 +9,11 @@ metaJetVertexCharge = { 'IsATagger' : True, 'DependsOn' : ['AtlasExtrapolator', 'BTagTrackToVertexTool', #LC FIXME check if it works 'NewJetFitterVxFinder', - 'BTagCalibrationBrokerTool', 'MuonCorrectionsTool', 'MuonSelectorTool', ], 'CalibrationTaggers' : ['JetVertexCharge',], - 'PassByPointer' : {'calibrationTool' : 'BTagCalibrationBrokerTool', - 'muonCorrectionTool' : 'MuonCorrectionsTool' , + 'PassByPointer' : {'muonCorrectionTool' : 'MuonCorrectionsTool' , 'muonSelectorTool' : 'MuonSelectorTool' }, 'ToolCollection' : 'JetVertexCharge' } diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_LoadTools.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_LoadTools.py index 0095817aba0ce2f248345e18aa196120a0ffe1ef..7258f6fc9bb588e295eb288c0fc869e859e042df 100644 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_LoadTools.py +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_LoadTools.py @@ -42,6 +42,7 @@ def Initiate(ConfInstance=None): from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags as commonGeoFlags from AtlasGeoModel.InDetGMJobProperties import InDetGeometryFlags as geoFlags from IOVDbSvc.CondDB import conddb + # Declare the COOL folder to the CondInputLoader btagrun1=False if conddb.dbdata == 'COMP200': btagrun1=True @@ -69,11 +70,6 @@ def Initiate(ConfInstance=None): if ConfInstance._name == "Trig": BTaggingFlags.MV2c20=True - if ConfInstance.getTool("BTagCalibrationBrokerTool"): - print ConfInstance.BTagTag()+' - INFO - BTagCalibrationBrokerTool already exists prior to default initialization; assuming user set up entire initialization him/herself. Note however that if parts of the initalization were not set up, and a later tool requires them, they will be set up at that point automatically with default settings.' - ConfInstance._Initialized = True - return True - print ConfInstance.BTagTag()+' - INFO - Initializing default basic tools' if ConfInstance.checkFlagsUsingBTaggingFlags(): @@ -121,6 +117,11 @@ def Initiate(ConfInstance=None): from AthenaCommon.AlgSequence import AlgSequence topSequence = AlgSequence() + + #Create and add our condition algorithm to the Condition Sequencer + + SetupConditionAlgorithm(ConfInstance) + # # ========== Add tools now # @@ -129,11 +130,9 @@ def Initiate(ConfInstance=None): from AthenaCommon.AppMgr import ToolSvc from AthenaCommon.Resilience import treatException,protectedInclude if ConfInstance._name == "": - protectedInclude("BTagging/BTagCalibBroker_jobOptions.py") # New file which includes the file from JetCalibration and also registers it via registerTool() so it will be recognized by the various addTool() functions. - BTagCalibrationBrokerTool = ConfInstance.getTool("BTagCalibrationBrokerTool") # In case this variable is needed + print ConfInstance.BTagTag()+' - No calibration broker setup - The condition algorithm is used' elif ConfInstance._name == "Trig": - protectedInclude("BTagging/BTagCalibBroker_Trig_jobOptions.py") - BTagCalibrationBrokerTool = ConfInstance.getTool("BTagCalibrationBrokerTool") + print ConfInstance.BTagTag()+' - No calibration broker setup - The condition algorithm is used' elif ConfInstance._name == "AODFix": protectedInclude("BTagging/BTagCalibBroker_AODFix_jobOptions.py") BTagCalibrationBrokerTool = ConfInstance.getTool("BTagCalibrationBrokerTool") @@ -151,36 +150,6 @@ def Initiate(ConfInstance=None): BTagLeptonTruthTool = None thisBTagLabeling = None - # -- to label jets with truth information - #from JetRec.JetRecFlags import jetFlags - #if jetFlags.useTruth(): - # # Jet Label - # if BTaggingFlags.jetTruthMatching == 'matchQuark' or BTaggingFlags.jetTruthMatching == 'jetTrackTruthMatching': - # BTagJetTruthMatching = addTool("BTagJetTruthMatching", - # ToolSvc = ToolSvc, - # Verbose = BTaggingFlags.OutputLevel < 3, - # options = {'subtype' : BTaggingFlags.jetTruthMatching}, - # SuppressNonCloneWarning=True) - # BTagJetTruthMatching.McEventCollection = TheTruthCollectionKey - # else: - # BTagJetTruthMatching = None - # print("#BTAG# - WARNING - BTaggingFlags.jetTruthMatching has unsupported value!") - # # Lepton Truth Match - # #BTagLeptonTruthTool = addTool('BTagLeptonTruthTool', ToolSvc = ToolSvc, Verbose = BTaggingFlags.OutputLevel < 3) - # #BTagLeptonTruthTool.McEventCollection = TheTruthCollectionKey - # BTagLeptonTruthTool = None # TEMPORARY: BTagLeptonTruthTool not implemented yet? - # # Labeling tool - # thisBTagLabeling = addTool("thisBTagLabeling", ToolSvc = ToolSvc, Verbose = BTaggingFlags.OutputLevel < 3, - # options = {'JetTruthMatchTool' : BTagJetTruthMatching, - # #'LeptonTruthTool' : BTagLeptonTruthTool}, TEMPORARY: BTagLeptonTruthTool not implemented yet? - # }, - # SuppressNonCloneWarning=True) - #else: - # BTagJetTruthMatching = None - # BTagLeptonTruthTool = None - # thisBTagLabeling = None - # NOTE: These variables no longer serve any purpose, since any tool can be retrieved using getTool - # -- for reference mode: if BTaggingFlags.Runmodus == 'reference': @@ -192,6 +161,72 @@ def Initiate(ConfInstance=None): print ConfInstance.BTagTag()+' - WARNING - Tool initialization requested but B-Tagging is not possible for the current dataset.' return False +def SetupConditionAlgorithm(ConfInstance=None): + """General function which can setup condition algorithm + Hack: In trigger mode, the online mode is automatically setup. + In online mode check that the condition algorithm is not already setup""" + + from AthenaCommon.AlgSequence import AthSequencer + condSeq = AthSequencer("AthCondSeq") + if hasattr(condSeq, "JetTagCalibHistosKey"): + if BTaggingFlags.OutputLevel < 3: + print(ConfInstance.BTagTag()+" - DEBUG Default key already defined, another scheme must have been setup before") + return True + + + from IOVDbSvc.CondDB import conddb + if conddb.dbdata == 'COMP200': + conddb.addFolder("GLOBAL_ONL", "/GLOBAL/Onl/BTagCalib/RUN12", className='CondAttrListCollection') + conddb.addFolder("GLOBAL_ONL", "/GLOBAL/Onl/TrigBTagCalib/RUN12", className='CondAttrListCollection') + elif conddb.isMC: + conddb.addFolder("GLOBAL_OFL", "/GLOBAL/BTagCalib/RUN12", className='CondAttrListCollection') + conddb.addFolder("GLOBAL_OFL", "/GLOBAL/TrigBTagCalib/RUN12", className='CondAttrListCollection') + + if ConfInstance.checkFlagsUsingBTaggingFlags(): + #IP2D + grades= [ "0HitIn0HitNInExp2","0HitIn0HitNInExpIn","0HitIn0HitNInExpNIn","0HitIn0HitNIn", + "0HitInExp", "0HitIn", + "0HitNInExp", "0HitNIn", + "InANDNInShared", "PixShared", "SctShared", + "InANDNInSplit", "PixSplit", + "Good"] + + #IP3D + #Same as IP2D. Revisit JetTagCalibCondAlg.cxx if not. + + from AthenaCommon.GlobalFlags import globalflags + + from JetTagCalibration.JetTagCalibrationConf import Analysis__JetTagCalibCondAlg as JetTagCalibCondAlg + readkeycalibpath = "/GLOBAL/BTagCalib/RUN12" + connSchema = "GLOBAL_OFL" + if globalflags.DataSource()=='data': + readkeycalibpath = readkeycalibpath.replace("/GLOBAL/BTagCalib","/GLOBAL/Onl/BTagCalib") + connSchema = "GLOBAL" + Taggers = ['IP2D','IP3D','SV1','JetFitterNN','SoftMu', 'MV2c10', 'MV2c100', 'MV2c10mu', 'MV2c10rnn', 'MV2cl100','RNNIP', 'JetVertexCharge', 'MultiSVbb1', 'MultiSVbb2', 'DL1', 'DL1mu', 'DL1rnn'] + jettagcalibcondalg = "JetTagCalibHistosKey" + histoskey = "JetTagCalibHistosKey" + conddb.addFolder(connSchema, readkeycalibpath, className='CondAttrListCollection') + JetTagCalib = JetTagCalibCondAlg(jettagcalibcondalg, ReadKeyCalibPath=readkeycalibpath, HistosKey = histoskey, taggers = Taggers, channelAliases = BTaggingFlags.CalibrationChannelAliases, IP2D_TrackGradePartitions = grades, RNNIP_NetworkConfig = BTaggingFlags.RNNIPConfig) + condSeq += JetTagCalib + + + if ConfInstance._name == "Trig": + readkeycalibpath = "/GLOBAL/TrigBTagCalib/RUN12" + connSchema = "GLOBAL_OFL" + if globalflags.DataSource()=='data': + connSchema = "GLOBAL" + readkeycalibpath = readkeycalibpath.replace("/GLOBAL/TrigBTagCalib","/GLOBAL/Onl/TrigBTagCalib") + Taggers = BTaggingFlags.TriggerTaggers + jettagcalibcondalg += "_Trig" + histoskey = "TrigJetTagCalibHistosKey" + conddb.addFolder(connSchema, readkeycalibpath, className='CondAttrListCollection') + JetTagCalib = JetTagCalibCondAlg(jettagcalibcondalg, ReadKeyCalibPath=readkeycalibpath, HistosKey = histoskey, taggers = Taggers, channelAliases = BTaggingFlags.CalibrationChannelAliases, IP2D_TrackGradePartitions = grades, RNNIP_NetworkConfig = BTaggingFlags.RNNIPConfig) + #JetTagCalib.OutputLevel=2 + condSeq += JetTagCalib + + return True + + def SetupJetCollection(JetCollection, TaggerList=[], SetupScheme="Default", ConfInstance=None): """General function which can setup up a default B-Tagging configuration. Returns True if successful. Returns False if B-Tagging has been disabled for some reason. Also calls Initiate if needed. The function does nothing (and returns True) if a configuration for a given @@ -624,7 +659,6 @@ def SetupJetCollectionTrig(JetCollection, TaggerList, ConfInstance = None): if ConfInstance is None: from BTagging.BTaggingConfiguration import getConfiguration ConfInstance = getConfiguration() - from AthenaCommon.AppMgr import ToolSvc # -- setup basic b-tagging tool for this jet collection @@ -656,46 +690,50 @@ def SetupJetCollectionTrig(JetCollection, TaggerList, ConfInstance = None): #Now the basic taggers: if 'IP2D' in TaggerList: - ConfInstance.addTool('IP2DTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) - if 'IP2DNeg' in TaggerList: - ConfInstance.addTool('IP2DNegTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) + ConfInstance.addTool("IP2DTag_Trig", ToolSvc, 'BTagTrackToJetAssociator', JetCollection) + #if 'IP2DNeg' in TaggerList: + #ConfInstance.addTool('IP2DNegTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) if 'IP3D' in TaggerList: - ConfInstance.addTool('IP3DTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) - if 'IP3DNeg' in TaggerList: - ConfInstance.addTool('IP3DNegTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) + ConfInstance.addTool('IP3DTag_Trig', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) + #if 'IP3DNeg' in TaggerList: + # ConfInstance.addTool('IP3DNegTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) if 'SV1' in TaggerList: - ConfInstance.addTool('SV1Tag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) - if 'SV1Flip' in TaggerList: - ConfInstance.addTool('SV1FlipTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) - if 'SV0' in TaggerList: - ConfInstance.addTool('SV0Tag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) - - if 'MultiSVbb1' in TaggerList: - ConfInstance.addTool('MultiSVbb1Tag', ToolSvc, 'BTagTrackToJetAssociatorBB', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) - if 'MultiSVbb2' in TaggerList: - ConfInstance.addTool('MultiSVbb2Tag', ToolSvc, 'BTagTrackToJetAssociatorBB', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) - - if 'JetFitterNN' in TaggerList: - ConfInstance.addTool('JetFitterTagNN', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) - - if 'JetFitterCOMBNN' in TaggerList: - ConfInstance.addTool('JetFitterTagCOMBNN', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) - - if 'JetFitterNNFlip' in TaggerList: - ConfInstance.addTool('JetFitterTagNNFlip', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) - if 'IP3DNeg' in TaggerList: - ConfInstance.addTool('JetFitterTagCOMBNNIP3DNeg', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) - - if 'MV1' in TaggerList: - ConfInstance.addTool('MV1Tag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) - if 'MV1c' in TaggerList: - ConfInstance.addTool('MV1cTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) - if 'MV1cFlip' in TaggerList: - ConfInstance.addTool('MV1cFlipTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) - if 'MV1Flip' in TaggerList: - ConfInstance.addTool('MV1FlipTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) - if 'JetVertexCharge' in TaggerList: #LC FIXME - ConfInstance.addTool('JetVertexCharge', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) + ConfInstance.addTool('SV1Tag_Trig', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) + ConfInstance.addTool('JetFitterTagNN_Trig', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) + + #if 'JetFitterNN' in TaggerList: + # ConfInstance.addTool('JetFitterTagNN_Trig', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) + #if 'SV1Flip' in TaggerList: + # ConfInstance.addTool('SV1FlipTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) + #if 'SV0' in TaggerList: + # ConfInstance.addTool('SV0Tag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) + + #if 'MultiSVbb1' in TaggerList: + # ConfInstance.addTool('MultiSVbb1Tag', ToolSvc, 'BTagTrackToJetAssociatorBB', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) + #if 'MultiSVbb2' in TaggerList: + # ConfInstance.addTool('MultiSVbb2Tag', ToolSvc, 'BTagTrackToJetAssociatorBB', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) + + #if 'JetFitterNN' in TaggerList: + # ConfInstance.addTool('JetFitterTagNN', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) + + #if 'JetFitterCOMBNN' in TaggerList: + # ConfInstance.addTool('JetFitterTagCOMBNN', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) + + #if 'JetFitterNNFlip' in TaggerList: + # ConfInstance.addTool('JetFitterTagNNFlip', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) + # if 'IP3DNeg' in TaggerList: + # ConfInstance.addTool('JetFitterTagCOMBNNIP3DNeg', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) + + #if 'MV1' in TaggerList: + # ConfInstance.addTool('MV1Tag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) + #if 'MV1c' in TaggerList: + # ConfInstance.addTool('MV1cTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) + #if 'MV1cFlip' in TaggerList: + # ConfInstance.addTool('MV1cFlipTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) + #if 'MV1Flip' in TaggerList: + # ConfInstance.addTool('MV1FlipTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) + #if 'JetVertexCharge' in TaggerList: #LC FIXME + # ConfInstance.addTool('JetVertexCharge', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) # Activate MultivariateTagManager if any of its taggers are in TaggerList #list of mvtm taggers that are also in TaggerList @@ -704,7 +742,7 @@ def SetupJetCollectionTrig(JetCollection, TaggerList, ConfInstance = None): #set up MVTM if any of its taggers are active if (mvtm_active_taggers): - MVTM = ConfInstance.addTool('MultivariateTagManager', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) + MVTM = ConfInstance.addTool('MultivariateTagManager_Trig', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) if 'RNNIP' in TaggerList: MVTM.arbitraryAuxData = BTaggingFlags.MultivariateTagManagerAuxBranches else: @@ -712,21 +750,21 @@ def SetupJetCollectionTrig(JetCollection, TaggerList, ConfInstance = None): #set up MVTMFlip if (mvtm_active_flip_taggers): - MVTMFlip = ConfInstance.addTool('MultivariateFlipTagManager', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) + MVTMFlip = ConfInstance.addTool('MultivariateFlipTagManager_Trig', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) - if 'TagNtupleDumper' in TaggerList: - tag = ConfInstance.addTool('TagNtupleDumper', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) - MVTM.MVTagToolList.append(tag) + #if 'TagNtupleDumper' in TaggerList: + # tag = ConfInstance.addTool('TagNtupleDumper', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) + # MVTM.MVTagToolList.append(tag) #add all the taggers that use MVTM for mvtm_tagger in mvtm_active_taggers: - tag = ConfInstance.addTool(mvtm_tagger+'Tag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) + tag = ConfInstance.addTool(mvtm_tagger+'Tag_Trig', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) if tag not in MVTM.MVTagToolList: MVTM.MVTagToolList.append(tag) #add all the flip taggers that use MVTM for mvtm_tagger in mvtm_active_flip_taggers: - tag = ConfInstance.addTool(mvtm_tagger+'Tag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) + tag = ConfInstance.addTool(mvtm_tagger+'Tag_Trig', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) if tag not in MVTMFlip.MVTagToolList: MVTMFlip.MVTagToolList.append(tag) diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MV2Tag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MV2Tag.py index bc28b320b8126b2dda819c0d1cb9aae6263090c4..e3f09fa3924e8e312957ad789ee89c846ff0a30f 100644 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MV2Tag.py +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MV2Tag.py @@ -7,12 +7,10 @@ from BTagging.BTaggingFlags import BTaggingFlags metaMV2Tag = { 'IsATagger' : True, 'DependsOn' : ['AtlasExtrapolator', 'BTagTrackToVertexTool', - 'BTagCalibrationBrokerTool', 'IP3DTag', 'JetFitterTagCOMBNN', 'SV1Tag'], 'CalibrationTaggers' : ['MV2',], - 'PassByPointer' : {'calibrationTool' : 'BTagCalibrationBrokerTool'}, 'ToolCollection' : 'MV2Tag' } def toolMV2Tag(name, useBTagFlagsDefaults = True, **options): diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MV2c100Tag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MV2c100Tag.py index 36749e6c69a2d95ab6d3fb757a632c93c51340e4..1d9a68c00838882a4a60ce80c731e6e30d0df77a 100644 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MV2c100Tag.py +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MV2c100Tag.py @@ -7,10 +7,8 @@ from BTagging.BTaggingFlags import BTaggingFlags metaMV2c100Tag = { 'IsATagger' : False,#True, 'xAODBaseName' : 'MV2c100', 'DependsOn' : ['AtlasExtrapolator', - 'BTagCalibrationBrokerTool', 'BTagTrackToVertexTool'], 'CalibrationTaggers' : ['MV2c100',], - 'PassByPointer' : {'calibrationTool' : 'BTagCalibrationBrokerTool'}, 'ToolCollection' : 'MV2c100Tag'} def toolMV2c100Tag(name, useBTagFlagsDefaults = True, **options): diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MV2c10Tag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MV2c10Tag.py index 25f519551ad03d2c7b46dfdfb81b37983784a57f..6dc9a03afe35ca2ae1eb3698200d8dbccaa95f46 100644 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MV2c10Tag.py +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MV2c10Tag.py @@ -7,10 +7,8 @@ from BTagging.BTaggingFlags import BTaggingFlags metaMV2c10Tag = { 'IsATagger' : False,#True, 'xAODBaseName' : 'MV2c10', 'DependsOn' : ['AtlasExtrapolator', - 'BTagCalibrationBrokerTool', 'BTagTrackToVertexTool'], 'CalibrationTaggers' : ['MV2c10',], - 'PassByPointer' : {'calibrationTool' : 'BTagCalibrationBrokerTool'}, 'ToolCollection' : 'MV2c10Tag'} def toolMV2c10Tag(name, useBTagFlagsDefaults = True, **options): diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MV2c10TrigTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MV2c10TrigTag.py new file mode 100644 index 0000000000000000000000000000000000000000..b4d2708d442b824413614e978701165b70aca0a7 --- /dev/null +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MV2c10TrigTag.py @@ -0,0 +1,49 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +# Configuration functions for MV2c10Tag +# Author: Wouter van den Wollenberg (2013-2014) +from BTagging.BTaggingFlags import BTaggingFlags + +metaMV2c10Tag_Trig = { 'IsATagger' : False,#True, + 'xAODBaseName' : 'MV2c10', + 'DependsOn' : ['AtlasExtrapolator', + 'BTagTrackToVertexTool'], + 'CalibrationTaggers' : ['MV2c10',], + 'ToolCollection' : 'MV2c10Tag_Trig'} + +def toolMV2c10Tag_Trig(name, useBTagFlagsDefaults = True, **options): + """Sets up a MV2c10Tag tool and returns it. + + The following options have BTaggingFlags defaults: + + OutputLevel default: BTaggingFlags.OutputLevel + Runmodus default: BTaggingFlags.Runmodus + taggerName default: "MV2c10" + taggerNameBase default: "MV2c10" + forceMV2CalibrationAlias default: BTaggingFlags.ForceMV2CalibrationAlias + MV2CalibAlias default: BTaggingFlags.MV2CalibAlias + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + from BTagging.MV2defaultValues import default_values + from BTagging.MV2defaultValues import MVTM_varNames + + + if useBTagFlagsDefaults: + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, + 'Runmodus' : BTaggingFlags.Runmodus, + 'taggerName' : 'MV2c10', + 'taggerNameBase' : 'MV2c10', + 'forceMV2CalibrationAlias' : BTaggingFlags.ForceMV2CalibrationAlias, + 'MV2CalibAlias' : BTaggingFlags.MV2CalibAlias, + 'defaultvals' : default_values, + 'MVTMvariableNames' : MVTM_varNames, + 'HistosKey' : 'TrigJetTagCalibHistosKey', + } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + from JetTagTools.JetTagToolsConf import Analysis__MV2Tag + return Analysis__MV2Tag(**options) diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MV2c10muTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MV2c10muTag.py index 2276ff7f029d0309ca58a6a06310d7d7675a4ced..be4ed6ef4e1bb755b8f5d9f05dc75174f5a90443 100644 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MV2c10muTag.py +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MV2c10muTag.py @@ -7,11 +7,9 @@ from BTagging.BTaggingFlags import BTaggingFlags metaMV2c10muTag = { 'IsATagger' : False,#True, 'xAODBaseName' : 'MV2c10mu', 'DependsOn' : ['AtlasExtrapolator', - 'BTagCalibrationBrokerTool', 'SoftMuonTag', 'BTagTrackToVertexTool'], 'CalibrationTaggers' : ['MV2c10mu',], - 'PassByPointer' : {'calibrationTool' : 'BTagCalibrationBrokerTool'}, 'ToolCollection' : 'MV2c10muTag'} def toolMV2c10muTag(name, useBTagFlagsDefaults = True, **options): diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MV2c10rnnTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MV2c10rnnTag.py index c72f0e42a7adc53cb768db8cd12064f936d6ecf6..1ec1a94648662a5063180e847ea58e2cc14ac120 100644 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MV2c10rnnTag.py +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MV2c10rnnTag.py @@ -7,11 +7,9 @@ from BTagging.BTaggingFlags import BTaggingFlags metaMV2c10rnnTag = { 'IsATagger' : False,#True, 'xAODBaseName' : 'MV2c10rnn', 'DependsOn' : ['AtlasExtrapolator', - 'BTagCalibrationBrokerTool', 'SoftMuonTag', 'BTagTrackToVertexTool'], 'CalibrationTaggers' : ['MV2c10rnn',], - 'PassByPointer' : {'calibrationTool' : 'BTagCalibrationBrokerTool'}, 'ToolCollection' : 'MV2c10rnnTag'} def toolMV2c10rnnTag(name, useBTagFlagsDefaults = True, **options): diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MV2cl100Tag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MV2cl100Tag.py index 0531ddf12de4b5c545f824f26b509d99b2e517c1..129b5719fb2aa66d064ca2d9e0a46599a2def98e 100644 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MV2cl100Tag.py +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MV2cl100Tag.py @@ -7,10 +7,8 @@ from BTagging.BTaggingFlags import BTaggingFlags metaMV2cl100Tag = { 'IsATagger' : False,#True, 'xAODBaseName' : 'MV2cl100', 'DependsOn' : ['AtlasExtrapolator', - 'BTagCalibrationBrokerTool', 'BTagTrackToVertexTool'], 'CalibrationTaggers' : ['MV2cl100',], - 'PassByPointer' : {'calibrationTool' : 'BTagCalibrationBrokerTool'}, 'ToolCollection' : 'MV2cl100Tag'} def toolMV2cl100Tag(name, useBTagFlagsDefaults = True, **options): @@ -46,4 +44,4 @@ def toolMV2cl100Tag(name, useBTagFlagsDefaults = True, **options): options.setdefault(option, defaults[option]) options['name'] = name from JetTagTools.JetTagToolsConf import Analysis__MV2Tag - return Analysis__MV2Tag(**options) \ No newline at end of file + return Analysis__MV2Tag(**options) diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MultiSVbb1Tag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MultiSVbb1Tag.py index 4bf5ab630bd242bfaa2d20229dd1e255f9f81307..7fe3734ae72cd6c9a052af9736f9edf781ffcb74 100644 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MultiSVbb1Tag.py +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MultiSVbb1Tag.py @@ -8,10 +8,8 @@ metaMultiSVbb1Tag = { 'IsATagger' : True, 'xAODBaseName' : 'MSV', 'DependsOn' : ['AtlasExtrapolator', 'BTagTrackToVertexTool', - 'BTagCalibrationBrokerTool', 'InDetVKalMultiVxInJetTool',], 'CalibrationTaggers' : ['MultiSVbb1',], - 'PassByPointer' : {'calibrationTool' : 'BTagCalibrationBrokerTool'}, 'JetCollectionList' : 'jetCollectionList', 'DefaultTracks' : 'BTagTrackToJetAssociatorBB', 'ToolCollection' : 'MultiSVbb1Tag' } diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MultiSVbb2Tag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MultiSVbb2Tag.py index 8dbc68264abc0be4a5b44dd0898fda8e16a89a94..feadd77cbb72c9fe5a4b9b41d63796164681b52a 100644 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MultiSVbb2Tag.py +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MultiSVbb2Tag.py @@ -8,10 +8,8 @@ metaMultiSVbb2Tag = { 'IsATagger' : True, 'xAODBaseName' : 'MSV', 'DependsOn' : ['AtlasExtrapolator', 'BTagTrackToVertexTool', - 'BTagCalibrationBrokerTool', 'InDetVKalMultiVxInJetTool',], 'CalibrationTaggers' : ['MultiSVbb2',], - 'PassByPointer' : {'calibrationTool' : 'BTagCalibrationBrokerTool'}, 'JetCollectionList' : 'jetCollectionList', 'DefaultTracks' : 'BTagTrackToJetAssociatorBB', 'ToolCollection' : 'MultiSVbb2Tag' } diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MultivariateTrigTagManager.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MultivariateTrigTagManager.py new file mode 100644 index 0000000000000000000000000000000000000000..c450b5b4d5b01abfb539bee45b994dcca2e5ffe1 --- /dev/null +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MultivariateTrigTagManager.py @@ -0,0 +1,42 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +# Configuration functions for MultivariateTagManager +# Author: Marie Lanfermann (October 2015) +from BTagging.BTaggingFlags import BTaggingFlags + +metaMultivariateTagManager_Trig = { 'IsATagger' : True, + 'DependsOn' : ['AtlasExtrapolator', + 'BTagTrackToVertexTool', + 'IP2DTag_Trig', + 'IP3DTag_Trig', + 'NewJetFitterVxFinder', + 'SV1Tag_Trig'], + 'ToolCollection' : 'MultivariateTagManager_Trig' } + +def toolMultivariateTagManager_Trig(name, useBTagFlagsDefaults = True, **options): + """Sets up a MultivariateTagManager tool and returns it. + + The following options have BTaggingFlags defaults: + + OutputLevel default: BTaggingFlags.OutputLevel + inputSV0SourceName default: "SV0" + inputSV1SourceName default: "SV1" + inputIP2DSourceName default: "IP2D" + inputIP3DSourceName default: "IP3D" + inputJFSourceName default: "JetFitter" + + input: name: The name of the tool (should be unique). + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + if useBTagFlagsDefaults: + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, + 'inputSV0SourceName' : 'SV0', + 'inputSV1SourceName' : 'SV1', + 'inputIP2DSourceName' : 'IP2D', + 'inputIP3DSourceName' : 'IP3D', + 'inputJFSourceName' : 'JetFitter', + } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + from JetTagTools.JetTagToolsConf import Analysis__MultivariateTagManager + return Analysis__MultivariateTagManager(**options) diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_NewJetFitterCollection.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_NewJetFitterCollection.py index d8fbb5cef89b269a3dc96cb49f0fa06b686b27b9..bfcd1ee48679d03586ea7715f7fc583fc69306cc 100644 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_NewJetFitterCollection.py +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_NewJetFitterCollection.py @@ -445,17 +445,15 @@ def toolNeuralNetworkToHistoToolNN(name, useBTagFlagsDefaults = True, **options) #------------------------------------------------------------------------- metaJetFitterNNTool = { 'CalibrationTaggers' : ['JetFitter',], - 'DependsOn' : ['NeuralNetworkToHistoToolNN', - 'BTagCalibrationBrokerTool'], - 'PassByPointer' : {'calibrationTool' : 'BTagCalibrationBrokerTool', - 'NeuralNetworkToHistoTool' : 'NeuralNetworkToHistoToolNN'}, + 'DependsOn' : ['NeuralNetworkToHistoToolNN'], + 'PassByPointer' : {'NeuralNetworkToHistoTool' : 'NeuralNetworkToHistoToolNN'}, 'ToolCollection' : 'JetFitterCollection' } def _slim_jf_options(options): new_opts = {} removed = set( ['CalibrationDirectory', 'CalibrationSubDirectory', - 'calibrationTool', 'NeuralNetworkToHistoTool']) + 'NeuralNetworkToHistoTool']) kept = set(options) - removed for optname in kept: new_opts[optname] = options[optname] @@ -586,10 +584,8 @@ def toolNeuralNetworkToHistoToolCOMBNN(name, useBTagFlagsDefaults = True, **opti #----------------------------------------------------------------------------- metaJetFitterCOMBNNTool = { 'CalibrationTaggers' : ['JetFitter',], - 'DependsOn' : ['NeuralNetworkToHistoToolCOMBNN', - 'BTagCalibrationBrokerTool'], - 'PassByPointer' : {'calibrationTool' : 'BTagCalibrationBrokerTool', - 'NeuralNetworkToHistoTool' : 'NeuralNetworkToHistoToolCOMBNN'}, + 'DependsOn' : ['NeuralNetworkToHistoToolCOMBNN'], + 'PassByPointer' : {'NeuralNetworkToHistoTool' : 'NeuralNetworkToHistoToolCOMBNN'}, 'ToolCollection' : 'JetFitterCollection' } def toolJetFitterCOMBNNTool(name, useBTagFlagsDefaults = True, **options): diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_NewJetFitterTrigCollection.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_NewJetFitterTrigCollection.py new file mode 100644 index 0000000000000000000000000000000000000000..c785a0bd656c8cc5fa8ed78f2bc43fee7dd365bc --- /dev/null +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_NewJetFitterTrigCollection.py @@ -0,0 +1,478 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +# Configuration functions for NewJetFitterTag +# Author: Wouter van den Wollenberg (2013-2014) +# Because there are some many different JetFitter tools floating around +# now, this file was created to contain them all. +from BTagging.BTaggingFlags import BTaggingFlags + + +metaInDetImprovedJetFitterTrackSelectorTool_Trig = { 'DependsOn' : ['JetFitterExtrapolator',], + 'PassByPointer' : {'Extrapolator' : 'JetFitterExtrapolator'}, + 'ToolCollection' : 'JetFitterCollection_Trig' } + +def toolInDetImprovedJetFitterTrackSelectorTool_Trig(name, useBTagFlagsDefaults = True, **options): + """Sets up a InDetImprovedJetFitterTrackSelectorTool tool and returns it. + + The following options have BTaggingFlags defaults: + + pTMin default: 500.0 + IPd0Max default: 7.0 + IPz0Max default: 10.0 + sigIPd0Max default: 0.35 + sigIPz0Max default: 2.5 + etaMax default: 9999.0 + useTrackSummaryInfo default: True + nHitBLayer default: 0 + nHitPix default: 1 + nHitSct default: 4 + nHitSi default: 7 + nHitTrt default: 0 + useSharedHitInfo default: False + useTrackQualityInfo default: True + fitChi2OnNdfMax default: 3.5 + TrackSummaryTool default: None + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + if useBTagFlagsDefaults: + defaults = { 'pTMin' : 500.0, + 'IPd0Max' : 7.0, + 'IPz0Max' : 10.0, + 'sigIPd0Max' : 0.35, + 'sigIPz0Max' : 2.5, + 'etaMax' : 9999.0, + 'useTrackSummaryInfo' : True, + 'nHitBLayer' : 0, + 'nHitPix' : 1, + 'nHitSct' : 4, + 'nHitSi' : 7, + 'nHitTrt' : 0, + 'useSharedHitInfo' : False, + 'useTrackQualityInfo' : True, + 'fitChi2OnNdfMax' : 3.5, + 'TrackSummaryTool' : None } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + from InDetTrackSelectorTool.InDetTrackSelectorToolConf import InDet__InDetDetailedTrackSelectorTool + return InDet__InDetDetailedTrackSelectorTool(**options) + +#-------------------------------------------------------------------------- + +metaJetFitterFullLinearizedTrackFactory_Trig = {'DependsOn' : ['JetFitterExtrapolator',], + 'PassByPointer' : {'Extrapolator' : 'JetFitterExtrapolator' }, + 'ToolCollection': 'JetFitterCollection_Trig' } + +def toolJetFitterFullLinearizedTrackFactory_Trig(name, useBTagFlagsDefaults = True, **options): + """Sets up a JetFitterFullLinearizedTrackFactory tool and returns it. + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + Note however that this tool has no BTaggingFlags defaults; the option is + here only for consistency. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + options['name'] = name + from TrkVertexFitterUtils.TrkVertexFitterUtilsConf import Trk__FullLinearizedTrackFactory + return Trk__FullLinearizedTrackFactory(**options) + +#-------------------------------------------------------------------------- + +metaJetFitterMode3dTo1dFinder_Trig = { 'ToolCollection' : 'JetFitterCollection_Trig' } + +def toolJetFitterMode3dTo1dFinder_Trig(name, useBTagFlagsDefaults = True, **options): + """Sets up a JetFitterMode3dTo1dFinder tool and returns it. + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + Note however that this tool has no BTaggingFlags defaults; the option is + here only for consistency. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + options['name'] = name + from TrkVertexSeedFinderUtils.TrkVertexSeedFinderUtilsConf import Trk__Mode3dTo1dFinder + return Trk__Mode3dTo1dFinder(**options) + +#-------------------------------------------------------------------------- + +metaJetFitterSequentialVertexSmoother_Trig = { 'ToolCollection' : 'JetFitterCollection_Trig' } + +def toolJetFitterSequentialVertexSmoother_Trig(name, useBTagFlagsDefaults = True, **options): + """Sets up a JetFitterSequentialVertexSmoother tool and returns it. + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + Note however that this tool has no BTaggingFlags defaults; the option is + here only for consistency. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + options['name'] = name + from TrkVertexFitters.TrkVertexFittersConf import Trk__SequentialVertexSmoother + return Trk__SequentialVertexSmoother(**options) + +#-------------------------------------------------------------------------- + +metaVxInternalEdmFactory_Trig = {'DependsOn' : ['JetFitterFullLinearizedTrackFactory_Trig',], + 'PassByPointer' : {'LinearizedTrackFactory' : 'JetFitterFullLinearizedTrackFactory_Trig' }, + 'ToolCollection': 'JetFitterCollection_Trig' } + +def toolVxInternalEdmFactory_Trig(name, useBTagFlagsDefaults = True, **options): + """Sets up a VxInternalEdmFactory tool and returns it. + + The following options have BTaggingFlags defaults: + + OutputLevel default: BTaggingFlags.OutputLevel + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + if useBTagFlagsDefaults: + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + from TrkVxEdmCnv.TrkVxEdmCnvConf import Trk__VxCandidateXAODVertex + return Trk__VxCandidateXAODVertex(**options) + +#-------------------------------------------------------------------------- + +metaJetFitterSequentialVertexFitter_Trig = { 'DependsOn' : ['JetFitterSequentialVertexSmoother_Trig', + 'JetFitterFullLinearizedTrackFactory_Trig'] , + 'PassByPointer' : {'VertexSmoother' : 'JetFitterSequentialVertexSmoother', + 'LinearizedTrackFactory' : 'JetFitterFullLinearizedTrackFactory_Trig'}, + + 'ToolCollection' : 'JetFitterCollection_Trig' } + +def toolJetFitterSequentialVertexFitter_Trig(name, useBTagFlagsDefaults = True, **options): + """Sets up a JetFitterSequentialVertexFitter tool and returns it. + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + Note however that this tool has no BTaggingFlags defaults; the option is + here only for consistency. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + options['name'] = name + from TrkVertexFitters.TrkVertexFittersConf import Trk__SequentialVertexFitter + return Trk__SequentialVertexFitter(**options) + +#-------------------------------------------------------------------------- + +metaImprovedJetFitterInitializationHelper_Trig = { 'DependsOn' : ['JetFitterFullLinearizedTrackFactory_Trig',], + 'PassByPointer' : {'LinearizedTrackFactory' : 'JetFitterFullLinearizedTrackFactory_Trig' }, + 'ToolCollection' : 'JetFitterCollection_Trig' } + +def toolImprovedJetFitterInitializationHelper_Trig(name, useBTagFlagsDefaults = True, **options): + """Sets up a ImprovedJetFitterInitializationHelper tool and returns it. + + The following options have BTaggingFlags defaults: + + OutputLevel default: BTaggingFlags.OutputLevel + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + if useBTagFlagsDefaults: + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + from TrkJetVxFitter.TrkJetVxFitterConf import Trk__JetFitterInitializationHelper + return Trk__JetFitterInitializationHelper(**options) + +#-------------------------------------------------------------------------- + +metaTrkDistanceFinderNeutralNeutral_Trig = { 'ToolCollection' : 'JetFitterCollection_Trig' } + +def toolTrkDistanceFinderNeutralNeutral_Trig(name, useBTagFlagsDefaults = True, **options): + """Sets up a TrkDistanceFinderNeutralNeutral tool and returns it. + + The following options have BTaggingFlags defaults: + + OutputLevel default: BTaggingFlags.OutputLevel + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + if useBTagFlagsDefaults: + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + from TrkJetVxFitter.TrkJetVxFitterConf import Trk__TrkDistanceFinderNeutralNeutral + return Trk__TrkDistanceFinderNeutralNeutral(**options) + +#-------------------------------------------------------------------------- + +metaTrkDistanceFinderNeutralCharged_Trig = { 'ToolCollection' : 'JetFitterCollection_Trig' } + +def toolTrkDistanceFinderNeutralCharged_Trig(name, useBTagFlagsDefaults = True, **options): + """Sets up a TrkDistanceFinderNeutralCharged tool and returns it. + + The following options have BTaggingFlags defaults: + + OutputLevel default: BTaggingFlags.OutputLevel + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + if useBTagFlagsDefaults: + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + from TrkJetVxFitter.TrkJetVxFitterConf import Trk__TrkDistanceFinderNeutralCharged + return Trk__TrkDistanceFinderNeutralCharged(**options) + +#-------------------------------------------------------------------------- + +metaImprovedJetFitterRoutines_Trig = { 'DependsOn' : ['ImprovedJetFitterInitializationHelper_Trig', + 'TrkDistanceFinderNeutralNeutral_Trig', + 'TrkDistanceFinderNeutralCharged_Trig'], + 'PassByPointer' : {'JetFitterInitializationHelper' : 'ImprovedJetFitterInitializationHelper_Trig', + 'JetFitterMinimumDistanceFinderNeutral' : 'TrkDistanceFinderNeutralNeutral_Trig', + 'JetFitterMinimumDistanceFinder' : 'TrkDistanceFinderNeutralCharged_Trig' }, + 'ToolCollection' : 'JetFitterCollection_Trig' } + +def toolImprovedJetFitterRoutines_Trig(name, useBTagFlagsDefaults = True, **options): + """Sets up a ImprovedJetFitterRoutines tool and returns it. + + The following options have BTaggingFlags defaults: + + OutputLevel default: BTaggingFlags.OutputLevel + BeFast default: False + maxDRshift default: 0.0 + noPrimaryVertexRefit default: False + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + if useBTagFlagsDefaults: + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, + 'BeFast' : False, + 'maxDRshift' : 0.0, + 'noPrimaryVertexRefit' : False } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + from TrkJetVxFitter.TrkJetVxFitterConf import Trk__JetFitterRoutines + return Trk__JetFitterRoutines(**options) + +#-------------------------------------------------------------------------- + +metaInDetJetFitterUtils_Trig = { 'DependsOn' : ['JetFitterFullLinearizedTrackFactory_Trig', + 'JetFitterExtrapolator'], + 'PassByPointer' : {'LinearizedTrackFactory' : 'JetFitterFullLinearizedTrackFactory_Trig', + 'Extrapolator' : 'JetFitterExtrapolator' }, + 'ToolCollection' : 'JetFitterCollection_Trig' } + +def toolInDetJetFitterUtils_Trig(name, useBTagFlagsDefaults = True, **options): + """Sets up a InDetJetFitterUtils tool and returns it. + + The following options have BTaggingFlags defaults: + + OutputLevel default: BTaggingFlags.OutputLevel + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + if useBTagFlagsDefaults: + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + from InDetSecVxFinderTool.InDetSecVxFinderToolConf import InDet__InDetJetFitterUtils + return InDet__InDetJetFitterUtils(**options) + +#-------------------------------------------------------------------------- + +metaNewJetFitterVxFinder_Trig = { 'IsAVertexFinder' : True, + 'VertexFinderxAODBaseName' : 'JetFitter', + 'VertexFinderPassByPointer': {'JetFitterVariableFactory' : 'JetFitterVariablesFactory_Trig' }, + 'DependsOn' : ['BTagTrackToVertexTool', + 'InDetJetFitterUtils_Trig', + 'ImprovedJetFitterRoutines_Trig', + 'TrkDistanceFinderNeutralCharged_Trig', + 'TrkDistanceFinderNeutralNeutral_Trig', + 'ImprovedJetFitterInitializationHelper_Trig', + 'JetFitterSequentialVertexFitter_Trig', + 'JetFitterSequentialVertexSmoother_Trig', + 'JetFitterMode3dTo1dFinder_Trig', + 'InDetImprovedJetFitterTrackSelectorTool_Trig', + 'JetFitterExtrapolator', + 'JetFitterFullLinearizedTrackFactory_Trig', + 'JetFitterVariablesFactory_Trig', + 'VxInternalEdmFactory_Trig'], + 'PassByPointer' : { 'Mode3dFinder' : 'JetFitterMode3dTo1dFinder_Trig', + 'JetFitterInitializationHelper' : 'ImprovedJetFitterInitializationHelper_Trig', + 'TrackSelector' : 'InDetImprovedJetFitterTrackSelectorTool_Trig', + 'InDetJetFitterUtils' : 'InDetJetFitterUtils_Trig', + 'Extrapolator' : 'JetFitterExtrapolator', + 'SequentialVertexFitter' : 'JetFitterSequentialVertexFitter_Trig', + 'JetFitterRoutines' : 'ImprovedJetFitterRoutines_Trig', + 'VertexEdmFactory' : 'VxInternalEdmFactory_Trig' }, + 'ToolCollection' : 'JetFitterCollection_Trig' } + +def toolNewJetFitterVxFinder_Trig(name, useBTagFlagsDefaults = True, **options): + """Sets up a NewJetFitterVxFinder tool and returns it. + + The following options have BTaggingFlags defaults: + + OutputLevel default: BTaggingFlags.OutputLevel + VxPrimaryContainer default: BTaggingFlags.PrimaryVertexCollectionName + MaxNumDeleteIterations default: 30 + VertexProbCut default: 0.001 + MaxClusteringIterations default: 30 + VertexClusteringProbabilityCut default: 0.005 + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + if useBTagFlagsDefaults: + if not 'InDetKeys' in dir(): + from InDetRecExample.InDetKeys import InDetKeys + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, + 'VxPrimaryContainer' : BTaggingFlags.PrimaryVertexCollectionName, + 'MaxNumDeleteIterations' : 30, + 'VertexProbCut' : 0.001, + 'MaxClusteringIterations' : 30, + 'VertexClusteringProbabilityCut' : 0.005 } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + from InDetSecVxFinderTool.InDetSecVxFinderToolConf import InDet__InDetImprovedJetFitterVxFinder + return InDet__InDetImprovedJetFitterVxFinder(**options) + +#-------------------------------------------------------------------------- + +metaJetFitterVariablesFactory_Trig = { #'PassByName' : {'JetFitterInstance' : 'JetFitterTag', + # 'secVxFinderName' : 'JetFitterVxFinder' }, + 'ToolCollection' : 'JetFitterCollection_Trig' } + +def toolJetFitterVariablesFactory_Trig(name, useBTagFlagsDefaults = True, **options): + """Sets up a NewJetFitterVariablesFactory tool and returns it. + + The following options have BTaggingFlags defaults: + + OutputLevel default: BTaggingFlags.OutputLevel + JetFitterInstance default: "JetFitterTag" + secVxFinderName default: "JetFitterVxFinder" + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + if useBTagFlagsDefaults: + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, + 'JetFitterInstance' : 'JetFitterTag', + 'secVxFinderName' : 'JetFitterVxFinder' } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + from JetTagTools.JetTagToolsConf import Analysis__JetFitterVariablesFactory + return Analysis__JetFitterVariablesFactory(**options) + +#------------------------------------------------------------------------- + +metaJetFitterNNTool_Trig = { 'CalibrationTaggers' : ['JetFitter',], + 'DependsOn' : ['NeuralNetworkToHistoToolNN'], + 'PassByPointer' : {'NeuralNetworkToHistoTool' : 'NeuralNetworkToHistoToolNN'}, + 'ToolCollection' : 'JetFitterCollection_Trig' } + +def _slim_jf_options(options): + new_opts = {} + removed = set( + ['CalibrationDirectory', 'CalibrationSubDirectory', + 'NeuralNetworkToHistoTool']) + kept = set(options) - removed + for optname in kept: + new_opts[optname] = options[optname] + return new_opts + +def toolJetFitterNNTool_Trig(name, useBTagFlagsDefaults = True, **options): + """Sets up a JetFitterNNTool tool and returns it. + + The following options have BTaggingFlags defaults: + + OutputLevel default: BTaggingFlags.OutputLevel + CalibrationDirectory default: "JetFitter" + CalibrationSubDirectory default: "NeuralNetwork" + useCombinedIPNN default: False + usePtCorrectedMass default: True + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + if useBTagFlagsDefaults: + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, + 'useCombinedIPNN' : False, + 'CalibrationDirectory' : 'JetFitter', + 'CalibrationSubDirectory' : 'NeuralNetwork', + 'usePtCorrectedMass' : True, } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + from JetTagTools.JetTagToolsConf import Analysis__JetFitterNNTool + from JetTagTools.JetTagToolsConf import Analysis__JetFitterInputWriter + if BTaggingFlags.RunJetFitterNNTool: + return Analysis__JetFitterNNTool(**options) + else: + return Analysis__JetFitterInputWriter(**_slim_jf_options(options)) + +#------------------------------------------------------------------------- + +metaJetFitterTagNN_Trig = { 'IsATagger' : True, + 'xAODBaseName' : 'JetFitter', + 'DependsOn' : ['AtlasExtrapolator', + 'BTagTrackToVertexTool', + 'NewJetFitterVxFinder', + 'JetFitterNNTool', + 'NeuralNetworkToHistoToolNN', + 'JetFitterNtupleWriterNN'], + 'PassByPointer' : { 'jetfitterClassifier' : 'JetFitterNNTool', + 'jetfitterNtupleWriter' : 'JetFitterNtupleWriterNN' }, + 'JetCollectionList' : 'jetCollectionList', + 'ToolCollection' : 'JetFitterCollection_Trig' } + +def toolJetFitterTagNN_Trig(name, useBTagFlagsDefaults = True, **options): + """Sets up a JetFitterTagNN tool and returns it. + + The following options have BTaggingFlags defaults: + + OutputLevel default: BTaggingFlags.OutputLevel + Runmodus default: BTaggingFlags.Runmodus + jetCollectionList default: BTaggingFlags.Jets + SecVxFinderName default: "JetFitter" + useForcedCalibration default: False + ipinfoTaggerName default: "" + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + if useBTagFlagsDefaults: + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, + 'Runmodus' : BTaggingFlags.Runmodus, + 'jetCollectionList' : BTaggingFlags.Jets, + 'SecVxFinderName' : 'JetFitter', + 'useForcedCalibration' : False, + 'ipinfoTaggerName' : "", + } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + from JetTagTools.JetTagToolsConf import Analysis__JetFitterTag + return Analysis__JetFitterTag(**options) + +#------------------------------------------------------------------------- diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_RNNIPTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_RNNIPTag.py index dd600b9e4ab50978b6760efd179cb7eca8f9557d..6a2f1f18e0cb0d1eb40788143a768f33c9055114 100644 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_RNNIPTag.py +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_RNNIPTag.py @@ -13,7 +13,6 @@ def buildRNNIP(basename, is_flipped=False, calibration=None): 'xAODBaseName' : basename, 'CalibrationTaggers' : [cal_dir], 'DependsOn' : ['AtlasExtrapolator', - 'BTagCalibrationBrokerTool', 'BTagTrackToVertexTool', 'InDetVKalVxInJetTool', 'BTagTrackToVertexIPEstimator', @@ -26,7 +25,6 @@ def buildRNNIP(basename, is_flipped=False, calibration=None): 'PassByPointer' : { 'SVForIPTool' : 'SVForIPTool_IP3D', 'trackSelectorTool' : 'IP3DTrackSelector', - 'calibrationTool' : 'BTagCalibrationBrokerTool', 'trackGradeFactory' : 'IP3DDetailedTrackGradeFactory', 'TrackToVertexIPEstimator' : 'BTagTrackToVertexIPEstimator'}, 'PassTracksAs' : 'trackAssociationName', diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_SV1Tag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_SV1Tag.py index 01f3b3be7da0b7d4533d155b11ea8ffc120d06ee..ad5f1e684bd63915ef94795af679d8a69aa7538a 100644 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_SV1Tag.py +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_SV1Tag.py @@ -11,7 +11,6 @@ metaSV1Tag = { 'IsATagger' : True, 'InDetVKalVxInJetTool', 'SV1NewLikelihoodTool'], 'PassByPointer' : {'LikelihoodTool' : 'SV1NewLikelihoodTool'}, -# 'PassByName' : {'SecVxFinderName' : 'InDetVKalVxInJetTool' }, 'JetCollectionList' : 'jetCollectionList', 'ToolCollection' : 'SV1Tag' } @@ -53,8 +52,6 @@ def toolSV1Tag(name, useBTagFlagsDefaults = True, **options): #----------------------------------------------------------------- metaSV1NewLikelihoodTool = { 'CalibrationTaggers' : ['SV1',], - 'DependsOn' : ['BTagCalibrationBrokerTool',], - 'PassByPointer' : {'calibrationTool' : 'BTagCalibrationBrokerTool' }, 'ToolCollection' : 'SV1Tag' } def toolSV1NewLikelihoodTool(name, useBTagFlagsDefaults = True, **options): diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_SV1TrigTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_SV1TrigTag.py new file mode 100644 index 0000000000000000000000000000000000000000..0f9d6ccb5220f3427e2839ecd19d5fd3b4e189e3 --- /dev/null +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_SV1TrigTag.py @@ -0,0 +1,76 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +# Configuration functions for SV1Tag_Trig +# Author: Wouter van den Wollenberg (2013-2014) +from BTagging.BTaggingFlags import BTaggingFlags + +metaSV1Tag_Trig = { 'IsATagger' : True, + 'xAODBaseName' : 'SV1', + 'DependsOn' : ['AtlasExtrapolator', + 'BTagTrackToVertexTool', + 'InDetVKalVxInJetTool_Trig', + 'SV1NewLikelihoodTool_Trig'], + 'PassByPointer' : {'LikelihoodTool' : 'SV1NewLikelihoodTool_Trig'}, + 'JetCollectionList' : 'jetCollectionList', + 'ToolCollection' : 'SV1Tag_Trig' } + +def toolSV1Tag_Trig(name, useBTagFlagsDefaults = True, **options): + """Sets up a SV1Tag_Trig tool and returns it. + + The following options have BTaggingFlags defaults: + + OutputLevel default: BTaggingFlags.OutputLevel + Runmodus default: BTaggingFlags.Runmodus + referenceType default: BTaggingFlags.ReferenceType + SVAlgType default: "SV1" + jetCollectionList default: BTaggingFlags.Jets + SecVxFinderName default: "SV1" + LikelihoodTool default: None + UseCHypo default: True + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + if useBTagFlagsDefaults: + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, + 'Runmodus' : BTaggingFlags.Runmodus, + 'referenceType' : BTaggingFlags.ReferenceType, + 'SVAlgType' : 'SV1', + 'jetCollectionList' : BTaggingFlags.Jets, + 'SecVxFinderName' : 'SV1', + 'LikelihoodTool' : None, + 'UseCHypo' : True, + } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + from JetTagTools.JetTagToolsConf import Analysis__SVTag + return Analysis__SVTag(**options) + +#--------------------------------------------------------------------- + +metaSV1NewLikelihoodTool_Trig = { 'CalibrationTaggers' : ['SV1',], + 'ToolCollection' : 'SV1Tag_Trig' } + +def toolSV1NewLikelihoodTool_Trig(name, useBTagFlagsDefaults = True, **options): + """Sets up a SV1NewLikelihoodTool_Trig tool and returns it. + + The following options have BTaggingFlags defaults: + + OutputLevel default: BTaggingFlags.OutputLevel + taggerName default: "SV1" + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + if useBTagFlagsDefaults: + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, + 'HistosKey' : 'TrigJetTagCalibHistosKey', + 'taggerName' : 'SV1' } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + from JetTagTools.JetTagToolsConf import Analysis__NewLikelihoodTool + return Analysis__NewLikelihoodTool(**options) diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_SV2Tag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_SV2Tag.py index 4c428ba6f0928e0ae47f388708b33e47b13b87e2..345f41124b2970b1f0ab6e6d3b67ab5e1d19170f 100644 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_SV2Tag.py +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_SV2Tag.py @@ -52,8 +52,6 @@ def toolSV2Tag(name, useBTagFlagsDefaults = True, **options): #----------------------------------------------------------------- metaSV2NewLikelihoodTool = { 'CalibrationTaggers' : ['SV2',], - 'DependsOn' : ['BTagCalibrationBrokerTool',], - 'PassByPointer' : {'calibrationTool' : 'BTagCalibrationBrokerTool' }, 'ToolCollection' : 'SV2Tag' } def toolSV2NewLikelihoodTool(name, useBTagFlagsDefaults = True, **options): diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_SoftMuonTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_SoftMuonTag.py index c90c8ec389f082b4f5dc65e79fc217c25099c146..ad3e36c13b897256acfa9222665c25fc0cc78520 100644 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_SoftMuonTag.py +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_SoftMuonTag.py @@ -8,7 +8,6 @@ metaSoftMuonTag = { 'IsATagger' : True, 'NeedsMuonAssociator' : True, 'DependsOn' : ['AtlasExtrapolator', 'BTagTrackToVertexTool', - 'BTagCalibrationBrokerTool', 'BTagFullLinearizedTrackFactory', 'BTagTrackToVertexIPEstimator', 'SoftMuonTagNewLikelihoodTool', @@ -16,7 +15,6 @@ metaSoftMuonTag = { 'IsATagger' : True, 'PassByPointer' : {'LikelihoodTool' : 'SoftMuonTagNewLikelihoodTool', 'TrackToVertexIPEstimator' : 'BTagTrackToVertexIPEstimator', 'muonSelectorTool': 'MuonSelectorTool', - 'calibrationTool' : 'BTagCalibrationBrokerTool' }, # 'TrackToVertexTool' : 'BTagTrackToVertexTool'}, 'JetCollectionList' : 'jetCollectionList', @@ -55,8 +53,6 @@ def toolSoftMuonTag(name, useBTagFlagsDefaults = True, **options): #---------------------------------------------------------------------- metaSoftMuonTagNewLikelihoodTool = { 'CalibrationTaggers' : ['SMT',], - 'DependsOn' : ['BTagCalibrationBrokerTool',], - 'PassByPointer' : {'calibrationTool' : 'BTagCalibrationBrokerTool'}, 'ToolCollection' : 'SoftMuonTag' } def toolSoftMuonTagNewLikelihoodTool(name, useBTagFlagsDefaults = True, **options): diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_jobOptions.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_jobOptions.py index 17d83b87b1e57b82e596ec5e4e3f0b740b618ad7..379b726c0b33c8bc411802eca755be12b3625d8c 100755 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_jobOptions.py +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_jobOptions.py @@ -61,7 +61,6 @@ if not BTaggingFlags.DoNotSetupBTagging: # Temporary measure so the JetRec peopl topSequence = AlgSequence() for i, jet in enumerate(JetCollectionList): - #btagger = ConfInstance.setupJetBTaggerTool(ToolSvc, jet) #The [:-4] is not needed here; this function automatically removes trailing 'jets' or 'Jets'. btagger = ConfInstance.setupJetBTaggerAlg(ToolSvc, jet) #The [:-4] is not needed here; this function automatically removes trailing 'jets' or 'Jets'. if btagger is None: continue diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibration/CMakeLists.txt b/PhysicsAnalysis/JetTagging/JetTagCalibration/CMakeLists.txt index a3323d66ab8440950fbc983e5e7976d35079cd6e..b82b5150682e4be7a16d448f516ef8cd05589210 100644 --- a/PhysicsAnalysis/JetTagging/JetTagCalibration/CMakeLists.txt +++ b/PhysicsAnalysis/JetTagging/JetTagCalibration/CMakeLists.txt @@ -11,6 +11,7 @@ atlas_depends_on_subdirs( PUBLIC Control/StoreGate GaudiKernel PRIVATE +# PhysicsAnalysis/JetTagging/JetTagTools Database/APR/FileCatalog Database/AthenaPOOL/AthenaPoolUtilities Database/AthenaPOOL/PoolSvc diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibration/JetTagCalibration/JetTagCalibCondAlg.h b/PhysicsAnalysis/JetTagging/JetTagCalibration/JetTagCalibration/JetTagCalibCondAlg.h new file mode 100755 index 0000000000000000000000000000000000000000..2c0bb6687f92fae373284e204a22256010b8fba6 --- /dev/null +++ b/PhysicsAnalysis/JetTagging/JetTagCalibration/JetTagCalibration/JetTagCalibCondAlg.h @@ -0,0 +1,137 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef JETTAGCALIBRATION_JETTAGCALIBCONDALG_H +#define JETTAGCALIBRATION_JETTAGCALIBCONDALG_H + +#include "AthenaBaseComps/AthAlgorithm.h" +#include "StoreGate/ReadCondHandleKey.h" +#include "StoreGate/WriteCondHandleKey.h" + +#include "GaudiKernel/ICondSvc.h" + +#include "AthenaPoolUtilities/CondAttrListCollection.h" +#include "JetTagCalibration/JetTagCalibCondData.h" + +#include "TFile.h" +#include <map> +#include <string> +#include <utility> +#include <set> + +class TH2; +class TObject; +class IPoolSvc; + +namespace Analysis { + + /** + @ class JetTagCalibCondAlg + + This class retrieves calibration histograms from COOL for the taggers. + A single COOL folder is defined for all the taggers. + Each tagger is subdivided in channels, each channel being associated to a jet type + (Cone4Topo, Kt6, etc). + + Any further substructure (track categories, signal/background) is hidden to COOL + and is defined by the actual name of the histogram. + + This class holds the collection of maps between the histogram name and the pointer + to the histogram, the latter being kept up-to-date with the condition algorithm mecanism. + All the taggers histograms are registered in initialize() method with the + registerHistogram() method. + + The geometry tag corresponding to the calibrations, the type of physics events used, + the tracking algorithm, etc, are all defined by a DB tag. + + @author emmanuel.le.guirriec@cern.ch + */ + +class JetTagCalibCondAlg : public AthAlgorithm { + + public: + + JetTagCalibCondAlg (const std::string& name, ISvcLocator* pSvcLocator); + ~JetTagCalibCondAlg(); + + StatusCode initialize(); + StatusCode execute(); + StatusCode finalize(); + + private: + void registerHistogram(const std::string& tagger, const std::string& histoname); + void registerHistogram(const std::string& tagger, const std::string& directory, const std::string& histoname); + StatusCode createHistoMap(TFile* file, JetTagCalibCondData * histos); + StatusCode objectTDirExists(const std::string& histname, TFile* file) const; + StatusCode getTObject(const std::string& histname, TFile* file, TObject*& hist) const; + std::vector<std::string> tokenize(std::string str, std::string delim); + void smoothAndNormalizeHistogram(TObject*& h, const std::string& hname); + void smoothASH2D(TH2* input2D, int m1, int m2); + + void initializeIPTag(); + void initializeIP2D(); + void initializeIP3D(); + void initializeSVEff(std::string); + void initializeSV1(); + void initializeSV2(); + void initializeJetFitterNN(); + void initializeSoftMu(); + void initializeMV2(std::string); + void initializeRNNIP(); + void initializeJetVertexCharge(); + void initializeMultiSV(std::string); + void initializeDL1(std::string); + + SG::ReadCondHandleKey<CondAttrListCollection> m_readKey{this, "ReadKeyCalibPath", "/GLOBAL/BTagCalib/RUN12", "Key of input (raw) conditions folder of bration path"}; // /GLOBAL/BTagCalib/Onl/RUN12 online, /GLOBAL/BTagCalib/RUN12 offline + SG::WriteCondHandleKey<JetTagCalibCondData> m_writeKey{this, "HistosKey", "JetTagCalibHistosKey", "Key of output (derived) JetTag calibration data"}; + + ServiceHandle<ICondSvc> m_condSvc; + IPoolSvc* m_poolsvc; + + + std::vector< std::string > m_taggers; + std::unordered_map<std::string,std::string> m_directoryMap; + std::vector<std::vector<std::string> > m_taggersHists; + std::vector< std::string > m_mappedAlias; + std::vector< std::string > m_originalChannels; + /* aliases for channels: + * to specifiy an alias, enter a string "channelA->channelAA" (or a list of strings) + * this will force to use channelAA from the DB wherever channelA was mentioned */ + StringArrayProperty m_channelAliases; + std::map< std::string, std::vector<std::string> > m_channelAliasesMultiMap; + + //for IPTag + bool m_IPTag_useCHypo; + std::vector<std::string> m_IPTag_hypotheses; // hypotheses: b | u + + //for IP2DTag + std::vector< std::string > m_IP2D_trackGradePartitions; //could be defined for each tagger + + //for SV1Tag + bool m_useDRJPVSV; + + //for SV2Tag + bool m_usePtSV2; + + //for Likelihood tool + int m_Likelihood_smoothNTimes; + std::vector<std::string> m_Likelihood_vetoSmoothingOf; + + //for JetFitterNNTag + std::string m_JetFitterNN_calibrationDirectory; + std::string m_JetFitterNN_calibrationSubDirectory; + bool m_JetFitterNN_useCombinedIPNN; + int m_JetFitterNN_maximumRegisteredLayers; + + //for RNNIP + // Initalize with a config name and path to a network If the + // network path is empty we read from the calib db Note that this + // won't support reading different local files for different jet + // collections. + std::map<std::string, std::string > m_RNNIP_network_cfg; + + +}; +} +#endif // JETTAGCALIBRATION_JETTAGCALIBCONDALG_H diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibration/JetTagCalibration/JetTagCalibCondData.h b/PhysicsAnalysis/JetTagging/JetTagCalibration/JetTagCalibration/JetTagCalibCondData.h new file mode 100644 index 0000000000000000000000000000000000000000..83f851a3d4acd46e1eb036d0856aeba5b9f204eb --- /dev/null +++ b/PhysicsAnalysis/JetTagging/JetTagCalibration/JetTagCalibration/JetTagCalibCondData.h @@ -0,0 +1,63 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +/** + * @file JetTagCalibCondData.h + * @author emmanuel.le.guirriec@cern.ch +**/ + +#ifndef JETTAGCALIBCONDDATA_H +#define JETTAGCALIBCONDDATA_H + +#include <vector> +#include <map> +#include "AthenaKernel/CLASS_DEF.h" + + +class TObject; +class TH1; + +/** + * @class JetTagCalibCondData + * Concrete class for JetTagging calibration condition data +**/ + +namespace Analysis { + +class JetTagCalibCondData { +public: + // Constructor + JetTagCalibCondData(); + // Destructor + virtual ~JetTagCalibCondData() = default; + + /** Resize the data members */ + void resize(const std::vector<std::string> sizeHisto); + void clear(); + void printAliasesStatus() const; + void printHistosStatus() const; + std::string getChannelAlias(const std::string& originalChannel) const; + void addHisto(const unsigned int indexTagger, const std::string& name, TObject *); + void addChannelAlias(const std::string& channel, const std::string& alias); + TH1* retrieveHistogram(const std::string& folder, const std::string& channel, const std::string& hname) const; + template <class T> T* retrieveTObject(const std::string& folder, const std::string& channel, const std::string& hname) const; + + std::string channelName(const std::string& fullHistoName) const; + std::string histoName(const std::string& fullHistoName) const ; + std::string fullHistoName(const std::string& channel, const std::string& histoName) const; + std::vector<std::string> tokenize(std::string str, std::string delim); + +private: + std::vector< std::map<std::string, TObject*> > m_histos; + std::map< std::string, std::string > m_channelAliasesMap; + std::vector< std::string> m_taggers; + +}; +} +CLASS_DEF(Analysis::JetTagCalibCondData, 232300155, 1) + +#include "AthenaKernel/CondCont.h" +CONDCONT_DEF(Analysis::JetTagCalibCondData, 197330919); +#include "JetTagCalibration/JetTagCalibCondData.icc" +#endif // JETTAGCALIBCONDDATA_H diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibration/JetTagCalibration/JetTagCalibCondData.icc b/PhysicsAnalysis/JetTagging/JetTagCalibration/JetTagCalibration/JetTagCalibCondData.icc new file mode 100755 index 0000000000000000000000000000000000000000..a65075dcfa701445504ece22bcac04c20af72780 --- /dev/null +++ b/PhysicsAnalysis/JetTagging/JetTagCalibration/JetTagCalibration/JetTagCalibCondData.icc @@ -0,0 +1,44 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "TObject.h" +#include <string> +#include <utility> +#include <algorithm> +#include "AthenaKernel/getMessageSvc.h" + +namespace Analysis { + +template <class T> T* JetTagCalibCondData::retrieveTObject(const std::string& folder, const std::string& channel, const std::string& hname) const { + T* h = 0; + std::string channelAlias = this->getChannelAlias(channel); + MsgStream log(Athena::getMessageSvc(), "JetTagCalibCondData"); + log << MSG::DEBUG << "#BTAG# retrieving " << hname + << " (channel " << channel << " -> " << channelAlias << ") " + << " in folder " << folder << endmsg; + for(unsigned int i=0;i<m_taggers.size();i++) { + if(folder==m_taggers[i]) { + std::string fname = this->fullHistoName(channelAlias,hname); + log << MSG::DEBUG << "#BTAG# folder " << folder << " found in pos " << i + << " , retrieving " << fname << endmsg; + std::map<std::string, TObject*>::const_iterator mI = m_histos[i].find(fname); + std::map<std::string, TObject*>::const_iterator mE = m_histos[i].end(); + if(mI!=mE) { + log << MSG::DEBUG << "#BTAG# histo found: " << hname << endmsg; + h = dynamic_cast<T*> ( (*mI).second); + if(h) { + log << MSG::DEBUG << "#BTAG# histo pointer is valid." << endmsg; + } else { + log << MSG::DEBUG << "#BTAG# histo pointer is NOT valid." << endmsg; + } + break; + } else { + log << MSG::DEBUG << "#BTAG# histo not found in folder: " << hname << endmsg; + } + } + } + return h; +} + +} diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibration/share/JetTagCalibrationCondAlg_jobOptions.py b/PhysicsAnalysis/JetTagging/JetTagCalibration/share/JetTagCalibrationCondAlg_jobOptions.py new file mode 100755 index 0000000000000000000000000000000000000000..336d0492ed2b8d5cfa2a7135d261f050aefbe012 --- /dev/null +++ b/PhysicsAnalysis/JetTagging/JetTagCalibration/share/JetTagCalibrationCondAlg_jobOptions.py @@ -0,0 +1,67 @@ +from AthenaCommon.AthenaCommonFlags import athenaCommonFlags +from AthenaCommon.GlobalFlags import globalflags +if globalflags.DataSource()=='data': + BTaggingFlags.CalibrationFolderRoot=BTaggingFlags.CalibrationFolderRoot.replace("/GLOBAL/BTagCalib","/GLOBAL/Onl/BTagCalib") + connSchema="GLOBAL" + message = "#BTAG# accessing online conditions DB" + if not athenaCommonFlags.isOnline(): + message = message + " (via offline replica)" + print message +else: + connSchema="GLOBAL_OFL" + print "#BTAG# accessing offline conditions DB" + +print "#BTAG# running in reco mode -> btag calibration root folder is CalibrationFolderRoot =", BTaggingFlags.CalibrationFolderRoot + +JetCollectionForCalib = [] +JetCollectionForCalib+= BTaggingFlags.Jets +if "AntiKt4EMTopo" not in JetCollectionForCalib: + JetCollectionForCalib+=["AntiKt4EMTopo"] + +print "BTAG channel" +print BTaggingFlags.CalibrationChannelAliases + +#IP2D +grades= [ "0HitIn0HitNInExp2","0HitIn0HitNInExpIn","0HitIn0HitNInExpNIn","0HitIn0HitNIn", + "0HitInExp", "0HitIn", + "0HitNInExp", "0HitNIn", + "InANDNInShared", "PixShared", "SctShared", + "InANDNInSplit", "PixSplit", + "Good"] + +from JetTagCalibration.JetTagCalibrationConf import Analysis__JetTagCalibCondAlg +JetTagCalibrationCondAlg = Analysis__JetTagCalibCondAlg( + name = "JetTagCalibrationCondAlg", + taggers = [], + channels = JetCollectionForCalib, + channelAliases = BTaggingFlags.CalibrationChannelAliases, + IP2D_TrackGradePartitions = grades, + RNNIP_NerworkConfig = BTaggingFlags.RNNIPConfig, + OutputLevel = BTaggingFlags.OutputLevel +) +ToolSvc += JetTagCalibrationCondAlg +theApp.Dlls+=['DetDescrCondExample','DetDescrCondTools'] + +from IOVDbSvc.CondDB import conddb + +# with new scheme, only one actual COOL folder: +folder = BTaggingFlags.CalibrationFolderRoot + 'RUN12' + +if BTaggingFlags.CalibrationFromLocalReplica: + dbname="OFLP200" + #For data, use COMP200 for Run 1, CONDBR2 for Run 2 + if globalflags.DataSource()=='data': + dbname=conddb.dbdata + conddb.addFolder("","<dbConnection>sqlite://X;schema=mycool.db;dbname="+dbname+"</dbConnection> "+folder+" <tag>"+BTaggingFlags.CalibrationTag+"</tag>") +else: + if BTaggingFlags.CalibrationFromCERN: + conddb.addFolder("","<dbConnection>oracle://ATLAS_COOLPROD;schema=ATLAS_COOLOFL_GLOBAL;dbname=OFLP200</dbConnection> "+folder+" <tag>"+BTaggingFlags.CalibrationTag+"</tag>") + else: + if BTaggingFlags.CalibrationTag == "": + conddb.addFolder(connSchema,folder) + else: + conddb.addFolder(connSchema,folder+" <tag>"+BTaggingFlags.CalibrationTag+"</tag>") + +if BTaggingFlags.OutputLevel < 3: + print JetTagCalibrationCondAlg + diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibration/src/CalibrationBroker.cxx b/PhysicsAnalysis/JetTagging/JetTagCalibration/src/CalibrationBroker.cxx index 8190d2c619915fa1ec9578a0be92dd6d91a28474..eddec0b2136dfda4631ccd5456573e71a7a168eb 100755 --- a/PhysicsAnalysis/JetTagging/JetTagCalibration/src/CalibrationBroker.cxx +++ b/PhysicsAnalysis/JetTagging/JetTagCalibration/src/CalibrationBroker.cxx @@ -392,7 +392,12 @@ namespace Analysis { std::string hname = histnames[h]; ATH_MSG_DEBUG( "#BTAG# registrating tagger "<< m_taggers[i] <<" with " << m_channels.size() << " histograms (1 per channel): "); - for(uint j=0;j<m_channels.size();j++) { + for(uint j=0;j<mappedAlias.size();j++) { + std::string fname = this->fullHistoName(mappedAlias[j],hname); + TObject* dummy = nullptr; + m_histos[i].insert(std::make_pair(fname, std::make_pair(dummy,false))); + } + /*for(uint j=0;j<m_channels.size();j++) { if(this->channelAlias(m_channels[j])==m_channels[j]) { // skip aliased channels std::string fname = this->fullHistoName(m_channels[j],hname); TObject* dummy = nullptr; @@ -401,7 +406,7 @@ namespace Analysis { ATH_MSG_DEBUG( "#BTAG# " << m_channels[j] << " is aliased to " << this->channelAlias(m_channels[j]) << " : not registering twice histogram " << hname ); } - } + }*/ } } diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibration/src/JetTagCalibCondAlg.cxx b/PhysicsAnalysis/JetTagging/JetTagCalibration/src/JetTagCalibCondAlg.cxx new file mode 100644 index 0000000000000000000000000000000000000000..ca04fe6cf8dd80982ed9738e77bbe2442352ba11 --- /dev/null +++ b/PhysicsAnalysis/JetTagging/JetTagCalibration/src/JetTagCalibCondAlg.cxx @@ -0,0 +1,917 @@ +/* + * Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + * */ + +#include "JetTagCalibration/JetTagCalibCondAlg.h" + +//#include "JetTagTools/HistoHelperRoot.h" +#include "AthenaPoolUtilities/CondAttrListCollection.h" +#include "PoolSvc/IPoolSvc.h" +#include "FileCatalog/IFileCatalog.h" +#include "TH1.h" +#include "TH2.h" +#include "TObject.h" +#include <TString.h> +#include "TTree.h" + +namespace Analysis { + + /** + @ class JetTagCalibCondAlg + + @author emmanuel.le.guirriec@cern.ch + */ + + + JetTagCalibCondAlg::JetTagCalibCondAlg (const std::string& name, ISvcLocator* pSvcLocator) + : ::AthAlgorithm( name, pSvcLocator ) + , m_condSvc("CondSvc", name) , + m_Likelihood_smoothNTimes(1) , + m_JetFitterNN_calibrationDirectory("JetFitter"), + m_JetFitterNN_calibrationSubDirectory("NeuralNetwork"), + m_JetFitterNN_useCombinedIPNN(false), + m_JetFitterNN_maximumRegisteredLayers(4) + { + declareProperty("taggers", m_taggers); + declareProperty("channels", m_originalChannels); + declareProperty("channelAliases", m_channelAliases); + declareProperty("IPTag_UseCHypo" , m_IPTag_useCHypo = true); + declareProperty("IP2D_TrackGradePartitions", m_IP2D_trackGradePartitions); + declareProperty("SV_useDRJPV", m_useDRJPVSV=true); + declareProperty("SV2_usePt", m_usePtSV2=false); + declareProperty("Likelihood_smoothNTimes",m_Likelihood_smoothNTimes); + declareProperty("Likelihood_vetoSmoothingOf", m_Likelihood_vetoSmoothingOf); + declareProperty("JetFitterNN_CalibrationDirectory",m_JetFitterNN_calibrationDirectory); + declareProperty("JetFitterNN_CalibrationSubDirectory",m_JetFitterNN_calibrationSubDirectory); + declareProperty("JetFitterNN_useCombinedIPNN",m_JetFitterNN_useCombinedIPNN); + declareProperty("JetFitterNN_maximumRegisteredLayers",m_JetFitterNN_maximumRegisteredLayers); + declareProperty("RNNIP_NetworkConfig", m_RNNIP_network_cfg); + m_Likelihood_vetoSmoothingOf.push_back("/N2T"); + m_Likelihood_vetoSmoothingOf.push_back("/N2TEffSV2"); + m_Likelihood_vetoSmoothingOf.push_back("/Sip3D"); + } + + JetTagCalibCondAlg::~JetTagCalibCondAlg() + { + } + + StatusCode JetTagCalibCondAlg::initialize() { + ATH_MSG_DEBUG("initialize " << name()); + + // CondSvc + ATH_CHECK( m_condSvc.retrieve() ); + + // PoolSvc + ATH_CHECK(service("PoolSvc",m_poolsvc)); + + // Condition Handles + ATH_CHECK( m_readKey.initialize() ); + ATH_CHECK( m_writeKey.initialize() ); + + // Register write handle + if (m_condSvc->regHandle(this, m_writeKey).isFailure()) { + ATH_MSG_ERROR("#BTAG# Unable to register WriteCondHandle " << m_writeKey.fullKey() << " with CondSvc"); + return StatusCode::FAILURE; + } + + // Prepare histo maps: + if (m_taggers.size() > 0) { + ATH_MSG_DEBUG( "#BTAG# List of calibrated taggers"); + for(uint i=0;i<m_taggers.size();i++) { + ATH_MSG_DEBUG("#BTAG# Tagger " << m_taggers[i] ); + std::vector<std::string> hvect; + m_taggersHists.push_back(hvect); + } + } + else { + ATH_MSG_ERROR( "#BTAG# No taggers defined"); + } + + // List of channels: + ATH_MSG_DEBUG( "#BTAG# Original channels " ); + + for(uint i=0;i<m_originalChannels.size();i++) { + ATH_MSG_DEBUG("#BTAG# Channel " << m_originalChannels[i] ); + } + + // Decode channel aliases + if (m_channelAliases.size() > 0) { + for(std::vector<std::string>::const_iterator aliasI = m_channelAliases.value().begin(), + aliasE = m_channelAliases.value().end(); + aliasI != aliasE; aliasI++) { + const std::string::size_type delim = aliasI->find("->"); + if(delim == std::string::npos) { + ATH_MSG_ERROR( "#BTAG# Unexpected format in channelAliases: " << (*aliasI)); + } else { + ATH_MSG_DEBUG( "#BTAG# Calibration channel alias: " << aliasI->substr(0, delim) << " -> " + << aliasI->substr(delim+2) ); + std::string jetc= aliasI->substr(0, delim); + std::vector<std::string> jeta = tokenize(aliasI->substr(delim+2), ","); + m_channelAliasesMultiMap.insert(std::make_pair(jetc, jeta) ); + // Add to list of channels to which aliases will be attached + // (necessary because getJetAuthor used in taggers does not use + // jet collection name but standardised info) + if (std::find(m_originalChannels.begin(), m_originalChannels.end(),jetc) + == m_originalChannels.end()) m_originalChannels.push_back(jetc); + } + } + } + else { + ATH_MSG_ERROR( "#BTAG# No channel aliases defined"); + } + + m_directoryMap.clear(); + + //IP2D tagger + if (std::find(m_taggers.begin(), m_taggers.end(), "IP2D") != m_taggers.end()) { + initializeIP2D(); + } + + //IP3D tagger + if (std::find(m_taggers.begin(), m_taggers.end(), "IP3D") != m_taggers.end()) { + initializeIP3D(); + } + + //SV1 tagger + if (std::find(m_taggers.begin(), m_taggers.end(), "SV1") != m_taggers.end()) { + initializeSV1(); + } + + //SV2 tagger + if (std::find(m_taggers.begin(), m_taggers.end(), "SV2") != m_taggers.end()) { + initializeSV2(); + } + + //JetFitterNN tagger + if (std::find(m_taggers.begin(), m_taggers.end(), "JetFitterNN") != m_taggers.end()) { + initializeJetFitterNN(); + } + + + //SoftMu tagger + if (std::find(m_taggers.begin(), m_taggers.end(), "SoftMu") != m_taggers.end()) { + initializeSoftMu(); + } + + //MV2c10 tagger + if (std::find(m_taggers.begin(), m_taggers.end(), "MV2c10") != m_taggers.end()) { + initializeMV2("MV2c10"); + } + + //MV2cl100 tagger + if (std::find(m_taggers.begin(), m_taggers.end(), "MV2cl100") != m_taggers.end()) { + initializeMV2("MV2cl100"); + } + + //MV2c100 tagger + if (std::find(m_taggers.begin(), m_taggers.end(), "MV2c100") != m_taggers.end()) { + initializeMV2("MV2c100"); + } + + //MV2c10mu tagger + if (std::find(m_taggers.begin(), m_taggers.end(), "MV2c10mu") != m_taggers.end()) { + initializeMV2("MV2c10mu"); + } + + //MV2c10rnn tagger + if (std::find(m_taggers.begin(), m_taggers.end(), "MV2c10rnn") != m_taggers.end()) { + initializeMV2("MV2c10rnn"); + } + + //RNNIP tagger + if (std::find(m_taggers.begin(), m_taggers.end(), "RNNIP") != m_taggers.end()) { + initializeRNNIP(); + } + + //JetVertexCharge tagger + if (std::find(m_taggers.begin(), m_taggers.end(), "JetVertexCharge") != m_taggers.end()) { + initializeJetVertexCharge(); + } + + //MultiSV tagger + if (std::find(m_taggers.begin(), m_taggers.end(), "MultiSVbb1") != m_taggers.end()) { + initializeMultiSV("MultiSVbb1"); + } + + //MultiSV tagger + if (std::find(m_taggers.begin(), m_taggers.end(), "MultiSVbb2") != m_taggers.end()) { + initializeMultiSV("MultiSVbb2"); + } + + //Dl1 taggers + if (std::find(m_taggers.begin(), m_taggers.end(), "DL1") != m_taggers.end()) { + initializeDL1("DL1"); + initializeDL1("DL1mu"); + initializeDL1("DL1rnn"); + } + + + return StatusCode::SUCCESS; + } + + + void JetTagCalibCondAlg::initializeIPTag() { + ATH_MSG_DEBUG("initialize IPTag paths of the calibration file"); + m_IPTag_hypotheses.push_back("B"); + m_IPTag_hypotheses.push_back("U"); + if(m_IPTag_useCHypo){ + m_IPTag_hypotheses.push_back("C"); + } + } + + void JetTagCalibCondAlg::initializeIP2D() { + ATH_MSG_DEBUG("initialize IP2D paths of the calibration file"); + + this->initializeIPTag(); + + //check that grades are defined + + //check that hypotheses for likelihood tool are defined + std::string hName; + for(unsigned int i=0;i<m_IP2D_trackGradePartitions.size();i++) { + for(unsigned int ih=0;ih<m_IPTag_hypotheses.size();ih++) { + hName = m_IPTag_hypotheses[ih]+"/"+m_IP2D_trackGradePartitions[i]+"/SipA0"; + registerHistogram("IP2D", hName); + } + } + } + + + void JetTagCalibCondAlg::initializeIP3D() { + ATH_MSG_DEBUG("initialize IP3D paths of the calibration file"); + + this->initializeIPTag(); + + + //check that hypotheses for likelihood tool are defined + std::string hName; + for(unsigned int i=0;i<m_IP2D_trackGradePartitions.size();i++) { + for(unsigned int ih=0;ih<m_IPTag_hypotheses.size();ih++) { + hName = m_IPTag_hypotheses[ih]+"/"+m_IP2D_trackGradePartitions[i]+"/Sip3D"; + registerHistogram("IP3D", hName); + } + } + } + + void JetTagCalibCondAlg::initializeSVEff(std::string SVmode) { + // for SV efficiencies, add a few histograms: + std::string hName; + for(unsigned int ih=0;ih<m_IPTag_hypotheses.size();ih++) { + hName = m_IPTag_hypotheses[ih]+"/N2TEff"+SVmode; + registerHistogram(SVmode, hName); + hName = m_IPTag_hypotheses[ih]+"/N2TNorm"+SVmode; + registerHistogram(SVmode, hName); + } + } + + + void JetTagCalibCondAlg::initializeSV1() { + ATH_MSG_DEBUG("initialize SV1 paths of the calibration file"); + + this->initializeIPTag(); + + std::string hName; + for(unsigned int ih=0;ih<m_IPTag_hypotheses.size();ih++) { + hName = m_IPTag_hypotheses[ih]+"/N2T"; + registerHistogram("SV1", hName); + hName = m_IPTag_hypotheses[ih]+"/BidimME"; + registerHistogram("SV1", hName); + if(m_useDRJPVSV) { + hName = m_IPTag_hypotheses[ih]+"/DRJPVSV"; + registerHistogram("SV1", hName); + } + } + + this->initializeSVEff("SV1"); + } + + void JetTagCalibCondAlg::initializeSV2() { + ATH_MSG_DEBUG("initialize SV2 paths of the calibration file"); + + this->initializeIPTag(); + + std::string hName; + if(m_usePtSV2){ + for(unsigned int ih=0;ih<m_IPTag_hypotheses.size();ih++) { + hName = m_IPTag_hypotheses[ih]+"/TridimMENPt"; + registerHistogram("SV2", hName); + hName = m_IPTag_hypotheses[ih]+"/N2TEffSV2"; + registerHistogram("SV2", hName); + } + }else{ + for(unsigned int ih=0;ih<m_IPTag_hypotheses.size();ih++) { + hName = m_IPTag_hypotheses[ih]+"/TridimMEN2T"; + registerHistogram("SV2", hName); + } + } + + this->initializeSVEff("SV2"); + } + + + void JetTagCalibCondAlg::initializeJetFitterNN() + { + + TString directory(m_JetFitterNN_calibrationSubDirectory); + directory+="/"; + if (m_JetFitterNN_useCombinedIPNN) + { + directory+="comb"; + } + else + { + directory+="standalone"; + } + directory+="/"; + + this->registerHistogram("JetFitterNN", m_JetFitterNN_calibrationDirectory, + std::string((const char*)(directory+"LayersInfo"))); + + Int_t nHidden=m_JetFitterNN_maximumRegisteredLayers-2; + + for (Int_t i=0;i<nHidden+1;++i) + { + + TString weightName("Layer"); + weightName+=i; + weightName+="_weights"; + + TString thresholdName("Layer"); + thresholdName+=i; + thresholdName+="_thresholds"; + + this->registerHistogram("JetFitterNN", m_JetFitterNN_calibrationDirectory, + std::string((const char*)(directory+weightName))); + + this->registerHistogram("JetFitterNN", m_JetFitterNN_calibrationDirectory, + std::string((const char*)(directory+thresholdName))); + } + ATH_MSG_DEBUG(" Registered NN histograms with directory: " << m_JetFitterNN_calibrationDirectory << " and subdirectory " << directory); + + } + + + void JetTagCalibCondAlg::initializeSoftMu() + { + std::string taggerNameBase("SMT"); + std::string treeName("BDT"); + std::string varStrName("variables"); + ATH_MSG_DEBUG("#BTAG# Folder I look into: "<< taggerNameBase+"Calib/"+treeName); + this->registerHistogram("SoftMu", taggerNameBase, taggerNameBase+"Calib/"+treeName); + this->registerHistogram("SoftMu", taggerNameBase, taggerNameBase+"Calib/"+varStrName); + } + + + void JetTagCalibCondAlg::initializeMV2(std::string taggerNameBase) + { + std::string treeName("BDT"); + std::string varStrName("variables"); + ATH_MSG_DEBUG("#BTAG# Folder I look into: "<< taggerNameBase+"Calib/"+treeName); + + this->registerHistogram(taggerNameBase, taggerNameBase+"Calib"); + this->registerHistogram(taggerNameBase, taggerNameBase+"Calib/"+treeName); + this->registerHistogram(taggerNameBase, taggerNameBase+"Calib/"+varStrName); + } + + void JetTagCalibCondAlg::initializeRNNIP() + { + for (const auto& rnn_name_pair: m_RNNIP_network_cfg) { + if (rnn_name_pair.second.size() == 0) { + ATH_MSG_VERBOSE("registering RNN " << rnn_name_pair.first); + this->registerHistogram("RNNIP",rnn_name_pair.first); + ATH_MSG_DEBUG(" #BTAG# Registered NN histograms with directory: " << + "RNNIP"); + } + } + } + + + void JetTagCalibCondAlg::initializeJetVertexCharge() + { + std::string taggerNameBase = "JetVertexCharge"; + //MVA xml files + this->registerHistogram(taggerNameBase, taggerNameBase+"Calib_cat_JC_SVC_noMu"); + this->registerHistogram(taggerNameBase, taggerNameBase+"Calib_cat_JC_SVC_incMu"); + this->registerHistogram(taggerNameBase, taggerNameBase+"Calib_cat_JC_SVC_TVC_noMu"); + this->registerHistogram(taggerNameBase, taggerNameBase+"Calib_cat_JC_SVC_TVC_incMu"); + this->registerHistogram(taggerNameBase, taggerNameBase+"Calib_cat_JC_incMu"); + + //reference histos + this->registerHistogram(taggerNameBase, "jvc_JC_SVC_noMu_b"); + this->registerHistogram(taggerNameBase, "jvc_JC_SVC_noMu_bbar"); + this->registerHistogram(taggerNameBase, "jvc_JC_SVC_incMu_b"); + this->registerHistogram(taggerNameBase, "jvc_JC_SVC_incMu_bbar"); + this->registerHistogram(taggerNameBase, "jvc_JC_SVC_TVC_noMu_b"); + this->registerHistogram(taggerNameBase, "jvc_JC_SVC_TVC_noMu_bbar"); + this->registerHistogram(taggerNameBase, "jvc_JC_SVC_TVC_incMu_b"); + this->registerHistogram(taggerNameBase, "jvc_JC_SVC_TVC_incMu_bbar"); + this->registerHistogram(taggerNameBase, "jvc_JC_incMu_b"); + this->registerHistogram(taggerNameBase, "jvc_JC_incMu_bbar"); + this->registerHistogram(taggerNameBase, "jvc_JC_noMu_b"); + this->registerHistogram(taggerNameBase, "jvc_JC_noMu_bbar"); + this->registerHistogram(taggerNameBase, "jvc_SVC_b"); + this->registerHistogram(taggerNameBase, "jvc_SVC_bbar"); + this->registerHistogram(taggerNameBase, "jvc_JC_all_b"); + this->registerHistogram(taggerNameBase, "jvc_JC_all_bbar"); + } + + void JetTagCalibCondAlg::initializeMultiSV(std::string taggerNameBase) + { + ATH_MSG_DEBUG("#BTAG# taggerNameBase " << taggerNameBase); + std::string treeName = "BDT"; + std::string varStrName = "variables"; + this->registerHistogram(taggerNameBase, taggerNameBase+"Calib"); + this->registerHistogram(taggerNameBase, taggerNameBase+"Calib/"+treeName); + this->registerHistogram(taggerNameBase, taggerNameBase+"Calib/"+varStrName); + } + + void JetTagCalibCondAlg::initializeDL1(std::string taggerNameBase) + { + std::string file_name = "net_configuration"; // directory of NN calibration (starting from specific jet collection directory) in COOL db + this->registerHistogram(taggerNameBase, file_name); //register the calibration file for later access + + ATH_MSG_DEBUG(" #BTAG# Registered NN histograms with directory: " << taggerNameBase); + } + + void JetTagCalibCondAlg::registerHistogram(const std::string& tagger, const std::string& hname) { + std::string dir(tagger); + this->registerHistogram(tagger,dir,hname); + } + + void JetTagCalibCondAlg::registerHistogram(const std::string& tagger, const std::string& directory, const std::string& hname) { + ATH_MSG_DEBUG( "#BTAG# registering histogram " << hname << " in tagger " << tagger ); + m_directoryMap[tagger] = directory; + bool registered = false; + for(uint i=0;i<m_taggers.size();i++) { + if(tagger==m_taggers[i]) { + ATH_MSG_DEBUG( "#BTAG# tagger " << tagger << " found in pos " << i + << " , registrating " << hname ); + + m_taggersHists[i].push_back(hname); + registered = true; + } + } + if(!registered) { + ATH_MSG_DEBUG( "#BTAG# tagger " << tagger << " not found." + << " Registrating of " << hname << " not possible."); + } + } + + + StatusCode JetTagCalibCondAlg::execute() { + ATH_MSG_DEBUG("execute " << name()); + m_mappedAlias.clear(); + + // Read Cond Handle - GUID + SG::ReadCondHandle<CondAttrListCollection> readHandle{m_readKey}; + const CondAttrListCollection* atrcol{*readHandle}; + if(atrcol==nullptr) { + ATH_MSG_ERROR("#BTAG# Cannot retrieve CondAttrListCollection for " << m_readKey.key()); + return StatusCode::FAILURE; + } + + + // Construct the output Cond Object and fill it in + std::unique_ptr<JetTagCalibCondData> writeCdo{std::make_unique<JetTagCalibCondData>()}; + writeCdo->resize(m_taggers); + + // Define validity of the output cond object and record it + EventIDRange rangeW; + if(!readHandle.range(rangeW)) { + ATH_MSG_ERROR("#BTAG# Failed to retrieve validity range for " << readHandle.key()); + return StatusCode::FAILURE; + } + + + unsigned int channel=1; //Always 1 in old version with CoolHistSvc + CondAttrListCollection::const_iterator citr = atrcol->chanAttrListPair(channel); + if (citr==atrcol->end()) { + ATH_MSG_WARNING("#BTAG# Cannot find valid reference for " << readHandle.key() << " channel " << channel); + return StatusCode::FAILURE; + } + + const std::string coolguid=citr->second["fileGUID"].data<std::string>(); + ATH_MSG_DEBUG("#BTAG# Folder key "+ readHandle.key()+" has current file GUID "+coolguid); + + // Open the file + std::string pfname, tech; + m_poolsvc->catalog()->getFirstPFN(coolguid, pfname, tech ); + TFile* pfile = TFile::Open(pfname.c_str(),"READ"); + if (pfile==nullptr || !pfile->IsOpen()) { + delete pfile; + ATH_MSG_WARNING("Problems opening input file "+pfname); + return StatusCode::FAILURE; + } + + StatusCode sc = createHistoMap(pfile, writeCdo.get()); + if(sc != StatusCode::SUCCESS){ + // do nothing for the moment + } + + for(uint i=0;i<m_taggers.size();i++) { + std::string tagger = m_taggers[i]; + + ATH_MSG_DEBUG( "#BTAG# registrating tagger "<< m_taggers[i]); + std::vector<std::string> histnames = m_taggersHists[i]; + for(unsigned int h=0; h<histnames.size(); ++h){ + std::string hname = histnames[h]; + for(uint j=0;j<m_mappedAlias.size();j++) { + std::string fname = writeCdo->fullHistoName(m_mappedAlias[j],hname); + ATH_MSG_DEBUG( "#BTAG# Retrieving " << tagger <<":"<< fname ); + std::string channel = writeCdo->channelName(fname); + std::string hname = writeCdo->histoName(fname); + std::string hFullName(m_directoryMap[tagger]); + hFullName+="/"; hFullName+=channel; + hFullName+="/"; hFullName+=hname; + ATH_MSG_DEBUG( "#BTAG# histo name in physical file= " << hFullName ); + TObject* hPointer = nullptr; + if (getTObject(hFullName, pfile, hPointer)) { + if(hPointer) { + ATH_MSG_DEBUG( "#BTAG# Cached pointer to histogram: " << hPointer); + if (tagger == "IP2D" || tagger == "IP3D" || tagger == "SV1") { + ATH_MSG_VERBOSE("#BTAG# Smoothing histogram " << hname << " ..."); + smoothAndNormalizeHistogram(hPointer, hname); + } + const TString rootClassName=hPointer->ClassName(); + if (rootClassName=="TTree") { + ((TTree*)hPointer)->LoadBaskets(); + ((TTree*)hPointer)->SetDirectory(0); + } + + writeCdo->addHisto(i,fname,hPointer); + } else { + ATH_MSG_ERROR( "#BTAG# Could not cache pointer to histogram " << fname ); + } + } else { + ATH_MSG_WARNING("#BTAG# error: histogram "<<hFullName + <<" does not exist - you are probably using an old database tag"); + } + + } //end loop mapped alias + } //end loop histograms + } //end loop tagger + + // Write Cond Handle + SG::WriteCondHandle<JetTagCalibCondData > histoWriteHandle{m_writeKey}; + if(histoWriteHandle.record(rangeW,std::move(writeCdo)).isFailure()) { + ATH_MSG_ERROR("#BTAG# Could not record vector of histograms maps " << histoWriteHandle.key() + << " with EventRange " << rangeW + << " into Conditions Store"); + return StatusCode::FAILURE; + } + ATH_MSG_INFO("recorded new CDO " << histoWriteHandle.key() << " with range " << rangeW << " into Conditions Store"); + + // close the file + pfile->Close(); + delete pfile; + + return StatusCode::SUCCESS; + } + + StatusCode JetTagCalibCondAlg::createHistoMap(TFile* pfile, JetTagCalibCondData * histosCdo){ + + ATH_MSG_DEBUG("#BTAG# in createHistoMap" ); + std::vector< std::string > channels; + + for(unsigned int j=0; j<m_originalChannels.size(); ++j){ + channels.push_back(m_originalChannels[j]); + } + + std::string folder(m_readKey.key()); + + + for(uint i=0;i<m_taggers.size();++i) { + std::string tagger = m_taggers[i]; + + for(unsigned int j=0; j<m_originalChannels.size(); ++j){ + /// get all aliases + std::map<std::string, std::vector<std::string> >::iterator ialiaslist + = m_channelAliasesMultiMap.find(m_originalChannels[j]); + if(ialiaslist == m_channelAliasesMultiMap.end()){ + ATH_MSG_DEBUG( "#BTAG# no alias for original channel" << m_originalChannels[j] ); + if(!objectTDirExists(tagger+"/"+m_originalChannels[j], pfile)){ + ATH_MSG_WARNING( "#BTAG# no calibration for jet collection " << m_originalChannels[j] + << " consider using aliases " ); + } + continue; + } + std::vector<std::string> aliaslist = ialiaslist->second; + if(aliaslist.size() == 1){ + if("none" == aliaslist[0]){ + ATH_MSG_DEBUG("#BTAG# no alias for original channel" << m_originalChannels[j]); + + if(objectTDirExists(tagger+"/"+m_originalChannels[j], pfile)){ + ATH_MSG_WARNING( "#BTAG# no calibration for jet collection " << m_originalChannels[j] + << " consider using aliases " ); + } + continue; + } + } + + bool foundalias=false; + + for(unsigned int k=0; k<aliaslist.size(); ++k){ + + std::string aliasentry = aliaslist[k]; + if("none" == aliasentry){ + ATH_MSG_DEBUG("#BTAG# first alias entry is none - replace with original channel" + << m_originalChannels[j] ); + aliasentry= m_originalChannels[j]; + } + /// now see if the jet collection exists in db + std::string hFullName(tagger); + hFullName+="/"; hFullName+=aliasentry; + // Check if jet collection already in channel alias map + if (std::count(m_mappedAlias.begin(), m_mappedAlias.end(), aliasentry) > 0) { + ATH_MSG_DEBUG( "#BTAG# found alias entry in Map " << aliasentry ); + histosCdo->addChannelAlias(m_originalChannels[j],aliasentry); + foundalias=true; + break; + } + else { + if (objectTDirExists(hFullName, pfile)) { + ATH_MSG_DEBUG( "#BTAG# found alias entry in DB " << aliasentry ); + if("none"!=aliaslist[k]){ + std::vector<std::string>::const_iterator pos = find(channels.begin(), + channels.end(), aliasentry); + if(pos==channels.end()) { + ATH_MSG_DEBUG("#BTAG# Alias is pointing to undefined channel: " << aliasentry + << ". Adding it to channel list."); + channels.push_back(aliasentry); + } + histosCdo->addChannelAlias(m_originalChannels[j],aliasentry); + m_mappedAlias.push_back(aliasentry); + } + foundalias=true; + break; + } + else{ + ATH_MSG_DEBUG( "#BTAG# no alias entry " << aliasentry + << " trying next alias "); + } + } + } + if(!foundalias){ + ATH_MSG_WARNING( "#BTAG# none of the aliases exist for jet collection " + << m_originalChannels[j]); + } + + } + break ; /// check alias for the first tagger. same jet collections for all taggers for now + + } + + ATH_MSG_DEBUG( "#BTAG# final registered channels " ); + for(uint i=0;i<channels.size();++i) { + ATH_MSG_DEBUG( "#BTAG# Channel " << channels[i] ); + } + + //print alias map + histosCdo->printAliasesStatus(); + + return StatusCode::SUCCESS; + + } + + + + std::vector<std::string> JetTagCalibCondAlg::tokenize(std::string str, std::string delim){ + std::vector<std::string> tokens; + std::string::size_type sPos, sEnd, sLen; + // if str starts with a character in delim, do you want an empty string in tokens? + // sPos = 0; // if answer is yes + sPos = str.find_first_not_of(delim); // if answer is no + while(sPos != std::string::npos){ + sEnd = str.find_first_of(delim, sPos); + if(sEnd == std::string::npos) sEnd = str.length(); + sLen = sEnd - sPos; + std::string token = str.substr(sPos, sLen); + tokens.push_back(token); + sPos = str.find_first_not_of(delim, sEnd); + } + return tokens; + } + + StatusCode JetTagCalibCondAlg::finalize() { + ATH_MSG_DEBUG("finalize " << name()); + return StatusCode::SUCCESS; + } + + StatusCode JetTagCalibCondAlg::objectTDirExists(const std::string& histname, TFile * pfile) const { + + ATH_MSG_DEBUG("#BTAG# in objectTDirExists" ); + + // now read the histogram into memory + ATH_MSG_DEBUG("Getting object "+histname+" from file"); + TObject* hist = nullptr; + pfile->GetObject(histname.c_str(),hist); + if (hist==nullptr) { + ATH_MSG_DEBUG("#BTAG# Could not load TObject " << histname); + return StatusCode::FAILURE; + } + + return StatusCode::SUCCESS; + } + + StatusCode JetTagCalibCondAlg::getTObject(const std::string& histname, TFile * pfile, TObject*& hist) const { + // now read the histogram into memory + ATH_MSG_DEBUG("Getting object "+histname+" from file"); + pfile->GetObject(histname.c_str(),hist); + if (hist==nullptr) { + ATH_MSG_DEBUG("#BTAG# Could not load TObject " << histname); + return StatusCode::FAILURE; + } + else { + // make this histogram unassociated with the TFile, so file can be closed + // only for histogram objects, others do not get associated + // TTrees have special treatment + TH1* ihist=dynamic_cast<TH1*>(hist); + if (ihist!=nullptr) ihist->SetDirectory(0); + // if it is a TDirectory, also need special treatment to unassociate parent + TDirectory* idir=dynamic_cast<TDirectory*>(hist); + if (idir!=nullptr) { + TDirectory* mdir=idir->GetMotherDir(); + if (mdir!=nullptr) { + ATH_MSG_DEBUG("Disconnecting TDirectory "+histname+" from parent"); + mdir->GetList()->Remove(idir); + idir->SetMother(0); + } else { + ATH_MSG_WARNING("Could not get MotherDir for TDirectory "+histname); + } + } + } + + return StatusCode::SUCCESS; + } + + void JetTagCalibCondAlg::smoothAndNormalizeHistogram(TObject*& hist, const std::string& hname) { + //Select small part of NewLikelihoodTool to reproduce CalibrationBroker behaviour (smooth and normalize histogram) + TH1* h = dynamic_cast<TH1*>(hist); + if(h) { + double norm = h->Integral(); + if(norm) { + // check if smoothing of histogram is not vetoed: + bool veto = false; + for(unsigned int iv=0; iv<m_Likelihood_vetoSmoothingOf.size(); iv++) { + if(hname.find(m_Likelihood_vetoSmoothingOf[iv])!=std::string::npos) { + veto = true; + ATH_MSG_VERBOSE("#BTAG# Smoothing of " << hname << " is vetoed !"); + break; + } + } + if(1==h->GetDimension() && m_Likelihood_smoothNTimes) { + if(!veto) { + if(norm>10000)h->Smooth(m_Likelihood_smoothNTimes); + else h->Smooth((int)(m_Likelihood_smoothNTimes*100./sqrt(norm))); + } + } + if(2==h->GetDimension()) { + int m2d=3; + if(!veto) { + TH2 * dc_tmp = dynamic_cast<TH2*>(h); + if (dc_tmp) { + this->smoothASH2D(dc_tmp, m2d, m2d); + } + } + } + if(3==h->GetDimension()) { + ATH_MSG_WARNING("#BTAG# Code needs to be migrated from NewLikelihoodTool"); + } + // normalize: + norm = h->Integral(); + h->Scale(1./norm); + } else { + ATH_MSG_DEBUG("#BTAG# Histo "<<h<<" is empty!"); + } + } + } + +void JetTagCalibCondAlg::smoothASH2D(TH2* input2D, int m1, int m2) { + + ATH_MSG_DEBUG("Smoothing a two dimensional histogram "<< input2D->GetName() + << " " << m1 << " " << m2); + ATH_MSG_DEBUG("First (1-3, 1-3) 3x3 bins before smoothing: "); + for(int i=1;i<4;i++) { + for(int j=1;j<4;j++) { + ATH_MSG_DEBUG(i<<" "<<j<<" : "<<input2D->GetBinContent(i,j)<< " / "); + } + } + int ioffset = input2D->GetNbinsX() / 2 ; + int joffset = input2D->GetNbinsY() / 2 ; + ATH_MSG_DEBUG("Middle (" << ioffset+1 << "-" << ioffset+4 << ", (" + << joffset+1 << "-" << joffset+4 << ") 3x3 bins before smoothing: "); + for(int i=1;i<4;i++) { + for(int j=1;j<4;j++) { + ATH_MSG_DEBUG(i<<" "<<j<<" : "<<input2D->GetBinContent(i+ioffset,j+joffset)<< " / "); + } + } + + // + const int lsup = 20; + if (m1 > lsup || m2 > lsup) { + ATH_MSG_DEBUG("HistoHelperRoot::smoothASH2D: m1 or m2 too big !"); + return; + } else { + int nx = input2D->GetNbinsX()+1; + int ny = input2D->GetNbinsY()+1; + float **h, **res; + h = new float*[nx-1]; + res = new float*[nx-1]; + for (int i = 0;i < nx-1;i++) { + h[i] = new float[ny-1]; + res[i] = new float[ny-1]; + } + for (int iy = 1;iy<ny;iy++) { + for (int ix = 1;ix<nx;ix++) { + h[ix-1][iy-1] = (float) input2D->GetBinContent(ix,iy); + } + } + // + int i,j,k,l; + float wk1[41],wk2[41],wgt[100][100]; + double wk[41][41],wks = 0.; + float ai,am1 = float(m1), am2 = float(m2); + const float am12 = am1*am1, am22 = am2*am2; + const float inv_am1_am2 = 1. / (am1 * am2); + const float inv_am12 = 1. / am12; + const float inv_am22 = 1. / am22; + // Initialisation + for (k = 0;k<nx-1;k++) { + for (l = 0;l<ny-1;l++) { + res[k][l] = 0.; wgt[k][l] = 0.; + } + } + // Weights + for (i = lsup+1-m1;i<lsup+m1;i++) { + ai = float(i-lsup)*float(i-lsup); + wk1[i] = 15./16.*(1.-ai*inv_am12)*(1.-ai*inv_am12); + wks = wks + wk1[i]; + } + const double fac1 = am1 / wks; + for (i = lsup+1-m1;i<lsup+m1;i++) { + wk1[i] = wk1[i]*fac1; + } + wks = 0.; + for (i = lsup+1-m2;i<lsup+m2;i++) { + ai = float(i-lsup)*float(i-lsup); + wk2[i] = 15./16.*(1.-ai*inv_am22)*(1.-ai*inv_am22); + wks = wks + wk2[i]; + } + const double fac2 = am2 / wks; + for (i = lsup+1-m2;i<lsup+m2;i++) { + wk2[i] = wk2[i]*fac2; + } + for (i = lsup+1-m1;i<lsup+m1;i++) { + for (j = lsup+1-m2;j<lsup+m2;j++) { + wk[i][j] = wk1[i]*wk2[j]; + } + } + // + for (k = 0;k<nx-1;k++) { + for (l = 0;l<ny-1;l++) { + for (i = std::max(0,k-m1+1);i<std::min(nx-1,k+m1);i++) { + for (j = std::max(0,l-m2+1);j<std::min(ny-1,l+m2);j++) { + res[i][j] = res[i][j] + wk[lsup+i-k][lsup+j-l]*h[k][l]; + wgt[i][j] = wgt[i][j] + wk[lsup+i-k][lsup+j-l]; + } + } + } + } + for (k = 0;k<nx-1;k++) { + for (l = 0;l<ny-1;l++) { + res[k][l] = res[k][l]*inv_am1_am2; + if (wgt[k][l] != 0.) {res[k][l] = res[k][l]/wgt[k][l];} + } + } + // replace the histo content with the result of smoothing: + input2D->Reset(); + for (int iy = 1;iy<ny;iy++) { + for (int ix = 1;ix<nx;ix++) { + input2D->SetBinContent(ix,iy,res[ix-1][iy-1]); + } + } + for (i = 0; i < nx-1; i++){ + delete[] h[i]; + delete[] res[i]; + } + delete[] h; + delete[] res; + } + ATH_MSG_DEBUG("First (1-3, 1-3) 3x3 bins after smoothing: "); + for(int i=1;i<4;i++) { + for(int j=1;j<4;j++) { + ATH_MSG_DEBUG(i<<" "<<j<<" : "<<input2D->GetBinContent(i,j)<< " / "); + } + } + ioffset = input2D->GetNbinsX() / 2 ; + joffset = input2D->GetNbinsY() / 2 ; + ATH_MSG_DEBUG("Middle (" << ioffset+1 << "-" << ioffset+4 << ", (" + << joffset+1 << "-" << joffset+4 << ") 3x3 bins after smoothing: "); + for(int i=1;i<4;i++) { + for(int j=1;j<4;j++) { + ATH_MSG_DEBUG(i<<" "<<j<<" : "<<input2D->GetBinContent(i+ioffset,j+joffset)<< " / "); + } + } +} + +} diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibration/src/JetTagCalibCondData.cxx b/PhysicsAnalysis/JetTagging/JetTagCalibration/src/JetTagCalibCondData.cxx new file mode 100644 index 0000000000000000000000000000000000000000..13796054ce51be6d6021843356b425a91afca3b4 --- /dev/null +++ b/PhysicsAnalysis/JetTagging/JetTagCalibration/src/JetTagCalibCondData.cxx @@ -0,0 +1,134 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#include "JetTagCalibration/JetTagCalibCondData.h" +// Gaudi includes +#include "GaudiKernel/MsgStream.h" +#include "AthenaKernel/getMessageSvc.h" + +#include "TObject.h" +#include "TH1.h" +#include "TTree.h" + +/** + * @file JetTagCalibCondData.cxx + * @author emmanuel.le.guirriec@cern.ch +**/ + + +namespace Analysis { + +JetTagCalibCondData::JetTagCalibCondData() + { + MsgStream log(Athena::getMessageSvc(), "JetTagCalibCondData"); + log << MSG::DEBUG << "#BTAG# addChannelAlias : map size" << m_channelAliasesMap.size() << endmsg; + m_channelAliasesMap.clear(); + } + + +void JetTagCalibCondData::resize(const std::vector<std::string> taggers) { + m_histos.reserve(taggers.size()); + for(uint i=0;i<taggers.size();i++) { + m_taggers.push_back(taggers[i]); + std::map<std::string, TObject* > hmap; + m_histos.push_back(hmap); + } +} + +void JetTagCalibCondData::clear() { + m_channelAliasesMap.clear(); +} + +void JetTagCalibCondData::addHisto(const unsigned int indexTagger, const std::string& name, TObject * obj) { + m_histos[indexTagger].insert(std::make_pair(name, obj)); +} + +void JetTagCalibCondData::addChannelAlias(const std::string& channel, const std::string& alias) { + MsgStream log(Athena::getMessageSvc(), "JetTagCalibCondData"); + log << MSG::DEBUG << "#BTAG# addChannelAlias : map size" << m_channelAliasesMap.size() << endmsg; + log << MSG::DEBUG << "#BTAG# addChannelAlias : " << channel << " : " << alias << endmsg; + std::pair<std::string,std::string> chan = std::make_pair(channel,alias); + m_channelAliasesMap.insert(chan); +} + +std::string JetTagCalibCondData::getChannelAlias(const std::string& originalChannel) const { + std::string alias = originalChannel; + std::map< std::string, std::string>::const_iterator pos; + pos = m_channelAliasesMap.find(originalChannel); + if (pos != m_channelAliasesMap.end()) alias = pos->second; + return alias; +} + +void JetTagCalibCondData::printAliasesStatus() const { + MsgStream log(Athena::getMessageSvc(), "JetTagCalibCondData"); + log << MSG::DEBUG << "#BTAG# final registered aliases "; + std::map<std::string,std::string>::const_iterator iter = m_channelAliasesMap.begin(); + for(;iter!=m_channelAliasesMap.end();++iter) { + log << MSG::DEBUG << "#BTAG# Channel alias " << iter->first <<"->"<<iter->second; + } + log << endmsg; +} + + +void JetTagCalibCondData::printHistosStatus() const { + MsgStream log(Athena::getMessageSvc(), "JetTagCalibCondData"); + log << MSG::DEBUG << "#BTAG# histograms retrieved from DB" << endmsg; + std::map<std::string, TObject*>::const_iterator iter_hist; + for(unsigned int i=0;i<m_histos.size();i++) { + iter_hist = m_histos[i].begin(); + for(;iter_hist!=m_histos[i].end();++iter_hist) { + log << MSG::DEBUG << "#BTAG# histogram name: "<< iter_hist->first << endmsg; + } + } +} + +TH1* JetTagCalibCondData::retrieveHistogram(const std::string& folder, const std::string& channel, const std::string& hname) const { + return this->retrieveTObject<TH1>(folder,channel,hname); +} + + + +std::vector<std::string> JetTagCalibCondData::tokenize(std::string str, std::string delim){ + std::vector<std::string> tokens; + std::string::size_type sPos, sEnd, sLen; + // if str starts with a character in delim, do you want an empty string in tokens? + // sPos = 0; // if answer is yes + sPos = str.find_first_not_of(delim); // if answer is no + while(sPos != std::string::npos){ + sEnd = str.find_first_of(delim, sPos); + if(sEnd == std::string::npos) sEnd = str.length(); + sLen = sEnd - sPos; + std::string token = str.substr(sPos, sLen); + tokens.push_back(token); + sPos = str.find_first_not_of(delim, sEnd); + } + return tokens; +} + +std::string JetTagCalibCondData::channelName(const std::string& fname) const { + const std::string delim("#"); + std::string::size_type sPos; + sPos = fname.find_first_of(delim); + std::string channel = fname.substr(0,sPos); + return channel; +} + +std::string JetTagCalibCondData::histoName(const std::string& fname) const { + const std::string delim("#"); + std::string::size_type sPos; + sPos = fname.find_first_of(delim); + std::string hname = fname.substr(sPos+1); + return hname; +} + +std::string JetTagCalibCondData::fullHistoName(const std::string& channel, const std::string& histoName) const { + std::string fname = channel + "#" + histoName; + return fname; +} + +} + + + + diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibration/src/components/JetTagCalibration_entries.cxx b/PhysicsAnalysis/JetTagging/JetTagCalibration/src/components/JetTagCalibration_entries.cxx index a0c82aa9df9a52986e32cffa083a1e60e59fe39a..7dc7daebeaab534991d06ea2bc6059d34e7e2107 100644 --- a/PhysicsAnalysis/JetTagging/JetTagCalibration/src/components/JetTagCalibration_entries.cxx +++ b/PhysicsAnalysis/JetTagging/JetTagCalibration/src/components/JetTagCalibration_entries.cxx @@ -1,6 +1,6 @@ #include "JetTagCalibration/CalibrationBroker.h" - +#include "JetTagCalibration/JetTagCalibCondAlg.h" using namespace Analysis ; -DECLARE_COMPONENT( Analysis::CalibrationBroker ) - +DECLARE_COMPONENT( CalibrationBroker ) +DECLARE_COMPONENT( JetTagCalibCondAlg ) diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibration/src/components/JetTagCalibration_load.cxx b/PhysicsAnalysis/JetTagging/JetTagCalibration/src/components/JetTagCalibration_load.cxx new file mode 100644 index 0000000000000000000000000000000000000000..0110b7f79b19cbec2d273b518f8910f16e4136f7 --- /dev/null +++ b/PhysicsAnalysis/JetTagging/JetTagCalibration/src/components/JetTagCalibration_load.cxx @@ -0,0 +1,3 @@ +#include "GaudiKernel/LoadFactoryEntries.h" + +LOAD_FACTORY_ENTRIES( JetTagCalibCondAlg ) diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/DL1Tag.h b/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/DL1Tag.h index 20dccc1eae9851fb8e6e66a466b289c774bfd564..91087e38acf1f09a3db521081a0c2140f37d2091 100644 --- a/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/DL1Tag.h +++ b/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/DL1Tag.h @@ -17,6 +17,7 @@ #include "AthenaBaseComps/AthAlgTool.h" #include "JetTagTools/NNLayerConfig.h" #include "JetTagTools/IMultivariateJetTagger.h" +#include "JetTagCalibration/JetTagCalibCondData.h" #include <vector> #include <istream> @@ -26,10 +27,6 @@ namespace xAOD { typedef Vertex_v1 Vertex; } -namespace Analysis { - class CalibrationBroker; -} - namespace lwt { class LightweightNeuralNetwork; } @@ -57,8 +54,8 @@ namespace Analysis { typedef std::map<std::string, std::vector<lwt::Input> > map_var; typedef std::map<std::string, lwt::LightweightNeuralNetwork*> nn_map; - // load the calibration file from the COOL db - void load_calibration_file(); + /** Key of calibration data: */ + SG::ReadCondHandleKey<JetTagCalibCondData> m_readKey{this, "HistosKey", "JetTagCalibHistosKey", "Key of input (derived) JetTag calibration data"}; void cache_calibration(const std::string& jetauthor); std::string get_calib_string(std::string jetauthor); @@ -67,7 +64,6 @@ namespace Analysis { std::string m_calibrationDirectory; std::string m_calibrationSubDirectory; - ToolHandle<CalibrationBroker> m_calibrationTool; // pointer to calibration in COOL std::string m_xAODBaseName; bool m_forceDL1CalibrationAlias; std::string m_DL1CalibAlias; diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/HistoHelperRoot.h b/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/HistoHelperRoot.h index a44dff8d7cff7a9d3474342642823b20bcb13ede..e8d2a40f5a3c14cc9c1a15e37e3a9091f4d0c7e5 100644 --- a/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/HistoHelperRoot.h +++ b/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/HistoHelperRoot.h @@ -46,10 +46,7 @@ class HistoHelperRoot TH1* getHisto1D(const std::string& histoName); TH2* getHisto2D(const std::string& histoName); TH3* getHisto3D(const std::string& histoName); - void normalizeHistos(); - void normalizeHistos(const std::string); - void smoothHistos(const std::string); - // + // Interpolating static double Interpol1d(double, TH1*); static double Interpol2d(double, double, TH2*); diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/JetFitterNNTool.h b/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/JetFitterNNTool.h index 44179062a4199a4d06608fd76f97dc5da4fa3b6d..008a1c52f2bc32d564bced120491b47d9fd5451a 100644 --- a/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/JetFitterNNTool.h +++ b/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/JetFitterNNTool.h @@ -21,6 +21,7 @@ #include "JetTagTools/IJetFitterClassifierTool.h" #include "xAODBTagging/BTagging.h" +#include "JetTagCalibration/JetTagCalibCondData.h" #include <vector> #include <string> #include <map> @@ -41,8 +42,6 @@ namespace Analysis { class IJetFitterTagInfo; -class CalibrationBroker; - static const InterfaceID IID_JetFitterNNTool("Analysis::JetFitterNNTool", 1, 0); @@ -73,8 +72,6 @@ static const InterfaceID IID_JetFitterNNTool("Analysis::JetFitterNNTool", 1, 0); void loadCalibration(const std::string & jetauthor); - void initializeCalibrationFile(); - std::map<std::string,TTrainedNetwork*> m_NN; std::string m_calibrationDirectory; @@ -85,7 +82,8 @@ static const InterfaceID IID_JetFitterNNTool("Analysis::JetFitterNNTool", 1, 0); bool m_useCombinedIPNN; - ToolHandle<CalibrationBroker> m_calibrationTool; + /** Key of calibration data: */ + SG::ReadCondHandleKey<JetTagCalibCondData> m_readKey{this, "HistosKey", "JetTagCalibHistosKey", "Key of input (derived) JetTag calibration data"}; int m_maximumRegisteredLayers; bool m_usePtCorrectedMass; diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/JetVertexCharge.h b/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/JetVertexCharge.h index 99ad071ed6ea8f32451fbbaa996b56d84d7b26c4..8b664d68e86d772cc52cb13c76c18321dc4f46d3 100644 --- a/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/JetVertexCharge.h +++ b/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/JetVertexCharge.h @@ -21,6 +21,7 @@ #include "GaudiKernel/ToolHandle.h" #include "JetTagTools/ITagTool.h" +#include "JetTagCalibration/JetTagCalibCondData.h" #include "xAODTracking/TrackParticle.h" @@ -66,7 +67,8 @@ namespace Analysis { // data members //------------------------------------------------------------------------ - ToolHandle<CalibrationBroker> m_calibrationTool; + /** Key of calibration data: */ + SG::ReadCondHandleKey<JetTagCalibCondData> m_readKey{this, "HistosKey", "JetTagCalibHistosKey", "Key of input (derived) JetTag calibration data"}; ToolHandle<CP::IMuonSelectionTool> m_muonSelectorTool; ToolHandle<CP::IMuonCalibrationAndSmearingTool> m_muonCorrectionTool; const xAOD::Vertex *m_primVtx = 0; @@ -165,7 +167,7 @@ namespace Analysis { bool passTrackCuts( const xAOD::TrackParticle &track ) const; int category(); - float logLikelihoodRatio( int cat , float w, std::string author, std::string alias); + float logLikelihoodRatio( int cat , float w, std::string author); StatusCode SetupReaders( std::string author, std::string alias , int mvaCat, TList* list); void PrintVariables(); diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/MV2Tag.h b/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/MV2Tag.h index 15ab405546563653f1f3c18f4417247c1178cc66..a02927dbedb451b7c52c2127cd4fba75ae4a0593 100644 --- a/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/MV2Tag.h +++ b/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/MV2Tag.h @@ -14,22 +14,11 @@ #include "AthenaBaseComps/AthAlgTool.h" #include "JetTagTools/IMultivariateJetTagger.h" -//#include "GaudiKernel/ToolHandle.h" -//#include "JetTagTools/ITagTool.h" #include <string> #include <map> #include <list> -#include "egammaMVACalib/egammaMVACalib.h" #include "MVAUtils/BDT.h" - -#include "TMVA/MethodBase.h" -#include "TMVA/IMethod.h" - -namespace TMVA { class Reader; } - -namespace Analysis { - class CalibrationBroker; -} +#include "JetTagCalibration/JetTagCalibCondData.h" namespace Analysis { @@ -48,7 +37,6 @@ namespace Analysis { StatusCode finalize(); void finalizeHistos() {}; - //StatusCode tagJet(xAOD::Jet& jetToTag, xAOD::BTagging* BTag); void assignProbability(xAOD::BTagging* BTag, const std::map<std::string,double>& inputs, const std::string& jetauthor); private: @@ -58,11 +46,9 @@ namespace Analysis { std::string m_treeName; std::string m_varStrName; - /** pointer to calibration in COOL: */ - ToolHandle<CalibrationBroker> m_calibrationTool; + /** Key of calibration data: */ + SG::ReadCondHandleKey<JetTagCalibCondData> m_readKey{this, "HistosKey", "JetTagCalibHistosKey", "Key of input (derived) JetTag calibration data"}; bool m_forceMV2CalibrationAlias; - bool m_useEgammaMethodMV2; - //bool m_decorateBTaggingObj; std::string m_decTagName; std::string m_MV2CalibAlias; std::string m_MV2cXX; @@ -88,10 +74,7 @@ namespace Analysis { // points to something in storegate) //const xAOD::Vertex* m_priVtx; - /** reader to define the TMVA algorithms */ - - std::map<std::string, TMVA::Reader*> m_tmvaReaders; - std::map<std::string, TMVA::MethodBase*> m_tmvaMethod; + /** reader to define the MVA algorithms */ std::map<std::string, MVAUtils::BDT*> m_egammaBDTs; std::list<std::string> m_undefinedReaders; // keep track of undefined readers to prevent too many warnings. @@ -112,7 +95,7 @@ namespace Analysis { //void PrintInputs(); void CreateLocalVariables(std::map<std::string, double> var_map); void ReplaceNaN_andAssign(std::map<std::string, double> var_map); - void SetVariableRefs(const std::vector<std::string> inputVars, TMVA::Reader* tmvaReader, + void SetVariableRefs(const std::vector<std::string> inputVars, unsigned &nConfgVar, bool &badVariableFound, std::vector<float*> &inputPointers); std::vector<float> GetMulticlassResponse(MVAUtils::BDT* bdt) const { diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/MultiSVTag.h b/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/MultiSVTag.h index fa528bc9e5128be0867ab06f53edf26ef65a879e..ee4e4b2ad616ec400989cf53657ae2f7d30d9969 100644 --- a/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/MultiSVTag.h +++ b/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/MultiSVTag.h @@ -12,6 +12,7 @@ #include "AthenaBaseComps/AthAlgTool.h" #include "GaudiKernel/ToolHandle.h" #include "JetTagTools/ITagTool.h" +#include "JetTagCalibration/JetTagCalibCondData.h" #include "GeoPrimitives/GeoPrimitives.h" #include "xAODTracking/TrackParticle.h" #include "xAODTracking/TrackParticleContainer.h" @@ -19,17 +20,7 @@ #include <vector> #include <map> #include <list> -#include "egammaMVACalib/egammaMVACalib.h" #include "MVAUtils/BDT.h" -#include "TMVA/IMethod.h" -#include "TMVA/MethodBase.h" -namespace TMVA { class Reader; } -namespace Analysis { class CalibrationBroker; } - -//namespace xAOD { class TrackParticle; class TrackParticleContainer; } -//namespace Trk { class VxCandidate; class RecVertex;} -//class Jet; -//class StoreGateSvc; namespace Analysis { @@ -53,7 +44,8 @@ namespace Analysis std::string m_treeName; std::string m_varStrName; - ToolHandle<CalibrationBroker> m_calibrationTool; + /** Key of calibration data: */ + SG::ReadCondHandleKey<JetTagCalibCondData> m_readKey{this, "HistosKey", "JetTagCalibHistosKey", "Key of input (derived) JetTag calibration data"}; std::string m_MultiSV; // std::string m_runModus; @@ -62,7 +54,6 @@ namespace Analysis bool m_disableAlgo; int m_warnCounter; - bool m_useEgammaMethodMultiSV; std::vector<std::string> m_jetCollectionList; std::vector<std::string> m_hypotheses; @@ -97,14 +88,12 @@ namespace Analysis float m_mx12_DR ; float m_mx12_Angle; //... - std::map<std::string, TMVA::Reader*> m_tmvaReaders; - std::map<std::string, TMVA::MethodBase*> m_tmvaMethod; std::map<std::string, MVAUtils::BDT*> m_egammaBDTs; std::list<std::string> m_undefinedReaders; std::string m_sv0_infosource; std::string m_sv1_infosource; - void SetVariableRefs(const std::vector<std::string> inputVars, TMVA::Reader* tmvaReader, + void SetVariableRefs(const std::vector<std::string> inputVars, unsigned &nConfgVar, bool &badVariableFound, std::vector<float*> &inputPointers); double GetClassResponse (MVAUtils::BDT* bdt) const { return (bdt->GetPointers().size() ? bdt->GetGradBoostMVA(bdt->GetPointers()) : -9.); } }; // End class diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/MultivariateTagManager.h b/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/MultivariateTagManager.h index ceb159cc7ac076adc1ee81c8d4515c509b4e6ece..2478d1d08502848d87969d79f15c485cb4402868 100644 --- a/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/MultivariateTagManager.h +++ b/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/MultivariateTagManager.h @@ -15,18 +15,12 @@ @authors Dan Guest, Marie Lanfermann ********************************************************/ -// #include "xAODBTagging/BTagging.h" -// #include "GaudiKernel/ToolHandle.h" -// #include "AthenaBaseComps/AthAlgTool.h" +#include "AthenaBaseComps/AthAlgTool.h" #include "JetTagTools/ITagTool.h" #include "JetTagTools/IMultivariateJetTagger.h" #include <vector> -namespace Analysis { - class CalibrationBroker; -} - namespace Analysis { class IMultivariateJetTagger; diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/NewLikelihoodTool.h b/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/NewLikelihoodTool.h index 50c3e60a79941d96181fb8e599f6e6223cac1270..f8675f310af3539d2c06d323f805318ba81b61ce 100644 --- a/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/NewLikelihoodTool.h +++ b/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/NewLikelihoodTool.h @@ -13,6 +13,7 @@ #include "AthenaBaseComps/AthAlgTool.h" #include "GaudiKernel/ToolHandle.h" #include "JetTagTools/LikelihoodComponents.h" +#include "JetTagCalibration/JetTagCalibCondData.h" #include <string> #include <vector> @@ -20,8 +21,6 @@ class TH1; namespace Analysis { -class CalibrationBroker; - static const InterfaceID IID_NewLikelihoodTool("Analysis::NewLikelihoodTool", 1, 0); class NewLikelihoodTool : public AthAlgTool { @@ -60,8 +59,9 @@ class NewLikelihoodTool : public AthAlgTool { std::string m_taggerName; // tagger this tool refers to std::vector<std::string> m_hypotheses; // likelihood hypotheses: usually B or U - /** Pointer to the calibration tool: */ - ToolHandle<CalibrationBroker> m_calibrationTool; + + /** Key of calibration data: */ + SG::ReadCondHandleKey<JetTagCalibCondData> m_readKey{this, "HistosKey", "JetTagCalibHistosKey", "Key of input (derived) JetTag calibration data"}; /** Treatment of histograms: */ bool m_normalizedProb; diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/RNNIPTag.h b/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/RNNIPTag.h index 58ff7d0a53469a4adca47414df9caf54bf481aef..db67066d5dcc63a283451db77370dd1bdd7b9c93 100644 --- a/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/RNNIPTag.h +++ b/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/RNNIPTag.h @@ -14,6 +14,7 @@ #include "AthenaBaseComps/AthAlgTool.h" #include "GaudiKernel/ToolHandle.h" #include "JetTagTools/ITagTool.h" +#include "JetTagCalibration/JetTagCalibCondData.h" #include "xAODTracking/TrackParticleContainerFwd.h" @@ -44,7 +45,6 @@ namespace Analysis { class TrackGradePartition; class SVForIPTool; class ITrackGradeFactory; - class CalibrationBroker; // track struct, and sorting functions struct IPxDInfo; @@ -117,6 +117,8 @@ namespace Analysis { /** Name of the track-to-jet association in the BTagging object */ std::string m_trackAssociationName; + /** Key of calibration data: */ + SG::ReadCondHandleKey<JetTagCalibCondData> m_readKey{this, "HistosKey", "JetTagCalibHistosKey", "Key of input (derived) JetTag calibration data"}; /** forcing the calibration folder of a given collection */ std::string m_ForcedCalibName; @@ -145,12 +147,11 @@ namespace Analysis { // load the calibration file from the COOL db void update_networks_for(const std::string& author); - void register_hist(const std::string& name = "/rnnip"); + //void register_hist(const std::string& name = "/rnnip"); std::string get_calib_string( const std::string& author, const std::string& name = "/rnnip"); std::string m_calibrationDirectory; - ToolHandle<CalibrationBroker> m_calibrationTool; /** names of fools for getting the secondary vertex information */ std::string m_secVxFinderNameForV0Removal; diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/SoftMuonTag.h b/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/SoftMuonTag.h index 61d9805e88e276c072beffb71ce8d9607357ed24..189876f8a26ceb0bdd2825d6b4b4b5a6388a365b 100644 --- a/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/SoftMuonTag.h +++ b/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/SoftMuonTag.h @@ -20,12 +20,9 @@ #include <list> #include "JetTagTools/ITagTool.h" #include "xAODTracking/TrackParticle.h" -#include "egammaMVACalib/egammaMVACalib.h" #include "MVAUtils/BDT.h" #include "StoreGate/ReadHandleKey.h" - -#include "TMVA/MethodBase.h" -#include "TMVA/IMethod.h" +#include "JetTagCalibration/JetTagCalibCondData.h" #include "JetTagTools/IMultivariateJetTagger.h" @@ -42,12 +39,9 @@ namespace CP { class IMuonSelectionTool; } namespace Analysis { - class SoftMuonInfo; class NewLikelihoodTool; - // class LikelihoodMultiDTool; class HistoHelperRoot; - class CalibrationBroker; class SoftMuonTag : public AthAlgTool, virtual public ITagTool { @@ -78,8 +72,8 @@ namespace Analysis std::string m_treeName; std::string m_varStrName; - /** pointer to calibration in COOL: */ - ToolHandle<CalibrationBroker> m_calibrationTool; + /** Key of calibration data: */ + SG::ReadCondHandleKey<JetTagCalibCondData> m_readKey{this, "HistosKey", "JetTagCalibHistosKey", "Key of input (derived) JetTag calibration data"}; bool m_forceMV2CalibrationAlias; bool m_useEgammaMethodMV2; //bool m_decorateBTaggingObj; @@ -88,8 +82,6 @@ namespace Analysis std::string m_MV2cXX; std::string m_xAODBaseName; - std::map<std::string, TMVA::Reader*> m_tmvaReaders; - std::map<std::string, TMVA::MethodBase*> m_tmvaMethod; std::map<std::string, MVAUtils::BDT*> m_egammaBDTs; std::list<std::string> m_undefinedReaders; // keep track of undefined readers to prevent too many warnings. @@ -186,10 +178,8 @@ namespace Analysis bool m_writeInfoPlus; std::string m_originalMuCollectionName; std::string m_muonAssociationName; - //const MuonContainer* m_originalMuCollection; void ReplaceNaN_andAssign(std::map<std::string, double> var_map); - //void SetVariableRefs(const std::vector<std::string> inputVars, TMVA::Reader* tmvaReader, void SetVariableRefs(const std::vector<std::string> inputVars, unsigned &nConfgVar, bool &badVariableFound, std::vector<float*> &inputPointers); void ClearInputs(); diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/src/DL1Tag.cxx b/PhysicsAnalysis/JetTagging/JetTagTools/src/DL1Tag.cxx index 907bd5c8885af565acdfa6c9b9a9643c3cef4b49..e2073d9b0db9fbcf8b14f3e44b9fbd0524fd5dfe 100644 --- a/PhysicsAnalysis/JetTagging/JetTagTools/src/DL1Tag.cxx +++ b/PhysicsAnalysis/JetTagging/JetTagTools/src/DL1Tag.cxx @@ -20,7 +20,6 @@ #include "GaudiKernel/IToolSvc.h" #include "xAODTracking/TrackParticle.h" -#include "JetTagCalibration/CalibrationBroker.h" #include "JetTagTools/DL1Tag.h" #include "JetTagTools/LightweightNeuralNetwork.h" #include "JetTagTools/parse_json.h" @@ -57,8 +56,6 @@ namespace Analysis { DL1Tag::DL1Tag(const std::string& name, const std::string& n, const IInterface* p): AthAlgTool(name, n,p), m_calibrationDirectory("DL1"), - m_calibrationSubDirectory("AntiKt4TopoEM"), - m_calibrationTool("BTagCalibrationBroker"), m_n_compute_errors(0), m_runModus("analysis") { @@ -67,8 +64,6 @@ namespace Analysis { // access to JSON NN configuration file from COOL: declareProperty("calibration_directory", m_calibrationDirectory); - declareProperty("calibration_subdirectory", m_calibrationSubDirectory); - declareProperty("calibrationTool", m_calibrationTool); declareProperty("forceDL1CalibrationAlias", m_forceDL1CalibrationAlias = true); declareProperty("DL1CalibAlias", m_DL1CalibAlias = "AntiKt4TopoEM"); declareProperty("xAODBaseName", m_xAODBaseName); @@ -86,23 +81,15 @@ namespace Analysis { } StatusCode DL1Tag::initialize() { - // prepare calibraiton tool - StatusCode sc = m_calibrationTool.retrieve(); - if ( sc.isFailure() ) { - ATH_MSG_FATAL( "#BTAG# Failed to retrieve tool " << m_calibrationTool ); - return sc; - } - else { - ATH_MSG_INFO( "#BTAG# Retrieved: " << m_calibrationTool ); - } + // prepare readKey for calibration data: + ATH_CHECK(m_readKey.initialize()); // Read in the configuration of the neural net for DL1: if (m_LocalNNConfigFile.size() != 0) { // retrieve map of NN config and default values from local JSON file std::ifstream nn_config_ifstream(m_LocalNNConfigFile); build_nn("local", nn_config_ifstream); } - else { // load the configuration from the COOL db: - load_calibration_file(); + else { // done in condition algorithm } ATH_MSG_INFO(" Initialization of DL1Tag successful" ); @@ -110,18 +97,6 @@ namespace Analysis { } - void DL1Tag::load_calibration_file() { - std::string file_name = "/net_configuration"; // directory of NN calibration (starting from specific jet collection directory) in COOL db - m_calibrationTool->registerHistogram(m_calibrationDirectory, file_name); //register the calibration file for later access - - ATH_MSG_DEBUG(" #BTAG# Registered NN histograms with directory: " << - m_calibrationDirectory << " and subdirectory " << - m_calibrationSubDirectory); - - m_calibrationTool->printStatus(); - } - - void DL1Tag::build_nn(const std::string& jetauthor, std::istream& nn_config_istream) { if (m_NeuralNetworks.count(jetauthor)) { delete m_NeuralNetworks[jetauthor]; @@ -144,12 +119,11 @@ namespace Analysis { void DL1Tag::cache_calibration(const std::string& jetauthor) { - bool update = m_calibrationTool->retrieveHistogram(m_calibrationDirectory, jetauthor, "net_configuration").second; - + // check if this network is alread cached, so do nothing - if ( (!update) && (m_NeuralNetworks.count(jetauthor) == 1) ) { - return; - } + //if (m_NeuralNetworks.count(jetauthor) == 1) { + // return; + //} // get the NN configuration std::string calib = get_calib_string(jetauthor); ATH_MSG_DEBUG("Reading NN for " + jetauthor + ": " @@ -161,19 +135,14 @@ namespace Analysis { } std::string DL1Tag::get_calib_string(std::string jetauthor) { - std::string file_name = "/net_configuration"; - std::pair<TObject*, bool> stringpair = m_calibrationTool->retrieveTObject<TObject>(m_calibrationDirectory, jetauthor, file_name); - if (stringpair.second == true) { - m_calibrationTool->updateHistogramStatus(m_calibrationDirectory, jetauthor, "net_configuration",false); - } - TObjString* cal_string = dynamic_cast<TObjString*>(stringpair.first); + std::string file_name = "net_configuration"; + + SG::ReadCondHandle<JetTagCalibCondData> readCdo(m_readKey); + TObjString * cal_string = readCdo->retrieveTObject<TObjString>(m_calibrationDirectory, jetauthor, file_name); if (cal_string == 0){ //catch if no string was found std::string fuller_name = m_calibrationDirectory + "/" + jetauthor + "/net_configuration"; - if (stringpair.first) { - fuller_name.append(" [but an object was found]"); - } throw std::logic_error("Cannot retrieve string: " + fuller_name); } std::string calibration(cal_string->GetString().Data()); diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/src/HistoHelperRoot.cxx b/PhysicsAnalysis/JetTagging/JetTagTools/src/HistoHelperRoot.cxx index a3d2cf99604f6fee58821854ef52ec45e1b53095..1e73fabc6d1159d4524a32115b6b3014b0e56ee7 100644 --- a/PhysicsAnalysis/JetTagging/JetTagTools/src/HistoHelperRoot.cxx +++ b/PhysicsAnalysis/JetTagging/JetTagTools/src/HistoHelperRoot.cxx @@ -172,102 +172,6 @@ TH3* HistoHelperRoot::getHisto3D(const std::string& histoName) return m_histoMap3D[histoName]; } -void HistoHelperRoot::normalizeHistos() -{ - //std::cout <<"In HistoHelperRoot::normalizeHistos()" << std::endl; - for (std::map<std::string, TH1*>::iterator mapItr = m_histoMap1D.begin(); - mapItr != m_histoMap1D.end(); ++mapItr ) { - const std::string& name = (*mapItr).first; - // - TH1* histo = (*mapItr).second; - double norm(histo->Integral()); - if (norm!=1. && norm != 0.) { - //std::cout << "Normalizing: " << name << std::endl; - histo->Scale(1./norm); - } else if (norm == 0.) { - std::cout << "Empty histogram ! "<< name <<std::endl; - } - } - for (std::map<std::string, TH2*>::iterator mapItr = m_histoMap2D.begin(); - mapItr != m_histoMap2D.end(); ++mapItr ) { - const std::string& name = (*mapItr).first; - // - TH2* histo = (*mapItr).second; - double norm(histo->Integral()); - if (norm!=1. && norm != 0.) { - //std::cout << "Normalizing: " << name << std::endl; - histo->Scale(1./norm); - } else if (norm == 0.) { - std::cout << "Empty histogram ! "<< name <<std::endl; - } - } - for (std::map<std::string, TH3*>::iterator mapItr = m_histoMap3D.begin(); - mapItr != m_histoMap3D.end(); ++mapItr ) { - const std::string& name = (*mapItr).first; - // - TH3* histo = (*mapItr).second; - double norm(histo->Integral()); - if (norm!=1. && norm != 0.) { - //std::cout << "Normalizing: " << name << std::endl; - histo->Scale(1./norm); - } else if (norm == 0.) { - std::cout << "Empty histogram ! "<< name <<std::endl; - } - } - - -} - -void HistoHelperRoot::normalizeHistos(const std::string histname) -{ - double norm = 0.; - // - std::map<std::string,TH1*>::const_iterator pos = m_histoMap1D.find(histname); - if (pos != m_histoMap1D.end()) { - TH1* histo = pos->second; - norm = histo->Integral(); - if (norm!=1. && norm != 0.) { - histo->Scale(1./norm); - } else if (norm == 0.) { - std::cout << "Empty histogram ! "<< (*pos).first <<std::endl; - } - } else { - std::map<std::string,TH2*>::const_iterator pos = m_histoMap2D.find(histname); - if (pos != m_histoMap2D.end()) { - TH2* histo = pos->second; - norm = histo->Integral(); - if (norm!=1. && norm != 0.) { - histo->Scale(1./norm); - } else if (norm == 0.) { - std::cout << "Empty histogram ! "<< (*pos).first <<std::endl; - } - } else { - std::map<std::string,TH3*>::const_iterator pos = m_histoMap3D.find(histname); - if (pos != m_histoMap3D.end()) { - TH3* histo = pos->second; - norm = histo->Integral(); - if (norm!=1. && norm != 0.) { - histo->Scale(1./norm); - } else if (norm == 0.) { - std::cout << "Empty histogram ! "<< (*pos).first <<std::endl; - } - } else { - std::cout << "Histo "<< histname << " does not exist ? Nothing to normalise !" << std::endl; - } - } - } -} - -void HistoHelperRoot::smoothHistos(const std::string histname) -{ - std::map<std::string,TH1*>::const_iterator pos = m_histoMap1D.find(histname); - if (pos != m_histoMap1D.end()) { - (pos->second)->Smooth(); - } else { - std::cout << "Histo "<< histname << " does not exist ? Nothing to normalise !" << std::endl; - } -} - void HistoHelperRoot::print() { for (std::map<std::string, TH1*>::iterator mapItr = m_histoMap1D.begin(); mapItr != m_histoMap1D.end(); ++mapItr ) { diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/src/IPTag.cxx b/PhysicsAnalysis/JetTagging/JetTagTools/src/IPTag.cxx index cdbf0181904fcddfb14cc8d8dea0abb0067e64d7..5a428289232e4f19f9024a8a6b419025ce4a30e0 100644 --- a/PhysicsAnalysis/JetTagging/JetTagTools/src/IPTag.cxx +++ b/PhysicsAnalysis/JetTagging/JetTagTools/src/IPTag.cxx @@ -83,8 +83,6 @@ namespace Analysis { : AthAlgTool(t,n,p), m_runModus("analysis"), m_histoHelper(0), - //m_secVxFinderNameForV0Removal("InDetVKalVxInJetTool"), - //m_secVxFinderNameForIPSign("InDetVKalVxInJetTool"), m_sortPt(false), m_sortD0sig(false), m_sortZ0D0sig(false), @@ -95,7 +93,6 @@ namespace Analysis { m_likelihoodTool("Analysis::NewLikelihoodTool"), m_SVForIPTool("Analysis::SVForIPTool"), m_trackGradeFactory("Analysis::BasicTrackGradeFactory"), - // VD:trackToVertexIPestimator missing m_InDetTrackSelectorTool("InDet::InDetTrackSelectionTool"), m_TightTrackVertexAssociationTool("CP::TightTrackVertexAssociationTool") { @@ -135,8 +132,6 @@ namespace Analysis { declareProperty("purificationDeltaR" , m_purificationDeltaR = 0.8); declareProperty("jetPtMinRef" , m_jetPtMinRef = 15.*Gaudi::Units::GeV); - //declareProperty("SecVxFinderNameForV0Removal",m_secVxFinderNameForV0Removal); - //declareProperty("SecVxFinderNameForIPSign" ,m_secVxFinderNameForIPSign) declareProperty("SecVxFinderName" ,m_secVxFinderName); declareProperty("NtrkMin" , m_NtrkMin =6 ); @@ -217,13 +212,6 @@ namespace Analysis { m_hypotheses.push_back("C"); } - /** retrieving TrackToVertex: */ - /*if ( m_trackToVertexTool.retrieve().isFailure() ) { - ATH_MSG_FATAL("#BTAG# Failed to retrieve tool " << m_trackToVertexTool); - return StatusCode::FAILURE; - } else { - - }*/ // FF: comment out V0 finding if (m_SVForIPTool.retrieve().isFailure() ) { ATH_MSG_FATAL("#BTAG# Failed to retrieve tool " << m_SVForIPTool); @@ -268,7 +256,7 @@ namespace Analysis { /** prepare the track partitions: */ int nbPart = m_trackGradePartitionsDefinition.size(); - ATH_MSG_INFO("#BTAG# Defining " << nbPart <<" track partitions: "); + ATH_MSG_DEBUG("#BTAG# Defining " << nbPart <<" track partitions: "); for(int i=0;i<nbPart;i++) { TrackGradePartition* part(0); try { @@ -295,7 +283,7 @@ namespace Analysis { ATH_MSG_ERROR("#BTAG# Terminating now... "); return StatusCode::FAILURE; } - ATH_MSG_INFO((*part)); + ATH_MSG_DEBUG((*part)); m_trackGradePartitions.push_back(part); } @@ -308,19 +296,6 @@ namespace Analysis { ATH_MSG_DEBUG("#BTAG# Retrieved tool " << m_likelihoodTool); } m_likelihoodTool->defineHypotheses(m_hypotheses); - // define new lh variables: - for(unsigned int i=0;i<m_trackGradePartitions.size();i++) { - for(unsigned int ih=0;ih<m_hypotheses.size();ih++) { - std::string hName; - if(m_impactParameterView=="1D") - hName = m_hypotheses[ih]+"/"+m_trackGradePartitions[i]->suffix()+"/SipZ0"; - if(m_impactParameterView=="2D") - hName = m_hypotheses[ih]+"/"+m_trackGradePartitions[i]->suffix()+"/SipA0"; - if(m_impactParameterView=="3D") - hName = m_hypotheses[ih]+"/"+m_trackGradePartitions[i]->suffix()+"/Sip3D"; - m_likelihoodTool->defineHistogram(hName); - } - } m_likelihoodTool->printStatus(); } @@ -331,8 +306,7 @@ namespace Analysis { /** book calibration histograms if needed */ if( m_runModus == "reference" ) { - //FF: comment out reference mode running for now - ATH_MSG_INFO("#BTAG# running IPTag in reference mode"); + ATH_MSG_DEBUG("#BTAG# running IPTag in reference mode"); for(uint j=0;j<m_jetCollectionList.size();j++) { //int nbGrades=trackFactoryGradesDefinition.numberOfGrades(); @@ -373,11 +347,6 @@ namespace Analysis { } // ms m_histoHelper->print(); } - /* ms - m_nbjet = 0; - m_ncjet = 0; - m_nljet = 0; - */ if (m_impactParameterView=="3D") { if ( m_InDetTrackSelectorTool.retrieve().isFailure() ) { @@ -427,8 +396,6 @@ namespace Analysis { if( m_runModus == "reference" ) { // here we require a jet selection: if( jetToTag.pt()>m_jetPtMinRef && fabs(jetToTag.eta())<2.5 ) { - // and also a truth match: - //const TruthInfo* mcinfo = jetToTag.tagInfo<TruthInfo>("TruthInfo"); label = xAOD::jetFlavourLabel(&jetToTag); double deltaRtoClosestB = 999., deltaRtoClosestC = 999., deltaRtoClosestT = 999.; double deltaRmin(0.); @@ -436,10 +403,7 @@ namespace Analysis { // for purification: require no b or c quark closer than dR=m_purificationDeltaR jetToTag.getAttribute("TruthLabelDeltaR_C",deltaRtoClosestC); jetToTag.getAttribute("TruthLabelDeltaR_T",deltaRtoClosestT); - //double deltaRtoClosestB = mcinfo->deltaRMinTo("B"); - //double deltaRtoClosestC = mcinfo->deltaRMinTo("C"); deltaRmin = deltaRtoClosestB < deltaRtoClosestC ? deltaRtoClosestB : deltaRtoClosestC; - //double deltaRtoClosestT = mcinfo->deltaRMinTo("T"); deltaRmin = deltaRtoClosestT < deltaRmin ? deltaRtoClosestT : deltaRmin; } else { ATH_MSG_ERROR("#BTAG# No TruthInfo ! Cannot run in reference mode !"); @@ -488,7 +452,6 @@ namespace Analysis { int nbTrak = 0; m_trackSelectorTool->primaryVertex(m_priVtx->position()); m_trackSelectorTool->prepare(); - //std::vector<const xAOD::TrackParticle*>* trackVector = NULL; std::vector< ElementLink< xAOD::TrackParticleContainer > > associationLinks = BTag->auxdata<std::vector<ElementLink<xAOD::TrackParticleContainer> > >(m_trackAssociationName); double sumTrkpT = 0; unsigned ntrk=0; @@ -587,7 +550,6 @@ namespace Analysis { vectZ0.reserve(nbTrackMean); vectZ0Signi.reserve(nbTrackMean); vectGrades.reserve(nbTrackMean); - //////////vectTP.reserve(nbTrackMean); vectFromV0.reserve(nbTrackMean); vectWeightB.reserve(nbTrackMean); vectWeightU.reserve(nbTrackMean); @@ -690,11 +652,7 @@ namespace Analysis { if (m_sortD0sig) std::sort( vectObj.begin() , vectObj.end() , StructD0Sigsorting ); if (m_sortZ0D0sig) std::sort( vectObj.begin() , vectObj.end() , StructZ0D0Sigsorting ); - - //std::cout << std::endl; - //std::cout << " " << m_NtrkMax << " , " << m_trkFract << " , " << m_NtrkMin << std::endl; int resizeVal=vectObj.size(); - //int tmpSize=resizeVal; if (m_NtrkMax!=1000) { if ( m_trkFract==1.0 ) { if ( m_NtrkMax<resizeVal ) resizeVal=m_NtrkMax; @@ -714,7 +672,7 @@ namespace Analysis { /** fill reference histograms: */ ///* ms if( m_runModus == "reference" ) { - if( pref != "" ) { // current jet passes selection for Sig or Bkg + if( !pref.empty() ) { // current jet passes selection for Sig or Bkg ATH_MSG_DEBUG("#BTAG# filling ref histo for " << pref); const TrackGradesDefinition & trackFactoryGradesDefinition = m_trackGradeFactory->getTrackGradesDefinition(); const std::vector<TrackGrade> & gradeList = trackFactoryGradesDefinition.getList(); @@ -954,17 +912,6 @@ namespace Analysis { twu = tmp[1]; twc = 0.; if(m_useCHypo) twc = tmp[2]; - /* - double w = -100.; - if(pb<=0.) { - w = -30.; - } else if (pu<=0.) { - w = +100.; - } else { - w = log(pb/pu); - } - return w; - */ } diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/src/JetFitterNNTool.cxx b/PhysicsAnalysis/JetTagging/JetTagTools/src/JetFitterNNTool.cxx index f4d50059dd7093f3d29c3463f4144a600bbfb750..196d7c80c83eaf940d8a0f7ba3f3f1024c838af8 100644 --- a/PhysicsAnalysis/JetTagging/JetTagTools/src/JetFitterNNTool.cxx +++ b/PhysicsAnalysis/JetTagging/JetTagTools/src/JetFitterNNTool.cxx @@ -21,8 +21,6 @@ #include <TH1F.h> #include <TH2F.h> -#include "JetTagCalibration/CalibrationBroker.h" - #include "TrkNeuralNetworkUtils/TTrainedNetwork.h" #include "JetTagTools/JetFitterNNTool.h" #include "TrkNeuralNetworkUtils/NeuralNetworkToHistoTool.h" @@ -43,7 +41,6 @@ JetFitterNNTool::JetFitterNNTool(const std::string& name, m_calibrationSubDirectory("NeuralNetwork"), m_networkToHistoTool("Trk::NeuralNetworkToHistoTool"), m_useCombinedIPNN(true), - m_calibrationTool("BTagCalibrationBroker"), m_maximumRegisteredLayers(4) { declareProperty("CalibrationDirectory",m_calibrationDirectory); @@ -52,8 +49,6 @@ JetFitterNNTool::JetFitterNNTool(const std::string& name, declareProperty("NeuralNetworkToHistoTool",m_networkToHistoTool); declareProperty("useCombinedIPNN",m_useCombinedIPNN); - declareProperty("calibrationTool", m_calibrationTool); - declareProperty("maximumRegisteredLayers",m_maximumRegisteredLayers); declareProperty("usePtCorrectedMass",m_usePtCorrectedMass = false); @@ -82,77 +77,21 @@ JetFitterNNTool::~JetFitterNNTool() { } StatusCode JetFitterNNTool::initialize() { + ATH_CHECK(m_readKey.initialize()); - //here you have to initialize the histograms needed for the fit... - StatusCode sc = m_calibrationTool.retrieve(); - if (sc.isFailure()) - { - ATH_MSG_FATAL(" Could not retrieve " << m_calibrationTool << ". Aborting..."); - return sc; - } else ATH_MSG_INFO(" Retrieved: " << m_calibrationTool); - - sc = m_networkToHistoTool.retrieve(); + StatusCode sc = m_networkToHistoTool.retrieve(); if (sc.isFailure()) { ATH_MSG_FATAL(" Could not retrieve " << m_networkToHistoTool << ". Aborting..."); return sc; - } else ATH_MSG_INFO(" Retrieved: " << m_networkToHistoTool << ". "); + } else ATH_MSG_DEBUG(" Retrieved: " << m_networkToHistoTool << ". "); - ATH_MSG_INFO("Calibration setting: cannot use Neural Network with more than: " << m_maximumRegisteredLayers << "."); + ATH_MSG_DEBUG("Calibration setting: cannot use Neural Network with more than: " << m_maximumRegisteredLayers << "."); - //now you need to initialize the Calibration Broker with the needed histograms... - initializeCalibrationFile(); - - ATH_MSG_INFO(" Initialization of JetFitterNNTool succesfull"); + ATH_MSG_DEBUG(" Initialization of JetFitterNNTool succesfull"); return StatusCode::SUCCESS; } - void JetFitterNNTool::initializeCalibrationFile() - { - - TString directory(m_calibrationSubDirectory); - directory+="/"; - if (m_useCombinedIPNN) - { - directory+="comb"; - } - else - { - directory+="standalone"; - } - directory+="/"; - - m_calibrationTool->registerHistogram(m_calibrationDirectory, - std::string((const char*)(directory+"LayersInfo"))); - - Int_t nHidden=m_maximumRegisteredLayers-2; - - for (Int_t i=0;i<nHidden+1;++i) - { - - TString weightName("Layer"); - weightName+=i; - weightName+="_weights"; - - TString thresholdName("Layer"); - thresholdName+=i; - thresholdName+="_thresholds"; - - m_calibrationTool->registerHistogram(m_calibrationDirectory, - std::string((const char*)(directory+weightName))); - - m_calibrationTool->registerHistogram(m_calibrationDirectory, - std::string((const char*)(directory+thresholdName))); - - } - - ATH_MSG_DEBUG(" Registered NN histograms with directory: " << m_calibrationDirectory << " and subdirectory " << directory); - - m_calibrationTool->printStatus(); - - } - - StatusCode JetFitterNNTool::finalize() { //here you should probably delete something :-) @@ -165,6 +104,8 @@ StatusCode JetFitterNNTool::finalize() { std::vector<TH1*> retrievedHistos; + SG::ReadCondHandle<JetTagCalibCondData> readCdo(m_readKey); + //it is assumed that in the NN 0 is signal (bottom), 1 is charm and 2 is light TString directory(m_calibrationSubDirectory); @@ -179,26 +120,11 @@ StatusCode JetFitterNNTool::finalize() { } directory+="/"; - std::pair<TH1*, bool> histoLayers = m_calibrationTool->retrieveHistogram(m_calibrationDirectory, + TH1* histoLayers = readCdo->retrieveHistogram("JetFitterNN", jetauthor, std::string((const char*)(directory+TString("LayersInfo")))); - - if (histoLayers.second==false && m_NN[jetauthor]!=0) - { - return; - } - else if(histoLayers.second==true) - { - ATH_MSG_DEBUG(" HistoLayers in " << directory << " was updated. Switching updated now to false ... "); - m_calibrationTool->updateHistogramStatus(m_calibrationDirectory, - jetauthor, - std::string((const char*)(directory+TString("LayersInfo"))), - false); - } - - - TH1F* myHistoLayers=dynamic_cast<TH1F*>(histoLayers.first); + TH1F* myHistoLayers=dynamic_cast<TH1F*>(histoLayers); if (myHistoLayers==0) { @@ -210,7 +136,7 @@ StatusCode JetFitterNNTool::finalize() { Int_t nHidden=myHistoLayers->GetNbinsX()-2; - ATH_MSG_INFO(" Retrieving calibration for NN with: " << nHidden << " hidden layers."); + ATH_MSG_DEBUG(" Retrieving calibration for NN with: " << nHidden << " hidden layers."); for (Int_t i=0;i<nHidden+1;++i) { @@ -223,20 +149,11 @@ StatusCode JetFitterNNTool::finalize() { thresholdName+=i; thresholdName+="_thresholds"; - std::pair<TH1*, bool> weightHisto = m_calibrationTool->retrieveHistogram(m_calibrationDirectory, + TH1* weightHisto = readCdo->retrieveHistogram("JetFitterNN", jetauthor, std::string((const char*)(directory+weightName))); - - if (weightHisto.second==true) - { - m_calibrationTool->updateHistogramStatus(m_calibrationDirectory, - jetauthor, - std::string((const char*)(directory+weightName)), - false); - } - - TH2F* myWeightHisto=dynamic_cast<TH2F*>(weightHisto.first); + TH2F* myWeightHisto=dynamic_cast<TH2F*>(weightHisto); if (myWeightHisto==0) { @@ -251,19 +168,11 @@ StatusCode JetFitterNNTool::finalize() { retrievedHistos.push_back(myWeightHisto); - std::pair<TH1*, bool> thresholdHisto = m_calibrationTool->retrieveHistogram(m_calibrationDirectory, + TH1* thresholdHisto = readCdo->retrieveHistogram("JetFitterNN", jetauthor, std::string((const char*)(directory+thresholdName))); - if (thresholdHisto.second==true) - { - m_calibrationTool->updateHistogramStatus(m_calibrationDirectory, - jetauthor, - std::string((const char*)(directory+thresholdName)), - false); - } - - TH1F* myThresholdHisto=dynamic_cast<TH1F*>(thresholdHisto.first); + TH1F* myThresholdHisto=dynamic_cast<TH1F*>(thresholdHisto); if (myThresholdHisto==0) { diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/src/JetVertexCharge.cxx b/PhysicsAnalysis/JetTagging/JetTagTools/src/JetVertexCharge.cxx index 86521f421458bb32e652a4a4ee369240e6e8b629..4fa615f5fd7ddc005cf21da7506bcbe56c59718f 100644 --- a/PhysicsAnalysis/JetTagging/JetTagTools/src/JetVertexCharge.cxx +++ b/PhysicsAnalysis/JetTagging/JetTagTools/src/JetVertexCharge.cxx @@ -26,7 +26,6 @@ #include "xAODMuon/MuonContainer.h" #include "JetTagTools/JetTagUtils.h" -#include "JetTagCalibration/CalibrationBroker.h" #include "MuonSelectorTools/IMuonSelectionTool.h" #include "MuonMomentumCorrections/IMuonCalibrationAndSmearingTool.h" #include "TMVA/Reader.h" @@ -47,7 +46,6 @@ namespace Analysis { JetVertexCharge::JetVertexCharge(const std::string& t, const std::string& n, const IInterface* p) : AthAlgTool(t,n,p), - m_calibrationTool("BTagCalibrationBroker"), m_muonSelectorTool("JVC_MuonSelectorTool"), m_muonCorrectionTool( "JVC_MuonCorrectionTool" ), m_runModus("analysis") @@ -56,7 +54,6 @@ namespace Analysis { declareProperty("SecVxFinderName", m_secVxFinderName); declareProperty("Runmodus", m_runModus); - declareProperty("calibrationTool", m_calibrationTool); declareProperty("muonSelectorTool", m_muonSelectorTool); declareProperty("muonCorrectionTool", m_muonCorrectionTool); declareProperty("taggerNameBase", m_taggerNameBase = "JetVertexCharge"); @@ -98,17 +95,8 @@ namespace Analysis { //Initialize method StatusCode JetVertexCharge::initialize() { - StatusCode sc = m_calibrationTool.retrieve(); - if ( sc.isFailure() ) { - ATH_MSG_FATAL("#BTAG# Failed to retrieve tool " << m_calibrationTool); - return sc; - } else { - ATH_MSG_DEBUG("#BTAG# Retrieved tool " << m_calibrationTool); - } - - //Retrieve the Muon Selectot tool - sc = m_muonSelectorTool.retrieve(); + StatusCode sc = m_muonSelectorTool.retrieve(); if ( sc.isFailure() ) { ATH_MSG_FATAL("#BTAG# Failed to retrieve tool " << m_muonSelectorTool); return sc; @@ -127,34 +115,8 @@ namespace Analysis { ATH_CHECK( m_muonCorrectionTool->initialize() ); - - //MVA xml files - m_calibrationTool->registerHistogram(m_taggerNameBase, m_taggerNameBase+"Calib_cat_JC_SVC_noMu"); - m_calibrationTool->registerHistogram(m_taggerNameBase, m_taggerNameBase+"Calib_cat_JC_SVC_incMu"); - m_calibrationTool->registerHistogram(m_taggerNameBase, m_taggerNameBase+"Calib_cat_JC_SVC_TVC_noMu"); - m_calibrationTool->registerHistogram(m_taggerNameBase, m_taggerNameBase+"Calib_cat_JC_SVC_TVC_incMu"); - m_calibrationTool->registerHistogram(m_taggerNameBase, m_taggerNameBase+"Calib_cat_JC_incMu"); - - //reference histos - m_calibrationTool->registerHistogram(m_taggerNameBase, "jvc_JC_SVC_noMu_b"); - m_calibrationTool->registerHistogram(m_taggerNameBase, "jvc_JC_SVC_noMu_bbar"); - m_calibrationTool->registerHistogram(m_taggerNameBase, "jvc_JC_SVC_incMu_b"); - m_calibrationTool->registerHistogram(m_taggerNameBase, "jvc_JC_SVC_incMu_bbar"); - m_calibrationTool->registerHistogram(m_taggerNameBase, "jvc_JC_SVC_TVC_noMu_b"); - m_calibrationTool->registerHistogram(m_taggerNameBase, "jvc_JC_SVC_TVC_noMu_bbar"); - m_calibrationTool->registerHistogram(m_taggerNameBase, "jvc_JC_SVC_TVC_incMu_b"); - m_calibrationTool->registerHistogram(m_taggerNameBase, "jvc_JC_SVC_TVC_incMu_bbar"); - m_calibrationTool->registerHistogram(m_taggerNameBase, "jvc_JC_incMu_b"); - m_calibrationTool->registerHistogram(m_taggerNameBase, "jvc_JC_incMu_bbar"); - m_calibrationTool->registerHistogram(m_taggerNameBase, "jvc_JC_noMu_b"); - m_calibrationTool->registerHistogram(m_taggerNameBase, "jvc_JC_noMu_bbar"); - m_calibrationTool->registerHistogram(m_taggerNameBase, "jvc_SVC_b"); - m_calibrationTool->registerHistogram(m_taggerNameBase, "jvc_SVC_bbar"); - m_calibrationTool->registerHistogram(m_taggerNameBase, "jvc_JC_all_b"); - m_calibrationTool->registerHistogram(m_taggerNameBase, "jvc_JC_all_bbar"); - - - // m_alreadySetup = false; + // prepare readKey for calibration data: + ATH_CHECK(m_readKey.initialize()); m_catNames[JC_SVC_noMu] = "JC_SVC_noMu"; m_catNames[JC_SVC_incMu] = "JC_SVC_incMu"; @@ -196,64 +158,29 @@ namespace Analysis { StatusCode JetVertexCharge::tagJet( xAOD::Jet& jetToTag, xAOD::BTagging* BTag) { + //Retrieval of Calibration Condition Data objects + SG::ReadCondHandle<JetTagCalibCondData> readCdo(m_readKey); - /** author to know which jet algorithm: */ - std::string author = JetTagUtils::getJetAuthor(jetToTag); - if (m_doForcedCalib) author = m_ForcedCalibName; - std::string alias = m_calibrationTool->channelAlias(author); - + /** author to know which jet algorithm: */ + std::string author = JetTagUtils::getJetAuthor(jetToTag); + if (m_doForcedCalib) author = m_ForcedCalibName; + std::string alias = readCdo->getChannelAlias(author); - ClearVars(); - m_jet_uPt = jetToTag.pt(); + ClearVars(); + m_jet_uPt = jetToTag.pt(); - // if(m_runModus=="analysis" && !m_alreadySetup ) { - // StatusCode sc = SetupReaders(author, alias, JC_SVC_noMu ); - // if( sc.isFailure() ) { - // ATH_MSG_WARNING("#BTAG# Could not setup the reader for the JC_SVC_noMu category, author = " << author); - // return StatusCode::SUCCESS; - // } else ATH_MSG_INFO("#BTAG# Reader correctly setup for the JC_SVC_noMu category, author = " << author); - - // sc = SetupReaders(author, alias, JC_SVC_incMu ); - // if( sc.isFailure() ) { - // ATH_MSG_WARNING("#BTAG# Could not setup the reader for the JC_SVC_incMu category, author = " << author); - // return StatusCode::SUCCESS; - // } else ATH_MSG_INFO("#BTAG# Reader correctly setup for the JC_SVC_incMu category, author = " << author); - - // sc = SetupReaders(author, alias, JC_SVC_TVC_noMu ); - // if( sc.isFailure() ) { - // ATH_MSG_WARNING("#BTAG# Could not setup the reader for the JC_SVC_TVC_noMu category, author = " << author); - // return StatusCode::SUCCESS; - // } else ATH_MSG_INFO("#BTAG# Reader correctly setup for the JC_SVC_TVC_noMu category, author = " << author); - - // sc = SetupReaders(author, alias, JC_SVC_TVC_incMu ); - // if( sc.isFailure() ) { - // ATH_MSG_WARNING("#BTAG# Could not setup the reader for the JC_SVC_TVC_incMu category, author = " << author); - // return StatusCode::SUCCESS; - // } else ATH_MSG_INFO("#BTAG# Reader correctly setup for the JC_SVC_TVC_incMu category, author = " << author); - - // sc = SetupReaders(author, alias, JC_incMu ); - // if( sc.isFailure() ) { - // ATH_MSG_WARNING("#BTAG# Could not setup the reader for the JC_incMu category, author = " << author); - // return StatusCode::SUCCESS; - // } else ATH_MSG_INFO("#BTAG# Reader correctly setup for the JC_incMu category, author = " << author); - - // m_alreadySetup = true; - // } - + // computing the JetCharge (JC) + //============================================================== - //============================================================== - // computing the JetCharge (JC) - //============================================================== - - std::vector<ElementLink< xAOD::TrackParticleContainer > > tracksInJet; - tracksInJet = BTag->auxdata< std::vector<ElementLink< xAOD::TrackParticleContainer > > >(m_trackAssociationName); - if( tracksInJet.size() == 0 ) { + std::vector<ElementLink< xAOD::TrackParticleContainer > > tracksInJet; + tracksInJet = BTag->auxdata< std::vector<ElementLink< xAOD::TrackParticleContainer > > >(m_trackAssociationName); + if( tracksInJet.size() == 0 ) { ATH_MSG_DEBUG("#BTAG# Could not find tracks associated with name " << m_trackAssociationName); - } else { + } else { ATH_MSG_DEBUG("#BTAG# There are "<<tracksInJet.size()<<" tracks associated to the jet."); @@ -283,7 +210,7 @@ StatusCode JetVertexCharge::tagJet( xAOD::Jet& jetToTag, xAOD::BTagging* BTag) { m_jc_all_jetPt = charge_all/jetToTag.pt(); - } + } //============================================================== @@ -457,7 +384,7 @@ StatusCode JetVertexCharge::tagJet( xAOD::Jet& jetToTag, xAOD::BTagging* BTag) { for( const auto& muLink : muonsInJet) { const xAOD::Muon* mu = *muLink; - xAOD::Muon* corrMuHelper = 0; + xAOD::Muon* corrMuHelper = nullptr; if( m_muonCorrectionTool->correctedCopy( *mu, corrMuHelper) != CP::CorrectionCode::Ok ) { ATH_MSG_WARNING("Cannot apply calibration nor smearing for muons." ); continue; @@ -468,9 +395,6 @@ StatusCode JetVertexCharge::tagJet( xAOD::Jet& jetToTag, xAOD::BTagging* BTag) { // Make all the muon quality cuts... xAOD::Muon::Quality quality = m_muonSelectorTool->getQuality(*p_corrMu); - //if( quality == xAOD::Muon::Tight ) ATH_MSG_INFO("Muon quality is 'Tight'"); - //else if( quality == xAOD::Muon::Medium ) ATH_MSG_INFO("Muon quality is 'Medium'"); - //else ATH_MSG_INFO("Muon quality is "<<quality); //just added this cut if( quality > m_muonQualityCut ) continue; @@ -634,63 +558,60 @@ StatusCode JetVertexCharge::tagJet( xAOD::Jet& jetToTag, xAOD::BTagging* BTag) { BTag->setVariable<int>(m_taggerNameBase, "category", mvaCat ); BTag->setVariable<double>(m_taggerNameBase, "discriminant", -7. ); - } - else if( m_runModus == "analysis") { - - double llr; - if(mvaCat == JC_noMu ) { - llr = logLikelihoodRatio( JC_noMu, m_jc , author, alias); - BTag->setVariable<double>(m_taggerNameBase, "discriminant", llr ); - return StatusCode::SUCCESS; - } - else if(mvaCat == JC_all ) { - llr = logLikelihoodRatio( JC_all, m_jc_all , author, alias); - BTag->setVariable<double>(m_taggerNameBase, "discriminant", llr ); - return StatusCode::SUCCESS; - } - else if(mvaCat == SVC ) { - llr = logLikelihoodRatio( SVC, m_svc , author, alias); - BTag->setVariable<double>(m_taggerNameBase, "discriminant", llr ); - return StatusCode::SUCCESS; - } - else if(mvaCat < 0 ) { //NULL cat - BTag->setVariable<double>(m_taggerNameBase, "discriminant", -7. ); - return StatusCode::SUCCESS; - } - - std::pair<TList*, bool> calib = m_calibrationTool->retrieveTObject<TList>(m_taggerNameBase, author, m_taggerNameBase + "Calib_cat_" + m_catNames[mvaCat]); - // the bool indicates whether a calibration has "changed". This is the case in particular when retrieving it for the first time. - if (calib.second) { - StatusCode sc = SetupReaders(author, alias, mvaCat, calib.first ); - if( sc.isFailure() ) { - ATH_MSG_DEBUG("#BTAG# Could not setup the reader for the " << m_catNames[mvaCat] << " category and author " << author); - return StatusCode::SUCCESS; - } else ATH_MSG_DEBUG("#BTAG# Reader correctly setup for the " << m_catNames[mvaCat] << " category and author " << author); - } - - - //Finally compute the weight - float mvaWeight = -9.; - std::string reader_name = alias+m_catNames[mvaCat]; - std::map<std::string, TMVA::Reader*>::iterator pos2 = m_tmvaReaders.find(reader_name); - if(pos2==m_tmvaReaders.end()) { - int alreadyWarned = std::count(m_undefinedReaders.begin(),m_undefinedReaders.end(),reader_name); - if(0==alreadyWarned) { - ATH_MSG_WARNING("#BTAG# no TMVAReader defined for jet collection " << reader_name); - m_undefinedReaders.push_back(reader_name); - } - } - else { - std::map<std::string, TMVA::MethodBase*>::iterator itmap2 = m_tmvaMethod.find(reader_name); - if((itmap2->second)!=0){ - mvaWeight = pos2->second->EvaluateMVA( itmap2->second ); - } else ATH_MSG_WARNING("#BTAG# kl==0"); - } + } + else if( m_runModus == "analysis") { + + double llr; + if(mvaCat == JC_noMu ) { + llr = logLikelihoodRatio( JC_noMu, m_jc , author); + BTag->setVariable<double>(m_taggerNameBase, "discriminant", llr ); + return StatusCode::SUCCESS; + } + else if(mvaCat == JC_all ) { + llr = logLikelihoodRatio( JC_all, m_jc_all , author); + BTag->setVariable<double>(m_taggerNameBase, "discriminant", llr ); + return StatusCode::SUCCESS; + } + else if(mvaCat == SVC ) { + llr = logLikelihoodRatio( SVC, m_svc , author); + BTag->setVariable<double>(m_taggerNameBase, "discriminant", llr ); + return StatusCode::SUCCESS; + } + else if(mvaCat < 0 ) { //NULL cat + BTag->setVariable<double>(m_taggerNameBase, "discriminant", -7. ); + return StatusCode::SUCCESS; + } + + TList* calib = readCdo->retrieveTObject<TList>(m_taggerNameBase, author, m_taggerNameBase + "Calib_cat_" + m_catNames[mvaCat]); + StatusCode sc = SetupReaders(author, alias, mvaCat, calib ); + if( sc.isFailure() ) { + ATH_MSG_DEBUG("#BTAG# Could not setup the reader for the " << m_catNames[mvaCat] << " category and author " << author); + return StatusCode::SUCCESS; + } else ATH_MSG_DEBUG("#BTAG# Reader correctly setup for the " << m_catNames[mvaCat] << " category and author " << author); + + + //Finally compute the weight + float mvaWeight = -9.; + std::string reader_name = alias+m_catNames[mvaCat]; + std::map<std::string, TMVA::Reader*>::iterator pos2 = m_tmvaReaders.find(reader_name); + if(pos2==m_tmvaReaders.end()) { + int alreadyWarned = std::count(m_undefinedReaders.begin(),m_undefinedReaders.end(),reader_name); + if(0==alreadyWarned) { + ATH_MSG_WARNING("#BTAG# no TMVAReader defined for jet collection " << reader_name); + m_undefinedReaders.push_back(reader_name); + } + } + else { + std::map<std::string, TMVA::MethodBase*>::iterator itmap2 = m_tmvaMethod.find(reader_name); + if((itmap2->second)!=0){ + mvaWeight = pos2->second->EvaluateMVA( itmap2->second ); + } else ATH_MSG_WARNING("#BTAG# kl==0"); + } - //Now I compute the log-likelihood ratio - llr = logLikelihoodRatio( mvaCat, mvaWeight , author, alias); - BTag->setVariable<double>(m_taggerNameBase, "discriminant", llr ); + //Now I compute the log-likelihood ratio + llr = logLikelihoodRatio( mvaCat, mvaWeight , author); + BTag->setVariable<double>(m_taggerNameBase, "discriminant", llr ); } //if runmodus Analysis @@ -766,113 +687,78 @@ int JetVertexCharge::category() { } ////////////////////////////////////////////////////// -float JetVertexCharge::logLikelihoodRatio( int mvaCat, float mvaWeight, std::string author, std::string alias) { +float JetVertexCharge::logLikelihoodRatio( int mvaCat, float mvaWeight, std::string author) { - std::pair<TH1*,bool> histo_pos; - std::pair<TH1*,bool> histo_neg; + TH1* histo_pos = nullptr; + TH1* histo_neg = nullptr; + + //Retrieval of Calibration Condition Data objects + SG::ReadCondHandle<JetTagCalibCondData> readCdo(m_readKey); if( mvaCat == JC_noMu) { - histo_pos = m_calibrationTool->retrieveHistogram(m_taggerNameBase, author, "jvc_JC_noMu_bbar"); - histo_neg = m_calibrationTool->retrieveHistogram(m_taggerNameBase, author, "jvc_JC_noMu_b"); + histo_pos = readCdo->retrieveHistogram(m_taggerNameBase, author, "jvc_JC_noMu_bbar"); + histo_neg = readCdo->retrieveHistogram(m_taggerNameBase, author, "jvc_JC_noMu_b"); } else if( mvaCat == JC_SVC_noMu) { - histo_pos = m_calibrationTool->retrieveHistogram(m_taggerNameBase, author, "jvc_JC_SVC_noMu_bbar"); - histo_neg = m_calibrationTool->retrieveHistogram(m_taggerNameBase, author, "jvc_JC_SVC_noMu_b"); + histo_pos = readCdo->retrieveHistogram(m_taggerNameBase, author, "jvc_JC_SVC_noMu_bbar"); + histo_neg = readCdo->retrieveHistogram(m_taggerNameBase, author, "jvc_JC_SVC_noMu_b"); } else if( mvaCat == JC_SVC_incMu) { - histo_pos = m_calibrationTool->retrieveHistogram(m_taggerNameBase, author, "jvc_JC_SVC_incMu_bbar"); - histo_neg = m_calibrationTool->retrieveHistogram(m_taggerNameBase, author, "jvc_JC_SVC_incMu_b"); + histo_pos = readCdo->retrieveHistogram(m_taggerNameBase, author, "jvc_JC_SVC_incMu_bbar"); + histo_neg = readCdo->retrieveHistogram(m_taggerNameBase, author, "jvc_JC_SVC_incMu_b"); } else if( mvaCat == JC_SVC_TVC_noMu) { - histo_pos = m_calibrationTool->retrieveHistogram(m_taggerNameBase, author, "jvc_JC_SVC_TVC_noMu_bbar"); - histo_neg = m_calibrationTool->retrieveHistogram(m_taggerNameBase, author, "jvc_JC_SVC_TVC_noMu_b"); + histo_pos = readCdo->retrieveHistogram(m_taggerNameBase, author, "jvc_JC_SVC_TVC_noMu_bbar"); + histo_neg = readCdo->retrieveHistogram(m_taggerNameBase, author, "jvc_JC_SVC_TVC_noMu_b"); } else if( mvaCat == JC_incMu) { - histo_pos = m_calibrationTool->retrieveHistogram(m_taggerNameBase, author, "jvc_JC_incMu_bbar"); - histo_neg = m_calibrationTool->retrieveHistogram(m_taggerNameBase, author, "jvc_JC_incMu_b"); + histo_pos = readCdo->retrieveHistogram(m_taggerNameBase, author, "jvc_JC_incMu_bbar"); + histo_neg = readCdo->retrieveHistogram(m_taggerNameBase, author, "jvc_JC_incMu_b"); } else if( mvaCat == JC_SVC_TVC_incMu) { - histo_pos = m_calibrationTool->retrieveHistogram(m_taggerNameBase, author, "jvc_JC_SVC_TVC_incMu_bbar"); - histo_neg = m_calibrationTool->retrieveHistogram(m_taggerNameBase, author, "jvc_JC_SVC_TVC_incMu_b"); + histo_pos = readCdo->retrieveHistogram(m_taggerNameBase, author, "jvc_JC_SVC_TVC_incMu_bbar"); + histo_neg = readCdo->retrieveHistogram(m_taggerNameBase, author, "jvc_JC_SVC_TVC_incMu_b"); } else if( mvaCat == SVC) { - histo_pos = m_calibrationTool->retrieveHistogram(m_taggerNameBase, author, "jvc_SVC_bbar"); - histo_neg = m_calibrationTool->retrieveHistogram(m_taggerNameBase, author, "jvc_SVC_b"); + histo_pos = readCdo->retrieveHistogram(m_taggerNameBase, author, "jvc_SVC_bbar"); + histo_neg = readCdo->retrieveHistogram(m_taggerNameBase, author, "jvc_SVC_b"); } else if( mvaCat == JC_all) { - histo_pos = m_calibrationTool->retrieveHistogram(m_taggerNameBase, author, "jvc_JC_all_bbar"); - histo_neg = m_calibrationTool->retrieveHistogram(m_taggerNameBase, author, "jvc_JC_all_b"); + histo_pos = readCdo->retrieveHistogram(m_taggerNameBase, author, "jvc_JC_all_bbar"); + histo_neg = readCdo->retrieveHistogram(m_taggerNameBase, author, "jvc_JC_all_b"); } else if(mvaCat == -1) { return -7; } - bool histosHaveChanged = (histo_pos.second || histo_neg.second); - if(histosHaveChanged) { - - if( histo_pos.first ==NULL ) { - ATH_MSG_WARNING("#BTAG# BBAR HISTO can't be retrieved -> no calibration for "<< m_taggerNameBase ); - return -3.; - } - if( histo_neg.first==NULL) { - ATH_MSG_WARNING("#BTAG# B HISTO can't be retrieved -> no calibration for "<< m_taggerNameBase ); - return -3; - } - if( mvaCat == JC_noMu) { - m_calibrationTool->updateHistogramStatus(m_taggerNameBase, alias, "jvc_JC_noMu_bbar", false); - m_calibrationTool->updateHistogramStatus(m_taggerNameBase, alias, "jvc_JC_noMu_b", false); - } - else if( mvaCat == JC_SVC_noMu) { - m_calibrationTool->updateHistogramStatus(m_taggerNameBase, alias, "jvc_JC_SVC_noMu_bbar", false); - m_calibrationTool->updateHistogramStatus(m_taggerNameBase, alias, "jvc_JC_SVC_noMu_b", false); - } - else if( mvaCat == JC_SVC_incMu) { - m_calibrationTool->updateHistogramStatus(m_taggerNameBase, alias, "jvc_JC_SVC_incMu_bbar", false); - m_calibrationTool->updateHistogramStatus(m_taggerNameBase, alias, "jvc_JC_SVC_incMu_b", false); - } - else if( mvaCat == JC_SVC_TVC_noMu) { - m_calibrationTool->updateHistogramStatus(m_taggerNameBase, alias, "jvc_JC_SVC_TVC_noMu_bbar", false); - m_calibrationTool->updateHistogramStatus(m_taggerNameBase, alias, "jvc_JC_SVC_TVC_noMu_b", false); - } - else if( mvaCat == JC_SVC_TVC_incMu) { - m_calibrationTool->updateHistogramStatus(m_taggerNameBase, alias, "jvc_JC_SVC_TVC_incMu_bbar", false); - m_calibrationTool->updateHistogramStatus(m_taggerNameBase, alias, "jvc_JC_SVC_TVC_incMu_b", false); - } - else if( mvaCat == SVC) { - m_calibrationTool->updateHistogramStatus(m_taggerNameBase, alias, "jvc_SVC_bbar", false); - m_calibrationTool->updateHistogramStatus(m_taggerNameBase, alias, "jvc_SVC_b", false); - } - else if( mvaCat == JC_all) { - m_calibrationTool->updateHistogramStatus(m_taggerNameBase, alias, "jvc_JC_all_bbar", false); - m_calibrationTool->updateHistogramStatus(m_taggerNameBase, alias, "jvc_JC_all_b", false); - } - else if( mvaCat == JC_incMu) { - m_calibrationTool->updateHistogramStatus(m_taggerNameBase, alias, "jvc_JC_incMu_bbar", false); - m_calibrationTool->updateHistogramStatus(m_taggerNameBase, alias, "jvc_JC_incMu_b", false); - } - - - TH1F* hp = (TH1F*) histo_pos.first; - TH1F* hn = (TH1F*) histo_neg.first; + if( histo_pos == nullptr ) { + ATH_MSG_WARNING("#BTAG# BBAR HISTO can't be retrieved -> no calibration for "<< m_taggerNameBase ); + return -3.; + } + if( histo_neg== nullptr) { + ATH_MSG_WARNING("#BTAG# B HISTO can't be retrieved -> no calibration for "<< m_taggerNameBase ); + return -3; + } - std::map<int, TH1F*>::iterator pos; - std::map<int, TH1F*>::iterator neg; + TH1F* hp = (TH1F*) histo_pos; + TH1F* hn = (TH1F*) histo_neg; - pos = m_histoList_pos.find(mvaCat); - if(pos!=m_histoList_pos.end()) { - m_histoList_pos.erase(pos); - } - neg = m_histoList_neg.find(mvaCat); - if(neg!=m_histoList_neg.end()) { - m_histoList_neg.erase(neg); - } + std::map<int, TH1F*>::iterator pos; + std::map<int, TH1F*>::iterator neg; - m_histoList_pos.insert( std::make_pair( mvaCat, hp ) ); - m_histoList_neg.insert( std::make_pair( mvaCat, hn ) ); + pos = m_histoList_pos.find(mvaCat); + if(pos!=m_histoList_pos.end()) { + m_histoList_pos.erase(pos); + } + neg = m_histoList_neg.find(mvaCat); + if(neg!=m_histoList_neg.end()) { + m_histoList_neg.erase(neg); + } - } //if something changed + m_histoList_pos.insert( std::make_pair( mvaCat, hp ) ); + m_histoList_neg.insert( std::make_pair( mvaCat, hn ) ); float histo_bbar = minProb, histo_b = minProb; @@ -905,42 +791,12 @@ StatusCode JetVertexCharge::SetupReaders( std::string /*author*/, std::string al ATH_MSG_DEBUG("#BTAG# setting up reader for category "<<mvaCat); - - // std::pair<TList*, bool> calib; - - // if( mvaCat == JC_SVC_noMu ) calib = m_calibrationTool->retrieveTObject<TList>(m_taggerNameBase, author, m_taggerNameBase+"Calib_cat_JC_SVC_noMu"); - // else if(mvaCat == JC_SVC_incMu ) calib = m_calibrationTool->retrieveTObject<TList>(m_taggerNameBase, author, m_taggerNameBase+"Calib_cat_JC_SVC_incMu"); - // else if(mvaCat == JC_SVC_TVC_noMu ) calib = m_calibrationTool->retrieveTObject<TList>(m_taggerNameBase, author, m_taggerNameBase+"Calib_cat_JC_SVC_TVC_noMu"); - // else if(mvaCat == JC_SVC_TVC_incMu ) calib = m_calibrationTool->retrieveTObject<TList>(m_taggerNameBase, author, m_taggerNameBase+"Calib_cat_JC_SVC_TVC_incMu"); - // else if(mvaCat == JC_incMu ) calib = m_calibrationTool->retrieveTObject<TList>(m_taggerNameBase, author, m_taggerNameBase+"Calib_cat_JC_incMu"); - - - // bool calibHasChanged = calib.second; - // if(calibHasChanged) { - - ATH_MSG_DEBUG("#BTAG# " << m_taggerNameBase << " calib updated -> try to retrieve"); - // if(!calib.first) { if (! list) { ATH_MSG_WARNING("#BTAG# Tlist can't be retrieved -> no calibration for "<< m_taggerNameBase ); return StatusCode::FAILURE; } - m_calibrationTool->updateHistogramStatus(m_taggerNameBase, alias, m_taggerNameBase+"Calib_cat_" + m_catNames[mvaCat], false); - // if( mvaCat == JC_SVC_noMu) m_calibrationTool->updateHistogramStatus(m_taggerNameBase, alias, m_taggerNameBase+"Calib_cat_JC_SVC_noMu", false); - // else if( mvaCat == JC_SVC_incMu) m_calibrationTool->updateHistogramStatus(m_taggerNameBase, alias, m_taggerNameBase+"Calib_cat_JC_SVC_incMu", false); - // else if( mvaCat == JC_SVC_TVC_noMu) m_calibrationTool->updateHistogramStatus(m_taggerNameBase, alias, m_taggerNameBase+"Calib_cat_JC_SVC_TVC_noMu", false); - // else if( mvaCat == JC_SVC_TVC_incMu) m_calibrationTool->updateHistogramStatus(m_taggerNameBase, alias, m_taggerNameBase+"Calib_cat_JC_SVC_TVC_incMu", false); - // else if( mvaCat == JC_incMu) m_calibrationTool->updateHistogramStatus(m_taggerNameBase, alias, m_taggerNameBase+"Calib_cat_JC_incMu", false); - - // //now the new part istringstream - // TList* list = calib.first; - - // Note: the variables and their ranges (to be used in TMVA::Reader::AddVariable() calls) are extracted from the XML object itself. - // This is somewhat fragile, as it assumes that the expressions used are either simple variable names or expressions implementing a minimum or maximum bound, like - // "(distSV>105.)?105.:distSV" - // where it is assumed that the actual variable name follows the ":", and the ">" is an XML representation of ">" (and hence needs to be replaced with the latter) - std::vector<std::string> inputVars; std::ostringstream iss; for(int i=0; i<list->GetSize(); ++i) { @@ -994,69 +850,6 @@ StatusCode JetVertexCharge::SetupReaders( std::string /*author*/, std::string al tmvaReader->AddVariable(expression.c_str(), m_variablePtr[var]); } - // if( mvaCat == JC_SVC_noMu ) { - // tmvaReader->AddVariable( "JC", &m_jc ); - // tmvaReader->AddVariable( "SVC", &m_svc ); - // tmvaReader->AddVariable( "(track_good_pt>90000.)?90000.:track_good_pt", &m_jc_track_pt ); - // tmvaReader->AddVariable( "(ntrk0>14.)?14.:ntrk0", &m_sv_ntrk ); - // tmvaReader->AddVariable( "(distSV>105.)?105.:distSV", &m_sv_dist ); - // tmvaReader->AddVariable( "(errSV>5.)?5.:errSV", &m_sv_err ); - // tmvaReader->AddVariable( "(track_sv_pt>200000.)?200000.:track_sv_pt", &m_sv_track_pt ); - // } - // else if( mvaCat == JC_SVC_incMu ) { - // tmvaReader->AddVariable( "JC", &m_jc ); - // tmvaReader->AddVariable( "SVC", &m_svc ); - // tmvaReader->AddVariable( "mu_charge", &m_mu_charge ); - // tmvaReader->AddVariable( "(track_good_pt>120000.)?120000.:track_good_pt", &m_jc_track_pt ); - // tmvaReader->AddVariable( "(ntrk0>13.)?13.:ntrk0", &m_sv_ntrk ); - // tmvaReader->AddVariable( "(distSV>120.)?120.:distSV", &m_sv_dist ); - // tmvaReader->AddVariable( "(errSV>5.)?5.:errSV", &m_sv_err ); - // tmvaReader->AddVariable( "(mu_ptRel>20.)?20.:mu_ptRel", &m_mu_ptRel ); - // tmvaReader->AddVariable( "(mu_ptLong>500.)?500.:mu_ptLong", &m_mu_ptlong ); - // } - // else if( mvaCat == JC_SVC_TVC_noMu ) { - // tmvaReader->AddVariable( "JC", &m_jc ); - // tmvaReader->AddVariable( "SVC", &m_svc ); - // tmvaReader->AddVariable( "TVC", &m_tvc ); - // tmvaReader->AddVariable( "(track_good_pt>100000.)?100000.:track_good_pt", &m_jc_track_pt ); - // tmvaReader->AddVariable( "(ntrk0>10.)?10.:ntrk0", &m_sv_ntrk ); - // tmvaReader->AddVariable( "(distSV>90.)?90.:distSV", &m_sv_dist ); - // tmvaReader->AddVariable( "(errSV>5.)?5.:errSV", &m_sv_err ); - // tmvaReader->AddVariable( "(track_sv_pt>250000.)?250000.:track_sv_pt", &m_sv_track_pt ); - // tmvaReader->AddVariable( "(massSV_pions>6000.)?6000.:massSV_pions", &m_sv_mass_pions ); - // tmvaReader->AddVariable( "(ntrk1_used>10.)?10.:ntrk1_used", &m_tv_ntrk ); - // tmvaReader->AddVariable( "(distTV>200.)?200.:distTV", &m_tv_dist ); - // tmvaReader->AddVariable( "(errTV>5.)?5.:errTV", &m_tv_err ); - // tmvaReader->AddVariable( "(massTV_kaons>6000.)?6000.:massTV_kaons", &m_tv_mass_kaons ); - // } - // else if(mvaCat == JC_SVC_TVC_incMu) { - // tmvaReader->AddVariable( "JC", &m_jc ); - // tmvaReader->AddVariable( "SVC", &m_svc ); - // tmvaReader->AddVariable( "TVC", &m_tvc ); - // tmvaReader->AddVariable( "mu_charge", &m_mu_charge ); - // tmvaReader->AddVariable( "(track_good_pt>120000.)?120000.:track_good_pt", &m_jc_track_pt ); - // tmvaReader->AddVariable( "(ntrk0>10.)?10.:ntrk0", &m_sv_ntrk ); - // tmvaReader->AddVariable( "(distSV>90.)?90.:distSV", &m_sv_dist ); - // tmvaReader->AddVariable( "(errSV>5.)?5.:errSV", &m_sv_err ); - // tmvaReader->AddVariable( "(ntrk1_used>10.)?10.:ntrk1_used", &m_tv_ntrk ); - // tmvaReader->AddVariable( "(distTV>200.)?200.:distTV", &m_tv_dist ); - // tmvaReader->AddVariable( "(errTV>5.)?5.:errTV", &m_tv_err ); - // tmvaReader->AddVariable( "(massTV_kaons>6000.)?6000.:massTV_kaons", &m_tv_mass_kaons ); - // tmvaReader->AddVariable( "(mu_ptRel>12.)?12.:mu_ptRel", &m_mu_ptRel ); - // tmvaReader->AddVariable( "(mu_ptLong>400.)?400.:mu_ptLong", &m_mu_ptLong ); - // } - // else if(mvaCat == JC_incMu) { - // tmvaReader->AddVariable( "JC", &m_jc ); - // tmvaReader->AddVariable( "mu_charge", &m_mu_charge ); - // tmvaReader->AddVariable( "(ngoodtrk>28.)?28.:ngoodtrk", &m_ngoodtrk ); - // tmvaReader->AddVariable( "(track_good_pt>120000.)?120000.:track_good_pt", &m_jc_track_pt ); - // tmvaReader->AddVariable( "(mu_ptRel>20.)?20.:mu_ptRel", &m_mu_ptRel ); - // tmvaReader->AddVariable( "(mu_ptLong>400.)?400.:mu_ptLong", &m_mu_ptLong ); - // tmvaReader->AddVariable( "(mu_iso_ptvar40>700000.)?700000.:mu_iso_ptvar40", &m_mu_iso ); - // tmvaReader->AddVariable( "mu_jet_dR", &m_mu_jet_dR ); - // } - - TMVA::IMethod* method= tmvaReader->BookMVA(TMVA::Types::kMLP, iss.str().data()); auto kl = dynamic_cast<TMVA::MethodBase*>(method); diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/src/MV2Tag.cxx b/PhysicsAnalysis/JetTagging/JetTagTools/src/MV2Tag.cxx index ab0443cc83bb6e33c09bdb67cd8cf69b5e1c060b..5ec874643422686579723aef59746e86df1905d2 100644 --- a/PhysicsAnalysis/JetTagging/JetTagTools/src/MV2Tag.cxx +++ b/PhysicsAnalysis/JetTagging/JetTagTools/src/MV2Tag.cxx @@ -5,14 +5,11 @@ #include "GaudiKernel/IToolSvc.h" #include "xAODTracking/TrackParticle.h" -#include "JetTagCalibration/CalibrationBroker.h" #include "JetTagTools/MV2Tag.h" #include "xAODBTagging/BTagging.h" #include "xAODJet/Jet.h" -#include "TObjString.h" - #include <fstream> #include <sstream> #include <algorithm> @@ -25,11 +22,11 @@ #include "JetTagTools/JetTagUtils.h" #include "AthenaKernel/Units.h" -#include "TMVA/Reader.h" -#include "TMVA/MethodBDT.h" #include "TList.h" #include "TString.h" #include "TObjString.h" +#include "TObjArray.h" +#include "TTree.h" #include <fstream> #include <algorithm> #include <utility> @@ -51,14 +48,10 @@ namespace Analysis { MV2Tag::MV2Tag(const std::string& name, const std::string& n, const IInterface* p): AthAlgTool(name, n,p), - m_calibrationTool("BTagCalibrationBroker"), m_runModus("analysis") { declareInterface<IMultivariateJetTagger>(this); - // access to XML configuration files for TMVA from COOL: - declareProperty("calibrationTool", m_calibrationTool); - // force MV2 to always use a calibration derived from MV2CalibAlias jet collection declareProperty("forceMV2CalibrationAlias", m_forceMV2CalibrationAlias = true); declareProperty("MV2CalibAlias", m_MV2CalibAlias = "AntiKt4TopoEM"); @@ -89,25 +82,14 @@ namespace Analysis { StatusCode MV2Tag::initialize() { m_disableAlgo=false; - m_useEgammaMethodMV2=false; m_warnCounter=0; m_treeName = "BDT"; m_varStrName = "variables"; - // prepare calibration tool: - StatusCode sc = m_calibrationTool.retrieve(); - if ( sc.isFailure() ) { - ATH_MSG_FATAL("#BTAG# Failed to retrieve tool " << m_calibrationTool); - return sc; - } else { - ATH_MSG_INFO("#BTAG# Retrieved tool " << m_calibrationTool); - } - m_calibrationTool->registerHistogram(m_taggerNameBase, m_taggerNameBase+"Calib"); - m_calibrationTool->registerHistogram(m_taggerNameBase, m_taggerNameBase+"Calib/"+m_treeName); - m_calibrationTool->registerHistogram(m_taggerNameBase, m_taggerNameBase+"Calib/"+m_varStrName); - m_tmvaReaders.clear(); - m_tmvaMethod.clear(); + // prepare readKey for calibration data: + ATH_CHECK(m_readKey.initialize()); + m_egammaBDTs.clear(); return StatusCode::SUCCESS; } @@ -115,17 +97,7 @@ namespace Analysis { StatusCode MV2Tag::finalize() { ATH_MSG_DEBUG("#BTAG# Finalizing MV2."); - if (m_useEgammaMethodMV2) { - for( auto temp: m_egammaBDTs ) if(temp.second) delete temp.second; - } - else { - // delete readers: - std::map<std::string, TMVA::Reader*>::iterator pos = m_tmvaReaders.begin(); - for( ; pos != m_tmvaReaders.end(); ++pos ) delete pos->second; - std::map<std::string, TMVA::MethodBase*>::iterator posm = m_tmvaMethod.begin(); - for( ; posm != m_tmvaMethod.end(); ++posm ) delete posm->second; - } - + for( auto temp: m_egammaBDTs ) if(temp.second) delete temp.second; for (auto& iter: m_local_inputvals) { delete iter.second; } @@ -138,7 +110,7 @@ namespace Analysis { /* * #index for this function - * #1: Preparation of MVA instance using tmva/MVAUtils BDT + * #1: Preparation of MVA instance using MVAUtils BDT * #2: set input variables from MultivariateTagManager inputs map * #3: Calcuation of MVA output variable(s) * #4: Fill MVA output variable(s) into xAOD @@ -152,206 +124,84 @@ namespace Analysis { } } - // #1: Preparation of MVA instance using tmva/egammaBDT + // #1: Preparation of MVA instance using egammaBDT /* jet author: */ std::string author(assigned_jet_author); + ATH_MSG_DEBUG("#BTAG# Jet author for MV2: " << author); if (m_forceMV2CalibrationAlias) { author = m_MV2CalibAlias; } + MVAUtils::BDT *bdt = nullptr; std::map<std::string, MVAUtils::BDT*>::iterator it_egammaBDT; - ATH_MSG_DEBUG("#BTAG# Jet author for MV2: " << author); - - /* check if calibration has to be updated: */ - std::pair<TObject*, bool> calib=m_calibrationTool->retrieveTObject<TObject>(m_taggerNameBase,author,m_taggerNameBase+"Calib"); - - bool calibHasChanged = calib.second; - - TMVA::Reader* tmvaReader=0; std::map<std::string, TMVA::Reader*>::iterator pos; - TMVA::MethodBase * kl=0; std::map<std::string, TMVA::MethodBase*>::iterator it_mb; - MVAUtils::BDT *bdt=0; std::map<std::string, MVAUtils::BDT*>::iterator it_egammaBDT; - - /*KM: Retrieval of objects from the calibration file and store it back in the calibration broker temporarily*/ - if(calibHasChanged) { - ATH_MSG_DEBUG("#BTAG# " << m_taggerNameBase << " calib updated -> try to retrieve"); - if(!calib.first) { - ATH_MSG_WARNING("#BTAG# TObject can't be retrieved -> no calibration for"<< m_taggerNameBase<<" "<<author); - m_disableAlgo=true; - return; - } - else { - const TString rootClassName=calib.first->ClassName(); - - if (rootClassName=="TDirectoryFile") m_useEgammaMethodMV2=true; - else if (rootClassName=="TList") m_useEgammaMethodMV2=false;//tmva method - else { - ATH_MSG_WARNING("#BTAG# Unsupported ROOT class type: "<<rootClassName<<" is retrieved. Disabling algorithm.."); - m_disableAlgo=true; - return; - } - - } - m_calibrationTool->updateHistogramStatus(m_taggerNameBase, author, m_taggerNameBase+"Calib", false); - - //const std::string treeName ="BDT"; - //const std::string varStrName="variables"; - std::vector<std::string> inputVars; inputVars.clear(); - - if (!m_useEgammaMethodMV2) { - ATH_MSG_INFO("#BTAG# Booking TMVA::Reader for "<<m_taggerNameBase); - std::ostringstream iss; //iss.clear(); - //now the new part istringstream - TList* list = (TList*)calib.first; - - for(int i=0; i<list->GetSize(); ++i) { - - TObjString* ss = (TObjString*)list->At(i); - std::string sss = ss->String().Data(); - - //KM: if it doesn't find "<" in the string, it starts from non-space character - int posi = sss.find('<')!=std::string::npos ? sss.find('<') : sss.find_first_not_of(" "); - std::string tmp = sss.erase(0,posi); - - iss << tmp.data(); - if (tmp.find("<Variable")!=std::string::npos ) { - if ( tmp.find("Variable VarIndex")!=std::string::npos ) { - std::string varIndex =tmp.substr(tmp.find("=\"")+2, tmp.find("\" ")-(tmp.find("=\"")+2)); - std::string tmpVar = tmp.erase(0,tmp.find("Expression=\"")+12); - std::string varExpress=tmp.substr(0, tmp.find("\"")); - inputVars.push_back(varExpress); - } - } - // else if (tmp.find("NClass")!=std::string::npos ) { - // std::string newString=tmp.substr(tmp.find("\"")+1,tmp.find("\" ")-(tmp.find("\"")+1)); - // nClasses =stoi(newString); - // } - } - m_calibrationTool->storeCalib(m_taggerNameBase, author, m_taggerNameBase+"Calib", inputVars, iss.str(), 0); - - iss.clear(); - } - else {//if m_useEgammaMethodMV2 - std::pair<TObject*, bool> calibTree=m_calibrationTool->retrieveTObject<TObject>(m_taggerNameBase,author,m_taggerNameBase+"Calib/"+m_treeName); - std::pair<TObject*, bool> calibVariables=m_calibrationTool->retrieveTObject<TObject>(m_taggerNameBase,author,m_taggerNameBase+"Calib/"+m_varStrName); - TTree *tree = (TTree*) calibTree.first; - TObjArray* toa= (TObjArray*) calibVariables.first; - std::string commaSepVars=""; - if (toa) { - TObjString *tos= 0; - if (toa->GetEntries()>0) tos= (TObjString*) toa->At(0); - commaSepVars=tos->GetString().Data(); - } - - //prepare inputVars - while (commaSepVars.find(",")!=std::string::npos) { - inputVars.push_back(commaSepVars.substr(0,commaSepVars.find(","))); - commaSepVars.erase(0,commaSepVars.find(",")+1); - } - inputVars.push_back(commaSepVars.substr(0,-1)); - - m_calibrationTool->storeCalib(m_taggerNameBase, author, m_taggerNameBase+"Calib", inputVars, "", tree); - } - }//calibHasChanged - - /*KM: Get back the calib objects from calibration broker*/ - std::string alias = m_calibrationTool->channelAlias(author); - if (!m_calibrationTool->updatedTagger(m_taggerNameBase, author, m_taggerNameBase+"Calib") ) { - std::vector<float*> inputPointers; inputPointers.clear(); - unsigned nConfgVar=0; bool badVariableFound=false; - - CalibrationBroker::calibMV2 calib = m_calibrationTool->getCalib(m_taggerNameBase, author, m_taggerNameBase+"Calib"); - std::vector<std::string> inputVars = calib.inputVars; - std::string str = calib.str; - TTree* tree = (TTree*)calib.obj; - - if (str=="" and tree!=0) { m_useEgammaMethodMV2=true; } - else if (str!="" and tree==0) { m_useEgammaMethodMV2=false; } - else{ - ATH_MSG_WARNING("#BTAG# Unrecognized MV2 configuration disabling the algorithm..." ); - m_disableAlgo=true; - return; - } - ATH_MSG_VERBOSE("#BTAG# MV2 m_useEgammaMethodMV2= "<<m_useEgammaMethodMV2 ); - - if (!m_useEgammaMethodMV2) { - // now configure the TMVAReaders: - /// check if the reader for this tagger needs update - tmvaReader = new TMVA::Reader(); - - //Input variables : - //replace NAN default values and, assign the values from the MVTM input map to the relevant variables - //currently default values are hard coded in the definition of ReplaceNaN_andAssign() - - CreateLocalVariables( inputs ); + //Retrieval of Calibration Condition Data objects + SG::ReadCondHandle<JetTagCalibCondData> readCdo(m_readKey); + //readCdo->printHistosStatus(); - SetVariableRefs(inputVars,tmvaReader,nConfgVar,badVariableFound,inputPointers); + std::string alias = readCdo->getChannelAlias(author); - ATH_MSG_DEBUG("#BTAG# tmvaReader= "<<tmvaReader <<", nConfgVar"<<nConfgVar - <<", badVariableFound= "<<badVariableFound <<", inputPointers.size()= "<<inputPointers.size() ); - - if ( inputVars.size()!=nConfgVar or badVariableFound ) { - ATH_MSG_WARNING("#BTAG# Number of expected variables for MVA: "<< nConfgVar << " does not match the number of variables found in the calibration file: " << inputVars.size() << " ... the algorithm will be 'disabled' "<<alias<<" "<<author); - m_disableAlgo=true; - return; - } - - //tmvaReader->BookMVA("BDT", xmlFileName); - TMVA::IMethod* method= tmvaReader->BookMVA(TMVA::Types::kBDT, str.data() ); - kl = dynamic_cast<TMVA::MethodBase*>(method); + TObjArray* toa=readCdo->retrieveTObject<TObjArray>(m_taggerNameBase,author, m_taggerNameBase+"Calib/"+m_varStrName); + TTree *tree = readCdo->retrieveTObject<TTree>(m_taggerNameBase,author, m_taggerNameBase+"Calib/"+m_treeName); + std::string commaSepVars=""; + if (toa) { + TObjString *tos= nullptr; + if (toa->GetEntries()>0) tos= (TObjString*) toa->At(0); + commaSepVars=tos->GetString().Data(); + } else { + ATH_MSG_WARNING("#BTAG# calibVariables has no elements! PLEASE CHECK OUT!"); + m_disableAlgo=true; + return; + } - // add it or overwrite it in the map of readers: - pos = m_tmvaReaders.find(alias); - if(pos!=m_tmvaReaders.end()) { - delete pos->second; - m_tmvaReaders.erase(pos); - } - m_tmvaReaders.insert( std::make_pair( alias, tmvaReader ) ); + //prepare inputVars + std::vector<std::string> inputVars; inputVars.clear(); + while (commaSepVars.find(",")!=std::string::npos) { + inputVars.push_back(commaSepVars.substr(0,commaSepVars.find(","))); + commaSepVars.erase(0,commaSepVars.find(",")+1); + } + inputVars.push_back(commaSepVars.substr(0,-1)); - it_mb = m_tmvaMethod.find(alias); - if(it_mb!=m_tmvaMethod.end()) { - delete it_mb->second; - m_tmvaMethod.erase(it_mb); - } - m_tmvaMethod.insert( std::make_pair( alias, kl ) ); + ATH_MSG_DEBUG("#BTAG# tree name= "<< tree->GetName() <<" inputVars.size()= "<< inputVars.size());// <<" toa->GetEntries()= "<< toa->GetEntries() <<"commaSepVars= "<< commaSepVars); + for (unsigned int asv=0; asv<inputVars.size(); asv++) ATH_MSG_DEBUG("#BTAG# inputVar= "<< inputVars.at(asv)); - } - else {//if m_useEgammaMethodMV2 - ATH_MSG_INFO("#BTAG# Booking MVAUtils::BDT for "<<m_taggerNameBase); - if (tree) { - bdt = new MVAUtils:: BDT(tree); - } - else { - ATH_MSG_WARNING("#BTAG# No TTree with name: "<<m_treeName<<" exists in the calibration file.. Disabling algorithm."); - m_disableAlgo=true; - return; - } + ATH_MSG_DEBUG("#BTAG# Booking MVAUtils::BDT for "<<m_taggerNameBase); + + if (tree) { + ATH_MSG_DEBUG("#BTAG# TTree with name: "<<m_treeName<<" exists in the calibration file."); + bdt = new MVAUtils:: BDT(tree); + } + else { + ATH_MSG_WARNING("#BTAG# No TTree with name: "<<m_treeName<<" exists in the calibration file.. Disabling algorithm."); + m_disableAlgo=true; + delete bdt; + return; + } CreateLocalVariables( inputs ); - SetVariableRefs(inputVars,tmvaReader,nConfgVar,badVariableFound,inputPointers); - - ATH_MSG_DEBUG("#BTAG# tmvaReader= "<<tmvaReader <<", nConfgVar"<<nConfgVar - <<", badVariableFound= "<<badVariableFound <<", inputPointers.size()= "<<inputPointers.size() ); + std::vector<float*> inputPointers; inputPointers.clear(); + unsigned nConfgVar=0; bool badVariableFound=false; + SetVariableRefs(inputVars,nConfgVar,badVariableFound,inputPointers); + ATH_MSG_DEBUG("#BTAG# nConfgVar"<<nConfgVar + <<", badVariableFound= "<<badVariableFound <<", inputPointers.size()= "<<inputPointers.size() ); if ( inputVars.size()!=nConfgVar or badVariableFound ) { - ATH_MSG_WARNING( "#BTAG# Number of expected variables for MVA: "<< nConfgVar << " does not match the number of variables found in the calibration file: " << inputVars.size() << " ... the algorithm will be 'disabled' "<<alias<<" "<<author); - m_disableAlgo=true; - delete bdt; - return; + ATH_MSG_WARNING("#BTAG# Number of expected variables for MVA: "<< nConfgVar << " does not match the number of variables found in the calibration file: " << inputVars.size() << " ... the algorithm will be 'disabled' "<<alias<<" "<<author); + m_disableAlgo=true; + delete bdt; + return; } - bdt->SetPointers(inputPointers); - - it_egammaBDT = m_egammaBDTs.find(alias); - if(it_egammaBDT!=m_egammaBDTs.end()) { - delete it_egammaBDT->second; - m_egammaBDTs.erase(it_egammaBDT); - } - m_egammaBDTs.insert( std::make_pair( alias, bdt ) ); + + bdt->SetPointers(inputPointers); - } - m_calibrationTool->updateHistogramStatusPerTagger(m_taggerNameBase,author, m_taggerNameBase+"Calib", false); + it_egammaBDT = m_egammaBDTs.find(alias); + if(it_egammaBDT!=m_egammaBDTs.end()) { + delete it_egammaBDT->second; + m_egammaBDTs.erase(it_egammaBDT); } + m_egammaBDTs.insert( std::make_pair( alias, bdt ) ); + // #2 fill inputs //replace NAN default values and, assign the values from the MVTM input map to the relevant variables @@ -362,52 +212,24 @@ namespace Analysis { /* compute MV2: */ double mv2 = -10.; double mv2m_pb=-10., mv2m_pu=-10., mv2m_pc=-10.; - //TMVA method - if (!m_useEgammaMethodMV2) { - - pos = m_tmvaReaders.find(alias); - if(pos==m_tmvaReaders.end()) { - int alreadyWarned = std::count(m_undefinedReaders.begin(),m_undefinedReaders.end(),alias); - if(0==alreadyWarned) { - ATH_MSG_WARNING("#BTAG# no TMVAReader defined for jet collection alias, author: "<<alias<<" "<<author); - m_undefinedReaders.push_back(alias); - } - } else { - it_mb = m_tmvaMethod.find(alias); - if( (it_mb->second)!=0 ){ - if(m_taggerNameBase.find("MV2c")!=std::string::npos) mv2 = pos->second->EvaluateMVA( it_mb->second );//this gives back double - else { - std::vector<float> outputs= pos->second->EvaluateMulticlass( it_mb->second );//this gives back float - if (outputs.size()==m_nClasses){ - mv2m_pb=outputs[0]; mv2m_pu=outputs[1]; mv2m_pc=outputs[2]; - } else ATH_MSG_WARNING("#BTAG# Unkown error, outputs vector size not "<<m_nClasses<<"!!!" ); - } - } - else ATH_MSG_WARNING("#BTAG# kl==0 for alias, author: "<<alias<<" "<<author); + it_egammaBDT = m_egammaBDTs.find(alias); + if(it_egammaBDT==m_egammaBDTs.end()) { + int alreadyWarned = std::count(m_undefinedReaders.begin(),m_undefinedReaders.end(),alias); + if(0==alreadyWarned) { + ATH_MSG_WARNING("#BTAG# no egammaBDT defined for jet collection alias, author: "<<alias<<" "<<author); + m_undefinedReaders.push_back(alias); } - } - // use MVAUtils Egamma method else { - it_egammaBDT = m_egammaBDTs.find(alias); - if(it_egammaBDT==m_egammaBDTs.end()) { - int alreadyWarned = std::count(m_undefinedReaders.begin(),m_undefinedReaders.end(),alias); - if(0==alreadyWarned) { - ATH_MSG_WARNING("#BTAG# no egammaBDT defined for jet collection alias, author: "<<alias<<" "<<author); - m_undefinedReaders.push_back(alias); - } - } - else { - if(it_egammaBDT->second !=0) { - if (m_taggerNameBase.find("MV2c")!=std::string::npos) mv2= GetClassResponse(it_egammaBDT->second);//this gives back double - else { //if it is MV2m - std::vector<float> outputs= GetMulticlassResponse(it_egammaBDT->second);//this gives back float - //vector size is checked in the function above - mv2m_pb=outputs[0]; mv2m_pu=outputs[1]; mv2m_pc=outputs[2] ; - } - } - else ATH_MSG_WARNING("#BTAG# egamma BDT is 0 for alias, author: "<<alias<<" "<<author); - } + if(it_egammaBDT->second !=0) { + if (m_taggerNameBase.find("MV2c")!=std::string::npos) mv2= GetClassResponse(it_egammaBDT->second);//this gives back double + else { //if it is MV2m + std::vector<float> outputs= GetMulticlassResponse(it_egammaBDT->second);//this gives back float + //vector size is checked in the function above + mv2m_pb=outputs[0]; mv2m_pu=outputs[1]; mv2m_pc=outputs[2] ; + } + } + else ATH_MSG_WARNING("#BTAG# egamma BDT is 0 for alias, author: "<<alias<<" "<<author); } if (m_taggerNameBase.find("MV2c")!=std::string::npos) ATH_MSG_DEBUG("#BTAG# MV2 weight: " << mv2<<", "<<alias<<", "<<author); @@ -485,15 +307,8 @@ void MV2Tag::ReplaceNaN_andAssign(std::map<std::string, double> var_map){ } - void MV2Tag::SetVariableRefs(const std::vector<std::string> inputVars, TMVA::Reader* tmvaReader, unsigned &nConfgVar, bool &badVariableFound, std::vector<float*> &inputPointers) { - + void MV2Tag::SetVariableRefs(const std::vector<std::string> inputVars, unsigned &nConfgVar, bool &badVariableFound, std::vector<float*> &inputPointers) { - if (!m_useEgammaMethodMV2) { - if(!tmvaReader) { - ATH_MSG_WARNING("#BTAG# tmva method is chosen but tmvaReader==0!!"); - return; - } - } for (unsigned ivar=0; ivar<inputVars.size(); ivar++) { //pt and abs(eta) @@ -504,12 +319,7 @@ void MV2Tag::ReplaceNaN_andAssign(std::map<std::string, double> var_map){ ATH_MSG_WARNING( "#BTAG# \""<<inputVars.at(ivar)<<"\" <- This variable found in xml/calib-file does not match to any variable declared in MV2... the algorithm will be 'disabled'."); badVariableFound=true; }else{ - if(m_useEgammaMethodMV2){ inputPointers.push_back(m_local_inputvals.at(inputVars.at(ivar)) ); - } - else{ - tmvaReader->AddVariable(inputVars.at(ivar).data(),m_local_inputvals.at(inputVars.at(ivar))); - } nConfgVar++; } diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/src/MultiSVTag.cxx b/PhysicsAnalysis/JetTagging/JetTagTools/src/MultiSVTag.cxx index 287509197d6b01cc5a6e6f0943c8ac6d18c24489..095fe83e6efe38d0aea246234b5d621fdbe8eed7 100644 --- a/PhysicsAnalysis/JetTagging/JetTagTools/src/MultiSVTag.cxx +++ b/PhysicsAnalysis/JetTagging/JetTagTools/src/MultiSVTag.cxx @@ -26,13 +26,9 @@ #include "VxVertex/RecVertex.h" #include "VxVertex/VxTrackAtVertex.h" -#include "JetTagCalibration/CalibrationBroker.h" -#include "TMVA/Reader.h" -#include "TMVA/MethodBDT.h" -#include "TMVA/MethodBase.h" -#include "TList.h" -#include "TString.h" #include "TObjString.h" +#include "TObjArray.h" +#include "TTree.h" #include <fstream> #include <algorithm> #include <utility> @@ -50,19 +46,14 @@ namespace Analysis MultiSVTag::MultiSVTag(const std::string& t, const std::string& n, const IInterface* p) : AthAlgTool(t,n,p), - m_calibrationTool("BTagCalibrationBroker"), m_runModus("analysis") - // m_secVxFinderName("InDetVKalVxInJetTool") { declareInterface<ITagTool>(this); - // access to XML configuration files for TMVA from COOL: - declareProperty("calibrationTool", m_calibrationTool); declareProperty("Runmodus", m_runModus= "analysis"); declareProperty("jetCollectionList", m_jetCollectionList); declareProperty("useForcedCalibration", m_doForcedCalib = false); declareProperty("ForcedCalibrationName", m_ForcedCalibName = "AntiKt4TopoEM");//Cone4H1Tower declareProperty("SecVxFinderName",m_secVxFinderName); - //declareProperty("SVAlgType", m_SVmode); declareProperty("taggerNameBase",m_taggerNameBase = "MultiSVbb1"); declareProperty("taggerName", m_taggerName = "MultiSVbb1"); declareProperty("xAODBaseName",m_xAODBaseName); @@ -76,226 +67,102 @@ namespace Analysis StatusCode MultiSVTag::initialize() { // define tagger name: - //m_taggerNameBase = instanceName2; - //std::string tmp = "MultiSV1" ; m_disableAlgo=false; - m_useEgammaMethodMultiSV=false; m_warnCounter=0; m_treeName = "BDT"; m_varStrName = "variables"; - //m_taggerNameBase = tmp; - - StatusCode sc = m_calibrationTool.retrieve(); - if ( sc.isFailure() ) { - ATH_MSG_FATAL("#BTAG# Failed to retrieve tool " << m_calibrationTool); - return sc; - } else { - ATH_MSG_DEBUG("#BTAG# Retrieved tool " << m_calibrationTool); - } - m_calibrationTool->registerHistogram(m_taggerNameBase, m_taggerNameBase+"Calib"); - m_calibrationTool->registerHistogram(m_taggerNameBase, m_taggerNameBase+"Calib/"+m_treeName); - m_calibrationTool->registerHistogram(m_taggerNameBase, m_taggerNameBase+"Calib/"+m_varStrName); - ATH_MSG_DEBUG("#BTAG# m_taggerNameBase " << m_taggerNameBase); - m_tmvaReaders.clear(); - m_tmvaMethod.clear(); + + // prepare readKey for calibration data: + ATH_CHECK(m_readKey.initialize()); m_egammaBDTs.clear(); return StatusCode::SUCCESS; } StatusCode MultiSVTag::finalize(){ - if (m_useEgammaMethodMultiSV) { - for( auto temp: m_egammaBDTs ) if(temp.second) delete temp.second; - } - else { - // delete readers: - std::map<std::string, TMVA::Reader*>::iterator pos = m_tmvaReaders.begin(); - for( ; pos != m_tmvaReaders.end(); ++pos ) delete pos->second; - std::map<std::string, TMVA::MethodBase*>::iterator posm = m_tmvaMethod.begin(); - for( ; posm != m_tmvaMethod.end(); ++posm ) delete posm->second; - } + for( auto temp: m_egammaBDTs ) if(temp.second) delete temp.second; return StatusCode::SUCCESS; } StatusCode MultiSVTag::tagJet(xAOD::Jet& jetToTag, xAOD::BTagging * BTag){ + //Retrieval of Calibration Condition Data objects + SG::ReadCondHandle<JetTagCalibCondData> readCdo(m_readKey); + /** author to know which jet algorithm: */ std::string author = JetTagUtils::getJetAuthor(jetToTag); if (m_doForcedCalib) author = m_ForcedCalibName; ATH_MSG_DEBUG("#BTAG# MSV Using jet type " << author << " for calibrations."); //.... - std::string alias = m_calibrationTool->channelAlias(author);//why this gives always the same? - //TString xmlFileName = "btag"+m_taggerNameBase+"Config_"+alias+".xml";//from MV1, so should work - //ATH_MSG_DEBUG("#BTAG# xmlFileName= "<<xmlFileName); + std::string alias = readCdo->getChannelAlias(author); - TMVA::Reader* tmvaReader = nullptr; - std::map<std::string, TMVA::Reader*>::iterator pos; - TMVA::MethodBase * kl=0; std::map<std::string, TMVA::MethodBase*>::iterator it_mb; MVAUtils::BDT *bdt=0; std::map<std::string, MVAUtils::BDT*>::iterator it_egammaBDT; ATH_MSG_DEBUG("#BTAG# Jet author for MultiSVTag: " << author << ", alias: " << alias ); /* check if calibration (neural net structure or weights) has to be updated: */ - std::pair<TObject*, bool> calib=m_calibrationTool->retrieveTObject<TObject>(m_taggerNameBase,author,m_taggerNameBase+"Calib"); - - bool calibHasChanged = calib.second; - std::ostringstream iss; - std::map<std::string, TMVA::MethodBase*>::iterator itmap; - if(calibHasChanged) { - - ATH_MSG_DEBUG("#BTAG# " << m_taggerNameBase << " calib updated -> try to retrieve"); - if(!calib.first) { - ATH_MSG_WARNING("#BTAG# TObject can't be retrieved -> no calibration for "<< m_taggerNameBase ); - return StatusCode::SUCCESS; - } - const TString rootClassName=calib.first->ClassName(); - if (rootClassName=="TDirectoryFile") m_useEgammaMethodMultiSV=true; - else if (rootClassName=="TList") m_useEgammaMethodMultiSV=false;//tmva method - else { - ATH_MSG_WARNING("#BTAG# Unsupported ROOT class type: "<<rootClassName<<" is retrieved. Disabling algorithm.."); - m_disableAlgo=true; - return StatusCode::SUCCESS; - } - - m_calibrationTool->updateHistogramStatus(m_taggerNameBase, alias, m_taggerNameBase+"Calib", false); - std::vector<float*> inputPointers; inputPointers.clear(); - std::vector<std::string> inputVars; inputVars.clear(); - unsigned nConfgVar=0,calibNvars=0; bool badVariableFound=false; - - if (!m_useEgammaMethodMultiSV) { - ATH_MSG_INFO("#BTAG# Booking TMVA::Reader for "<<m_taggerNameBase); - std::ostringstream iss; //iss.clear(); - //now the new part istringstream - TList* list = (TList*)calib.first; - for(int i=0; i<list->GetSize(); ++i) { - TObjString* ss = (TObjString*)list->At(i); - std::string sss = ss->String().Data(); - //KM: if it doesn't find "<" in the string, it starts from non-space character - int posi = sss.find('<')!=std::string::npos ? sss.find('<') : sss.find_first_not_of(" "); - std::string tmp = sss.erase(0,posi); - //std::cout<<tmp<<std::endl; - iss << tmp.data(); - if (tmp.find("<Variable")!=std::string::npos ) { - if ( tmp.find("Variables NVar")!=std::string::npos ) { - std::string newString=tmp.substr(tmp.find("\"")+1,tmp.find("\" ")-(tmp.find("\"")+1)); - calibNvars=stoi(newString); - } - else if ( tmp.find("Variable VarIndex")!=std::string::npos ) { - std::string varIndex =tmp.substr(tmp.find("=\"")+2, tmp.find("\" ")-(tmp.find("=\"")+2)); - std::string tmpVar = tmp.erase(0,tmp.find("Expression=\"")+12); - std::string varExpress=tmp.substr(0, tmp.find("\"")); - inputVars.push_back(varExpress); - } - } - // else if (tmp.find("NClass")!=std::string::npos ) { - // std::string newString=tmp.substr(tmp.find("\"")+1,tmp.find("\" ")-(tmp.find("\"")+1)); - // nClasses =stoi(newString); - // } - } + TObject* calib=readCdo->retrieveTObject<TObject>(m_taggerNameBase,author,m_taggerNameBase+"Calib"); - // now configure the TMVAReaders: - /// check if the reader for this tagger needs update - tmvaReader = new TMVA::Reader(); - - SetVariableRefs(inputVars,tmvaReader,nConfgVar,badVariableFound,inputPointers); - ATH_MSG_DEBUG("#BTAG# tmvaReader= "<<tmvaReader <<", nConfgVar"<<nConfgVar - <<", badVariableFound= "<<badVariableFound <<", inputPointers.size()= "<<inputPointers.size() ); - - if ( calibNvars!=nConfgVar or badVariableFound ) { - ATH_MSG_WARNING("#BTAG# Number of expected variables for MVA: "<< nConfgVar << " does not match the number of variables found in the calibration file: " << calibNvars << " ... the algorithm will be 'disabled' "<<alias<<" "<<author); - m_disableAlgo=true; - return StatusCode::SUCCESS; - } - - //tmvaReader->BookMVA("BDT", xmlFileName); - TMVA::IMethod* method= tmvaReader->BookMVA(TMVA::Types::kBDT, iss.str().data() ); - kl = dynamic_cast<TMVA::MethodBase*>(method); - - // add it or overwrite it in the map of readers: - pos = m_tmvaReaders.find(alias); - if(pos!=m_tmvaReaders.end()) { - delete pos->second; - m_tmvaReaders.erase(pos); - } - m_tmvaReaders.insert( std::make_pair( alias, tmvaReader ) ); - - it_mb = m_tmvaMethod.find(alias); - if(it_mb!=m_tmvaMethod.end()) { - delete it_mb->second; - m_tmvaMethod.erase(it_mb); - } - m_tmvaMethod.insert( std::make_pair( alias, kl ) ); + if(!calib) { + ATH_MSG_WARNING("#BTAG# TObject can't be retrieved -> no calibration for "<< m_taggerNameBase ); + return StatusCode::SUCCESS; + } - iss.clear(); - } - else {//if m_useEgammaMethodMultiSV - ATH_MSG_INFO("#BTAG# Booking MVAUtils::BDT for "<<m_taggerNameBase); + std::vector<float*> inputPointers; inputPointers.clear(); + std::vector<std::string> inputVars; inputVars.clear(); + unsigned nConfgVar=0,calibNvars=0; bool badVariableFound=false; - // TDirectoryFile* f= (TDirectoryFile*)calib.first; - // TTree *tree = (TTree*) f->Get(treeName.data()); - std::pair<TObject*, bool> calibTree=m_calibrationTool->retrieveTObject<TObject>(m_taggerNameBase,author,m_taggerNameBase+"Calib/"+m_treeName); - TTree *tree = (TTree*) calibTree.first; + ATH_MSG_DEBUG("#BTAG# Booking MVAUtils::BDT for "<<m_taggerNameBase); - if (tree) { - bdt = new MVAUtils:: BDT(tree); - } - else { - ATH_MSG_WARNING("#BTAG# No TTree with name: "<<m_treeName<<" exists in the calibration file.. Disabling algorithm."); - m_disableAlgo=true; - return StatusCode::SUCCESS; - } + TTree *tree = readCdo->retrieveTObject<TTree>(m_taggerNameBase,author,m_taggerNameBase+"Calib/"+m_treeName); + if (tree) { + bdt = new MVAUtils:: BDT(tree); + } + else { + ATH_MSG_WARNING("#BTAG# No TTree with name: "<<m_treeName<<" exists in the calibration file.. Disabling algorithm."); + m_disableAlgo=true; + return StatusCode::SUCCESS; + } - // TObjArray* toa= (TObjArray*) f->Get(varStrName.data()); - std::pair<TObject*, bool> calibVariables=m_calibrationTool->retrieveTObject<TObject>(m_taggerNameBase,author,m_taggerNameBase+"Calib/"+m_varStrName); - TObjArray* toa= (TObjArray*) calibVariables.first; - std::string commaSepVars=""; - if (toa) { - TObjString *tos= 0; - if (toa->GetEntries()>0) tos= (TObjString*) toa->At(0); + TObjArray* toa= readCdo->retrieveTObject<TObjArray>(m_taggerNameBase,author,m_taggerNameBase+"Calib/"+m_varStrName); + std::string commaSepVars=""; + if (toa) { + TObjString *tos= nullptr; + if (toa->GetEntries()>0) tos= (TObjString*) toa->At(0); commaSepVars=tos->GetString().Data(); - } + } - while (commaSepVars.find(",")!=std::string::npos) { - inputVars.push_back(commaSepVars.substr(0,commaSepVars.find(","))); calibNvars++; - commaSepVars.erase(0,commaSepVars.find(",")+1); - } - inputVars.push_back(commaSepVars.substr(0,-1)); calibNvars++; + while (commaSepVars.find(",")!=std::string::npos) { + inputVars.push_back(commaSepVars.substr(0,commaSepVars.find(","))); calibNvars++; + commaSepVars.erase(0,commaSepVars.find(",")+1); + } + inputVars.push_back(commaSepVars.substr(0,-1)); calibNvars++; - SetVariableRefs(inputVars,tmvaReader,nConfgVar,badVariableFound,inputPointers); - ATH_MSG_DEBUG("#BTAG# tmvaReader= "<<tmvaReader <<", nConfgVar"<<nConfgVar + SetVariableRefs(inputVars,nConfgVar,badVariableFound,inputPointers); + ATH_MSG_DEBUG("#BTAG# nConfgVar"<<nConfgVar <<", badVariableFound= "<<badVariableFound <<", inputPointers.size()= "<<inputPointers.size() ); - if ( calibNvars!=nConfgVar or badVariableFound ) { + if ( calibNvars!=nConfgVar or badVariableFound ) { ATH_MSG_WARNING( "#BTAG# Number of expected variables for MVA: "<< nConfgVar << " does not match the number of variables found in the calibration file: " << calibNvars << " ... the algorithm will be 'disabled' "<<alias<<" "<<author); - m_disableAlgo=true; - delete bdt; - return StatusCode::SUCCESS; - } - - bdt->SetPointers(inputPointers); - - it_egammaBDT = m_egammaBDTs.find(alias); - if(it_egammaBDT!=m_egammaBDTs.end()) { - delete it_egammaBDT->second; - m_egammaBDTs.erase(it_egammaBDT); - } - m_egammaBDTs.insert( std::make_pair( alias, bdt ) ); + m_disableAlgo=true; + delete bdt; + return StatusCode::SUCCESS; + } - } - }//calib has changed + bdt->SetPointers(inputPointers); - //if(!m_calibrationTool->updatedTagger(m_taggerNameBase, alias, m_taggerNameBase+"Calib", name())) { - // if(iss.str().size()>0){ - // m_calibrationTool->updateHistogramStatusPerTagger(m_taggerNameBase,alias, m_taggerNameBase+"Calib", false, name()); + it_egammaBDT = m_egammaBDTs.find(alias); + if(it_egammaBDT!=m_egammaBDTs.end()) { + delete it_egammaBDT->second; + m_egammaBDTs.erase(it_egammaBDT); + } + m_egammaBDTs.insert( std::make_pair( alias, bdt ) ); - //.... //the jet double jeteta = jetToTag.eta(), jetphi = jetToTag.phi(), jetpt = jetToTag.pt(); m_jetpt = jetpt; ATH_MSG_DEBUG("#BTAG# Jet properties : eta = " << jeteta << " phi = " << jetphi << " pT = " <<jetpt/GeV); - //ATH_MSG_INFO("Factory PVX x = " << m_priVtx->x() << " y = " << m_priVtx->y() << " z = " << m_priVtx->z()); TLorentzVector jp4; jp4.SetPtEtaPhiM(jetToTag.pt(), jetToTag.eta(), jetToTag.phi(), jetToTag.m()); - // CLHEP::HepLorentzVector jp4(jetToTag.jetP4().px(), jetToTag.jetP4().px(), jetToTag.jetP4().px(), jetToTag.e()); int msv_n = 0; int all_trks = 0; @@ -493,24 +360,6 @@ namespace Analysis //compute BDT weight double msvW = -9.; if( nvtx2trk>1 ){ - if(!m_useEgammaMethodMultiSV){ - std::map<std::string, TMVA::Reader*>::iterator pos2 = m_tmvaReaders.find(alias); - if(pos2==m_tmvaReaders.end()) {// if(pos2==m_tmvaReaders[binnb-1].end()) { - int alreadyWarned = std::count(m_undefinedReaders.begin(),m_undefinedReaders.end(),alias); - if(0==alreadyWarned) { - ATH_MSG_WARNING("#BTAG# no TMVAReader defined for jet collection " << alias); - m_undefinedReaders.push_back(alias); - } - } - else { - std::map<std::string, TMVA::MethodBase*>::iterator itmap2 = m_tmvaMethod.find(alias); - if((itmap2->second)!=0){ - msvW = pos2->second->EvaluateMVA( itmap2->second ); //"BDT method" - ATH_MSG_DEBUG("#BTAG# BB weight: "<<m_taggerNameBase<<" "<< msvW); - }else ATH_MSG_WARNING("#BTAG# kl==0 for alias, author: "<<alias<<" "<<author); - } - } - else { it_egammaBDT = m_egammaBDTs.find(alias); if(it_egammaBDT==m_egammaBDTs.end()) { int alreadyWarned = std::count(m_undefinedReaders.begin(),m_undefinedReaders.end(),alias); @@ -525,7 +374,6 @@ namespace Analysis ATH_MSG_DEBUG("#BTAG# BB weight: "<<m_taggerNameBase<<" "<< msvW); }else ATH_MSG_WARNING("#BTAG# egamma BDT is 0 for alias, author: "<<alias<<" "<<author); } - } } if(m_runModus=="analysis") { @@ -538,43 +386,33 @@ namespace Analysis /// implementation for Analysis::ITagTool::finalizeHistos } - void MultiSVTag::SetVariableRefs(const std::vector<std::string> inputVars, TMVA::Reader* tmvaReader, unsigned &nConfgVar, bool &badVariableFound, std::vector<float*> &inputPointers) { - - if (!m_useEgammaMethodMultiSV) { - if(!tmvaReader) { - ATH_MSG_WARNING("#BTAG# tmva method is chosen but tmvaReader==0!!"); - return; - } - } + void MultiSVTag::SetVariableRefs(const std::vector<std::string> inputVars, unsigned &nConfgVar, bool &badVariableFound, std::vector<float*> &inputPointers) { - //std::cout<<"MultiSV input vars: "; for (unsigned ivar=0; ivar<inputVars.size(); ivar++) { - //std::cout<<inputVars.at(ivar)<<", "; - if (inputVars.at(ivar)=="pt" ) { m_useEgammaMethodMultiSV ? inputPointers.push_back(&m_jetpt ) : tmvaReader->AddVariable(inputVars.at(ivar).data(),&m_jetpt ); nConfgVar++; } - else if (inputVars.at(ivar)=="Nvtx" ) { m_useEgammaMethodMultiSV ? inputPointers.push_back(&m_nvtx ) : tmvaReader->AddVariable(inputVars.at(ivar).data(),&m_nvtx ); nConfgVar++; } - else if (inputVars.at(ivar)=="MaxEfrc" ) { m_useEgammaMethodMultiSV ? inputPointers.push_back(&m_maxefrc ) : tmvaReader->AddVariable(inputVars.at(ivar).data(),&m_maxefrc ); nConfgVar++; } - else if (inputVars.at(ivar)=="sumMass" ) { m_useEgammaMethodMultiSV ? inputPointers.push_back(&m_summass ) : tmvaReader->AddVariable(inputVars.at(ivar).data(),&m_summass ); nConfgVar++; } - else if (inputVars.at(ivar)=="totalntrk" ) { m_useEgammaMethodMultiSV ? inputPointers.push_back(&m_totalntrk ) : tmvaReader->AddVariable(inputVars.at(ivar).data(),&m_totalntrk ); nConfgVar++; } - else if (inputVars.at(ivar)=="diffntrkSV0" ) { m_useEgammaMethodMultiSV ? inputPointers.push_back(&m_diffntrkSV0 ) : tmvaReader->AddVariable(inputVars.at(ivar).data(),&m_diffntrkSV0 ); nConfgVar++; } - else if (inputVars.at(ivar)=="diffntrkSV1" ) { m_useEgammaMethodMultiSV ? inputPointers.push_back(&m_diffntrkSV1 ) : tmvaReader->AddVariable(inputVars.at(ivar).data(),&m_diffntrkSV1 ); nConfgVar++; } - else if (inputVars.at(ivar)=="normDist" ) { m_useEgammaMethodMultiSV ? inputPointers.push_back(&m_normDist ) : tmvaReader->AddVariable(inputVars.at(ivar).data(),&m_normDist ); nConfgVar++; } - else if (inputVars.at(ivar)=="maxVtxMass" ) { m_useEgammaMethodMultiSV ? inputPointers.push_back(&m_mmax_mass ) : tmvaReader->AddVariable(inputVars.at(ivar).data(),&m_mmax_mass ); nConfgVar++; } - else if (inputVars.at(ivar)=="maxSecVtxMass" ) { m_useEgammaMethodMultiSV ? inputPointers.push_back(&m_mmx2_mass ) : tmvaReader->AddVariable(inputVars.at(ivar).data(),&m_mmx2_mass ); nConfgVar++; } - else if (inputVars.at(ivar)=="EfrcmaxVtxMass" ) { m_useEgammaMethodMultiSV ? inputPointers.push_back(&m_mmax_efrc ) : tmvaReader->AddVariable(inputVars.at(ivar).data(),&m_mmax_efrc ); nConfgVar++; } - else if (inputVars.at(ivar)=="EfrcmaxSecVtxMass") { m_useEgammaMethodMultiSV ? inputPointers.push_back(&m_mmx2_efrc ) : tmvaReader->AddVariable(inputVars.at(ivar).data(),&m_mmx2_efrc ); nConfgVar++; } - else if (inputVars.at(ivar)=="dlsmaxVtxMass" ) { m_useEgammaMethodMultiSV ? inputPointers.push_back(&m_mmax_dist ) : tmvaReader->AddVariable(inputVars.at(ivar).data(),&m_mmax_dist ); nConfgVar++; } - else if (inputVars.at(ivar)=="dlsmaxSecVtxMass" ) { m_useEgammaMethodMultiSV ? inputPointers.push_back(&m_mmx2_dist ) : tmvaReader->AddVariable(inputVars.at(ivar).data(),&m_mmx2_dist ); nConfgVar++; } - else if (inputVars.at(ivar)=="dRmaxVtxMassj" ) { m_useEgammaMethodMultiSV ? inputPointers.push_back(&m_mmax_DRjet ) : tmvaReader->AddVariable(inputVars.at(ivar).data(),&m_mmax_DRjet ); nConfgVar++; } - else if (inputVars.at(ivar)=="dRmaxSecVtxMassj" ) { m_useEgammaMethodMultiSV ? inputPointers.push_back(&m_mmx2_DRjet ) : tmvaReader->AddVariable(inputVars.at(ivar).data(),&m_mmx2_DRjet ); nConfgVar++; } - else if (inputVars.at(ivar)=="d2Mass12" ) { m_useEgammaMethodMultiSV ? inputPointers.push_back(&m_mx12_2d12 ) : tmvaReader->AddVariable(inputVars.at(ivar).data(),&m_mx12_2d12 ); nConfgVar++; } - else if (inputVars.at(ivar)=="DRMass12" ) { m_useEgammaMethodMultiSV ? inputPointers.push_back(&m_mx12_DR ) : tmvaReader->AddVariable(inputVars.at(ivar).data(),&m_mx12_DR ); nConfgVar++; } - else if (inputVars.at(ivar)=="AngleMass12" ) { m_useEgammaMethodMultiSV ? inputPointers.push_back(&m_mx12_Angle ) : tmvaReader->AddVariable(inputVars.at(ivar).data(),&m_mx12_Angle ); nConfgVar++; } + if (inputVars.at(ivar)=="pt" ) { inputPointers.push_back(&m_jetpt ) ; nConfgVar++; } + else if (inputVars.at(ivar)=="Nvtx" ) { inputPointers.push_back(&m_nvtx ) ; nConfgVar++; } + else if (inputVars.at(ivar)=="MaxEfrc" ) { inputPointers.push_back(&m_maxefrc ) ; nConfgVar++; } + else if (inputVars.at(ivar)=="sumMass" ) { inputPointers.push_back(&m_summass ) ; nConfgVar++; } + else if (inputVars.at(ivar)=="totalntrk" ) { inputPointers.push_back(&m_totalntrk ) ; nConfgVar++; } + else if (inputVars.at(ivar)=="diffntrkSV0" ) { inputPointers.push_back(&m_diffntrkSV0 ) ; nConfgVar++; } + else if (inputVars.at(ivar)=="diffntrkSV1" ) { inputPointers.push_back(&m_diffntrkSV1 ) ; nConfgVar++; } + else if (inputVars.at(ivar)=="normDist" ) { inputPointers.push_back(&m_normDist ) ; nConfgVar++; } + else if (inputVars.at(ivar)=="maxVtxMass" ) { inputPointers.push_back(&m_mmax_mass ) ; nConfgVar++; } + else if (inputVars.at(ivar)=="maxSecVtxMass" ) { inputPointers.push_back(&m_mmx2_mass ) ; nConfgVar++; } + else if (inputVars.at(ivar)=="EfrcmaxVtxMass" ) { inputPointers.push_back(&m_mmax_efrc ) ; nConfgVar++; } + else if (inputVars.at(ivar)=="EfrcmaxSecVtxMass") { inputPointers.push_back(&m_mmx2_efrc ) ; nConfgVar++; } + else if (inputVars.at(ivar)=="dlsmaxVtxMass" ) { inputPointers.push_back(&m_mmax_dist ) ; nConfgVar++; } + else if (inputVars.at(ivar)=="dlsmaxSecVtxMass" ) { inputPointers.push_back(&m_mmx2_dist ) ; nConfgVar++; } + else if (inputVars.at(ivar)=="dRmaxVtxMassj" ) { inputPointers.push_back(&m_mmax_DRjet ) ; nConfgVar++; } + else if (inputVars.at(ivar)=="dRmaxSecVtxMassj" ) { inputPointers.push_back(&m_mmx2_DRjet ) ; nConfgVar++; } + else if (inputVars.at(ivar)=="d2Mass12" ) { inputPointers.push_back(&m_mx12_2d12 ) ; nConfgVar++; } + else if (inputVars.at(ivar)=="DRMass12" ) { inputPointers.push_back(&m_mx12_DR ) ; nConfgVar++; } + else if (inputVars.at(ivar)=="AngleMass12" ) { inputPointers.push_back(&m_mx12_Angle ) ; nConfgVar++; } else { ATH_MSG_WARNING( "#BTAG# \""<<inputVars.at(ivar)<<"\" <- This variable found in xml/calib-file does not match to any variable declared in MultiSV... the algorithm will be 'disabled'.");//<<alias<<" "<<author); badVariableFound=true; } } - //std::cout<<std::endl; } diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/src/MultivariateTagManager.cxx b/PhysicsAnalysis/JetTagging/JetTagTools/src/MultivariateTagManager.cxx index 44ac05643d7b4ea8a77656c75876d34e400e0894..525a6d073c72ec3d558dbddc0cb42fdf31497097 100644 --- a/PhysicsAnalysis/JetTagging/JetTagTools/src/MultivariateTagManager.cxx +++ b/PhysicsAnalysis/JetTagging/JetTagTools/src/MultivariateTagManager.cxx @@ -17,8 +17,6 @@ #include "GaudiKernel/ToolHandle.h" #include "GaudiKernel/IToolSvc.h" -#include "JetTagCalibration/CalibrationBroker.h" - #include "JetTagTools/JetTagUtils.h" #include "JetTagTools/MultivariateTagManager.h" #include "JetTagTools/BTagVariables.h" diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/src/NewLikelihoodTool.cxx b/PhysicsAnalysis/JetTagging/JetTagTools/src/NewLikelihoodTool.cxx index f8b5376ed96a3cc144105c1ebd1439592c49f254..42e09ea9c261af10dfc0bf9df55bc6f5dc5b67e1 100644 --- a/PhysicsAnalysis/JetTagging/JetTagTools/src/NewLikelihoodTool.cxx +++ b/PhysicsAnalysis/JetTagging/JetTagTools/src/NewLikelihoodTool.cxx @@ -5,7 +5,6 @@ #include "JetTagTools/NewLikelihoodTool.h" #include "JetTagTools/HistoHelperRoot.h" -#include "JetTagCalibration/CalibrationBroker.h" #include <cmath> #include <string> @@ -22,7 +21,6 @@ namespace Analysis { AthAlgTool(t,n,p), m_taggerName("undefined"), m_hypotheses(std::vector<std::string>()), - m_calibrationTool("BTagCalibrationBroker"), m_normalizedProb(true), m_interpolate(false), m_smoothNTimes(1), @@ -34,7 +32,6 @@ namespace Analysis { declareInterface<NewLikelihoodTool>(this); declareProperty("taggerName", m_taggerName); declareProperty("hypotheses", m_hypotheses); - declareProperty("calibrationTool",m_calibrationTool); declareProperty("normalizedProb", m_normalizedProb); declareProperty("interpolate",m_interpolate); declareProperty("smoothNTimes",m_smoothNTimes); @@ -51,13 +48,8 @@ namespace Analysis { } StatusCode NewLikelihoodTool::initialize() { - /** retrieving calibrationTool: */ - if ( m_calibrationTool.retrieve().isFailure() ) { - ATH_MSG_FATAL("#BTAG# Failed to retrieve tool " << m_calibrationTool); - return StatusCode::FAILURE; - } else { - ATH_MSG_DEBUG("#BTAG# Retrieved tool " << m_calibrationTool); - } + ATH_CHECK(m_readKey.initialize()); + return StatusCode::SUCCESS; } @@ -79,20 +71,12 @@ namespace Analysis { m_hypotheses = hyp; } - void NewLikelihoodTool::defineHistogram(const std::string& hname) { - m_histograms.push_back(hname); - std::vector<std::string> gradeList = this->gradeList(hname); - m_calibrationTool->registerHistogram(m_taggerName, hname); - } - void NewLikelihoodTool::printStatus() const { msg(MSG::INFO) << "#BTAG# - hypotheses : "; for(unsigned int ih=0;ih<m_hypotheses.size();ih++) msg(MSG::INFO) << m_hypotheses[ih] << ", "; msg(MSG::INFO) << endmsg; msg(MSG::INFO) << "#BTAG# - histograms : " << endmsg; for(unsigned int ih=0;ih<m_histograms.size();ih++) msg(MSG::INFO) << m_histograms[ih] << endmsg; - msg(MSG::INFO) << "#BTAG# - status of underlying calibrations: " << endmsg; - m_calibrationTool->printStatus(); } void NewLikelihoodTool::clear() { @@ -140,10 +124,11 @@ namespace Analysis { } TH1* NewLikelihoodTool::prepareHistogram(const std::string& hypo, const std::string& hname) { - TH1* histoSum(0); - bool updated = false; - std::string channelName = m_calibrationTool->channelName(hname); - std::string histoName = m_calibrationTool->histoName(hname); + TH1* histoSum = nullptr; + + SG::ReadCondHandle<JetTagCalibCondData> readCdo(m_readKey); + std::string channelName = readCdo->channelName(hname); + std::string histoName = readCdo->histoName(hname); std::string actualName = hypo + "/" + histoName; std::string longName = channelName + "#" + actualName; ATH_MSG_VERBOSE("#BTAG# preparing histogram " << longName); @@ -154,57 +139,41 @@ namespace Analysis { // - case with no grade: if(1==gradeList.size()) { ATH_MSG_DEBUG("#BTAG# Histo "<<actualName<<" has no grade: direct retrieval"); - std::pair<TH1*, bool> rth = m_calibrationTool->retrieveHistogram(m_taggerName, + histoSum = readCdo->retrieveHistogram(m_taggerName, channelName, actualName); - histoSum = rth.first; - updated = rth.second; - if(updated) { - ATH_MSG_VERBOSE("#BTAG# Smoothing histogram " << longName << " ..."); - this->smoothAndNormalizeHistogram(histoSum, longName); - m_calibrationTool->updateHistogramStatus(m_taggerName, channelName, actualName, false); - } } // - case with 1 grade: if(2==gradeList.size()) { ATH_MSG_DEBUG("#BTAG# Histo "<<actualName<<" has only one grade: direct retrieval"); - std::pair<TH1*, bool> rth = m_calibrationTool->retrieveHistogram(m_taggerName, + histoSum = readCdo->retrieveHistogram(m_taggerName, channelName, actualName); - histoSum = rth.first; - updated = rth.second; - if(updated) { - ATH_MSG_VERBOSE("#BTAG# Smoothing histogram " << longName << " ..."); - this->smoothAndNormalizeHistogram(histoSum, longName); - m_calibrationTool->updateHistogramStatus(m_taggerName, channelName, actualName, false); - } + //Part not fully migrated + //smoothAndNormalizeHistogram should not be called here but in condition algorithm + ATH_MSG_VERBOSE("#BTAG# Smoothing histogram " << longName << " ..."); + this->smoothAndNormalizeHistogram(histoSum, longName); } // - for many grades, get individual histos and sum them up: if(gradeList.size()>2) { - TH1* histo(0); - bool AllUpdated = true; + TH1* histo = nullptr; ATH_MSG_DEBUG("Histo " << actualName << " has " << (gradeList.size()-1) << " grades:"); for(unsigned int i=0;i<(gradeList.size()-1);i++) { actualName = hypo+"/"+gradeList[i]+gradeList[gradeList.size()-1]; ATH_MSG_VERBOSE("#BTAG# -> retrieving histo for grade " << i << " " << gradeList[i] << ": "); - std::pair<TH1*, bool> rthh = m_calibrationTool->retrieveHistogram(m_taggerName, + histo = readCdo->retrieveHistogram(m_taggerName, channelName, actualName); - histo = rthh.first; - updated = rthh.second; if(histo) ATH_MSG_VERBOSE("#BTAG# histo " << actualName - << " has " << histo->GetEntries() << " entries. Updated: " - << updated ); - if(updated) { - m_calibrationTool->updateHistogramStatus(m_taggerName, channelName, actualName, false); - } - AllUpdated = AllUpdated && updated; + << " has " << histo->GetEntries() << " entries."); if(0==i) { histoSum = histo; } else { if(histo&&histoSum) histoSum->Add(histo,1.); } } + //Part not fully migrated + //smoothAndNormalizeHistogram should not be called here but in condition algorithm ATH_MSG_VERBOSE("#BTAG# Smoothing histogram " << longName << " ..."); this->smoothAndNormalizeHistogram(histoSum, longName); } diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/src/RNNIPTag.cxx b/PhysicsAnalysis/JetTagging/JetTagTools/src/RNNIPTag.cxx index 05e8e1d50b3bd89bb574dc6e8d699b1a6cd45844..fcd00ce6d2e420c297aa2e07f9ee5e3e22d8602c 100644 --- a/PhysicsAnalysis/JetTagging/JetTagTools/src/RNNIPTag.cxx +++ b/PhysicsAnalysis/JetTagging/JetTagTools/src/RNNIPTag.cxx @@ -15,7 +15,6 @@ #include "JetTagInfo/TrackGrade.h" #include "JetTagInfo/TrackGradesDefinition.h" -#include "JetTagCalibration/CalibrationBroker.h" #include "TrkVertexFitterInterfaces/ITrackToVertexIPEstimator.h" @@ -29,7 +28,6 @@ #include "GeoPrimitives/GeoPrimitivesHelpers.h" #include "GaudiKernel/IToolSvc.h" -// #include "TLorentzVector.h" #include "TObjString.h" #include <cmath> @@ -157,7 +155,6 @@ namespace Analysis { //m_secVxFinderNameForIPSign("InDetVKalVxInJetTool"), m_unbiasIPEstimation(true), m_calibrationDirectory("RNNIP"), - m_calibrationTool("Analysis::CalibrationBroker"), m_secVxFinderName("InDetVKalVxInJetTool"), m_trackToVertexTool("Reco::TrackToVertex"), m_trackSelectorTool("Analysis::TrackSelector"), @@ -203,7 +200,6 @@ namespace Analysis { declareProperty("trackGradeFactory" , m_trackGradeFactory ); declareProperty("TrackToVertexIPEstimator" , m_trackToVertexIPEstimator); declareProperty("calibration_directory", m_calibrationDirectory); - declareProperty("calibrationTool", m_calibrationTool); } @@ -257,9 +253,9 @@ namespace Analysis { /** prepare the track partitions: */ int nbPart = m_trackGradePartitionsDefinition.size(); - ATH_MSG_INFO("#BTAG# Defining " << nbPart <<" track partitions: "); + ATH_MSG_DEBUG("#BTAG# Defining " << nbPart <<" track partitions: "); for(int i=0;i<nbPart;i++) { - TrackGradePartition* part(0); + TrackGradePartition* part = nullptr; try { part = new TrackGradePartition(m_trackGradePartitionsDefinition[i], *m_trackGradeFactory); @@ -284,17 +280,12 @@ namespace Analysis { ATH_MSG_ERROR("#BTAG# Terminating now... "); return StatusCode::FAILURE; } - ATH_MSG_INFO((*part)); + ATH_MSG_DEBUG((*part)); m_trackGradePartitions.push_back(part); } - for (const auto& rnn_name_pair: m_network_cfg) { - if (rnn_name_pair.second.size() == 0) { - ATH_MSG_VERBOSE("registering RNN " << rnn_name_pair.first); - register_hist(rnn_name_pair.first); - } - } - + // prepare readKey for calibration data: + ATH_CHECK(m_readKey.initialize()); return StatusCode::SUCCESS; } @@ -484,17 +475,6 @@ namespace Analysis { { } - - // _____________________________________________________________________ - // Calibration stuff - void RNNIPTag::register_hist(const std::string& file_name) { - m_calibrationTool->registerHistogram(m_calibrationDirectory, file_name); - ATH_MSG_DEBUG(" #BTAG# Registered NN histograms with directory: " << - m_calibrationDirectory); - - m_calibrationTool->printStatus(); - } - std::string RNNIPTag::get_calib_string(const std::string& author, const std::string& name) { @@ -509,18 +489,17 @@ namespace Analysis { } else { ATH_MSG_DEBUG("reading out from DB"); } - const auto stringpair = m_calibrationTool->retrieveTObject<TObject>( + + SG::ReadCondHandle<JetTagCalibCondData> readCdo(m_readKey); + + const auto string = readCdo->retrieveTObject<TObject>( m_calibrationDirectory, author, name); - if (stringpair.second == true) { - m_calibrationTool->updateHistogramStatus( - m_calibrationDirectory, author, name, false); - } - TObjString* cal_string = dynamic_cast<TObjString*>(stringpair.first); + TObjString* cal_string = dynamic_cast<TObjString*>(string); if (cal_string == 0){ //catch if no string was found std::string fuller_name = m_calibrationDirectory + "/" + author + "/" + name; - if (stringpair.first) { + if (string) { fuller_name.append(" [but an object was found]"); } ATH_MSG_WARNING("can't retreve calibration: " + fuller_name); diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/src/SVTag.cxx b/PhysicsAnalysis/JetTagging/JetTagTools/src/SVTag.cxx index 3f476e42e396afdde25f5c887adf389fad3f7cb8..437acd0ae656583042554bb9d2950937cbe820d0 100644 --- a/PhysicsAnalysis/JetTagging/JetTagTools/src/SVTag.cxx +++ b/PhysicsAnalysis/JetTagging/JetTagTools/src/SVTag.cxx @@ -89,38 +89,6 @@ namespace Analysis ATH_MSG_INFO("#BTAG# Retrieved tool " << m_likelihoodTool); } m_likelihoodTool->defineHypotheses(m_hypotheses); - // define new lh variables: - for(unsigned int ih=0;ih<m_hypotheses.size();ih++) { - std::string hName; - if(m_SVmode=="SV1") { - hName = m_hypotheses[ih]+"/N2T"; - m_likelihoodTool->defineHistogram(hName); - hName = m_hypotheses[ih]+"/BidimME"; - m_likelihoodTool->defineHistogram(hName); - if(m_useDRJPVSV) { - hName = m_hypotheses[ih]+"/DRJPVSV"; - m_likelihoodTool->defineHistogram(hName); - } - } - if(m_SVmode=="SV2") { - if(m_usePtSV2){ - hName = m_hypotheses[ih]+"/TridimMENPt"; - m_likelihoodTool->defineHistogram(hName); - hName = m_hypotheses[ih]+"/N2TEffSV2"; - m_likelihoodTool->defineHistogram(hName); - }else{ - hName = m_hypotheses[ih]+"/TridimMEN2T"; - m_likelihoodTool->defineHistogram(hName); - } - } - } - // for efficiencies, add a few histograms: - for(unsigned int ih=0;ih<m_hypotheses.size();ih++) { - std::string hName = m_hypotheses[ih]+"/N2TEff"+m_SVmode; - m_likelihoodTool->defineHistogram(hName); - hName = m_hypotheses[ih]+"/N2TNorm"+m_SVmode; - m_likelihoodTool->defineHistogram(hName); - } m_likelihoodTool->printStatus(); } diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/src/SoftMuonTag.cxx b/PhysicsAnalysis/JetTagging/JetTagTools/src/SoftMuonTag.cxx index 3c1ba59280f3c678ca0ba7394d855dd800786588..0a8de7c6db29fed7ff211c05c0dcf12407edf68a 100644 --- a/PhysicsAnalysis/JetTagging/JetTagTools/src/SoftMuonTag.cxx +++ b/PhysicsAnalysis/JetTagging/JetTagTools/src/SoftMuonTag.cxx @@ -43,17 +43,14 @@ PURPOSE: b-tagging based on soft muon identification #include "JetTagTools/NewLikelihoodTool.h" #include "JetTagTools/HistoHelperRoot.h" #include "GaudiKernel/ITHistSvc.h" -#include "JetTagCalibration/CalibrationBroker.h" #include "xAODMuon/MuonContainer.h" #include "AthenaKernel/Units.h" -#include "TMVA/Reader.h" -#include "TMVA/MethodBDT.h" -#include "TList.h" -#include "TString.h" +#include "TObjArray.h" #include "TObjString.h" +#include "TTree.h" #include <fstream> #include <algorithm> #include <utility> @@ -68,7 +65,6 @@ namespace Analysis SoftMuonTag::SoftMuonTag(const std::string& t, const std::string& n, const IInterface* p) : AthAlgTool(t,n,p), - m_calibrationTool("Analysis::CalibrationBroker"), m_trackToVertexTool("Reco::TrackToVertex"), m_muonSelectorTool("JVC_MuonSelectorTool"), m_likelihoodTool("Analysis::NewLikelihoodTool"), @@ -77,8 +73,6 @@ namespace Analysis { declareInterface<ITagTool>(this); /** ANDREA **/ - // access to XML configuration files for TMVA from COOL: - declareProperty("calibrationTool", m_calibrationTool); // which calibration folder to use declareProperty("taggerNameBase", m_taggerNameBase = "SMT"); declareProperty("taggerName", m_taggerName = "SMT"); @@ -169,20 +163,10 @@ namespace Analysis m_disableAlgo=false; m_treeName = "BDT"; m_varStrName = "variables"; - // prepare calibration tool: - StatusCode scc = m_calibrationTool.retrieve(); - if ( scc.isFailure() ) { - ATH_MSG_FATAL("#BTAG# Failed to retrieve tool " << m_calibrationTool); - return scc; - } else { - ATH_MSG_INFO("#BTAG# Retrieved tool " << m_calibrationTool); - } - ATH_MSG_DEBUG("#BTAG# Folder I look into: "<< m_taggerNameBase+"Calib/"+m_treeName); - m_calibrationTool->registerHistogram(m_taggerNameBase, m_taggerNameBase+"Calib"); - m_calibrationTool->registerHistogram(m_taggerNameBase, m_taggerNameBase+"Calib/"+m_treeName); - m_calibrationTool->registerHistogram(m_taggerNameBase, m_taggerNameBase+"Calib/"+m_varStrName); - m_tmvaReaders.clear(); - m_tmvaMethod.clear(); + + // prepare readKey for calibration data: + ATH_CHECK(m_readKey.initialize()); + m_egammaBDTs.clear(); /** ANDREA **/ @@ -315,7 +299,7 @@ namespace Analysis /** ANDREA **/ /* * #index for this function - * #1: Preparation of MVA instance using tmva/MVAUtils BDT + * #1: Preparation of MVA instance using MVAUtils BDT * #2: set input variables from MultivariateTagManager inputs map * #3: Calculation of MVA output variable(s) * #4: Fill MVA output variable(s) into xAOD @@ -329,45 +313,19 @@ namespace Analysis } } - // #1: Preparation of MVA instance using tmva/egammaBDT + // #1: Preparation of MVA instance using egammaBDT ATH_MSG_DEBUG("#BTAG# Jet author for SoftMuon: " << author ); - /* check if calibration has to be updated: */ - std::pair<TObject*, bool> calib=m_calibrationTool->retrieveTObject<TObject>(m_taggerNameBase,author,m_taggerNameBase+"Calib"); - - bool calibHasChanged = calib.second; - - TMVA::Reader* tmvaReader=0; std::map<std::string, TMVA::Reader*>::iterator pos; - MVAUtils::BDT *bdt=0; std::map<std::string, MVAUtils::BDT*>::iterator it_egammaBDT; - - /*KM: Retrieval of objects from the calibration file and store it back in the calibration broker temporarily*/ - if(calibHasChanged) { - ATH_MSG_DEBUG("#BTAG# " << m_taggerNameBase << " calib updated -> try to retrieve"); - if(!calib.first) { - ATH_MSG_WARNING("#BTAG# TObject can't be retrieved -> no calibration for"<< m_taggerNameBase<<" "<<author); - m_disableAlgo=true; - return StatusCode::SUCCESS; - } - else { - const TString rootClassName=calib.first->ClassName(); - if (rootClassName!="TDirectoryFile") { - ATH_MSG_WARNING("#BTAG# Unsupported ROOT class type: "<<rootClassName<<" is retrieved. Disabling algorithm.."); - m_disableAlgo=true; - return StatusCode::SUCCESS; - } - } - } + MVAUtils::BDT *bdt=nullptr; std::map<std::string, MVAUtils::BDT*>::iterator it_egammaBDT; - m_calibrationTool->updateHistogramStatus(m_taggerNameBase, author, m_taggerNameBase+"Calib", false); - std::vector<std::string> inputVars; inputVars.clear(); + //Retrieval of Calibration Condition Data objects + SG::ReadCondHandle<JetTagCalibCondData> readCdo(m_readKey); - std::pair<TObject*, bool> calibTree=m_calibrationTool->retrieveTObject<TObject>(m_taggerNameBase,author,m_taggerNameBase+"Calib/"+m_treeName); - std::pair<TObject*, bool> calibVariables=m_calibrationTool->retrieveTObject<TObject>(m_taggerNameBase,author,m_taggerNameBase+"Calib/"+m_varStrName); - TTree *tree = (TTree*) calibTree.first; - TObjArray* toa= (TObjArray*) calibVariables.first; + TObjArray* toa=readCdo->retrieveTObject<TObjArray>("SoftMu",author, m_taggerNameBase+"Calib/"+m_varStrName); + TTree *tree = readCdo->retrieveTObject<TTree>("SoftMu",author, m_taggerNameBase+"Calib/"+m_treeName); std::string commaSepVars=""; if (toa) { - TObjString *tos= 0; + TObjString *tos= nullptr; if (toa->GetEntries()>0) tos= (TObjString*) toa->At(0); commaSepVars=tos->GetString().Data(); } else { @@ -375,7 +333,9 @@ namespace Analysis m_disableAlgo=true; return StatusCode::SUCCESS; } + //prepare inputVars + std::vector<std::string> inputVars; inputVars.clear(); while (commaSepVars.find(",")!=std::string::npos) { inputVars.push_back(commaSepVars.substr(0,commaSepVars.find(","))); commaSepVars.erase(0,commaSepVars.find(",")+1); @@ -385,64 +345,42 @@ namespace Analysis ATH_MSG_DEBUG("#BTAG# tree name= "<< tree->GetName() <<" inputVars.size()= "<< inputVars.size());// <<" toa->GetEntries()= "<< toa->GetEntries() <<"commaSepVars= "<< commaSepVars); for (unsigned int asv=0; asv<inputVars.size(); asv++) ATH_MSG_DEBUG("#BTAG# inputVar= "<< inputVars.at(asv)); - ATH_MSG_DEBUG("#BTAG# m_taggerNameBase= "<< m_taggerNameBase ); - - m_calibrationTool->storeCalib(m_taggerNameBase, author, m_taggerNameBase+"Calib", inputVars, "", tree); - - - /*KM: Get back the calib objects from calibration broker*/ - std::string alias = m_calibrationTool->channelAlias(author); - if (!m_calibrationTool->updatedTagger(m_taggerNameBase, author, m_taggerNameBase+"Calib") ) { - std::vector<float*> inputPointers; inputPointers.clear(); - unsigned nConfgVar=0; bool badVariableFound=false; - - CalibrationBroker::calibMV2 calib = m_calibrationTool->getCalib(m_taggerNameBase, author, m_taggerNameBase+"Calib"); - std::vector<std::string> inputVars = calib.inputVars; - std::string str = calib.str; - TTree* tree = (TTree*) calib.obj; - ATH_MSG_DEBUG("#BTAG# str= "<< str <<" m_treeName= "<< m_treeName ); - - if ( (str!="" and tree==0) && (str=="" and tree!=0) ) { - ATH_MSG_WARNING("#BTAG# Unrecognized SMT configuration disabling the algorithm..." ); - m_disableAlgo=true; - return StatusCode::SUCCESS; - } - - ATH_MSG_INFO("#BTAG# Booking MVAUtils::BDT for "<<m_taggerNameBase); + ATH_MSG_DEBUG("#BTAG# Booking MVAUtils::BDT for "<<m_taggerNameBase); - if (tree) { - ATH_MSG_DEBUG("#BTAG# TTree with name: "<<m_treeName<<" exists in the calibration file."); - bdt = new MVAUtils:: BDT(tree); - } - else { - ATH_MSG_WARNING("#BTAG# No TTree with name: "<<m_treeName<<" exists in the calibration file.. Disabling algorithm."); - m_disableAlgo=true; - delete bdt; - return StatusCode::SUCCESS; - } + if (tree) { + ATH_MSG_DEBUG("#BTAG# TTree with name: "<<m_treeName<<" exists in the calibration file."); + bdt = new MVAUtils:: BDT(tree); + } + else { + ATH_MSG_WARNING("#BTAG# No TTree with name: "<<m_treeName<<" exists in the calibration file.. Disabling algorithm."); + m_disableAlgo=true; + delete bdt; + return StatusCode::SUCCESS; + } - SetVariableRefs(inputVars,nConfgVar,badVariableFound,inputPointers); - ATH_MSG_DEBUG("#BTAG# tmvaReader= "<<tmvaReader <<", nConfgVar"<<nConfgVar + std::string alias = readCdo->getChannelAlias(author); + std::vector<float*> inputPointers; inputPointers.clear(); + unsigned nConfgVar=0; bool badVariableFound=false; + + SetVariableRefs(inputVars,nConfgVar,badVariableFound,inputPointers); + ATH_MSG_DEBUG("#BTAG# nConfgVar"<<nConfgVar <<", badVariableFound= "<<badVariableFound <<", inputPointers.size()= "<<inputPointers.size() ); - if ( inputVars.size()!=nConfgVar or badVariableFound ) { - ATH_MSG_WARNING("#BTAG# Number of expected variables for SoftMu: "<< nConfgVar << " does not match the number of variables found in the calibration file: " << inputVars.size() << " ... the algorithm will be 'disabled' "<<alias<<" "<<author); - m_disableAlgo=true; - delete bdt; - return StatusCode::SUCCESS; - } + if ( inputVars.size()!=nConfgVar or badVariableFound ) { + ATH_MSG_WARNING("#BTAG# Number of expected variables for SoftMu: "<< nConfgVar << " does not match the number of variables found in the calibration file: " << inputVars.size() << " ... the algorithm will be 'disabled' "<<alias<<" "<<author); + m_disableAlgo=true; + delete bdt; + return StatusCode::SUCCESS; + } - bdt->SetPointers(inputPointers); + bdt->SetPointers(inputPointers); - it_egammaBDT = m_egammaBDTs.find(alias); - if(it_egammaBDT!=m_egammaBDTs.end()) { - delete it_egammaBDT->second; - m_egammaBDTs.erase(it_egammaBDT); - } - m_egammaBDTs.insert( std::make_pair( alias, bdt ) ); - m_calibrationTool->updateHistogramStatusPerTagger(m_taggerNameBase,author, m_taggerNameBase+"Calib", false); - + it_egammaBDT = m_egammaBDTs.find(alias); + if(it_egammaBDT!=m_egammaBDTs.end()) { + delete it_egammaBDT->second; + m_egammaBDTs.erase(it_egammaBDT); } + m_egammaBDTs.insert( std::make_pair( alias, bdt ) ); // Reference only: Fill control histograms and get jet label std::string pref = ""; @@ -464,8 +402,6 @@ namespace Analysis ///return StatusCode::SUCCESS; /// need to go untill the end to decorate } - - /// variables used to decorate the Btagging object float jet_mu_dRmin_pt=0; float jet_mu_dRmin_dR=10; diff --git a/PhysicsAnalysis/MCTruthClassifier/CMakeLists.txt b/PhysicsAnalysis/MCTruthClassifier/CMakeLists.txt index 64ff08b68225bc5a091d39e50b101ea03ec991bc..a6abcb25ed965bb3f8a38464461b84617c39df84 100644 --- a/PhysicsAnalysis/MCTruthClassifier/CMakeLists.txt +++ b/PhysicsAnalysis/MCTruthClassifier/CMakeLists.txt @@ -17,14 +17,15 @@ elseif( XAOD_ANALYSIS ) else() set( extra_deps GaudiKernel Reconstruction/RecoTools/ParticlesInConeTools + Reconstruction/RecoTools/RecoToolInterfaces PRIVATE Generators/TruthUtils - Reconstruction/RecoTools/RecoToolInterfaces Tracking/TrkEvent/TrkEventPrimitives Tracking/TrkEvent/TrkParametersIdentificationHelpers + Tracking/TrkEvent/TrkCaloExtension Control/AthenaKernel ) - set( extra_libs GaudiKernel - PRIVATE_LINK_LIBRARIES GeneratorObjects RecoToolInterfaces + set( extra_libs GaudiKernel RecoToolInterfaces + PRIVATE_LINK_LIBRARIES GeneratorObjects TrkEventPrimitives TrkParametersIdentificationHelpers ) endif() diff --git a/PhysicsAnalysis/MCTruthClassifier/MCTruthClassifier/IMCTruthClassifier.h b/PhysicsAnalysis/MCTruthClassifier/MCTruthClassifier/IMCTruthClassifier.h index 8ac2f28ad4a7a31d9728eaa1d033807c2fcafa84..f0b6804bbdc4dcf4b8300a5b2ca8918811cfd8eb 100644 --- a/PhysicsAnalysis/MCTruthClassifier/MCTruthClassifier/IMCTruthClassifier.h +++ b/PhysicsAnalysis/MCTruthClassifier/MCTruthClassifier/IMCTruthClassifier.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -13,7 +13,7 @@ Interface for the PhysicsAnalysis/MCTruthClassifier/MCTruthclassifier @author Frederic Derue derue@lpnhe.in2p3.fr CREATED : 01/09/2008 - MODIFIED : + MODIFIED : */ #include "AsgTools/IAsgTool.h" @@ -26,15 +26,20 @@ #include "xAODEgamma/PhotonFwd.h" #include "xAODTracking/TrackParticleFwd.h" #include "xAODCaloEvent/CaloClusterFwd.h" + #include "xAODTruth/TruthParticle.h" #include "xAODMuon/Muon.h" #include "xAODJet/Jet.h" +#include <memory> +#include <unordered_map> + #define MCTRUTHCLASSIFIER_CONST #ifndef XAOD_ANALYSIS +#include "RecoToolInterfaces/IParticleCaloExtensionTool.h" namespace HepMC { class GenParticle; } @@ -45,8 +50,9 @@ class IMCTruthClassifier : virtual public asg::IAsgTool { ASG_TOOL_INTERFACE(IMCTruthClassifier) public: - - +#ifndef XAOD_ANALYSIS + typedef std::unordered_map<size_t,std::unique_ptr<Trk::CaloExtension>> Cache; +#endif // Additional information that can be returned by the classifier. // Originally, these were all held in member variables in the classifier, // but that prevents the classifier methods from being made const. @@ -55,6 +61,7 @@ class IMCTruthClassifier : virtual public asg::IAsgTool { class Info { public: + const xAOD::TruthParticle* genPart = nullptr; MCTruthPartClassifier::ParticleOutCome particleOutCome = MCTruthPartClassifier::UnknownOutCome; @@ -75,7 +82,9 @@ class IMCTruthClassifier : virtual public asg::IAsgTool { const xAOD::TruthParticle* photonMother = nullptr; const xAOD::TruthParticle* bkgElecMother = nullptr; - +#ifndef XAOD_ANALYSIS + Cache *extrapolationCache = nullptr; +#endif std::vector<const xAOD::TruthParticle*> egPartPtr; std::vector<float> egPartdR; std::vector<std::pair<MCTruthPartClassifier::ParticleType,MCTruthPartClassifier::ParticleOrigin> > egPartClas; diff --git a/PhysicsAnalysis/MCTruthClassifier/MCTruthClassifier/MCTruthClassifier.h b/PhysicsAnalysis/MCTruthClassifier/MCTruthClassifier/MCTruthClassifier.h index 50a352f5006281473bf15461d0b9d90fa58c6e35..3e15deae45072ec3bc15808fefcc715ad2373c77 100644 --- a/PhysicsAnalysis/MCTruthClassifier/MCTruthClassifier/MCTruthClassifier.h +++ b/PhysicsAnalysis/MCTruthClassifier/MCTruthClassifier/MCTruthClassifier.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef MCTRUTHCLASSIFIER_MCTRUTHCLASSIFIER_H @@ -17,6 +17,7 @@ Updated: #include "AsgTools/AsgTool.h" #include "MCTruthClassifier/MCTruthClassifierDefs.h" #include "MCTruthClassifier/IMCTruthClassifier.h" + // EDM includes #include "xAODTruth/TruthParticleContainerFwd.h" @@ -128,7 +129,7 @@ class MCTruthClassifier : virtual public IMCTruthClassifier , public asg::AsgToo // static double partCharge(const xAOD::TruthParticle*); #ifndef XAOD_ANALYSIS - bool genPartToCalo(const xAOD::CaloCluster* , const xAOD::TruthParticle* , bool, double&, bool& ) const; + bool genPartToCalo(const xAOD::CaloCluster* , const xAOD::TruthParticle* , bool, double&, bool&, Cache * ) const; const xAOD::TruthParticle* egammaClusMatch(const xAOD::CaloCluster*, bool, Info* info) const; #endif diff --git a/PhysicsAnalysis/MCTruthClassifier/Root/MCTruthClassifier.cxx b/PhysicsAnalysis/MCTruthClassifier/Root/MCTruthClassifier.cxx index 0389a6850786a8fafec3e6193b43b458b0dd8a5c..401a600c4e0502e51e1ba3dfe7b1c5d26687eb7e 100644 --- a/PhysicsAnalysis/MCTruthClassifier/Root/MCTruthClassifier.cxx +++ b/PhysicsAnalysis/MCTruthClassifier/Root/MCTruthClassifier.cxx @@ -152,7 +152,6 @@ MCTruthClassifier::particleTruthClassifier(const xAOD::TruthParticle *thePart, ParticleOrigin partOrig = NonDefined; if (info) { - *info = Info(); info->genPart = thePart; } @@ -330,7 +329,6 @@ MCTruthClassifier::particleTruthClassifier(const xAOD::TrackParticle *trkPtr, const xAOD::TruthParticle* genPart = getGenPart(trkPtr); if (info) { - *info = Info(); info->genPart = genPart; } @@ -369,7 +367,6 @@ MCTruthClassifier::particleTruthClassifier(const xAOD::Electron* elec, } if (info) { - *info = Info(); info->genPart = genPart; } @@ -392,8 +389,6 @@ MCTruthClassifier::particleTruthClassifier(const xAOD::Photon* phot, ParticleType parttype = Unknown; ParticleOrigin partorig = NonDefined; - if (info) - *info = Info(); const xAOD::CaloCluster* clus=phot->caloCluster(); if(!clus) return std::make_pair(parttype,partorig); @@ -441,9 +436,6 @@ MCTruthClassifier::particleTruthClassifier(const xAOD::Muon* mu, //----------------------------------------------------------------------------------------- ATH_MSG_DEBUG( "Executing muon Classifier" ); - - if (info) - *info = Info(); ParticleType parttype = Unknown; ParticleOrigin partorig = NonDefined; @@ -479,9 +471,6 @@ MCTruthClassifier::particleTruthClassifier(const xAOD::CaloCluster* clus, ParticleType parttype = Unknown; ParticleOrigin partorig = NonDefined; - if (info){ - *info = Info(); - } if(!clus){ return std::make_pair(parttype,partorig); } @@ -512,10 +501,6 @@ MCTruthClassifier::particleTruthClassifier(const xAOD::Jet* jet, bool DR, ATH_MSG_DEBUG( "Executing Classifier with jet Input" ); - if (info){ - *info = Info(); - } - ParticleType parttype = UnknownJet; ParticleOrigin partorig = NonDefined; ParticleType tempparttype = UnknownJet; diff --git a/PhysicsAnalysis/MCTruthClassifier/src/MCTruthClassifierAthena.cxx b/PhysicsAnalysis/MCTruthClassifier/src/MCTruthClassifierAthena.cxx index ea6dab830fbea78345406f41fdc7416161d84ae2..c7a727b0f9ec24ef234e0e1245a65ac88ebc4047 100644 --- a/PhysicsAnalysis/MCTruthClassifier/src/MCTruthClassifierAthena.cxx +++ b/PhysicsAnalysis/MCTruthClassifier/src/MCTruthClassifierAthena.cxx @@ -152,7 +152,7 @@ MCTruthClassifier::egammaClusMatch(const xAOD::CaloCluster* clus, double dR(-999.); bool isNCone=false; - bool isExt = genPartToCalo(clus, thePart,isFwrdEle, dR, isNCone); + bool isExt = genPartToCalo(clus, thePart,isFwrdEle, dR, isNCone, info->extrapolationCache); if (!isExt) continue; theMatchPart = barcode_to_particle(truthParticleContainerReadHandle.ptr(),thePart->barcode()%m_barcodeShift); @@ -237,7 +237,7 @@ MCTruthClassifier::egammaClusMatch(const xAOD::CaloCluster* clus, double dR(-999.); bool isNCone=false; - bool isExt = genPartToCalo(clus, thePart, false , dR, isNCone); + bool isExt = genPartToCalo(clus, thePart, false , dR, isNCone, info->extrapolationCache); if(!isExt) continue; theMatchPart = barcode_to_particle(truthParticleContainerReadHandle.ptr(),thePart->barcode()%m_barcodeShift); @@ -293,14 +293,15 @@ bool MCTruthClassifier::genPartToCalo(const xAOD::CaloCluster* clus, const xAOD::TruthParticle* thePart, bool isFwrdEle, double& dRmatch, - bool & isNarrowCone) const { + bool & isNarrowCone, + Cache *cache) const { dRmatch = -999.; isNarrowCone = false; if ( thePart == 0 ) return false ; - std::unique_ptr<Trk::CaloExtension> caloExtension =m_caloExtensionTool->caloExtension(*thePart); - if( !caloExtension|| caloExtension->caloLayerIntersections().empty() ){ + const Trk::CaloExtension* caloExtension =m_caloExtensionTool->caloExtension(*thePart, *cache ); + if( caloExtension == nullptr || caloExtension->caloLayerIntersections().empty() ){ ATH_MSG_WARNING("extrapolation of Truth Particle with eta " << thePart->eta() <<" and Pt " << thePart->pt() << " to calo failed"); return false; diff --git a/PhysicsAnalysis/RingerSelectorTools/RingerSelectorTools/AsgElectronRingerSelector.h b/PhysicsAnalysis/RingerSelectorTools/RingerSelectorTools/AsgElectronRingerSelector.h index a5ec8c7a68ceb9808366ad4cb304962642e361c0..c8975bdf65a4b77934a5916efe67849504f32d29 100644 --- a/PhysicsAnalysis/RingerSelectorTools/RingerSelectorTools/AsgElectronRingerSelector.h +++ b/PhysicsAnalysis/RingerSelectorTools/RingerSelectorTools/AsgElectronRingerSelector.h @@ -320,7 +320,8 @@ class AsgElectronRingerSelector : public asg::AsgMetadataTool, * @class RingerConfStruct * @brief Configuration structure for parameters in file **/ -struct RingerConfStruct { +class RingerConfStruct { +public: bool useTrackPat; bool useRawTrackPat; //bool useCalStdPat; diff --git a/PhysicsAnalysis/RingerSelectorTools/RingerSelectorTools/tools/VariableDependency.h b/PhysicsAnalysis/RingerSelectorTools/RingerSelectorTools/tools/VariableDependency.h index 76224a1165fa7790939ce4ff66d2dac2f0b558ad..57cbb5b402d20c81055948d592ed8ba026bbbb10 100644 --- a/PhysicsAnalysis/RingerSelectorTools/RingerSelectorTools/tools/VariableDependency.h +++ b/PhysicsAnalysis/RingerSelectorTools/RingerSelectorTools/tools/VariableDependency.h @@ -34,7 +34,8 @@ namespace Ringer { * * Holds dependent variables values. **/ -struct DepVarStruct { +class DepVarStruct { +public: /// Holds particle transverse energy const float et; /// Holds eta position diff --git a/Projects/AthDataQuality/build.sh b/Projects/AthDataQuality/build.sh index cf1c7ed70b74856c7147bcb7c0daceea60a04003..b237408e895926c93384dbe2560cef2f1354cf5b 100755 --- a/Projects/AthDataQuality/build.sh +++ b/Projects/AthDataQuality/build.sh @@ -6,12 +6,15 @@ # Function printing the usage information for the script usage() { - echo "Usage: build.sh [-t build type] [-b build dir] [-c] [-m] [-i] [-p] [-a]" + echo "Usage: build.sh [-t build type] [-b build dir] [-c] [-m] [-i] [-p] [-a] [-x] [-N]" echo " -c: Execute CMake step" echo " -m: Execute make step" echo " -i: Execute install step" echo " -p: Execute CPack step" echo " -a: Abort on error" + echo " -x: Add extra CMake argument" + echo " -N: Use Ninja" + echo "If none of the c, m, i or p options are set then the script will do" echo "*all* steps. Otherwise only the enabled steps are run - it's your" echo "reponsibility to ensure that precusors are in good shape" @@ -25,7 +28,10 @@ EXE_MAKE="" EXE_INSTALL="" EXE_CPACK="" NIGHTLY=true -while getopts ":t:b:hcmipa" opt; do +BUILDTOOLTYPE="" +BUILDTOOL="make -k" +INSTALLRULE="install/fast" +while getopts ":t:b:hcmipax:N" opt; do case $opt in t) BUILDTYPE=$OPTARG @@ -48,6 +54,14 @@ while getopts ":t:b:hcmipa" opt; do a) NIGHTLY=false ;; + x) + EXTRACMAKE=$OPTARG + ;; + N) + BUILDTOOL="ninja -k 0" + BUILDTOOLTYPE="-GNinja" + INSTALLRULE="install" + ;; h) usage exit 0 @@ -84,23 +98,22 @@ fi mkdir -p ${BUILDDIR} BUILDDIR=$(cd ${BUILDDIR} && pwd) source $AthDataQualitySrcDir/build_env.sh -b $BUILDDIR +cat ${BUILDDIR}/build_env.log # create the actual build directory mkdir -p ${BUILDDIR}/build/AthDataQuality cd ${BUILDDIR}/build/AthDataQuality -# consider a pipe failed if ANY of the commands fails -set -o pipefail - # CMake: if [ -n "$EXE_CMAKE" ]; then # Remove the CMakeCache.txt file, to force CMake to find externals # from scratch in an incremental build. rm -f CMakeCache.txt # Now run the actual CMake configuration: - time cmake -DCMAKE_BUILD_TYPE:STRING=${BUILDTYPE} \ + { time cmake ${BUILDTOOLTYPE} -DCMAKE_BUILD_TYPE:STRING=${BUILDTYPE} \ + ${EXTRACMAKE} \ -DCTEST_USE_LAUNCHERS:BOOL=TRUE \ - ${AthDataQualitySrcDir} 2>&1 | tee cmake_config.log + ${AthDataQualitySrcDir}; } 2>&1 | tee cmake_config.log fi # for nightly builds we want to get as far as we can @@ -111,14 +124,19 @@ fi # make: if [ -n "$EXE_MAKE" ]; then - time make -k 2>&1 | tee cmake_build.log + # Forcibly remove the merged CLID file from the previous build, to + # avoid issues with some library possibly changing the name/CLID + # of something during the build. Note that ${platform} is coming from + # the build_env.sh script. + rm -f ${platform}/share/clid.db + # Build the project. + { time ${BUILDTOOL}; } 2>&1 | tee cmake_build.log fi # Install the results: if [ -n "$EXE_INSTALL" ]; then - time make install/fast \ - DESTDIR=${BUILDDIR}/install/AthDataQuality/${NICOS_PROJECT_VERSION} \ - 2>&1 | tee cmake_install.log + { time DESTDIR=${BUILDDIR}/install/AthDataQuality/${NICOS_PROJECT_VERSION} ${BUILDTOOL} ${INSTALLRULE}; } \ + 2>&1 | tee cmake_install.log fi # Build an RPM for the release: diff --git a/Projects/AthSimulation/build.sh b/Projects/AthSimulation/build.sh index 3c16570ca48face319c8b7baa707942c86eafc19..651433bbb7c0ff0a7fbea1a36521d84579c0b33f 100755 --- a/Projects/AthSimulation/build.sh +++ b/Projects/AthSimulation/build.sh @@ -6,12 +6,15 @@ # Function printing the usage information for the script usage() { - echo "Usage: build.sh [-t build type] [-b build dir] [-c] [-m] [-i] [-p] [-a]" + echo "Usage: build.sh [-t build type] [-b build dir] [-c] [-m] [-i] [-p] [-a] [-x] [-N]" echo " -c: Execute CMake step" echo " -m: Execute make step" echo " -i: Execute install step" echo " -p: Execute CPack step" echo " -a: Abort on error" + echo " -x: Add extra CMake argument" + echo " -N: Use Ninja" + echo "If none of the c, m, i or p options are set then the script will do" echo "*all* steps. Otherwise only the enabled steps are run - it's your" echo "reponsibility to ensure that precusors are in good shape" @@ -25,7 +28,10 @@ EXE_MAKE="" EXE_INSTALL="" EXE_CPACK="" NIGHTLY=true -while getopts ":t:b:hcmipa" opt; do +BUILDTOOLTYPE="" +BUILDTOOL="make -k" +INSTALLRULE="install/fast" +while getopts ":t:b:hcmipax:N" opt; do case $opt in t) BUILDTYPE=$OPTARG @@ -48,6 +54,14 @@ while getopts ":t:b:hcmipa" opt; do a) NIGHTLY=false ;; + x) + EXTRACMAKE=$OPTARG + ;; + N) + BUILDTOOL="ninja -k 0" + BUILDTOOLTYPE="-GNinja" + INSTALLRULE="install" + ;; h) usage exit 0 @@ -98,7 +112,8 @@ if [ -n "$EXE_CMAKE" ]; then # from scratch in an incremental build. rm -f CMakeCache.txt # Now run the actual CMake configuration: - { time cmake -DCMAKE_BUILD_TYPE:STRING=${BUILDTYPE} \ + { time cmake ${BUILDTOOLTYPE} -DCMAKE_BUILD_TYPE:STRING=${BUILDTYPE} \ + ${EXTRACMAKE} \ -DCTEST_USE_LAUNCHERS:BOOL=TRUE \ ${AthSimulationSrcDir}; } 2>&1 | tee cmake_config.log fi @@ -117,13 +132,13 @@ if [ -n "$EXE_MAKE" ]; then # the build_env.sh script. rm -f ${platform}/share/clid.db # Build the project. - { time make -k; } 2>&1 | tee cmake_build.log + { time ${BUILDTOOL}; } 2>&1 | tee cmake_build.log fi # Install the results: if [ -n "$EXE_INSTALL" ]; then - { time make install/fast \ - DESTDIR=${BUILDDIR}/install/AthSimulation/${NICOS_PROJECT_VERSION}; } 2>&1 | tee cmake_install.log + { time DESTDIR=${BUILDDIR}/install/AthSimulation/${NICOS_PROJECT_VERSION} ${BUILDTOOL} ${INSTALLRULE}; } \ + 2>&1 | tee cmake_install.log fi # Build an RPM for the release: diff --git a/Projects/AthSimulation/package_filters.txt b/Projects/AthSimulation/package_filters.txt index 552cada7658d7e48f2e8f496aa6c08bae9176920..efb38d6a229cb9f38262153985b10e6189287f0c 100644 --- a/Projects/AthSimulation/package_filters.txt +++ b/Projects/AthSimulation/package_filters.txt @@ -6,8 +6,6 @@ + AtlasGeometryCommon/GeoModelEnvelopes + AtlasGeometryCommon/Interpreters + AtlasGeometryCommon/SubDetectorEnvelopes -+ AtlasTest/NightlyTestTools/ATNight -+ AtlasTest/NightlyTestTools/Nicos + AtlasTest/TestTools + Calorimeter/CaloCnv/CaloDetMgrDetDescrCnv + Calorimeter/CaloCnv/CaloIdCnv @@ -40,7 +38,6 @@ + Control/CLIDComps + Control/CLIDSvc + Control/CxxUtils -+ Control/DataModel + Control/DataModelAthenaPool + Control/DataModelRoot + Control/GaudiSequencer @@ -71,9 +68,7 @@ + Database/APR/RootCollection + Database/APR/RootStorageSvc + Database/APR/StorageSvc -+ Database/APR/XMLCatalog + Database/AthenaPOOL/AthenaPoolCnvSvc -+ Database/AthenaPOOL/AthenaPoolKernel + Database/AthenaPOOL/AthenaPoolServices + Database/AthenaPOOL/AthenaPoolUtilities + Database/AthenaPOOL/DBDataModel @@ -218,7 +213,6 @@ + LArCalorimeter/LArG4/LArG4RunControl + LArCalorimeter/LArG4/LArG4SD + LArCalorimeter/LArG4/LArG4ShowerLib -+ LArCalorimeter/LArG4/LArG4ShowerLibData + LArCalorimeter/LArG4/LArG4ShowerLibSvc + LArCalorimeter/LArGeoModel/LArGeoAlgsNV + LArCalorimeter/LArGeoModel/LArGeoBarrel @@ -331,7 +325,6 @@ + Tools/PathResolver + Tools/PmbCxxUtils + Tools/PROCTools -+ Tools/PyCmt + Tools/PyJobTransforms + Tools/PyUtils + Tools/Scripts diff --git a/Projects/Athena/package_filters.txt b/Projects/Athena/package_filters.txt index c9b81c4212e84bc4e49c2d8f0019661fefffae55..cd306a1de015fd862d2dfe4f39c8a9447d43972f 100644 --- a/Projects/Athena/package_filters.txt +++ b/Projects/Athena/package_filters.txt @@ -10,6 +10,7 @@ # Remove most HLT packages + HLT/Trigger/TrigTransforms/TrigTransform ++ HLT/Event/ByteStreamEmonSvc - HLT/.* - Trigger/TrigValidation/TrigP1Test - HLT/HLToks diff --git a/Reconstruction/HeavyIonRec/HIJetRec/python/HIJetRecFlags.py b/Reconstruction/HeavyIonRec/HIJetRec/python/HIJetRecFlags.py index ea678cea410cd5339ad3f870e92e4772ce395ff5..b210d9c17c87d1129bc151960060aace08110111 100644 --- a/Reconstruction/HeavyIonRec/HIJetRec/python/HIJetRecFlags.py +++ b/Reconstruction/HeavyIonRec/HIJetRec/python/HIJetRecFlags.py @@ -126,6 +126,13 @@ class ExtraFlowMoments(JobProperty): allowedTypes = ['bool'] StoredValue = True +class DoHIBTagging(JobProperty): + """ Perform b-tagging over HI jet collections + """ + statusOn = True + allowedTypes = ['bool'] + StoredValue = False + class HIClusterKey(JobProperty): """ Key of CaloClusterContainer containing HI clusters @@ -251,6 +258,7 @@ list_jobproperties = [UnsubtractedSuffix, ModulationScheme, Remodulate, ExtraFlowMoments, + DoHIBTagging, HIClusterKey, IteratedEventShapeKey, TruthJetPtMin, diff --git a/Reconstruction/HeavyIonRec/HIJetRec/share/HIJetRec_jobOptions.py b/Reconstruction/HeavyIonRec/HIJetRec/share/HIJetRec_jobOptions.py index 78a1d0d92fcd715da631578701f999b4728e4539..352ee7fddf1b3bea62dfd978cb697833b8325d58 100644 --- a/Reconstruction/HeavyIonRec/HIJetRec/share/HIJetRec_jobOptions.py +++ b/Reconstruction/HeavyIonRec/HIJetRec/share/HIJetRec_jobOptions.py @@ -113,45 +113,47 @@ JetAlgFromTools(jtm.HIJetRecs,suffix="HI",persistify=True) # code cloned from BTagging_jobOptions.py # to allow b-tagging over HI jets -if not BTaggingFlags.DoNotSetupBTagging: # Temporary measure so the JetRec people can test setting this all up from their side. - # - # ========== Load and configure everything - # - - from BTagging.BTaggingConfiguration import getConfiguration - ConfInstance = getConfiguration() - - if ConfInstance.checkFlagsUsingBTaggingFlags(): - - #Jet collections - JetCollectionList = ['AntiKt4HIJets'] - from JetRec.JetRecFlags import jetFlags - - BTaggingFlags.Jets = [ name[:-4] for name in JetCollectionList] - - #BTagging list - btag = ConfInstance.getOutputFilesPrefix() #BTaggingFlags.OutputFilesBTag #"BTagging_" - - #TODO define name author (now BTagging_AntiKt4LCTopo) - AuthorSubString = [ btag+name[:-4] for name in JetCollectionList] - - NotInJetToolManager = [] # For jet collections - from JetRec.JetRecStandard import jtm - for i, jet in enumerate(JetCollectionList): - try: - btagger = ConfInstance.setupJetBTaggerTool(ToolSvc, jet) #The [:-4] is not needed here; this function automatically removes trailing 'jets' or 'Jets'. - if btagger is None: - continue - jet = jet.replace("Track", "PV0Track") - jetname = getattr(jtm, jet) - jetname.unlock() - jetname.JetModifiers += [ btagger ] - jetname.lock() - if BTaggingFlags.OutputLevel < 3: - print ConfInstance.getJetCollectionTool(jet[:-4]) - except AttributeError as error: - print '#BTAG# --> ' + str(error) - NotInJetToolManager.append(AuthorSubString[i]) - - if len(NotInJetToolManager) > 0: - AuthorSubString = list(set(AuthorSubString) - set(NotInJetToolManager)) +if HIJetFlags.DoHIBTagging(): + + if not BTaggingFlags.DoNotSetupBTagging: # Temporary measure so the JetRec people can test setting this all up from their side. + # + # ========== Load and configure everything + # + + from BTagging.BTaggingConfiguration import getConfiguration + ConfInstance = getConfiguration() + + if ConfInstance.checkFlagsUsingBTaggingFlags(): + + #Jet collections + JetCollectionList = ['AntiKt4HIJets'] + from JetRec.JetRecFlags import jetFlags + + BTaggingFlags.Jets = [ name[:-4] for name in JetCollectionList] + + #BTagging list + btag = ConfInstance.getOutputFilesPrefix() #BTaggingFlags.OutputFilesBTag #"BTagging_" + + #TODO define name author (now BTagging_AntiKt4LCTopo) + AuthorSubString = [ btag+name[:-4] for name in JetCollectionList] + + NotInJetToolManager = [] # For jet collections + from JetRec.JetRecStandard import jtm + for i, jet in enumerate(JetCollectionList): + try: + btagger = ConfInstance.setupJetBTaggerTool(ToolSvc, jet) #The [:-4] is not needed here; this function automatically removes trailing 'jets' or 'Jets'. + if btagger is None: + continue + jet = jet.replace("Track", "PV0Track") + jetname = getattr(jtm, jet) + jetname.unlock() + jetname.JetModifiers += [ btagger ] + jetname.lock() + if BTaggingFlags.OutputLevel < 3: + print ConfInstance.getJetCollectionTool(jet[:-4]) + except AttributeError as error: + print '#BTAG# --> ' + str(error) + NotInJetToolManager.append(AuthorSubString[i]) + + if len(NotInJetToolManager) > 0: + AuthorSubString = list(set(AuthorSubString) - set(NotInJetToolManager)) diff --git a/Reconstruction/RecJobTransforms/python/recTransformUtils.py b/Reconstruction/RecJobTransforms/python/recTransformUtils.py index fa4b722be5eac55a2112538a22aecde9c83c542a..1cf5cac009ccfe7a8cba589c638d12f344894342 100644 --- a/Reconstruction/RecJobTransforms/python/recTransformUtils.py +++ b/Reconstruction/RecJobTransforms/python/recTransformUtils.py @@ -97,7 +97,7 @@ def addRecoSubsteps(executorSet): executorSet.add(athenaExecutor(name = 'RDOtoBS', skeletonFile = 'RecJobTransforms/skeleton.RDOtoBS_tf.py', substep = 'r2b', inData = ['RDO'], outData = ['BS'])) executorSet.add(athenaExecutor(name = 'RDOtoRDOTrigger', skeletonFile = 'RecJobTransforms/skeleton.RDOtoRDOtrigger.py', - substep = 'r2t', inData = ['RDO'], outData = ['RDO_TRIG'])) + substep = 'r2t', inData = ['RDO','RDO_FTK'], outData = ['RDO_TRIG'])) # Note that the RAWtoALL substep is disabled by defaut (no inputs or outputs) # It will be enabled explicitly via --steering if required executorSet.add(athenaExecutor(name = 'RAWtoALL', skeletonFile = 'RecJobTransforms/skeleton.RAWtoALL_tf.py', diff --git a/Reconstruction/RecJobTransforms/share/skeleton.RDOtoRDOtrigger.py b/Reconstruction/RecJobTransforms/share/skeleton.RDOtoRDOtrigger.py index 0e5b8b781e7404fe4bafd96005481459a8b7c786..8d3394e558d9b11572ad1084aa516bd4bf43fcab 100644 --- a/Reconstruction/RecJobTransforms/share/skeleton.RDOtoRDOtrigger.py +++ b/Reconstruction/RecJobTransforms/share/skeleton.RDOtoRDOtrigger.py @@ -33,6 +33,12 @@ elif hasattr(runArgs,"inputRDO_FILTFile"): rec.readRDO.set_Value_and_Lock( True ) globalflags.InputFormat.set_Value_and_Lock('pool') athenaCommonFlags.PoolRDOInput.set_Value_and_Lock( runArgs.inputRDO_FILTFile ) +elif hasattr(runArgs,"inputRDO_FTKFile"): + rec.readRDO.set_Value_and_Lock( True ) + globalflags.InputFormat.set_Value_and_Lock('pool') + athenaCommonFlags.PoolRDOInput.set_Value_and_Lock( runArgs.inputRDO_FTKFile ) + from TriggerJobOpts.TriggerFlags import TriggerFlags + TriggerFlags.doFTK=True; else: raise RuntimeError("No RDO input file specified") diff --git a/Reconstruction/RecoAlgs/IsolationAlgs/python/IsoAODFixGetter.py b/Reconstruction/RecoAlgs/IsolationAlgs/python/IsoAODFixGetter.py deleted file mode 100644 index 9baab1e9fad5fd68b578ec3cb71337499dc53211..0000000000000000000000000000000000000000 --- a/Reconstruction/RecoAlgs/IsolationAlgs/python/IsoAODFixGetter.py +++ /dev/null @@ -1,230 +0,0 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration - -from AthenaCommon.Constants import INFO -from AthenaCommon.AppMgr import ToolSvc -from AthenaCommon.Logging import logging -from RecExConfig.RecFlags import rec - -from egammaRec.Factories import ToolFactory, AlgFactory, getPropertyValue - -#--------------------------------------- - -# tool to collect topo clusters in cone -from ParticlesInConeTools.ParticlesInConeToolsConf import xAOD__CaloClustersInConeTool -CaloClustersInConeTool = ToolFactory(xAOD__CaloClustersInConeTool, - CaloClusterLocation = "CaloCalTopoClusters") - -# configuration for ED computation -def configureEDCorrection(tool): - """Configure tools and algorithm for energy density correction - (only if doEnergyDensityCorrection = True)""" - # Return if doEnergyDensityCorrection is false - if not getPropertyValue(tool, 'doEnergyDensityCorrection'): - return - # Set OutputLevel to INFO or higher if tool has it too - OutputLevel = min(getPropertyValue(tool, 'OutputLevel'), INFO) - try: - from AthenaCommon.AppMgr import ToolSvc - from AthenaCommon.AlgSequence import AlgSequence - from EventShapeTools.EventDensityConfig import configEventDensityTool, EventDensityAlg - from JetRec.JetRecStandard import jtm - topSequence = AlgSequence() - if not hasattr(topSequence,'EDtpIsoVeryForwardAlg'): - tfcc = configEventDensityTool("EDtpIsoVeryForwardTool", - inputlabel = jtm.emget.Label, - radius = 0.5, - AbsRapidityMin = 2.5, - AbsRapidityMax = 4.5, - OutputContainer = "TopoClusterIsoVeryForwardEventShape", - OutputLevel = OutputLevel - ) - ToolSvc += tfcc - topSequence += EventDensityAlg("EDtpIsoVeryForwardAlg", EventDensityTool = tfcc) - - except Exception: - print '\nERROR: could not get handle to ED' - raise - -from CaloIdentifier import SUBCALO -from IsolationTool.IsolationToolConf import xAOD__CaloIsolationTool, xAOD__TrackIsolationTool -CaloIsolationTool = ToolFactory(xAOD__CaloIsolationTool,name = "CaloIsolationTool", - postInit = [configureEDCorrection], - CaloFillRectangularClusterTool = None, - ClustersInConeTool = CaloClustersInConeTool, - PFlowObjectsInConeTool = None, - IsoLeakCorrectionTool = None, - saveOnlyRequestedCorrections = True, - EMCaloNums = [], - HadCaloNums = [], - UseEMScale = True, - addCaloExtensionDecoration = False, - OutputLevel = 3) - -TrackIsolationTool = ToolFactory(xAOD__TrackIsolationTool, name = 'TrackIsolationTool') -from AthenaCommon import CfgMgr -tit = CfgMgr.xAOD__TrackIsolationTool('TrackIsolationTool') -tit.TrackSelectionTool.maxZ0SinTheta = 3 -tit.TrackSelectionTool.minPt = 1000 -tit.TrackSelectionTool.CutLevel = "Loose" - -import ROOT, cppyy -# Need to be sure base dict is loaded first. -cppyy.loadDictionary('xAODCoreRflxDict') -cppyy.loadDictionary('xAODPrimitivesDict') -isoPar = ROOT.xAOD.Iso - -# The types to be computed -IsoTypesEg = [ - [ isoPar.ptcone40, - isoPar.ptcone30, - isoPar.ptcone20 ] - ] -IsoTypesFe = [ - [ isoPar.topoetcone20, - isoPar.topoetcone30, - isoPar.topoetcone40 ] - ] -IsoTypesMu = [ - [ isoPar.topoetcone20, - isoPar.topoetcone30, - isoPar.topoetcone40 ] - ] -# And the corrections -IsoCorEg = [ - [ isoPar.coreTrackPtr ] - ] -# -IsoCorFe = [ - [ isoPar.coreCone, isoPar.pileupCorrection ] - ] -# -IsoCorMu = [ - [ isoPar.coreCone, isoPar.pileupCorrection ] - ] - -# - -from IsolationCorrections.IsolationCorrectionsConf import CP__IsolationCorrectionTool as ict -leakTool = ict(name = "LeakageCorrection", - CorrFile = "IsolationCorrections/isolation_ptcorrections_rel20_2.root") # in principle the default -ToolSvc += leakTool - -from IsolationAlgs.IsolationAlgsConf import IsolationBuilder -isoAODFixBuilderElectron = AlgFactory(IsolationBuilder, - name = "IsolationBuilderElectron", - ElectronCollectionContainerName = "Electrons", - PhotonCollectionContainerName = "", - MuonCollectionContainerName = "", - FwdElectronCollectionContainerName = "", - CaloCellIsolationTool = None, - CaloTopoIsolationTool = None, - PFlowIsolationTool = None, - TrackIsolationTool = None, - FeIsoTypes = [[]] , - FeCorTypes = IsoCorFe, - EgIsoTypes = [[]], - EgCorTypes = IsoCorEg, - MuIsoTypes = [[]] , - MuCorTypes = IsoCorMu, - IsAODFix = True, - LeakageTool = leakTool, - IsolateEl = False, - OutputLevel = 3) - -isoAODFixBuilderPhoton = AlgFactory(IsolationBuilder, - name = "IsolationBuilderPhoton", - ElectronCollectionContainerName = "", - PhotonCollectionContainerName = "Photons", - MuonCollectionContainerName = "", - FwdElectronCollectionContainerName = "", - CaloCellIsolationTool = None, - CaloTopoIsolationTool = None, - PFlowIsolationTool = None, - TrackIsolationTool = TrackIsolationTool, - FeIsoTypes = [[]] , - FeCorTypes = IsoCorFe, - EgIsoTypes = IsoTypesEg, - EgCorTypes = IsoCorEg, - MuIsoTypes = [[]] , - MuCorTypes = IsoCorMu, - IsAODFix = True, - LeakageTool = leakTool, - IsolateEl = False, - OutputLevel = 3) - -isoAODFixBuilderMuon = AlgFactory(IsolationBuilder, - name = "IsolationBuilderMuon", - ElectronCollectionContainerName = "", - PhotonCollectionContainerName = "", - MuonCollectionContainerName = "Muons", - FwdElectronCollectionContainerName = "", - CaloCellIsolationTool = None, - CaloTopoIsolationTool = CaloIsolationTool, - PFlowIsolationTool = None, - TrackIsolationTool = None, - FeIsoTypes = [[]] , - FeCorTypes = IsoCorFe, - EgIsoTypes = [[]], - EgCorTypes = IsoCorEg, - MuIsoTypes = IsoTypesMu, - MuCorTypes = IsoCorMu, - CustomConfigurationNameMu = 'Core0p05', - IsAODFix = True, - LeakageTool = None, - IsolateEl = False, - OutputLevel = 3) - - -isoAODFixBuilderFwdElectron = AlgFactory(IsolationBuilder, - name = "IsolationBuilderForwardElectron", - ElectronCollectionContainerName = "", - PhotonCollectionContainerName = "", - MuonCollectionContainerName = "", - FwdElectronCollectionContainerName = "ForwardElectrons", - CaloCellIsolationTool = None, - CaloTopoIsolationTool = CaloIsolationTool, - PFlowIsolationTool = None, - TrackIsolationTool = None, - FeIsoTypes = IsoTypesFe, - FeCorTypes = IsoCorFe, - EgIsoTypes = [[]], - EgCorTypes = IsoCorEg, - MuIsoTypes = [[]], - MuCorTypes = IsoCorMu, - IsAODFix = True, - LeakageTool = None, - IsolateEl = False, - OutputLevel = 3) - - -from RecExConfig.Configured import Configured -class isoAODFixGetter ( Configured ) : - - def __init__(self, intype = ""): - super( isoAODFixGetter, self ).__init__() - self.type = intype - - mlog = logging.getLogger ('isoAODFixGetter.py::configure:') - mlog.info('entering') - - # configure iso here: - try: - if self.type == "Electrons": - self._isoBuilderHandle = isoAODFixBuilderElectron() - elif self.type == "Photons": - self._isoBuilderHandle = isoAODFixBuilderPhoton() - elif self.type == "ForwardElectrons": - self._isoBuilderHandle = isoAODFixBuilderFwdElectron() - elif self.type == "Muons": - self._isoBuilderHandle = isoAODFixBuilderMuon() - else: - mlog.error("wrong object for IsolationBuilder") - except Exception: - mlog.error("could not get handle to IsolationBuilder") - import traceback - print traceback.format_exc() - return False - - def isoBuilderHandle(self): - return self._BuilderHandle - diff --git a/Reconstruction/RecoAlgs/IsolationAlgs/python/IsoGetter.py b/Reconstruction/RecoAlgs/IsolationAlgs/python/IsoGetter.py index f89b0ebaef6cd56455328f1c7ca8fde79bae94c0..136252a37f167bbf3b8ea6abc91da5f7405acf22 100644 --- a/Reconstruction/RecoAlgs/IsolationAlgs/python/IsoGetter.py +++ b/Reconstruction/RecoAlgs/IsolationAlgs/python/IsoGetter.py @@ -51,7 +51,8 @@ if recAlgs.doEFlow() : # PseudoJetGetters are now run in their own dedicated algs from JetRec.JetRecConf import PseudoJetAlgorithm # EMTopo (non-origin corrected) clusters - topSequence += PseudoJetAlgorithm("pjalg_"+jtm.emget.Label,PJGetter=jtm.emget) + if not hasattr(topSequence, "pjalg_"+jtm.emget.Label): + topSequence += PseudoJetAlgorithm("pjalg_"+jtm.emget.Label,PJGetter=jtm.emget) # EM Neutral PFOs topSequence += PseudoJetAlgorithm("pjalg_"+emnpflowget.Label,PJGetter=emnpflowget) @@ -60,6 +61,14 @@ from ParticlesInConeTools.ParticlesInConeToolsConf import xAOD__CaloClustersInCo CaloClustersInConeTool = ToolFactory(xAOD__CaloClustersInConeTool, CaloClusterLocation = "CaloCalTopoClusters") +# tool to extrapolate to the calo +import AthenaCommon.CfgMgr as CfgMgr +#this is just regular extrapolator, but in ToolFactory form +from egammaTools.InDetTools import egammaExtrapolator +CaloExtensionTool = ToolFactory (CfgMgr.Trk__ParticleCaloExtensionTool, + Extrapolator = egammaExtrapolator) + + # configuration for ED computation # For the time being, it uses all pflow objects (neutral@EM + charged) for pflow def configureEDCorrection(tool): @@ -72,6 +81,7 @@ def configureEDCorrection(tool): OutputLevel = min(getPropertyValue(tool, 'OutputLevel'), INFO) try: from AthenaCommon.AppMgr import ToolSvc + from JetRec.JetRecStandard import jtm from EventShapeTools.EventDensityConfig import configEventDensityTool, EventDensityAthAlg from AthenaCommon.AlgSequence import AlgSequence topSequence = AlgSequence() @@ -172,13 +182,14 @@ CaloIsolationTool = ToolFactory(xAOD__CaloIsolationTool,name = "CaloIsolationToo CaloFillRectangularClusterTool = CaloFillRectangularCluster, ClustersInConeTool = CaloClustersInConeTool, PFlowObjectsInConeTool = PFlowObjectsInConeTool, + ParticleCaloExtensionTool = CaloExtensionTool, IsoLeakCorrectionTool = IsoCorrectionTool, EMCaloNums = [SUBCALO.LAREM], HadCaloNums = [SUBCALO.LARHEC, SUBCALO.TILE], UseEMScale = True) TrackIsolationTool = ToolFactory(xAOD__TrackIsolationTool, name = 'TrackIsolationTool') -from AthenaCommon import CfgMgr +#from AthenaCommon import CfgMgr tit = CfgMgr.xAOD__TrackIsolationTool('TrackIsolationTool') tit.TrackSelectionTool.maxZ0SinTheta = 3 tit.TrackSelectionTool.minPt = 1000 diff --git a/Reconstruction/RecoAlgs/IsolationAlgs/python/IsoGetter.pyMod b/Reconstruction/RecoAlgs/IsolationAlgs/python/IsoGetter.pyMod deleted file mode 100644 index cc7d28de14049aaecbb6c6fd21d90642504f037c..0000000000000000000000000000000000000000 --- a/Reconstruction/RecoAlgs/IsolationAlgs/python/IsoGetter.pyMod +++ /dev/null @@ -1,246 +0,0 @@ -from AthenaCommon.Constants import INFO -from AthenaCommon.AppMgr import ToolSvc -from AthenaCommon.Logging import logging -from RecExConfig.RecFlags import rec - -from egammaRec.Factories import ToolFactory, AlgFactory, getPropertyValue - -#--------------------------------------- -# egamma specifics -from egammaCaloTools.egammaCaloToolsFactories import CaloFillRectangularCluster - -from AthenaCommon.GlobalFlags import globalflags -isMC = not globalflags.DataSource()=='data' -from IsolationCorrections.IsolationCorrectionsConf import CP__IsolationCorrectionTool as ICT -IsoCorrectionTool = ToolFactory(ICT, - name = "NewLeakageCorrTool", - IsMC = isMC) - -doPFlow = False -PFlowObjectsInConeTool = None -from RecExConfig.RecAlgsFlags import recAlgs -if recAlgs.doEFlow() : - - doPFlow = True - - # tool to collect pflow objects in cone - from PFlowUtils.PFlowUtilsConf import CP__RetrievePFOTool as RetrievePFOTool - pfoTool = RetrievePFOTool(); - ToolSvc += pfoTool - - from ParticlesInConeTools.ParticlesInConeToolsConf import xAOD__PFlowObjectsInConeTool - PFlowObjectsInConeTool = ToolFactory(xAOD__PFlowObjectsInConeTool, - name = "PFlowObjectsInConeTool", - RetrievePFOTool = pfoTool) - - from JetRec.JetRecStandard import jtm - from JetRecTools.JetRecToolsConf import PFlowPseudoJetGetter - jtm += PFlowPseudoJetGetter( - name = "emnpflowget", - Label = "EMNPFlow", - OutputContainer = "PseudoJetEMNPFlow", - RetrievePFOTool = jtm.pflowretriever, - InputIsEM = True, - CalibratePFO = False, - SkipNegativeEnergy = True, - UseNeutral = True, - UseCharged = False - ) - -# tool to collect topo clusters in cone -from ParticlesInConeTools.ParticlesInConeToolsConf import xAOD__CaloClustersInConeTool -CaloClustersInConeTool = ToolFactory(xAOD__CaloClustersInConeTool, - CaloClusterLocation = "CaloCalTopoClusters") - -# configuration for ED computation -# For the time being, it uses all pflow objects (neutral@EM + charged) for pflow -def configureEDCorrection(tool): - """Configure tools and algorithm for energy density correction - (only if doEnergyDensityCorrection = True)""" - # Return if doEnergyDensityCorrection is false - if not getPropertyValue(tool, 'doEnergyDensityCorrection'): - return - # Set OutputLevel to INFO or higher if tool has it too - OutputLevel = min(getPropertyValue(tool, 'OutputLevel'), INFO) - try: - from AthenaCommon.AppMgr import ToolSvc - from AthenaCommon.AlgSequence import AlgSequence - from EventShapeTools.EventDensityConfig import configEventDensityTool, EventDensityAlg - from JetRec.JetRecStandard import jtm - topSequence = AlgSequence() - if not hasattr(topSequence,'EDtpIsoCentralAlg'): - tccc = configEventDensityTool("EDtpIsoCentralTool", jtm.emget, - radius = 0.5, - AbsRapidityMin = 0.0, - AbsRapidityMax = 1.5, - OutputContainer = "TopoClusterIsoCentralEventShape", - OutputLevel = OutputLevel - ) - ToolSvc += tccc - topSequence += EventDensityAlg("EDtpIsoCentralAlg", EventDensityTool = tccc) - - if not hasattr(topSequence,'EDtpIsoForwardAlg'): - tfcc = configEventDensityTool("EDtpIsoForwardTool", jtm.emget, - radius = 0.5, - AbsRapidityMin = 1.5, - AbsRapidityMax = 3.0, - OutputContainer = "TopoClusterIsoForwardEventShape", - OutputLevel = OutputLevel - ) - ToolSvc += tfcc - topSequence += EventDensityAlg("EDtpIsoForwardAlg", EventDensityTool = tfcc) - - if doPFlow: - if not hasattr(topSequence,'EDpfIsoCentralAlg'): - tcpf = configEventDensityTool("EDpfIsoCentralTool", jtm.empflowget, - radius = 0.5, - AbsRapidityMin = 0.0, - AbsRapidityMax = 1.5, - OutputContainer = "ParticleFlowIsoCentralEventShape", - OutputLevel = OutputLevel - ) - ToolSvc += tcpf - topSequence += EventDensityAlg("EDpfIsoCentralAlg", EventDensityTool = tcpf) - - if not hasattr(topSequence,'EDpfIsoForwardAlg'): - tfpf = configEventDensityTool("EDpfIsoForwardTool", jtm.empflowget, - radius = 0.5, - AbsRapidityMin = 1.5, - AbsRapidityMax = 3.0, - OutputContainer = "ParticleFlowIsoForwardEventShape", - OutputLevel = OutputLevel - ) - ToolSvc += tfpf - topSequence += EventDensityAlg("EDpfIsoForwardAlg", EventDensityTool = tfpf) - - ## Try a neutral density - if not hasattr(topSequence,'EDnpfIsoCentralAlg'): - tcnpf = configEventDensityTool("EDnpfIsoCentralTool", jtm.emnpflowget, - radius = 0.5, - AbsRapidityMin = 0.0, - AbsRapidityMax = 1.5, - OutputContainer = "NeutralParticleFlowIsoCentralEventShape", - OutputLevel = OutputLevel - ) - ToolSvc += tcnpf - topSequence += EventDensityAlg("EDnpfIsoCentralAlg", EventDensityTool = tcnpf) - - if not hasattr(topSequence,'EDnpfIsoForwardAlg'): - tfnpf = configEventDensityTool("EDnpfIsoForwardTool", jtm.emnpflowget, - radius = 0.5, - AbsRapidityMin = 1.5, - AbsRapidityMax = 3.0, - OutputContainer = "NeutralParticleFlowIsoForwardEventShape", - OutputLevel = OutputLevel - ) - ToolSvc += tfnpf - topSequence += EventDensityAlg("EDnpfIsoForwardAlg", EventDensityTool = tfnpf) - - except Exception: - print '\nERROR: could not get handle to ED' - raise - -from CaloIdentifier import SUBCALO -from IsolationTool.IsolationToolConf import xAOD__CaloIsolationTool, xAOD__TrackIsolationTool -CaloIsolationTool = ToolFactory(xAOD__CaloIsolationTool,name = "MyCaloIsolationTool", - postInit = [configureEDCorrection], - CaloFillRectangularClusterTool = CaloFillRectangularCluster, - ClustersInConeTool = CaloClustersInConeTool, - PFlowObjectsInConeTool = PFlowObjectsInConeTool, - IsoLeakCorrectionTool = IsoCorrectionTool, - EMCaloNums = [SUBCALO.LAREM], - HadCaloNums = [SUBCALO.LARHEC, SUBCALO.TILE], - UseEMScale = True, - OutputLevel = 3) - -TrackIsolationTool = ToolFactory(xAOD__TrackIsolationTool, name = 'TrackIsolationTool') -from AthenaCommon import CfgMgr -tit = CfgMgr.xAOD__TrackIsolationTool('TrackIsolationTool') -tit.TrackSelectionTool.maxZ0SinTheta = 3 -tit.TrackSelectionTool.minPt = 1000 -tit.TrackSelectionTool.CutLevel = "TightPrimary" - -import ROOT, cppyy -# Need to be sure base dict is loaded first. -cppyy.loadDictionary('xAODCoreRflxDict') -cppyy.loadDictionary('xAODPrimitivesDict') -isoPar = ROOT.xAOD.Iso - -# In fact the default isolations are the same for eg and muons : prepare the list here -IsoTypes = [ - [ isoPar.etcone40, ## Be carefull : store them in decreasing dR - isoPar.etcone30, - isoPar.etcone20 ], - [ isoPar.topoetcone20, - isoPar.topoetcone30, - isoPar.topoetcone40 ], - [ isoPar.ptcone40, ## these ones will also trigger the ptvarconeXX. Be carefull : store them in decreasing dR - isoPar.ptcone30, - isoPar.ptcone20 ] - ] -if doPFlow: - IsoTypes.append( - [ isoPar.neflowisol20, - isoPar.neflowisol30, - isoPar.neflowisol40 ] ) - -from IsolationAlgs.IsolationAlgsConf import IsolationBuilder -isoBuilder = AlgFactory(IsolationBuilder, - name = "IsolationBuilder", - CaloCellIsolationTool = CaloIsolationTool, - CaloTopoIsolationTool = CaloIsolationTool, - PFlowIsolationTool = CaloIsolationTool, - TrackIsolationTool = TrackIsolationTool, - EgIsoTypes = [[]] if not rec.doEgamma() else IsoTypes, - MuIsoTypes = [[]] if not rec.doMuon() else IsoTypes, - OutputLevel = 3) - -#Customisation -CustomCuts = [ [ 3, 400, 'TightPrimary' ], [ 3, 500, 'TightPrimary' ] , [ 3, 800, 'TightPrimary' ], [ 3, 1200, 'TightPrimary' ], [ 3, 1000, 'Loose' ] ] -for icut in CustomCuts: - - from AthenaCommon.AppMgr import ToolSvc - from AthenaCommon.AlgSequence import AlgSequence - topSequence = AlgSequence() - CustomType = icut[2]+'z0'+str(icut[0])+'mmPt'+str(icut[1])+'MeV' - print 'Building track isolation tool for type ',CustomType - TrackIsolationCustom = xAOD__TrackIsolationTool(name = 'TrackIsolationTool'+CustomType) - TrackIsolationCustom.TrackSelectionTool.maxZ0SinTheta = float(icut[0]) - TrackIsolationCustom.TrackSelectionTool.minPt = float(icut[1]) - TrackIsolationCustom.TrackSelectionTool.CutLevel = icut[2] - ToolSvc += TrackIsolationCustom - isoBuilderCustom = IsolationBuilder( - name = "IsolationBuilder"+CustomType, - CaloCellIsolationTool = None, - CaloTopoIsolationTool = None, - PFlowIsolationTool = None, - TrackIsolationTool = TrackIsolationCustom, - EgIsoTypes = [[]] if not rec.doEgamma() else [[]],#[[isoPar.ptcone40,isoPar.ptcone30,isoPar.ptcone20]], - MuIsoTypes = [[]] if not rec.doMuon() else [[isoPar.ptcone40,isoPar.ptcone30,isoPar.ptcone20]], - CustomConfgurationName = CustomType, - OutputLevel = 3) - topSequence += isoBuilderCustom - - -from RecExConfig.Configured import Configured -class isoGetter ( Configured ) : - - def configure(self): - mlog = logging.getLogger ('isoGetter.py::configure:') - mlog.info('entering') - - # configure iso here: - try: - self._isoBuilderHandle = isoBuilder() - except Exception: - mlog.error("could not get handle to IsolationBuilder") - import traceback - print traceback.format_exc() - return False - - print self._isoBuilderHandle - return True - - def isoBuilderHandle(self): - return self._BuilderHandle - diff --git a/Reconstruction/RecoTools/IsolationTool/IsolationTool/CaloIsolationTool.h b/Reconstruction/RecoTools/IsolationTool/IsolationTool/CaloIsolationTool.h index 5fd48d1ea48537c3899290d0f91836ae60379420..f0f0864ef4eac74869bc8aaa74e19b2407136ba1 100644 --- a/Reconstruction/RecoTools/IsolationTool/IsolationTool/CaloIsolationTool.h +++ b/Reconstruction/RecoTools/IsolationTool/IsolationTool/CaloIsolationTool.h @@ -13,7 +13,6 @@ // #include "GaudiKernel/ToolHandle.h" #include "ParticlesInConeTools/ICaloClustersInConeTool.h" #include "ParticlesInConeTools/IPFlowObjectsInConeTool.h" -#include "RecoToolInterfaces/ICaloIsolationDecoratorTool.h" #include "RecoToolInterfaces/IParticleCaloCellAssociationTool.h" #include "RecoToolInterfaces/IParticleCaloExtensionTool.h" #include "TrkParametersIdentificationHelpers/TrackParametersIdHelper.h" @@ -44,9 +43,6 @@ namespace xAOD { virtual public ICaloTopoClusterIsolationTool, virtual public ICaloCellIsolationTool, virtual public INeutralEFlowIsolationTool, -#ifndef XAOD_ANALYSIS - virtual public ICaloIsolationDecoratorTool, -#endif // XAOD_ANALYSIS public asg::AsgTool { ASG_TOOL_CLASS3( CaloIsolationTool, ICaloTopoClusterIsolationTool, ICaloCellIsolationTool, INeutralEFlowIsolationTool ) public: @@ -86,31 +82,6 @@ namespace xAOD { CaloCorrection corrections) override; using INeutralEFlowIsolationTool::neutralEflowIsolation; -#ifndef XAOD_ANALYSIS - virtual - bool decorateParticle( const IParticle& tp, - const std::vector<Iso::IsolationType>& cones, - CaloCorrection corrections, - const CaloCellContainer* Cells = 0, - const CaloClusterContainer* TopClusters = 0) override final; -#endif - virtual - bool decorateParticle_caloCellIso( const IParticle& tp, - const std::vector<Iso::IsolationType>& cones, - CaloCorrection corrections, - const CaloCellContainer* Cells) override final; - - virtual - bool decorateParticle_topoClusterIso( const IParticle& tp, - const std::vector<Iso::IsolationType>& cones, - CaloCorrection corrections, - const CaloClusterContainer* TopClusters) override final; - - virtual - bool decorateParticle_eflowIso( const IParticle& tp, - const std::vector<Iso::IsolationType>& cones, - CaloCorrection corrections) override final; - private: /** map to the orignal particle */ // This never seems to have more than one entry??? @@ -156,11 +127,6 @@ namespace xAOD { double coneCoreSize, derefMap_t& derefMap); - // final dressing function - bool decorateParticle(CaloIsolation& result, - const IParticle& tp, - const std::vector<Iso::IsolationType>& cones, - CaloCorrection corrections); // etcone computation for TrackParticle #ifndef XAOD_ANALYSIS bool etConeIsolation( CaloIsolation& result, const TrackParticle& tp, @@ -247,7 +213,7 @@ namespace xAOD { /** get reference particle */ const IParticle* getReferenceParticle(const IParticle& particle) const; - // add the calo decoration + // add the calo decoration -- FIXME! Change to use standard caching void decorateTrackCaloPosition(const IParticle& particle, float eta, float phi) const; #ifndef XAOD_ANALYSIS diff --git a/Reconstruction/RecoTools/IsolationTool/IsolationTool/TrackIsolationTool.h b/Reconstruction/RecoTools/IsolationTool/IsolationTool/TrackIsolationTool.h index 3e0c07bbc15af3a5e09edaf0dc1e715649f25ef6..f166ce6bbcc6cecb7949768da18c5aa1d8db746f 100644 --- a/Reconstruction/RecoTools/IsolationTool/IsolationTool/TrackIsolationTool.h +++ b/Reconstruction/RecoTools/IsolationTool/IsolationTool/TrackIsolationTool.h @@ -81,14 +81,6 @@ namespace xAOD { const std::set<const TrackParticle*>* exclusionSet = 0, const TrackParticleContainer* indetTrackParticles = 0 ) const override; - /**ITrackIsolationTool interface: */ - virtual - bool decorateParticle( const IParticle& tp, - const std::vector<Iso::IsolationType>& cones, - TrackCorrection corrections, - const Vertex* vertex = 0, - const std::set<const TrackParticle*>* exclusionSet = 0, - const TrackParticleContainer* indetTrackParticles = 0 ) override; private: /// define 2*Pi diff --git a/Reconstruction/RecoTools/IsolationTool/Root/CaloIsolationTool.cxx b/Reconstruction/RecoTools/IsolationTool/Root/CaloIsolationTool.cxx index e204bfc33a7305b80d5b8dbf74eab1b4904106bd..8d1138673a7f7a90c72b03688998fd870c33a739 100644 --- a/Reconstruction/RecoTools/IsolationTool/Root/CaloIsolationTool.cxx +++ b/Reconstruction/RecoTools/IsolationTool/Root/CaloIsolationTool.cxx @@ -29,8 +29,6 @@ #include "xAODPrimitives/IsolationCorrection.h" #include "xAODPrimitives/IsolationHelpers.h" #include "xAODPrimitives/IsolationCorrectionHelper.h" -#include "xAODPrimitives/tools/getIsolationDecorator.h" -#include "xAODPrimitives/tools/getIsolationCorrectionDecorator.h" #include "xAODEgamma/Egamma.h" #include "xAODEgamma/EgammaDefs.h" @@ -1350,151 +1348,6 @@ bool CaloIsolationTool::correctIsolationEnergy_pflowCore(CaloIsolation& result, return &particle; } - bool CaloIsolationTool::decorateParticle(CaloIsolation& result, - const IParticle& tp, - const std::vector<Iso::IsolationType>& cones, - CaloCorrection corrections){ - // get the applied corrections - std::vector<Iso::IsolationCaloCorrection> correctionTypes; - Iso::IsolationCaloCorrectionBitsetHelper::decode(corrections.calobitset,correctionTypes); - ATH_MSG_DEBUG("Decoded correction types: " << correctionTypes.size()); - - // decorate the particle - const SG::AuxElement::Decorator< uint32_t > bitsetAcc = getIsolationCorrectionBitsetDecorator(Iso::isolationFlavour(cones[0])); - bitsetAcc(tp) = corrections.calobitset.to_ulong(); - - // Fill all computed corrections - // core correction type (e.g. coreMuon, core57cells) - for (auto coretype : result.coreCorrections) { - Iso::IsolationCaloCorrection ctype = coretype.first; - // core energy and area - for (auto par : coretype.second) { - if (par.first == Iso::coreArea) continue; // do not store area, as they are constant ! (pi R**2 or 5*0.025 * 7*pi/128) - const SG::AuxElement::Decorator< float > isoCorAcc = getIsolationCorrectionDecorator( Iso::isolationFlavour(cones[0]), ctype, par.first ); - ATH_MSG_DEBUG("Storing core correction " << Iso::toCString(ctype) << " var " << Iso::toCString(par.first) << " = " << par.second); - isoCorAcc(tp) = par.second; - } - } - // noncore correction type (e.g. pileup) - for (auto corrtype : result.noncoreCorrections) { - Iso::IsolationCaloCorrection ctype = corrtype.first; - if (ctype == Iso::pileupCorrection) continue; // do not store pileup corrections as they are rho * pi * (R**2 - areaCore) and rho is stored... - std::vector<float> corrvec = corrtype.second; - if (corrvec.size() != cones.size()) { - ATH_MSG_WARNING("Only cone size-based corrections are supported. Will do nothing to" << Iso::toCString(ctype) ); - continue; - } - for (unsigned int i = 0; i < corrvec.size();i++) { - SG::AuxElement::Decorator< float > isoCorAcc = getIsolationCorrectionDecorator(cones[i],ctype); - isoCorAcc(tp) = corrvec[i]; - } - } - - // fill main isolation - // loop over cones - if (result.etcones.size() == cones.size()) { - for( unsigned int i=0;i<cones.size();++i ){ - - Iso::IsolationType type = cones[i]; - const SG::AuxElement::Decorator< float >* isoTypeAcc = getIsolationDecorator(type); - if ( isoTypeAcc ) { - ATH_MSG_DEBUG("Filling " << Iso::toCString(type) << " = " << result.etcones[i]); - (*isoTypeAcc)(tp) = result.etcones[i]; - } else - ATH_MSG_WARNING("Cannot find accessor for " << Iso::toCString(type)); - } - } else if( !result.etcones.empty() ) - ATH_MSG_WARNING("Inconsistent etcones vector size: results : " << result.etcones.size() << ", number of wanted cones : " << cones.size() ); - - return true; - } - - bool CaloIsolationTool::decorateParticle_caloCellIso( const IParticle& tp, - const std::vector<Iso::IsolationType>& cones, - CaloCorrection corrections, - const CaloCellContainer* Cells){ - // calculate the isolation - CaloIsolation result; - if( !caloCellIsolation(result,tp,cones,corrections,Cells) ) { - ATH_MSG_DEBUG("Calculation of caloCellIsolation failed"); - return false; - } - if( !decorateParticle(result, tp, cones, corrections) ){ - ATH_MSG_DEBUG("Decoration of caloCellIsolation failed"); - return false; - } - - return true; - } - - - bool CaloIsolationTool::decorateParticle_topoClusterIso( const IParticle& tp, - const std::vector<Iso::IsolationType>& cones, - CaloCorrection corrections, - const CaloClusterContainer* TopClusters) { - // calculate the isolation - CaloIsolation result; - if( !caloTopoClusterIsolation(result,tp,cones,corrections,TopClusters) ) { - ATH_MSG_DEBUG("Calculation of caloTopoClusterIsolation failed"); - return false; - } - if( !decorateParticle(result, tp, cones, corrections) ){ - ATH_MSG_DEBUG("Decoration of caloTopoClusterIsolation failed"); - return false; - } - - return true; - } - - bool CaloIsolationTool::decorateParticle_eflowIso( const IParticle& tp, - const std::vector<Iso::IsolationType>& cones, - CaloCorrection corrections){ - // calculate the isolation - CaloIsolation result; - if( !neutralEflowIsolation(result,tp,cones,corrections) ) { - ATH_MSG_DEBUG("Calculation of neutralEflowIsolation failed"); - return false; - } - if( !decorateParticle(result, tp, cones, corrections) ){ - ATH_MSG_DEBUG("Decoration of neutralEflowIsolation failed"); - return false; - } - - return true; - } - -#ifndef XAOD_ANALYSIS - bool CaloIsolationTool::decorateParticle( const IParticle& tp, - const std::vector<Iso::IsolationType>& cones, - CaloCorrection corrections, - const CaloCellContainer* Cells, - const CaloClusterContainer* TopClusters){ - ATH_MSG_DEBUG("just a test "); - /// check Isolation flavour - Iso::IsolationFlavour flavour = Iso::numIsolationFlavours; - for( unsigned int i=0;i<cones.size();++i ){ - if(i==0) {flavour = isolationFlavour( cones[i] ); continue;} - if(flavour != isolationFlavour( cones[i] )){ - ATH_MSG_FATAL("decorateParticle does not support mixture of the isolation flavour!!!"); - return false; - } - } - - bool suc(false); - switch(flavour) { - case Iso::etcone: - suc = decorateParticle_caloCellIso(tp, cones, corrections, Cells); break; - case Iso::topoetcone: - suc = decorateParticle_topoClusterIso(tp, cones, corrections, TopClusters); break; - case Iso::neflowisol: - suc = decorateParticle_eflowIso(tp, cones, corrections); break; - default: - ATH_MSG_FATAL("Unsupported isolation flavour!!!"); return false; - } - - return suc; - } -#endif #ifdef XAOD_ANALYSIS // particlesInCone tool will not be avaible. Write our own... bool CaloIsolationTool::particlesInCone( float eta, float phi, float dr, std::vector<const CaloCluster*>& output ) const { @@ -1544,6 +1397,7 @@ bool CaloIsolationTool::correctIsolationEnergy_pflowCore(CaloIsolation& result, } #endif // XAOD_ANALYSIS + // FIXME! This should be updated to use the standard caching of extrapolation to calo void CaloIsolationTool::decorateTrackCaloPosition(const IParticle& p, float eta, float phi) const{ static SG::AuxElement::Decorator< char > dec_Decorated("caloExt_Decorated"); static SG::AuxElement::Decorator< float > dec_Eta("caloExt_eta"); diff --git a/Reconstruction/RecoTools/IsolationTool/Root/TrackIsolationTool.cxx b/Reconstruction/RecoTools/IsolationTool/Root/TrackIsolationTool.cxx index 91f6b2a530694468b024e46d372587e83c96237c..222499de9dcbf22157c13a403eb9de19c1c86203 100644 --- a/Reconstruction/RecoTools/IsolationTool/Root/TrackIsolationTool.cxx +++ b/Reconstruction/RecoTools/IsolationTool/Root/TrackIsolationTool.cxx @@ -16,8 +16,6 @@ #include "xAODPrimitives/IsolationConeSize.h" #include "xAODPrimitives/IsolationHelpers.h" #include "xAODPrimitives/IsolationCorrectionHelper.h" -#include "xAODPrimitives/tools/getIsolationDecorator.h" -#include "xAODPrimitives/tools/getIsolationCorrectionDecorator.h" #include "xAODMuon/Muon.h" #include <iomanip> @@ -167,79 +165,6 @@ namespace xAOD { return success; } - bool TrackIsolationTool::decorateParticle( const IParticle& tp, - const std::vector<Iso::IsolationType>& cones, - TrackCorrection corrections, - const Vertex* vertex, - const std::set<const TrackParticle*>* exclusionSet, - const TrackParticleContainer* indetTrackParticles ) { - - // calculate the isolation - TrackIsolation result; - if( !trackIsolation(result,tp,cones,corrections,vertex,exclusionSet,indetTrackParticles) ) { - ATH_MSG_DEBUG("Calculation of TrackIsolation failed"); - return false; - } - - // get the applied corrections - std::vector<Iso::IsolationTrackCorrection> correctionTypes; - Iso::IsolationTrackCorrectionBitsetHelper::decode(corrections.trackbitset,correctionTypes); - ATH_MSG_DEBUG("Decoded correction types: " << correctionTypes.size() ); - - - // decorate the track particle - - // This is independant of the size. At least for the time being - // fill bitset - const SG::AuxElement::Decorator< uint32_t > bitsetAcc = getIsolationCorrectionBitsetDecorator(Iso::isolationFlavour(cones[0])); - bitsetAcc(tp) = corrections.trackbitset.to_ulong(); - - - // fill corrections - for( auto ctype : correctionTypes ){ - auto el = result.coreCorrections.find(ctype); - if( el == result.coreCorrections.end() ){ - ATH_MSG_WARNING("Correction value not found " << Iso::toCString(ctype) ); - continue; - } - const SG::AuxElement::Decorator< float > isoCorAcc = getIsolationCorrectionDecorator( Iso::isolationFlavour(cones[0]), ctype ); - isoCorAcc(tp) = el->second; - } - - // loop over cones - for( unsigned int i=0;i<cones.size();++i ){ - - Iso::IsolationType type = cones[i]; - //Iso::IsolationFlavour flavour = Iso::isolationFlavour(type); - Iso::IsolationConeSize coneSize = enumconeSize(type); - - // fill main isolation - if( result.ptcones.size() == cones.size() ){ - const SG::AuxElement::Decorator< float >* isoTypeAcc = getIsolationDecorator(type); - if( isoTypeAcc ){ - ATH_MSG_DEBUG("Filling std cone " << result.ptcones[i]); - (*isoTypeAcc)(tp) = result.ptcones[i]; - } - }else if( !result.ptcones.empty() ){ - ATH_MSG_WARNING("Inconsistent ptcones vector size: " << result.ptvarcones_10GeVDivPt.size() << " number of cones " << cones.size() ); - } - - // also fill var cone - if( result.ptvarcones_10GeVDivPt.size() == cones.size() ){ - Iso::IsolationType varIsoType = Iso::isolationType( Iso::ptvarcone, coneSize ); - const SG::AuxElement::Decorator< float >* isoTypeAcc = getIsolationDecorator(varIsoType); - if( isoTypeAcc ){ - ATH_MSG_DEBUG("Filling var cone " << result.ptvarcones_10GeVDivPt[i]); - (*isoTypeAcc)(tp) = result.ptvarcones_10GeVDivPt[i]; - } - }else if( !result.ptvarcones_10GeVDivPt.empty() ){ - ATH_MSG_WARNING("Inconsistent ptvarcones_10GeVDivPt vector size: " << result.ptvarcones_10GeVDivPt.size() << " number of cones " << cones.size() ); - } - - } - return true; - } - bool TrackIsolationTool::binnedIsolation( TrackIsolationInput& input, TrackIsolation& result ) const { diff --git a/Reconstruction/RecoTools/RecoToolInterfaces/RecoToolInterfaces/ICaloCellIsolationTool.h b/Reconstruction/RecoTools/RecoToolInterfaces/RecoToolInterfaces/ICaloCellIsolationTool.h index c0bfd68fc1e2da4df6f09215a00a5767251193e0..83d46f46ce6fa6e4b5782d00ec822146232d4a37 100644 --- a/Reconstruction/RecoTools/RecoToolInterfaces/RecoToolInterfaces/ICaloCellIsolationTool.h +++ b/Reconstruction/RecoTools/RecoToolInterfaces/RecoToolInterfaces/ICaloCellIsolationTool.h @@ -42,19 +42,6 @@ namespace xAOD { CaloCorrection corrections, const CaloCellContainer* container = 0 ) const = 0; - /**ICaloCellIsolationTool interface for calculating the cell isolation variables and decorating the particle: - The tool expects the cones to be order in decreasing order (etcone40 -> etcone20) - Internally it reorders the cones so the output isolation values are also in the same order. - @param[in] tp input iparticle - @param[in] cones vector of input cones to be used - @param[in] corrections bitset specifying which corrections to apply to isolation - @param[in] container cell contrainer (for trigger only) - @return true if the calculation and decoration was successfull - */ - virtual bool decorateParticle_caloCellIso( const IParticle& tp, - const std::vector<Iso::IsolationType>& cones, - CaloCorrection corrections, - const CaloCellContainer* Cells = 0) = 0; }; } // end of namespace diff --git a/Reconstruction/RecoTools/RecoToolInterfaces/RecoToolInterfaces/ICaloIsolationDecoratorTool.h b/Reconstruction/RecoTools/RecoToolInterfaces/RecoToolInterfaces/ICaloIsolationDecoratorTool.h deleted file mode 100644 index f2916799aeec995eff128471ef741540c9522a5b..0000000000000000000000000000000000000000 --- a/Reconstruction/RecoTools/RecoToolInterfaces/RecoToolInterfaces/ICaloIsolationDecoratorTool.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -/////////////////////////////////////////////////////////////////// -// ICaloIsolationDecoratorTool.h, (c) ATLAS Detector software -/////////////////////////////////////////////////////////////////// -#ifndef XAOD_ICALOISOLATIONDECORATORTOOL_H -#define XAOD_ICALOISOLATIONDECORATORTOOL_H - -#include "GaudiKernel/IAlgTool.h" -#include "xAODPrimitives/IsolationType.h" -#include "xAODBase/IParticle.h" -#include "IsolationCommon.h" - -class CaloCellContainer; -class CaloClusterContainer; - -namespace xAOD { - - static const InterfaceID IID_ICaloIsolationDecoratorTool("xAOD::ICaloIsolationDecoratorTool", 1, 0); - - /** @class ICaloIsolationDecoratorTool - @brief interface for tools calculating track isolation - - @author Niels van Eldik, Sandrine Laplace - */ - - class ICaloIsolationDecoratorTool : virtual public IAlgTool { - public: - - static const InterfaceID& interfaceID( ) ; - - /**ICaloIsolationDecoratorTool interface for cell isolation: - @param[in] tp input iparticle - @param[in] cones vector of input cones to be used - @param[in] corrections bitset specifying which corrections to apply to isolation - @param[in] Cells cell contrainer (for trigger only) - @param[in] TopClusters topoCluster contrainer (for trigger only) - @return true if the decoration was successfull - */ - virtual bool decorateParticle( const IParticle& tp, - const std::vector<Iso::IsolationType>& cones, - CaloCorrection corrections, - const CaloCellContainer* Cells = 0, - const CaloClusterContainer* TopClusters = 0) = 0; - - }; - - inline const InterfaceID& ICaloIsolationDecoratorTool::interfaceID() { - return IID_ICaloIsolationDecoratorTool; - } - -} // end of namespace - -#endif diff --git a/Reconstruction/RecoTools/RecoToolInterfaces/RecoToolInterfaces/ICaloTopoClusterIsolationTool.h b/Reconstruction/RecoTools/RecoToolInterfaces/RecoToolInterfaces/ICaloTopoClusterIsolationTool.h index 427c19ab5cbb61af6a8935ecfadb7538f506100f..faeee6acd9df1fefa9a550670d3c40819ef24612 100644 --- a/Reconstruction/RecoTools/RecoToolInterfaces/RecoToolInterfaces/ICaloTopoClusterIsolationTool.h +++ b/Reconstruction/RecoTools/RecoToolInterfaces/RecoToolInterfaces/ICaloTopoClusterIsolationTool.h @@ -41,19 +41,6 @@ namespace xAOD { CaloCorrection corrections, const CaloClusterContainer* container = 0 ) const = 0; - /**ICaloTopoClusterIsolationTool interface for calculating cluster isolation variables and decorating the particle: - The tool expects the cones to be order in decreasing order (topetcone40 -> topoetcone20) - Internally it reorders the cones so the output isolation values are also in the same order. - @param[in] tp input iparticle - @param[in] cones vector of input cones to be used - @param[in] corrections bitset specifying which corrections to apply to isolation - @param[in] container topo cluster contrainer (for trigger only) - @return true if the calculation and decoration was successfull - */ - virtual bool decorateParticle_topoClusterIso(const IParticle& tp, - const std::vector<Iso::IsolationType>& cones, - CaloCorrection corrections, - const CaloClusterContainer* TopClusters = 0) =0; }; } // end of namespace diff --git a/Reconstruction/RecoTools/RecoToolInterfaces/RecoToolInterfaces/INeutralEFlowIsolationTool.h b/Reconstruction/RecoTools/RecoToolInterfaces/RecoToolInterfaces/INeutralEFlowIsolationTool.h index c3cd04152e01570703a9b094343f293b6f5c58c8..089fd8d85e7921eb8486397b474edca675f1a93b 100644 --- a/Reconstruction/RecoTools/RecoToolInterfaces/RecoToolInterfaces/INeutralEFlowIsolationTool.h +++ b/Reconstruction/RecoTools/RecoToolInterfaces/RecoToolInterfaces/INeutralEFlowIsolationTool.h @@ -40,17 +40,6 @@ namespace xAOD { const std::vector<Iso::IsolationType>& cones, CaloCorrection corrections) = 0; - /**INeutralEFlowIsolationTool interface for calculating the eflow isolation variables and decorating the particle: - The tool expects the cones to be order in decreasing order (neflowiso40 -> neflowiso20) - Internally it reorders the cones so the output isolation values are also in the same order. - @param[in] tp input iparticle - @param[in] cones vector of input cones to be used - @param[in] corrections bitset specifying which corrections to apply to isolation - @return true if the calculation and decoration was successfull - */ - virtual bool decorateParticle_eflowIso(const IParticle& tp, - const std::vector<Iso::IsolationType>& cones, - CaloCorrection corrections) = 0; }; } // end of namespace diff --git a/Reconstruction/RecoTools/RecoToolInterfaces/RecoToolInterfaces/ITrackIsolationTool.h b/Reconstruction/RecoTools/RecoToolInterfaces/RecoToolInterfaces/ITrackIsolationTool.h index 04a23b3bc4a43e463866a9ea85aa5e7352a63475..b0a4bc2bde8f99352c8977a3d0ac9ded25ce92f2 100644 --- a/Reconstruction/RecoTools/RecoToolInterfaces/RecoToolInterfaces/ITrackIsolationTool.h +++ b/Reconstruction/RecoTools/RecoToolInterfaces/RecoToolInterfaces/ITrackIsolationTool.h @@ -47,25 +47,6 @@ namespace xAOD { const std::set<const xAOD::TrackParticle*>* exclusionSet = 0, const TrackParticleContainer* indetTrackParticles = 0) const = 0; - /**ITrackIsolationTool interface: - Calculates the track isolation and decorates the particle - The tool expects the cones to be order in decreasing order (ptcone40 -> ptcone10) - Internally it reorders the cones so the output isolation values are also in the same order. - @param[in] tp input iparticle - @param[in] cones vector of input cones to be used - @param[in] corrections bitset specifying which corrections to apply to isolation - @param[in] vertex if provided vertex to be used for track selection - @param[in] exclusionSet if provided track particles in the set are ignored - @param[in] indetTrackParticles if provided the isolation will be calculated using the ID track particle collection passed - @return true if the calculation and decoration was successfull - */ - virtual bool decorateParticle( const IParticle& tp, - const std::vector<Iso::IsolationType>& cones, - TrackCorrection corrections, - const Vertex* vertex = 0, - const std::set<const TrackParticle*>* exclusionSet = 0, - const TrackParticleContainer* indetTrackParticles = 0 ) = 0; - }; } // end of namespace diff --git a/Reconstruction/egamma/egammaAlgs/src/egammaTruthAssociationAlg.cxx b/Reconstruction/egamma/egammaAlgs/src/egammaTruthAssociationAlg.cxx index 7255d0ef60c1e67ffd6a36572520970f5708ac53..6f8c1b53f3f562a4dd1cdcec994e213f932c533e 100644 --- a/Reconstruction/egamma/egammaAlgs/src/egammaTruthAssociationAlg.cxx +++ b/Reconstruction/egamma/egammaAlgs/src/egammaTruthAssociationAlg.cxx @@ -17,6 +17,9 @@ #include "xAODTruth/TruthParticleAuxContainer.h" #include "xAODTruth/TruthEventContainer.h" +#include "egammaInterfaces/IEMExtrapolationTools.h" + + typedef ElementLink<xAOD::TruthParticleContainer> TruthLink_t; typedef ElementLink<xAOD::CaloClusterContainer> ClusterLink_t; typedef ElementLink<xAOD::ElectronContainer> ElectronLink_t; @@ -218,8 +221,13 @@ StatusCode egammaTruthAssociationAlg::match(const xAOD::TruthParticleContainer& writeDecorHandles<T> decoHandles(hkeys); + //Extrapolation Cache + Cache extrapolationCache{}; + for (auto particle : *decoHandles.readHandle()){ - MCTruthInfo_t info = particleTruthClassifier(particle); + + MCTruthInfo_t info = particleTruthClassifier(particle, &extrapolationCache); + const xAOD::TruthParticle* truthParticle = info.genPart; if (truthParticle) { ElementLink<xAOD::TruthParticleContainer> link(truthParticle, truthParticles); @@ -292,16 +300,12 @@ egammaTruthAssociationAlg::writeDecorHandles<T>::writeDecorHandles(const egammaT // ========================================================================== template<class T> egammaTruthAssociationAlg::MCTruthInfo_t -egammaTruthAssociationAlg::particleTruthClassifier(const T* particle) { +egammaTruthAssociationAlg::particleTruthClassifier(const T* particle, Cache *extrapolationCache) { MCTruthInfo_t info; -#ifdef MCTRUTHCLASSIFIER_CONST IMCTruthClassifier::Info mcinfo; + mcinfo.extrapolationCache = extrapolationCache; auto ret = m_mcTruthClassifier->particleTruthClassifier(particle, &mcinfo); info.genPart = mcinfo.genPart; -#else - auto ret = m_mcTruthClassifier->particleTruthClassifier(particle); - info.genPart = m_mcTruthClassifier->getGenPart(); -#endif info.first = ret.first; info.second = ret.second; return info; @@ -309,28 +313,17 @@ egammaTruthAssociationAlg::particleTruthClassifier(const T* particle) { /** Template specialisation for electrons: * second pass based on the cluster to find true photons **/ template<> egammaTruthAssociationAlg::MCTruthInfo_t -egammaTruthAssociationAlg::particleTruthClassifier<xAOD::Electron>(const xAOD::Electron* electron) { +egammaTruthAssociationAlg::particleTruthClassifier<xAOD::Electron>(const xAOD::Electron* electron, Cache *extrapolationCache) { MCTruthInfo_t info; -#ifdef MCTRUTHCLASSIFIER_CONST IMCTruthClassifier::Info mcinfo; + mcinfo.extrapolationCache = extrapolationCache; auto ret = m_mcTruthClassifier->particleTruthClassifier(electron, &mcinfo); -#else - auto ret = m_mcTruthClassifier->particleTruthClassifier(electron); -#endif if (ret.first == MCTruthPartClassifier::Unknown && !xAOD::EgammaHelpers::isFwdElectron(electron) && electron->caloCluster()){ ATH_MSG_DEBUG("Trying cluster-based truth classification for electron"); -#ifdef MCTRUTHCLASSIFIER_CONST ret = m_mcTruthClassifier->particleTruthClassifier( electron->caloCluster(), &mcinfo); -#else - ret = m_mcTruthClassifier->particleTruthClassifier( electron->caloCluster() ); -#endif } -#ifdef MCTRUTHCLASSIFIER_CONST info.genPart = mcinfo.genPart; -#else - info.genPart = m_mcTruthClassifier->getGenPart(); -#endif info.first = ret.first; info.second = ret.second; return info; diff --git a/Reconstruction/egamma/egammaAlgs/src/egammaTruthAssociationAlg.h b/Reconstruction/egamma/egammaAlgs/src/egammaTruthAssociationAlg.h index 944b5eefcb42b3410ea2f10fd2cc6d76d34778bd..c56d9005e470e8f5fb34029ec0ef44389b48951a 100644 --- a/Reconstruction/egamma/egammaAlgs/src/egammaTruthAssociationAlg.h +++ b/Reconstruction/egamma/egammaAlgs/src/egammaTruthAssociationAlg.h @@ -35,7 +35,10 @@ class egammaTruthAssociationAlg : public AthAlgorithm { public: - + + typedef std::unordered_map<size_t,std::unique_ptr<Trk::CaloExtension>> Cache; + + /** @brief constructor */ egammaTruthAssociationAlg(const std::string& name, ISvcLocator* pSvcLocator); @@ -55,6 +58,7 @@ private: MCTruthPartClassifier::ParticleType first; MCTruthPartClassifier::ParticleOrigin second; const xAOD::TruthParticle* genPart; + Cache *extrapolationCache; }; /** @brief helper class to contain write docoration handle keys */ @@ -87,7 +91,7 @@ private: /** @brief return the result of MCTruthClassifier::particleTruthClassifier * or do a second pass for electrons based on the cluster to find true photons **/ - template<class T> MCTruthInfo_t particleTruthClassifier(const T*) ; + template<class T> MCTruthInfo_t particleTruthClassifier(const T*, Cache *) ; /** @brief Create a copy a truth particle, add it to the new container and decorate it * with a link to the original particle **/ diff --git a/Reconstruction/egamma/egammaTools/CMakeLists.txt b/Reconstruction/egamma/egammaTools/CMakeLists.txt index 473351888d6fa1ec254391fef5236308b0aec9d7..57f036f6b86a1b159fe4ac71c6d82e6e532ba96f 100644 --- a/Reconstruction/egamma/egammaTools/CMakeLists.txt +++ b/Reconstruction/egamma/egammaTools/CMakeLists.txt @@ -15,7 +15,6 @@ atlas_depends_on_subdirs( PRIVATE Calorimeter/CaloUtils Control/AthenaBaseComps Control/AthenaKernel - Control/SGTools Control/StoreGate Control/AthContainers DetectorDescription/Identifier @@ -47,7 +46,7 @@ atlas_add_component( egammaTools src/components/*.cxx INCLUDE_DIRS LINK_LIBRARIES CaloConditions CaloEvent CaloIdentifier CaloRecLib CaloUtilsLib AthenaBaseComps AthenaKernel - AthContainers SGTools StoreGateLib Identifier EventKernel EventPrimitives FourMom FourMomUtils xAODCaloEvent + AthContainers StoreGateLib Identifier EventKernel EventPrimitives FourMom FourMomUtils xAODCaloEvent xAODEgamma xAODTracking xAODTruth GaudiKernel LArRecConditions LArCablingLib LumiBlockCompsLib PATCoreLib EgammaAnalysisInterfacesLib ElectronPhotonFourMomentumCorrectionLib egammaRecEvent egammaUtils TrkEventPrimitives ) diff --git a/Reconstruction/egamma/egammaTools/src/EMFourMomBuilder.h b/Reconstruction/egamma/egammaTools/src/EMFourMomBuilder.h index 80c89d1863b3ca52a2f4edcc80a1a9e55c7ab6f2..4824815c9c40d46e8e39e187afa14f101c65b81f 100644 --- a/Reconstruction/egamma/egammaTools/src/EMFourMomBuilder.h +++ b/Reconstruction/egamma/egammaTools/src/EMFourMomBuilder.h @@ -27,10 +27,7 @@ #include "GaudiKernel/ServiceHandle.h" #include "egammaBaseTool.h" #include "egammaInterfaces/IEMFourMomBuilder.h" -#include "EventKernel/IParticle.h" -#include "CaloEvent/CaloCluster.h" #include "EventPrimitives/EventPrimitives.h" - #include "egammaRecEvent/egammaRec.h" class eg_resolution; diff --git a/Reconstruction/egamma/egammaValidation/src/EgammaMonitoring.cxx b/Reconstruction/egamma/egammaValidation/src/EgammaMonitoring.cxx index 0f215d0a289af874391ada8214cc697c031bf03d..2cde033b11af9a0fb58077620911667464807012 100644 --- a/Reconstruction/egamma/egammaValidation/src/EgammaMonitoring.cxx +++ b/Reconstruction/egamma/egammaValidation/src/EgammaMonitoring.cxx @@ -594,7 +594,7 @@ StatusCode EgammaMonitoring::finalize() { egammaMonitoring::EfficiencyPlot truthPhotonConvRecoUnconvEfficiency("truthPhotonConvRecoUnconvEfficiency", "/MONITORING/truthPhotonConvRecoUnconvEfficiency/", rootHistSvc ); ATH_CHECK(truthPhotonConvRecoUnconvEfficiency.divide(truthPhotonConvRecoUnconv, truthPhotonConvPhoton)); egammaMonitoring::EfficiencyPlot truthPhotonUnconvRecoUnconvEfficiency("truthPhotonUnconvRecoUnconvEfficiency", "/MONITORING/truthPhotonUnconvRecoUnconvEfficiency/", rootHistSvc ); - ATH_CHECK(truthPhotonConvRecoUnconvEfficiency.divide(truthPhotonUnconvRecoUnconv, truthPhotonUnconvPhoton)); + ATH_CHECK(truthPhotonUnconvRecoUnconvEfficiency.divide(truthPhotonUnconvRecoUnconv, truthPhotonUnconvPhoton)); egammaMonitoring::EfficiencyPlot truthPhotonRecoConvEfficiency("truthPhotonRecoConvEfficiency", "/MONITORING/truthPhotonRecoConvEfficiency/", rootHistSvc ); ATH_CHECK(truthPhotonRecoConvEfficiency.divide(truthPhotonConvRecoConv, truthPhotonRecoPhoton)); egammaMonitoring::EfficiencyPlot truthPhotonRecoUnconvEfficiency("truthPhotonRecoUnconvEfficiency", "/MONITORING/truthPhotonRecoUnconvEfficiency/", rootHistSvc ); diff --git a/Reconstruction/iPat/iPatInterfaces/iPatInterfaces/ISiClusterProperties.h b/Reconstruction/iPat/iPatInterfaces/iPatInterfaces/ISiClusterProperties.h index acec282cb6501cf1b25701c3395b1b209d74262f..cce276011a29da5c5baecd89833142a737844b47 100755 --- a/Reconstruction/iPat/iPatInterfaces/iPatInterfaces/ISiClusterProperties.h +++ b/Reconstruction/iPat/iPatInterfaces/iPatInterfaces/ISiClusterProperties.h @@ -47,13 +47,13 @@ public: conservative cluster errors for use during pattern recognition */ virtual std::pair<double,double> broadErrors (const InDet::SiCluster* cluster, const SiliconDetector* detector, - const Amg::Vector3D& trackIntersect) = 0; + const Amg::Vector3D& trackIntersect) const = 0; /**ISiClusterProperties interface: precise cluster position and errors including track-dependent corrections */ virtual HitOnTrack* hitOnTrack (const InDet::SiCluster* cluster, const SiliconDetector* detector, - const Trk::TrackParameters* parameters) = 0; + const Trk::TrackParameters* parameters) const = 0; }; diff --git a/Reconstruction/iPat/iPatInterfaces/iPatInterfaces/ITrackFollower.h b/Reconstruction/iPat/iPatInterfaces/iPatInterfaces/ITrackFollower.h index efc6d48098c750c172272ec514a11521cb250f98..ba4528552449d87d7b6c413aebd55023ec7de912 100755 --- a/Reconstruction/iPat/iPatInterfaces/iPatInterfaces/ITrackFollower.h +++ b/Reconstruction/iPat/iPatInterfaces/iPatInterfaces/ITrackFollower.h @@ -43,13 +43,13 @@ public: virtual Track* associate_trt (const Track&) = 0; /**ITrackFollower interface: create a track after extrapolation (inwards or outwards) */ - virtual Track* extrapolate_inwards (const Track&) const = 0; - virtual Track* extrapolate_outwards (const Track&) const = 0; + virtual Track* extrapolate_inwards (const Track&) = 0; + virtual Track* extrapolate_outwards (const Track&) = 0; /**ITrackFollower interface: create a track after interpolation (various possibilities) */ - virtual Track* fast_interpolate_outwards (const Track&) const = 0; - virtual Track* interpolate (const Track&) const = 0; - virtual Track* interpolate_from_beam_spot (const Track&) const = 0; + virtual Track* fast_interpolate_outwards (const Track&) = 0; + virtual Track* interpolate (const Track&) = 0; + virtual Track* interpolate_from_beam_spot (const Track&) = 0; /**ITrackFollower interface: set input data containers (silicon clusters) */ virtual void setDataContainers (const InDet::SiClusterContainer* pixelContainer, diff --git a/Reconstruction/iPat/iPatInterfaces/iPatInterfaces/IiPatFitter.h b/Reconstruction/iPat/iPatInterfaces/iPatInterfaces/IiPatFitter.h index 5279c1651ae443561a1267f032c2251a38048bd7..7ba789f6ee3384869353d087ac00741ec666396d 100755 --- a/Reconstruction/iPat/iPatInterfaces/iPatInterfaces/IiPatFitter.h +++ b/Reconstruction/iPat/iPatInterfaces/iPatInterfaces/IiPatFitter.h @@ -45,7 +45,7 @@ public: FitQuality*& fitQuality, PerigeeParameters& perigee, hit_const_iterator begin, - hit_const_iterator end) = 0; + hit_const_iterator end) const = 0; /**IiPatFitter interface: updates the track PerigeeParameters, FitQuality and residuals. May modify hits */ @@ -57,7 +57,7 @@ public: hit_iterator begin, hit_iterator end, hit_const_iterator original_begin, - hit_const_iterator original_end) = 0; + hit_const_iterator original_end) const = 0; /**IiPatFitter interface: as fit above - but with residual set in HitOnTrack */ virtual void fitWithResiduals(TrackStatus status, @@ -65,7 +65,7 @@ public: PerigeeParameters& perigee, parameter_vector*& scattererParameters, hit_const_iterator begin, - hit_const_iterator end) = 0; + hit_const_iterator end) const = 0; /**IiPatFitter interface: uses transverse vertex as a measurement */ @@ -74,7 +74,7 @@ public: PerigeeParameters& perigee, const Trk::RecVertex& vertex, hit_const_iterator begin, - hit_const_iterator end) = 0; + hit_const_iterator end) const = 0; }; diff --git a/Reconstruction/iPat/iPatTrackFitter/iPatTrackFitter/TrackFitter.h b/Reconstruction/iPat/iPatTrackFitter/iPatTrackFitter/TrackFitter.h index 1fb85a42188bd17480ba0b9a497b446ec7ee463f..a73a6ee8292e110343aeea6196005c55dd097d84 100755 --- a/Reconstruction/iPat/iPatTrackFitter/iPatTrackFitter/TrackFitter.h +++ b/Reconstruction/iPat/iPatTrackFitter/iPatTrackFitter/TrackFitter.h @@ -43,19 +43,21 @@ public: TrackFitter (const std::string& type, const std::string& name, const IInterface* parent); - ~TrackFitter (void); // destructor + virtual ~TrackFitter (void); // destructor - StatusCode initialize(); - StatusCode finalize(); + virtual StatusCode initialize() override; + virtual StatusCode finalize() override; // updates the track PerigeeParameters and FitQuality + virtual void fit(TrackStatus status, FitQuality*& fitQuality, PerigeeParameters& perigee, hit_const_iterator begin, - hit_const_iterator end); + hit_const_iterator end) const override; // updates the track PerigeeParameters, FitQuality and residuals. May modify hits + virtual void fitWithRejection(TrackStatus status, FitQuality*& fitQuality, int maxReject, @@ -64,77 +66,93 @@ public: hit_iterator begin, hit_iterator end, hit_const_iterator original_begin, - hit_const_iterator original_end); + hit_const_iterator original_end) const override; // as fit above - but with residual set in HitOnTrack + virtual void fitWithResiduals(TrackStatus status, FitQuality*& fitQuality, PerigeeParameters& perigee, parameter_vector*& scattererParameters, hit_const_iterator begin, - hit_const_iterator end); + hit_const_iterator end) const override; // uses transverse vertex as a measurement + virtual void fitWithVertex(TrackStatus status, FitQuality*& fitQuality, PerigeeParameters& perigee, const Trk::RecVertex& vertex, hit_const_iterator begin, - hit_const_iterator end); + hit_const_iterator end) const override; protected: + class State; + // clean up memory - void clearMeasurements (void); + void clearMeasurements (State& state) const; // create internal measurements from HitOnTrack or RIO_OnTrack - void createMeasurements (hit_const_iterator begin, - hit_const_iterator end); + void createMeasurements (State& state, + hit_const_iterator begin, + hit_const_iterator end) const; // set and invoke fortran fit procedure - void fitProcedure (TrackStatus status, + void fitProcedure (State& state, + TrackStatus status, const PerigeeParameters& perigee, hit_const_iterator begin, - hit_const_iterator end); + hit_const_iterator end) const; // debug print-out - void print (TrackStatus status, + void print (const State& state, + TrackStatus status, const PerigeeParameters& perigee, const FitQuality& fitQuality) const; // get methods to extract fit results - void createPerigee (PerigeeParameters&) const; + void createPerigee (const State& state, + PerigeeParameters&) const; - void createQuality (FitQuality*&) const; - parameter_vector* createScatterers (void) const; - void setResiduals (void) const; + void createQuality (const State& state, + FitQuality*&) const; + parameter_vector* createScatterers (const State& state) const; + void setResiduals (const State& state) const; // temporary 3-point treatment - void threePoint (const PerigeeParameters& perigee, + void threePoint (State& state, + const PerigeeParameters& perigee, hit_const_iterator begin, - hit_const_iterator end); + hit_const_iterator end) const; - int m_driftHits; - bool m_fieldOff; - int m_fitCode; - Trk::FitProcedure* m_fitProcedure; - Trk::FitProcedureQuality* m_fitProcedureQuality; - int m_hit_pt3; ToolHandle<Trk::IMaterialAllocator> m_materialAllocator; - std::vector<Trk::FitMeasurement*> m_measurements; - Trk::FitParameters* m_parameters; - int m_planarHits; ToolHandle<Trk::IIntersector> m_rungeKuttaIntersector; double m_scatteringAngle; - double m_second_sigma_pt1; - double m_sigma_pt1; - double m_sigma_pt3; ToolHandle<Trk::IIntersector> m_solenoidalIntersector; ToolHandle<Trk::IIntersector> m_straightLineIntersector; + std::unique_ptr<Trk::FitProcedure> m_fitProcedure; ToolHandle< Trk::IPropagator > m_stepPropagator; ServiceHandle<Trk::ITrackingVolumesSvc> m_trackingVolumesSvc; Trk::FitMeasurement* m_vertexMeasurement; Trk::Volume* m_indetVolume; + struct State + { + Trk::FitParameters* m_parameters = nullptr; + std::unique_ptr<Trk::FitProcedureQuality> m_fitProcedureQuality; + int m_driftHits = 0; + int m_planarHits = 0; + int m_fitCode = 0; + int m_hit_pt3 = 0; + double m_second_sigma_pt1 = 0; + double m_sigma_pt1 = 0; + double m_sigma_pt3 = 0; + Trk::FitMeasurement* m_vertexMeasurement = nullptr; + std::vector<Trk::FitMeasurement*> m_measurements; + + void clearMeasurements(); + ~State(); + }; }; #endif // IPATREC_TRACKFITTER_H diff --git a/Reconstruction/iPat/iPatTrackFitter/src/TrackFitter.cxx b/Reconstruction/iPat/iPatTrackFitter/src/TrackFitter.cxx index e2d86f21212594cbdc8941181d3b491d1647cbe9..4af4a49c30cf7e4e80e67e48fa65e2dc48b90a6f 100755 --- a/Reconstruction/iPat/iPatTrackFitter/src/TrackFitter.cxx +++ b/Reconstruction/iPat/iPatTrackFitter/src/TrackFitter.cxx @@ -39,20 +39,9 @@ TrackFitter::TrackFitter (const std::string& type, const std::string& name, const IInterface* parent) : AthAlgTool (type, name, parent), - m_driftHits (0), - m_fieldOff (false), - m_fitCode (0), - m_fitProcedure (0), - m_fitProcedureQuality (0), - m_hit_pt3 (0), m_materialAllocator ("Trk::MaterialAllocator/MaterialAllocator"), - m_parameters (0), - m_planarHits (0), m_rungeKuttaIntersector ("Trk::RungeKuttaIntersector/RungeKuttaIntersector"), m_scatteringAngle (13.6), // Coulomb scattering constant - m_second_sigma_pt1 (0.), - m_sigma_pt1 (0.), - m_sigma_pt3 (0.), m_solenoidalIntersector ("Trk::SolenoidalIntersector/SolenoidalIntersector"), m_straightLineIntersector ("Trk::StraightLineIntersector/StraightLineIntersector"), m_stepPropagator ("Trk::STEP_Propagator/AtlasSTEP_Propagator"), @@ -72,8 +61,14 @@ TrackFitter::~TrackFitter (void) //<<<<<< PRIVATE MEMBER FUNCTION DEFINITIONS >>>>>> +TrackFitter::State::~State() +{ + clearMeasurements(); + delete m_parameters; +} + void -TrackFitter::clearMeasurements (void) +TrackFitter::State::clearMeasurements() { for (auto m : m_measurements) { @@ -83,14 +78,14 @@ TrackFitter::clearMeasurements (void) } void -TrackFitter::createMeasurements (hit_const_iterator begin, hit_const_iterator end) +TrackFitter::createMeasurements (State& state, hit_const_iterator begin, hit_const_iterator end) const { - m_driftHits = 0; - m_planarHits = 0; + state.m_driftHits = 0; + state.m_planarHits = 0; // copy hits into fitMeasurement vector int hit = 0; - if (m_vertexMeasurement) m_measurements.push_back(m_vertexMeasurement); + if (state.m_vertexMeasurement) state.m_measurements.push_back(state.m_vertexMeasurement); for (hit_const_iterator h = begin; h != end; ++h) { // fit up to brem hit @@ -109,17 +104,17 @@ TrackFitter::createMeasurements (hit_const_iterator begin, hit_const_iterator en case pixel_cluster: case broad_strip: case strip_cluster: - ++m_planarHits; + ++state.m_planarHits; if ((**h).rot()) { - m_measurements.push_back(new Trk::FitMeasurement(hit, + state.m_measurements.push_back(new Trk::FitMeasurement(hit, *h, (**h).rot())); } else if ((**h).isPixel()) { - m_measurements.push_back(new Trk::FitMeasurement(hit, + state.m_measurements.push_back(new Trk::FitMeasurement(hit, *h, Amg::Vector3D((**h).position()), (**h).sigma(), @@ -131,7 +126,7 @@ TrackFitter::createMeasurements (hit_const_iterator begin, hit_const_iterator en } else { - m_measurements.push_back(new Trk::FitMeasurement(hit, + state.m_measurements.push_back(new Trk::FitMeasurement(hit, *h, Amg::Vector3D((**h).position()), (**h).sigma(), @@ -147,14 +142,14 @@ TrackFitter::createMeasurements (hit_const_iterator begin, hit_const_iterator en case strip_reject: if ((**h).rot()) { - m_measurements.push_back(new Trk::FitMeasurement(hit, + state.m_measurements.push_back(new Trk::FitMeasurement(hit, *h, (**h).rot())); } else if ((**h).isPixel()) { - m_measurements.push_back(new Trk::FitMeasurement(hit, + state.m_measurements.push_back(new Trk::FitMeasurement(hit, *h, Amg::Vector3D((**h).position()), (**h).sigma(), @@ -166,7 +161,7 @@ TrackFitter::createMeasurements (hit_const_iterator begin, hit_const_iterator en } else { - m_measurements.push_back(new Trk::FitMeasurement(hit, + state.m_measurements.push_back(new Trk::FitMeasurement(hit, *h, Amg::Vector3D((**h).position()), (**h).sigma(), @@ -176,7 +171,7 @@ TrackFitter::createMeasurements (hit_const_iterator begin, hit_const_iterator en (**h).surface(), Trk::stripCluster)); } - (**m_measurements.rbegin()).setOutlier(); + (**state.m_measurements.rbegin()).setOutlier(); ++hit; break; case drift_time: @@ -187,8 +182,8 @@ TrackFitter::createMeasurements (hit_const_iterator begin, hit_const_iterator en break; } - ++m_driftHits; - m_measurements.push_back(new Trk::FitMeasurement(hit, + ++state.m_driftHits; + state.m_measurements.push_back(new Trk::FitMeasurement(hit, *h, (**h).rot())); ++hit; @@ -199,16 +194,16 @@ TrackFitter::createMeasurements (hit_const_iterator begin, hit_const_iterator en ATH_MSG_WARNING(" rot should be provided for drift hit" ); break; } - m_measurements.push_back(new Trk::FitMeasurement(hit, + state.m_measurements.push_back(new Trk::FitMeasurement(hit, *h, (**h).rot())); - (**m_measurements.rbegin()).setOutlier(); + (**state.m_measurements.rbegin()).setOutlier(); ++hit; break; case inactive: case inert: case scatterer: - m_measurements.push_back(new Trk::FitMeasurement((**h).materialEffects(), + state.m_measurements.push_back(new Trk::FitMeasurement((**h).materialEffects(), Trk::ParticleMasses().mass[Trk::pion], Amg::Vector3D((**h).position()))); @@ -220,100 +215,102 @@ TrackFitter::createMeasurements (hit_const_iterator begin, hit_const_iterator en } // ignore material at the end of the track - Trk::FitMeasurement* meas = m_measurements.back(); + Trk::FitMeasurement* meas = state.m_measurements.back(); while (! meas->isPositionMeasurement()) { delete meas; - m_measurements.pop_back(); - meas = m_measurements.back(); + state.m_measurements.pop_back(); + meas = state.m_measurements.back(); } } void -TrackFitter::fitProcedure (TrackStatus status, +TrackFitter::fitProcedure (State& state, + TrackStatus status, const PerigeeParameters& perigee, hit_const_iterator begin, - hit_const_iterator end) + hit_const_iterator end) const { // set parameters to starting values - delete m_parameters; - m_parameters = new Trk::FitParameters(perigee.transverseImpact(), - perigee.z(), - perigee.cosPhi(), - perigee.sinPhi(), - perigee.cotTheta(), - perigee.qOverPt(), - Amg::Vector3D(perigee.vertex())); + delete state.m_parameters; + state.m_parameters = + new Trk::FitParameters(perigee.transverseImpact(), + perigee.z(), + perigee.cosPhi(), + perigee.sinPhi(), + perigee.cotTheta(), + perigee.qOverPt(), + Amg::Vector3D(perigee.vertex())); // clean up previous fit - delete m_fitProcedureQuality; - m_fitProcedureQuality = 0; - clearMeasurements(); + state.m_fitProcedureQuality = nullptr; + state.clearMeasurements(); // create measurement vector, note special treatment for three_point tracks if (status == three_point) { - threePoint(perigee,begin,end); + threePoint(state, perigee,begin,end); } else { - createMeasurements(begin,end); + createMeasurements(state, begin,end); } // initialize the scattering centres - m_materialAllocator->initializeScattering(m_measurements); + m_materialAllocator->initializeScattering(state.m_measurements); // fail fit if there's a missing surface - m_fitCode = 0; - for (std::vector<Trk::FitMeasurement*>::const_iterator m = m_measurements.begin(); - m != m_measurements.end(); + state.m_fitCode = 0; + for (std::vector<Trk::FitMeasurement*>::const_iterator m = state.m_measurements.begin(); + m != state.m_measurements.end(); ++m) { if ((**m).surface() || (**m).isVertex() || (**m).isPerigee()) continue; ATH_MSG_WARNING( " fit fails as Trk::Surface is missing" ); - m_fitCode = 1; - m_fitProcedureQuality = new Trk::FitProcedureQuality(m_fitCode,-1); + state.m_fitCode = 1; + state.m_fitProcedureQuality = std::make_unique<Trk::FitProcedureQuality>(state.m_fitCode,-1); } // main fit procedure - if (! m_fitCode) + if (! state.m_fitCode) { MsgStream log(msgSvc(), name()); - m_fitProcedureQuality = - new Trk::FitProcedureQuality(m_fitProcedure->execute(false, + state.m_fitProcedureQuality = + std::make_unique<Trk::FitProcedureQuality>(m_fitProcedure->execute(false, log, - m_measurements, - m_parameters, + state.m_measurements, + state.m_parameters, 0, true)); - m_fitCode = m_fitProcedureQuality->fitCode(); + state.m_fitCode = state.m_fitProcedureQuality->fitCode(); // include leading material - if (status != three_point && ! m_fitCode) - m_materialAllocator->addLeadingMaterial(m_measurements,Trk::pion,*m_parameters); + if (status != three_point && ! state.m_fitCode) + m_materialAllocator->addLeadingMaterial(state.m_measurements,Trk::pion,*state.m_parameters); } } void -TrackFitter::createPerigee (PerigeeParameters& perigeeParameters) const +TrackFitter::createPerigee (const State& state, + PerigeeParameters& perigeeParameters) const { // return when fit fails - if (m_fitCode != 0) return; + if (state.m_fitCode != 0) return; // fill the perigee parameters and their covariance matrix - perigeeParameters.fillPerigee(m_parameters->cosPhi(), - m_parameters->cotTheta(), - m_parameters->ptInv0(), - m_parameters->sinPhi(), - m_parameters->d0(), - m_parameters->z0()); + perigeeParameters.fillPerigee(state.m_parameters->cosPhi(), + state.m_parameters->cotTheta(), + state.m_parameters->ptInv0(), + state.m_parameters->sinPhi(), + state.m_parameters->d0(), + state.m_parameters->z0()); if (! perigeeParameters.hasCovariance()) { perigeeParameters.covariance(new AmgSymMatrix(5)); } AmgSymMatrix(5)& covariance = *perigeeParameters.getCovariance(); - const AmgSymMatrix(5)& fitCovariance = *m_parameters->finalCovariance(); + const AmgSymMatrix(5)& fitCovariance = *state.m_parameters->finalCovariance(); for (int i = 0; i != 5; ++i) { for (int j = 0; j != 5; ++j) @@ -323,18 +320,19 @@ TrackFitter::createPerigee (PerigeeParameters& perigeeParameters) const } // from theta to cotTheta - double d3 = -1./(m_parameters->sinTheta()*m_parameters->sinTheta()); + double d3 = -1./(state.m_parameters->sinTheta()*state.m_parameters->sinTheta()); covariance(3,3) *= d3; for (int j = 0; j != 5; ++j) covariance(j,3) *= d3; // from qOverP to qOverPt - double d4 = 1./m_parameters->sinTheta(); + double d4 = 1./state.m_parameters->sinTheta(); covariance(4,4) *= d4; for (int j = 0; j != 5; ++j) covariance(j,4) *= d4; } void -TrackFitter::print (TrackStatus status, +TrackFitter::print (const State& state, + TrackStatus status, const PerigeeParameters& perigeeParameters, const FitQuality& fitQuality) const { @@ -354,35 +352,36 @@ TrackFitter::print (TrackStatus status, << " fitProb " << fitQuality.fit_probability(); } msg() << std::setiosflags(std::ios::fixed) << std::setw(6) - << m_planarHits << "(" << std::setw(2) << m_driftHits << ") planar(drift) hits " - << std::setw(5) << m_parameters->numberScatterers() << " scattering parameters " + << state.m_planarHits << "(" << std::setw(2) << state.m_driftHits << ") planar(drift) hits " + << std::setw(5) << state.m_parameters->numberScatterers() << " scattering parameters " << endmsg; } void -TrackFitter::createQuality (FitQuality*& fitQuality) const +TrackFitter::createQuality (const State& state, + FitQuality*& fitQuality) const { if (fitQuality == 0) fitQuality = new FitQuality; - fitQuality->fill(m_fitProcedureQuality->chiSq(), - m_fitProcedureQuality->numberDoF(), - m_fitProcedureQuality->fitCode(), - m_fitProcedureQuality->fitProbability(), - m_fitProcedureQuality->chiSqWorst()); + fitQuality->fill(state.m_fitProcedureQuality->chiSq(), + state.m_fitProcedureQuality->numberDoF(), + state.m_fitProcedureQuality->fitCode(), + state.m_fitProcedureQuality->fitProbability(), + state.m_fitProcedureQuality->chiSqWorst()); } parameter_vector* -TrackFitter::createScatterers (void) const +TrackFitter::createScatterers (const State& state) const { // return empty vector for fit without scattering parameter_vector* scattererParameters = new parameter_vector; scattererParameters->reserve(20); - if (! m_parameters->numberScatterers()) return scattererParameters; + if (! state.m_parameters->numberScatterers()) return scattererParameters; int param = 5; double qOverP = 0.; int scatter = 0; - for (std::vector<Trk::FitMeasurement*>::const_iterator m = m_measurements.begin(); - m != m_measurements.end(); + for (std::vector<Trk::FitMeasurement*>::const_iterator m = state.m_measurements.begin(); + m != state.m_measurements.end(); ++m) { if (! (**m).isScatterer()) continue; @@ -415,8 +414,8 @@ TrackFitter::createScatterers (void) const direction.y(), direction.z(), inversePt, - m_parameters->scattererTheta(scatter), - m_parameters->scattererPhi(scatter), + state.m_parameters->scattererTheta(scatter), + state.m_parameters->scattererPhi(scatter), 0., 0.)); @@ -428,7 +427,7 @@ TrackFitter::createScatterers (void) const // add parameters at last point (null scatterer) const Trk::TrackSurfaceIntersection& intersection = - (**(m_measurements.rbegin())).intersection(Trk::FittedTrajectory); + (**(state.m_measurements.rbegin())).intersection(Trk::FittedTrajectory); Amg::Vector3D direction = intersection.direction(); double sinTheta = direction.perp(); double inversePt = qOverP/sinTheta; @@ -448,11 +447,11 @@ TrackFitter::createScatterers (void) const } void -TrackFitter::setResiduals (void) const +TrackFitter::setResiduals (const State& state) const { // set residual from FitMeasurement into corresponding HitOnTrack - for (std::vector<Trk::FitMeasurement*>::const_iterator m = m_measurements.begin(); - m != m_measurements.end(); + for (std::vector<Trk::FitMeasurement*>::const_iterator m = state.m_measurements.begin(); + m != state.m_measurements.end(); ++m) { HitOnTrack* hit = (**m).hitOnTrack(); @@ -469,9 +468,10 @@ TrackFitter::setResiduals (void) const } void -TrackFitter::threePoint (const PerigeeParameters& perigee, +TrackFitter::threePoint (State& state, + const PerigeeParameters& perigee, hit_const_iterator begin, - hit_const_iterator end) + hit_const_iterator end) const { // TEMPORARY for 3-point tracks: // when cluster.sigma() working and checked this should move to CandidateBuilder @@ -484,47 +484,47 @@ TrackFitter::threePoint (const PerigeeParameters& perigee, --h3; if ((**h2).isPixel()) { - m_hit_pt3 = 2; + state.m_hit_pt3 = 2; } else { - m_hit_pt3 = 3; + state.m_hit_pt3 = 3; } double inv_sinTheta_square = 1. + perigee.cotTheta()*perigee.cotTheta(); - m_sigma_pt1 = scatteringAngle * + state.m_sigma_pt1 = scatteringAngle * ((**h2).position().perp() - (**begin).position().perp()); - m_sigma_pt1 *= 0.01*m_sigma_pt1*inv_sinTheta_square; + state.m_sigma_pt1 *= 0.01*state.m_sigma_pt1*inv_sinTheta_square; // TODO - check barrel / endcap (dr or dz/cotTheta) // 0.5 as 2 meas in SCT - m_sigma_pt3 = scatteringAngle * + state.m_sigma_pt3 = scatteringAngle * ((**h3).position().perp() - (**h2).position().perp()); - m_sigma_pt3 *= 0.5*0.01*m_sigma_pt3*inv_sinTheta_square; + state.m_sigma_pt3 *= 0.5*0.01*state.m_sigma_pt3*inv_sinTheta_square; - m_second_sigma_pt1 = m_sigma_pt1*inv_sinTheta_square; + state.m_second_sigma_pt1 = state.m_sigma_pt1*inv_sinTheta_square; if ((**begin).isBarrel()) { // double delta_r = ((**h2).position().perp() - (**begin).position().perp()); - // double sigma_scat1 = sqrt(m_sigma_pt1); - // double sigma_scat3 = sqrt(m_sigma_pt3); + // double sigma_scat1 = sqrt(state.m_sigma_pt1); + // double sigma_scat3 = sqrt(state.m_sigma_pt3); // cout << " 3point scat (barrel) " << 10000.*sigma_scat1 // << " " << 10000.*sigma_scat3 << " delta_r12 " << delta_r; } else { double inv_cosTheta_square = 1. + 1./perigee.cotTheta()*perigee.cotTheta(); - m_second_sigma_pt1 = m_sigma_pt1*inv_cosTheta_square; + state.m_second_sigma_pt1 = state.m_sigma_pt1*inv_cosTheta_square; // double delta_r = ((**h2).position().z() - (**begin).position().z())/perigee.cotTheta(); - // double sigma_scat1 = sqrt(m_sigma_pt1); - // double sigma_scat3 = sqrt(m_sigma_pt3); + // double sigma_scat1 = sqrt(state.m_sigma_pt1); + // double sigma_scat3 = sqrt(state.m_sigma_pt3); // cout << " 3point scat (endcap) " << 10000.*sigma_scat1 // << " " << 10000.*sigma_scat3 << " delta_r12 " << delta_r; } // cout << endl; - m_driftHits = 0; - m_planarHits = 0; + state.m_driftHits = 0; + state.m_planarHits = 0; // copy hits into fitMeasurement vector int hit = 0; @@ -536,13 +536,13 @@ TrackFitter::threePoint (const PerigeeParameters& perigee, { case pixel_cluster: case broad_pixel: - ++m_planarHits; + ++state.m_planarHits; if (hit == 0) { - sigmaWidth = sqrt(m_sigma_pt1 + sigmaWidth*sigmaWidth); - sigmaLength = sqrt(m_second_sigma_pt1 + sigmaLength*sigmaLength); + sigmaWidth = sqrt(state.m_sigma_pt1 + sigmaWidth*sigmaWidth); + sigmaLength = sqrt(state.m_second_sigma_pt1 + sigmaLength*sigmaLength); } - m_measurements.push_back(new Trk::FitMeasurement(hit, + state.m_measurements.push_back(new Trk::FitMeasurement(hit, *h, Amg::Vector3D((**h).position()), sigmaWidth, @@ -555,12 +555,12 @@ TrackFitter::threePoint (const PerigeeParameters& perigee, break; case strip_cluster: case broad_strip: - ++m_planarHits; - if (hit >= m_hit_pt3) + ++state.m_planarHits; + if (hit >= state.m_hit_pt3) { - sigmaWidth = sqrt(m_sigma_pt3 + sigmaWidth*sigmaWidth); + sigmaWidth = sqrt(state.m_sigma_pt3 + sigmaWidth*sigmaWidth); } - m_measurements.push_back(new Trk::FitMeasurement(hit, + state.m_measurements.push_back(new Trk::FitMeasurement(hit, *h, Amg::Vector3D((**h).position()), sigmaWidth, @@ -643,15 +643,15 @@ TrackFitter::initialize() } // can now create FitProcedure class - m_fitProcedure = new Trk::FitProcedure(false, - false, - false, - m_rungeKuttaIntersector, - m_solenoidalIntersector, - m_straightLineIntersector, - m_stepPropagator, - m_indetVolume, - 1); + m_fitProcedure = std::make_unique<Trk::FitProcedure>(false, + false, + false, + m_rungeKuttaIntersector, + m_solenoidalIntersector, + m_straightLineIntersector, + m_stepPropagator, + m_indetVolume, + 1); return StatusCode::SUCCESS; } @@ -659,10 +659,6 @@ TrackFitter::initialize() StatusCode TrackFitter::finalize() { - clearMeasurements(); - delete m_fitProcedure; - delete m_fitProcedureQuality; - delete m_parameters; return StatusCode::SUCCESS; } @@ -671,16 +667,17 @@ TrackFitter::fit (TrackStatus status, FitQuality*& fitQuality, PerigeeParameters& perigeeParameters, hit_const_iterator begin, - hit_const_iterator end) + hit_const_iterator end) const { ATH_MSG_VERBOSE( " fit " << status ); // ESD independent fit procedure - fitProcedure(status,perigeeParameters,begin,end); + State state; + fitProcedure(state,status,perigeeParameters,begin,end); // store results back into input classes - createQuality(fitQuality); - createPerigee(perigeeParameters); + createQuality(state, fitQuality); + createPerigee(state, perigeeParameters); } void @@ -692,25 +689,26 @@ TrackFitter::fitWithRejection(TrackStatus status, hit_iterator begin, hit_iterator end, hit_const_iterator original_begin, - hit_const_iterator original_end) + hit_const_iterator original_end) const { ATH_MSG_VERBOSE( " fitWithRejection " << status ); double chi_squared_cut_off = 6.25; // -> flat trt prob int number_rejected = 0; int iter = 0; bool fit = true; - + + State state; while (fit) { // ESD independent fit procedure - fitProcedure(status,perigeeParameters,begin,end); + fitProcedure(state,status,perigeeParameters,begin,end); // for a good fit: store results back into input classes - createQuality(fitQuality); - createPerigee(perigeeParameters); + createQuality(state, fitQuality); + createPerigee(state,perigeeParameters); // iterate after a good fit with a large hit residual - if (m_fitCode + if (state.m_fitCode || fitQuality->worst_hit_chi_squared() < chi_squared_cut_off) break; // don't touch any of the original hits from the candidate track space-points @@ -720,7 +718,7 @@ TrackFitter::fitWithRejection(TrackStatus status, hit_iterator h = begin; hit_const_iterator o = original_begin; int i; - for (i = 1; i < m_fitProcedureQuality->worstMeasurement(); ++i) ++h; + for (i = 1; i < state.m_fitProcedureQuality->worstMeasurement(); ++i) ++h; bool original = false; while (i-- > 0 && o != original_end) { @@ -785,7 +783,7 @@ TrackFitter::fitWithRejection(TrackStatus status, if (msgLvl(MSG::VERBOSE)) { msg(MSG::VERBOSE) << iter << " reject " << hitStatus - << " " << m_fitProcedureQuality->worstMeasurement() + << " " << state.m_fitProcedureQuality->worstMeasurement() << " " << fitQuality->worst_hit_chi_squared(); if (hitStatus == broad_strip) msg() << " ratio " << ((**h).broadSigma()/(**h).sigma()); @@ -806,10 +804,10 @@ TrackFitter::fitWithRejection(TrackStatus status, } // set the remaining track requirements - if (! m_fitCode) + if (! state.m_fitCode) { - scattererParameters = createScatterers(); - setResiduals(); + scattererParameters = createScatterers(state); + setResiduals(state); } } @@ -819,21 +817,22 @@ TrackFitter::fitWithResiduals (TrackStatus status, PerigeeParameters& perigeeParameters, parameter_vector*& scattererParameters, hit_const_iterator begin, - hit_const_iterator end) + hit_const_iterator end) const { ATH_MSG_VERBOSE( " fitWithResiduals " << status ); // ESD independent fit procedure - fitProcedure(status,perigeeParameters,begin,end); + State state; + fitProcedure(state,status,perigeeParameters,begin,end); // for a good fit: store results back into input classes // otherwise quit in case of fit failure - createQuality(fitQuality); - if (! m_fitCode) + createQuality(state, fitQuality); + if (! state.m_fitCode) { - createPerigee(perigeeParameters); - scattererParameters = createScatterers(); - setResiduals(); + createPerigee(state,perigeeParameters); + scattererParameters = createScatterers(state); + setResiduals(state); } } @@ -843,9 +842,10 @@ TrackFitter::fitWithVertex (TrackStatus status, PerigeeParameters& perigeeParameters, const Trk::RecVertex& vertex, hit_const_iterator begin, - hit_const_iterator end) + hit_const_iterator end) const { ATH_MSG_VERBOSE( " fitWithVertex " << status ); + State state; // include transverse vertex Amg::Vector3D delta = vertex.position() - perigeeParameters.vertex(); @@ -856,15 +856,15 @@ TrackFitter::fitWithVertex (TrackStatus status, double sigma = sqrt(sinPhi*sinPhi*covariance(0,0) + cosPhi*cosPhi*covariance(1,1) - 2.*cosPhi*sinPhi*covariance(1,0)); - m_vertexMeasurement = new Trk::FitMeasurement(d0, + state.m_vertexMeasurement = new Trk::FitMeasurement(d0, vertex.position(), sigma); // EDM independent fit procedure - fitProcedure(status,perigeeParameters,begin,end); + fitProcedure(state,status,perigeeParameters,begin,end); // store results back into input classes - m_vertexMeasurement = 0; - createQuality(fitQuality); - createPerigee(perigeeParameters); + state.m_vertexMeasurement = 0; + createQuality(state, fitQuality); + createPerigee(state,perigeeParameters); } diff --git a/Reconstruction/iPat/iPatTrackFollower/iPatTrackFollower/SiClusterProperties.h b/Reconstruction/iPat/iPatTrackFollower/iPatTrackFollower/SiClusterProperties.h index ab07e4c1a74f74a274e3ad1a8b6710abdd413c25..213678de64e4e69663a318ec123a7968da41102d 100755 --- a/Reconstruction/iPat/iPatTrackFollower/iPatTrackFollower/SiClusterProperties.h +++ b/Reconstruction/iPat/iPatTrackFollower/iPatTrackFollower/SiClusterProperties.h @@ -43,35 +43,39 @@ public: SiClusterProperties (const std::string& type, const std::string& name, const IInterface* parent); - ~SiClusterProperties (void); + virtual ~SiClusterProperties (void); - StatusCode initialize(); - StatusCode finalize(); + virtual StatusCode initialize() override; + virtual StatusCode finalize() override; // conservative cluster errors for use during pattern recognition std::pair<double,double> broadErrors (const InDet::SiCluster* cluster, const SiliconDetector* detector, - const Amg::Vector3D& trackIntersect); + const Amg::Vector3D& trackIntersect) const; // precise cluster position and errors including track-dependent corrections HitOnTrack* hitOnTrack (const InDet::SiCluster* cluster, const SiliconDetector* detector, - const Trk::TrackParameters* parameters); + const Trk::TrackParameters* parameters) const; private: - void barrelSCT_Errors (void); - void barrelSCT_Properties (void); - void barrelPixelErrors (void); - void barrelPixelProperties (void); - void endcapSCT_Errors (void); - void endcapSCT_Properties (void); - void endcapPixelErrors (void); - void endcapPixelProperties (void); - void setProperties (const SiliconDetector* detector, - const Amg::Vector3D& trackIntersect); - void setProperties (const SiliconDetector* detector, + struct State; + + void barrelSCT_Errors (State& state) const; + void barrelSCT_Properties (State& state) const; + void barrelPixelErrors (State& state) const; + void barrelPixelProperties (State& state) const; + void endcapSCT_Errors (State& state) const; + void endcapSCT_Properties (State& state) const; + void endcapPixelErrors (State& state) const; + void endcapPixelProperties (State& state) const; + void setProperties (State& state, + const SiliconDetector* detector, + const Amg::Vector3D& trackIntersect) const; + void setProperties (State& state, + const SiliconDetector* detector, const Amg::Vector3D& trackIntersect, - const Amg::Vector3D& trackDirection); + const Amg::Vector3D& trackDirection) const; // helpers, managers, tools const PixelID* m_pixelIdHelper; @@ -82,20 +86,21 @@ private: ToolHandle<Trk::IRIO_OnTrackCreator> m_sctPreciseROT_Maker; // state - double m_broadEtaError; - double m_broadPhiError; - const InDet::SiCluster* m_cluster; - const InDetDD::SiDetectorElement* m_element; - Amg::Vector3D m_globalPosition; - const Trk::TrackParameters* m_parameters; - double m_preciseEtaError; - double m_precisePhiError; - const InDet::SiClusterOnTrack* m_rotBroad; - const InDet::SiClusterOnTrack* m_rotPrecise; double m_sqrt12; - HitStatus m_status; - double m_trackCotTheta; - double m_trackRadius; + + struct State + { + const InDet::SiCluster* m_cluster; + double m_broadEtaError; + double m_broadPhiError; + Amg::Vector3D m_globalPosition; + const Trk::TrackParameters* m_parameters; + const InDet::SiClusterOnTrack* m_rotBroad; + const InDet::SiClusterOnTrack* m_rotPrecise; + HitStatus m_status; + double m_trackCotTheta; + double m_trackRadius; + }; }; diff --git a/Reconstruction/iPat/iPatTrackFollower/iPatTrackFollower/TrackFollower.h b/Reconstruction/iPat/iPatTrackFollower/iPatTrackFollower/TrackFollower.h index 4da69684da351e488c37b529f3b3af7cf6e6f5e7..7f5c3c97ef02172648bb17c25aca9ccedd64500d 100755 --- a/Reconstruction/iPat/iPatTrackFollower/iPatTrackFollower/TrackFollower.h +++ b/Reconstruction/iPat/iPatTrackFollower/iPatTrackFollower/TrackFollower.h @@ -43,19 +43,19 @@ public: TrackFollower (const std::string& type, const std::string& name, const IInterface* parent); - ~TrackFollower (void); + virtual ~TrackFollower (void); - StatusCode initialize(); - StatusCode finalize(); + virtual StatusCode initialize(); + virtual StatusCode finalize(); - Track* associate_trt (const Track&); - Track* extrapolate_inwards (const Track&) const; - Track* extrapolate_outwards (const Track&) const; - Track* fast_interpolate_outwards (const Track&) const; - Track* interpolate (const Track&) const; - Track* interpolate_from_beam_spot (const Track&) const; - void setDataContainers (const InDet::SiClusterContainer* pixelContainer, - const InDet::SiClusterContainer* sctContainer); + virtual Track* associate_trt (const Track&) override; + virtual Track* extrapolate_inwards (const Track&) override; + virtual Track* extrapolate_outwards (const Track&) override; + virtual Track* fast_interpolate_outwards (const Track&) override; + virtual Track* interpolate (const Track&) override; + virtual Track* interpolate_from_beam_spot (const Track&) override; + virtual void setDataContainers (const InDet::SiClusterContainer* pixelContainer, + const InDet::SiClusterContainer* sctContainer) override; private: typedef HitList::hit_list hit_list; @@ -68,7 +68,7 @@ private: hit_list* associateSilicon (layer_iterator begin, layer_iterator end, bool extrapolate, - const Track& track) const; + const Track& track); layer_iterator begin_layer (layer_vector* layers, const HitOnTrack& hit) const; layer_iterator end_layer (layer_iterator begin, diff --git a/Reconstruction/iPat/iPatTrackFollower/src/SiClusterProperties.cxx b/Reconstruction/iPat/iPatTrackFollower/src/SiClusterProperties.cxx index 94554f9ffff667e66638f7156a432e26476c55cc..8acc02601d7404ad7eaeed05dff7e03be35db60a 100755 --- a/Reconstruction/iPat/iPatTrackFollower/src/SiClusterProperties.cxx +++ b/Reconstruction/iPat/iPatTrackFollower/src/SiClusterProperties.cxx @@ -44,19 +44,7 @@ SiClusterProperties::SiClusterProperties(const std::string& type, m_sctIdHelper (nullptr), m_sctBroadROT_Maker (""), m_sctPreciseROT_Maker (""), - m_broadEtaError (0.), - m_broadPhiError (0.), - m_cluster (nullptr), - m_element (nullptr), - m_parameters (nullptr), - m_preciseEtaError (0.), - m_precisePhiError (0.), - m_rotBroad (nullptr), - m_rotPrecise (nullptr), - m_sqrt12 (sqrt(12.)), - m_status (pending), - m_trackCotTheta (0.), - m_trackRadius (0.) + m_sqrt12 (sqrt(12.)) { declareInterface<ISiClusterProperties>(this); declareProperty("PixelBroadROT_Maker", m_pixelBroadROT_Maker); @@ -159,93 +147,95 @@ SiClusterProperties::finalize() std::pair<double,double> SiClusterProperties::broadErrors (const InDet::SiCluster* cluster, const SiliconDetector* detector, - const Amg::Vector3D& trackIntersect) + const Amg::Vector3D& trackIntersect) const { - m_cluster = cluster; - m_globalPosition = cluster->globalPosition(); - setProperties (detector,trackIntersect); - return std::make_pair(m_broadPhiError,m_broadEtaError); + State state; + state.m_cluster = cluster; + state.m_globalPosition = cluster->globalPosition(); + setProperties (state,detector,trackIntersect); + return std::make_pair(state.m_broadPhiError,state.m_broadEtaError); } HitOnTrack* SiClusterProperties::hitOnTrack (const InDet::SiCluster* cluster, const SiliconDetector* detector, - const Trk::TrackParameters* parameters) + const Trk::TrackParameters* parameters) const { - m_cluster = cluster; - m_globalPosition = cluster->globalPosition(); - m_parameters = parameters; - setProperties (detector,m_parameters->position(),m_parameters->momentum().unit()); + State state; + state.m_cluster = cluster; + state.m_globalPosition = cluster->globalPosition(); + state.m_parameters = parameters; + setProperties (state,detector,state.m_parameters->position(),state.m_parameters->momentum().unit()); - if (m_rotBroad) + if (state.m_rotBroad) { return new HitOnTrack(detector->ring().isBarrel(), cluster->identify(), cluster, - m_rotBroad, - m_rotPrecise, - m_status); + state.m_rotBroad, + state.m_rotPrecise, + state.m_status); } // deprecated: this shouldn't be reached any more ATH_MSG_WARNING(" reached deprecated code "); - // return new HitOnTrack(m_globalPosition, - // m_broadPhiError, - // m_precisePhiError, - // m_broadEtaError, - // m_preciseEtaError, - // cluster->detectorElement()->sinStereo(m_globalPosition), + // return new HitOnTrack(state.m_globalPosition, + // state.m_broadPhiError, + // state.m_precisePhiError, + // state.m_broadEtaError, + // state.m_preciseEtaError, + // cluster->detectorElement()->sinStereo(state.m_globalPosition), // 0., // detector->ring().isBarrel(), // cluster->detectorElement(), // cluster->identify(), // cluster, // 0, - // m_status); + // state.m_status); return 0; } //<<<<<< PRIVATE MEMBER FUNCTION DEFINITIONS >>>>>> void -SiClusterProperties::barrelPixelErrors (void) +SiClusterProperties::barrelPixelErrors (State& state) const { // use broad errors for pixel cluster with unusual size or shape - m_rotBroad = dynamic_cast<const InDet::SiClusterOnTrack*> - (m_pixelBroadROT_Maker->correct(*m_cluster, *m_parameters)); - int size = m_cluster->rdoList().size(); - double phiClusterSize = m_cluster->width().colRow().x(); - double etaClusterSize = m_cluster->width().colRow().y(); + state.m_rotBroad = dynamic_cast<const InDet::SiClusterOnTrack*> + (m_pixelBroadROT_Maker->correct(*state.m_cluster, *state.m_parameters)); + int size = state.m_cluster->rdoList().size(); + double phiClusterSize = state.m_cluster->width().colRow().x(); + double etaClusterSize = state.m_cluster->width().colRow().y(); // cluster too wide in eta or phi or too few pixels at high eta - if (etaClusterSize > 2 + static_cast<int>(m_trackCotTheta) + if (etaClusterSize > 2 + static_cast<int>(state.m_trackCotTheta) || phiClusterSize > 3 - || size < static_cast<int>(m_trackCotTheta) - 2) + || size < static_cast<int>(state.m_trackCotTheta) - 2) { - m_status = broad_pixel; - m_rotPrecise = 0; + state.m_status = broad_pixel; + state.m_rotPrecise = 0; } else { - m_status = pixel_cluster; - m_rotPrecise = dynamic_cast<const InDet::SiClusterOnTrack*> - (m_pixelPreciseROT_Maker->correct(*m_cluster, *m_parameters)); + state.m_status = pixel_cluster; + state.m_rotPrecise = dynamic_cast<const InDet::SiClusterOnTrack*> + (m_pixelPreciseROT_Maker->correct(*state.m_cluster, *state.m_parameters)); } } void -SiClusterProperties::barrelPixelProperties (void) +SiClusterProperties::barrelPixelProperties (State& state) const { // note extra broadening of broad eta error to ~account for pixel inefficiency // (which often causes cluster splitting in eta) - m_status = broad_pixel; - m_broadEtaError = (m_cluster->width().z()+0.050*CLHEP::mm)/m_sqrt12; - m_broadPhiError = m_cluster->width().phiR()/m_sqrt12; + state.m_status = broad_pixel; + state.m_broadEtaError = (state.m_cluster->width().z()+0.050*CLHEP::mm)/m_sqrt12; + state.m_broadPhiError = state.m_cluster->width().phiR()/m_sqrt12; } void -SiClusterProperties::barrelSCT_Errors (void) +SiClusterProperties::barrelSCT_Errors (State& state) const { // something from old iPatRec code I'd like to see in the ROT: // since clusters of width>2 on stiff tracks (pT>1GeV) are @@ -255,155 +245,155 @@ SiClusterProperties::barrelSCT_Errors (void) // treated like singles. // anyway use broad errors for clusters with more than 2 strips - m_rotBroad = dynamic_cast<const InDet::SiClusterOnTrack*> - (m_sctBroadROT_Maker->correct(*m_cluster, *m_parameters)); - if (m_cluster->rdoList().size() > 2) + state.m_rotBroad = dynamic_cast<const InDet::SiClusterOnTrack*> + (m_sctBroadROT_Maker->correct(*state.m_cluster, *state.m_parameters)); + if (state.m_cluster->rdoList().size() > 2) { - m_status = broad_strip; - m_rotPrecise = 0; + state.m_status = broad_strip; + state.m_rotPrecise = 0; } else { - m_status = strip_cluster; - m_rotPrecise = dynamic_cast<const InDet::SiClusterOnTrack*> - (m_sctPreciseROT_Maker->correct(*m_cluster, *m_parameters)); + state.m_status = strip_cluster; + state.m_rotPrecise = dynamic_cast<const InDet::SiClusterOnTrack*> + (m_sctPreciseROT_Maker->correct(*state.m_cluster, *state.m_parameters)); } } void -SiClusterProperties::barrelSCT_Properties (void) +SiClusterProperties::barrelSCT_Properties (State& state) const { - m_status = broad_strip; - m_broadPhiError = m_cluster->width().phiR()/m_sqrt12; + state.m_status = broad_strip; + state.m_broadPhiError = state.m_cluster->width().phiR()/m_sqrt12; } void -SiClusterProperties::endcapPixelErrors (void) +SiClusterProperties::endcapPixelErrors (State& state) const { // broad errors for clusters with more than 2 pixels in either direction - m_rotBroad = dynamic_cast<const InDet::SiClusterOnTrack*> - (m_pixelBroadROT_Maker->correct(*m_cluster, *m_parameters)); + state.m_rotBroad = dynamic_cast<const InDet::SiClusterOnTrack*> + (m_pixelBroadROT_Maker->correct(*state.m_cluster, *state.m_parameters)); - double phiClusterSize = m_cluster->width().colRow().x(); - double etaClusterSize = m_cluster->width().colRow().y(); + double phiClusterSize = state.m_cluster->width().colRow().x(); + double etaClusterSize = state.m_cluster->width().colRow().y(); if (phiClusterSize > 2 || etaClusterSize > 2) { - m_status = broad_pixel; - m_rotPrecise = 0; + state.m_status = broad_pixel; + state.m_rotPrecise = 0; } else { - m_status = pixel_cluster; - m_rotPrecise = dynamic_cast<const InDet::SiClusterOnTrack*> - (m_pixelPreciseROT_Maker->correct(*m_cluster, *m_parameters)); + state.m_status = pixel_cluster; + state.m_rotPrecise = dynamic_cast<const InDet::SiClusterOnTrack*> + (m_pixelPreciseROT_Maker->correct(*state.m_cluster, *state.m_parameters)); } } void -SiClusterProperties::endcapPixelProperties (void) +SiClusterProperties::endcapPixelProperties (State& state) const { - m_status = broad_pixel; - m_broadEtaError = m_cluster->width().z()/m_sqrt12; - m_broadPhiError = m_cluster->width().phiR()/m_sqrt12; + state.m_status = broad_pixel; + state.m_broadEtaError = state.m_cluster->width().z()/m_sqrt12; + state.m_broadPhiError = state.m_cluster->width().phiR()/m_sqrt12; } void -SiClusterProperties::endcapSCT_Errors (void) +SiClusterProperties::endcapSCT_Errors (State& state) const { // use broad errors for clusters with more than 2 strips - m_rotBroad = dynamic_cast<const InDet::SiClusterOnTrack*> - (m_sctBroadROT_Maker->correct(*m_cluster, *m_parameters)); - if (m_cluster->rdoList().size() > 2) + state.m_rotBroad = dynamic_cast<const InDet::SiClusterOnTrack*> + (m_sctBroadROT_Maker->correct(*state.m_cluster, *state.m_parameters)); + if (state.m_cluster->rdoList().size() > 2) { - m_status = broad_strip; - m_rotPrecise = 0; + state.m_status = broad_strip; + state.m_rotPrecise = 0; } else { - m_status = strip_cluster; - m_rotPrecise = dynamic_cast<const InDet::SiClusterOnTrack*> - (m_sctPreciseROT_Maker->correct(*m_cluster, *m_parameters)); + state.m_status = strip_cluster; + state.m_rotPrecise = dynamic_cast<const InDet::SiClusterOnTrack*> + (m_sctPreciseROT_Maker->correct(*state.m_cluster, *state.m_parameters)); } } void -SiClusterProperties::endcapSCT_Properties (void) +SiClusterProperties::endcapSCT_Properties (State& state) const { // 'natural' error for wedge shape + smearing // crude approximation to use in initial track finding stages - m_status = broad_strip; - double error = m_cluster->width().phiR()/m_sqrt12 * - m_trackRadius/m_globalPosition.perp(); - m_broadPhiError = std::sqrt(error*error + 0.012*0.012); //CLHEP::mm + state.m_status = broad_strip; + double error = state.m_cluster->width().phiR()/m_sqrt12 * + state.m_trackRadius/state.m_globalPosition.perp(); + state.m_broadPhiError = std::sqrt(error*error + 0.012*0.012); //CLHEP::mm } void -SiClusterProperties::setProperties (const SiliconDetector* detector, - const Amg::Vector3D& trackIntersect) +SiClusterProperties::setProperties (State& state, + const SiliconDetector* detector, + const Amg::Vector3D& trackIntersect) const { // only broad errors will be required when track direction is unknown - m_precisePhiError = 0.; - m_preciseEtaError = 0.; const InDetDD::SiDetectorElement& element = detector->element(); - m_globalPosition = m_cluster->globalPosition(); + state.m_globalPosition = state.m_cluster->globalPosition(); if (element.isBarrel()) { if (element.isPixel()) { - barrelPixelProperties(); + barrelPixelProperties(state); } else { - barrelSCT_Properties(); + barrelSCT_Properties(state); } } else { if (element.isPixel()) { - endcapPixelProperties(); + endcapPixelProperties(state); } else { - m_trackRadius = trackIntersect.perp(); - endcapSCT_Properties(); + state.m_trackRadius = trackIntersect.perp(); + endcapSCT_Properties(state); } } } void -SiClusterProperties::setProperties (const SiliconDetector* detector, +SiClusterProperties::setProperties (State& state, + const SiliconDetector* detector, const Amg::Vector3D& trackIntersect, - const Amg::Vector3D& trackDirection) + const Amg::Vector3D& trackDirection) const { const InDetDD::SiDetectorElement& element = detector->element(); if (element.isBarrel()) { if (element.isPixel()) { - m_trackCotTheta = std::abs(trackDirection.z()/trackDirection.perp()); - barrelPixelProperties(); - barrelPixelErrors(); + state.m_trackCotTheta = std::abs(trackDirection.z()/trackDirection.perp()); + barrelPixelProperties(state); + barrelPixelErrors(state); } else { - barrelSCT_Properties(); - barrelSCT_Errors(); + barrelSCT_Properties(state); + barrelSCT_Errors(state); } } else { if (element.isPixel()) { - endcapPixelProperties(); - endcapPixelErrors(); + endcapPixelProperties(state); + endcapPixelErrors(state); } else { - m_trackRadius = trackIntersect.perp(); - endcapSCT_Properties(); - endcapSCT_Errors(); + state.m_trackRadius = trackIntersect.perp(); + endcapSCT_Properties(state); + endcapSCT_Errors(state); } } } diff --git a/Reconstruction/iPat/iPatTrackFollower/src/TrackFollower.cxx b/Reconstruction/iPat/iPatTrackFollower/src/TrackFollower.cxx index e78e7376808f63db1996f1b36c719ebd3a76ccff..9e9c28069070bcba4dbd43dfcc0e6f5c82a4bed0 100755 --- a/Reconstruction/iPat/iPatTrackFollower/src/TrackFollower.cxx +++ b/Reconstruction/iPat/iPatTrackFollower/src/TrackFollower.cxx @@ -320,7 +320,7 @@ TrackFollower::associate_trt (const Track& track) } Track* -TrackFollower::extrapolate_inwards (const Track& track) const +TrackFollower::extrapolate_inwards (const Track& track) { // extrapolate towards the vertex region ATH_MSG_DEBUG( "extrapolate_inwards" @@ -418,7 +418,7 @@ TrackFollower::extrapolate_inwards (const Track& track) const } Track* -TrackFollower::extrapolate_outwards (const Track& track) const +TrackFollower::extrapolate_outwards (const Track& track) { // extrapolate outwards from last assigned hit (to last SCT layer) ATH_MSG_DEBUG( "extrapolate_outwards" @@ -469,7 +469,7 @@ TrackFollower::extrapolate_outwards (const Track& track) const } Track* -TrackFollower::fast_interpolate_outwards (const Track& track) const +TrackFollower::fast_interpolate_outwards (const Track& track) { // interpolate to give a track segment outwards from the first hit ATH_MSG_DEBUG( "fast_interpolate_outwards" @@ -496,7 +496,7 @@ TrackFollower::fast_interpolate_outwards (const Track& track) const } Track* -TrackFollower::interpolate (const Track& track) const +TrackFollower::interpolate (const Track& track) { // interpolate to give a track segment joining the first and last hits ATH_MSG_DEBUG( "interpolate" @@ -526,7 +526,7 @@ TrackFollower::interpolate (const Track& track) const } Track* -TrackFollower::interpolate_from_beam_spot (const Track& track) const +TrackFollower::interpolate_from_beam_spot (const Track& track) { // interpolate to give a long_segment joining beam-line to last hit ATH_MSG_DEBUG( "interpolate_from_beam_spot" @@ -571,7 +571,7 @@ hit_list* TrackFollower::associateSilicon (std::vector<SiliconLayer*>::iterator begin, std::vector<SiliconLayer*>::iterator end, bool extrapolate, - const Track& track) const + const Track& track) { // create an empty hit_list hit_list* hits = new hit_list; diff --git a/Simulation/Digitization/python/DigiOutput.py b/Simulation/Digitization/python/DigiOutput.py index 33f61b36e7745feb64ce08025364cd332e412933..453435db6588dd3e18f4f13e432feebffa27bf64 100644 --- a/Simulation/Digitization/python/DigiOutput.py +++ b/Simulation/Digitization/python/DigiOutput.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration #from AthenaCommon import CfgMgr #from AthenaCommon.CfgGetter import getPrivateTool diff --git a/Simulation/Digitization/share/RunNumberOverride.py b/Simulation/Digitization/share/RunNumberOverride.py index 3f6b9a073f9f077aa110f70d36f0d5a23788f918..3324b6919b5a54dd9b7383b7988ed639587eb1d0 100644 --- a/Simulation/Digitization/share/RunNumberOverride.py +++ b/Simulation/Digitization/share/RunNumberOverride.py @@ -7,7 +7,7 @@ from AthenaCommon.AppMgr import ServiceMgr if digitizationFlags.dataRunNumber.get_Value(): if digitizationFlags.dataRunNumber.get_Value() < 0: raise SystemExit("Given a negative Run Number - please use a real run number from data.") - logDigitization_flags.info( 'Overriding run number to be: %s ', digitizationFlags.dataRunNumber.get_Value() ) + print 'Overriding run number to be: %s ', digitizationFlags.dataRunNumber.get_Value() myRunNumber = digitizationFlags.dataRunNumber.get_Value() myFirstLB = 1 myInitialTimeStamp = 1 diff --git a/Simulation/G4Atlas/G4AtlasApps/python/SimSkeleton.py b/Simulation/G4Atlas/G4AtlasApps/python/SimSkeleton.py index 850c3c749c32c80f179625b79a404e53b769e45f..155d900077a682fc6b0c2d7bb993d84152439ed8 100644 --- a/Simulation/G4Atlas/G4AtlasApps/python/SimSkeleton.py +++ b/Simulation/G4Atlas/G4AtlasApps/python/SimSkeleton.py @@ -106,7 +106,8 @@ class SimSkeleton(object): "TrackRecordCollection#MuonExitLayer"] from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags if ( hasattr(simFlags, 'SimulateNewSmallWheel') and simFlags.SimulateNewSmallWheel() ) or CommonGeometryFlags.Run()=="RUN3" : - stream1.ItemList += ["GenericMuonSimHitCollection#*"] + stream1.ItemList += ["GenericMuonSimHitCollection#*"] #MicroMegas only + stream1.ItemList += ["sTGCSimHitCollection#*"] ## Lucid if DetFlags.Lucid_on(): stream1.ItemList += ["LUCID_SimHitCollection#*"] diff --git a/Simulation/G4Atlas/G4AtlasApps/share/G4Atlas.flat.configuration.py b/Simulation/G4Atlas/G4AtlasApps/share/G4Atlas.flat.configuration.py index 2de0fd881f6c0455622cca2e6a9ff14bc687fd5a..f86c04f7f20300584909dc3620d23d5782e2ac8f 100644 --- a/Simulation/G4Atlas/G4AtlasApps/share/G4Atlas.flat.configuration.py +++ b/Simulation/G4Atlas/G4AtlasApps/share/G4Atlas.flat.configuration.py @@ -227,7 +227,8 @@ if not simFlags.ISFRun: "MDTSimHitCollection#*", "TrackRecordCollection#MuonExitLayer"] if ( hasattr(simFlags, 'SimulateNewSmallWheel') and simFlags.SimulateNewSmallWheel() ) or CommonGeometryFlags.Run()=="RUN3" : - stream1.ItemList += ["GenericMuonSimHitCollection#*"] + stream1.ItemList += ["GenericMuonSimHitCollection#*"] #MicroMegas only + stream1.ItemList += ["sTGCSimHitCollection#*"] ## Lucid if DetFlags.Lucid_on(): stream1.ItemList += ["LUCID_SimHitCollection#*"] diff --git a/Simulation/G4Atlas/G4AtlasApps/share/Tile2000_2003.flat.configuration.py b/Simulation/G4Atlas/G4AtlasApps/share/Tile2000_2003.flat.configuration.py index 54b92ac3c54d0b9e47f53dedc6a95a66897a3634..c0bd86bcff73a076a09d5cfa54c7306e3e2a7b88 100644 --- a/Simulation/G4Atlas/G4AtlasApps/share/Tile2000_2003.flat.configuration.py +++ b/Simulation/G4Atlas/G4AtlasApps/share/Tile2000_2003.flat.configuration.py @@ -195,7 +195,8 @@ if not simFlags.ISFRun: "TrackRecordCollection#MuonExitLayer"] from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags if ( hasattr(simFlags, 'SimulateNewSmallWheel') and simFlags.SimulateNewSmallWheel() ) or CommonGeometryFlags.Run()=="RUN3" : - stream1.ItemList += ["GenericMuonSimHitCollection#*"] + stream1.ItemList += ["GenericMuonSimHitCollection#*"] #MicroMegas only + stream1.ItemList += ["sTGCSimHitCollection#*"] ## Lucid if DetFlags.Lucid_on(): stream1.ItemList += ["LUCID_SimHitCollection#*"] diff --git a/Simulation/ISF/ISF_Example/python/ISF_Output.py b/Simulation/ISF/ISF_Example/python/ISF_Output.py index c9cd6185604c264999430912fe98846366ba127c..a8d5a500f575e18ca6ca732a1237d048c3f04499 100644 --- a/Simulation/ISF/ISF_Example/python/ISF_Output.py +++ b/Simulation/ISF/ISF_Example/python/ISF_Output.py @@ -44,6 +44,11 @@ def getHITSStreamItemList(): "CSCSimHitCollection#*", "MDTSimHitCollection#*", "TrackRecordCollection#MuonExitLayer"] + from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags + if ( hasattr(simFlags, 'SimulateNewSmallWheel') and simFlags.SimulateNewSmallWheel() ) or CommonGeometryFlags.Run()=="RUN3" : + hitsItemList += ["GenericMuonSimHitCollection#*"] #MicroMegas only + hitsItemList += ["sTGCSimHitCollection#*"] + ## FwdRegion if DetFlags.FwdRegion_on(): hitsItemList += ["SimulationHitCollection#*"] diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/CMakeLists.txt b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/CMakeLists.txt index f80aa38c7ab43fc44f7b0c7f3efa4d24bcfcaad1..275633dffd28044ece621b7817efb1c0f275dfda 100644 --- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/CMakeLists.txt +++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/CMakeLists.txt @@ -39,6 +39,7 @@ atlas_add_root_dictionary( ISF_FastCaloSimEvent _dictSource ISF_FastCaloSimEvent/TFCS2DFunction.h ISF_FastCaloSimEvent/TFCS2DFunctionHistogram.h ISF_FastCaloSimEvent/TFCSParametrizationBase.h + ISF_FastCaloSimEvent/TFCSParametrizationPlaceholder.h ISF_FastCaloSimEvent/TFCSParametrization.h ISF_FastCaloSimEvent/TFCSInvisibleParametrization.h ISF_FastCaloSimEvent/TFCSInitWithEkin.h diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/LinkDef.h b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/LinkDef.h index 0d81d35cc1e9b82246b8a3754532c06a0f638293..e0f2f70b6b11dee541a4a1d5edc36d437efa7c26 100644 --- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/LinkDef.h +++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/LinkDef.h @@ -17,6 +17,7 @@ #include "ISF_FastCaloSimEvent/TFCS2DFunctionHistogram.h" #include "ISF_FastCaloSimEvent/TFCSParametrizationBase.h" +#include "ISF_FastCaloSimEvent/TFCSParametrizationPlaceholder.h" #include "ISF_FastCaloSimEvent/TFCSParametrization.h" #include "ISF_FastCaloSimEvent/TFCSInvisibleParametrization.h" #include "ISF_FastCaloSimEvent/TFCSInitWithEkin.h" @@ -122,12 +123,13 @@ #pragma link C++ class TFCS2DFunction+; #pragma link C++ class TFCS2DFunctionHistogram+; #pragma link C++ class TFCSParametrizationBase+; +#pragma link C++ class TFCSParametrizationPlaceholder+; #pragma link C++ class TFCSParametrization+; #pragma link C++ class TFCSInvisibleParametrization+; #pragma link C++ class TFCSInitWithEkin+; #pragma link C++ class TFCSEnergyInterpolationLinear+; #pragma link C++ class TFCSEnergyInterpolationSpline+; -#pragma link C++ class TFCSParametrizationChain+; +#pragma link C++ class TFCSParametrizationChain-; #pragma link C++ class TFCSParametrizationBinnedChain+; #pragma link C++ class TFCSParametrizationFloatSelectChain+; #pragma link C++ class TFCSParametrizationPDGIDSelectChain+; diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCSParametrizationBase.h b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCSParametrizationBase.h index 5d11ae369f132fcf724d8f6f4d7ea9997c46eabd..5fc382f4a03d876aebeec15e622a63906b7a7dde 100644 --- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCSParametrizationBase.h +++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCSParametrizationBase.h @@ -135,6 +135,10 @@ public: ///Print object information. void Print(Option_t *option = "") const; + + ///Deletes all objects from the s_cleanup_list. + ///This list can get filled during streaming operations, where an immediate delete is not possible + static void DoCleanup(); protected: const double init_Ekin_nominal=0; @@ -144,6 +148,8 @@ protected: const double init_eta_min=-100; const double init_eta_max=100; + static std::vector< TFCSParametrizationBase* > s_cleanup_list; + #if defined(__FastCaloSimStandAlone__) public: /// Update outputlevel diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCSParametrizationChain.h b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCSParametrizationChain.h index 6d97dc41bc6049cd82d9669b5ec2cdb7830b8112..7f7dc86bb9b4e8100325e66108774fb9ed932b1a 100644 --- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCSParametrizationChain.h +++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCSParametrizationChain.h @@ -12,6 +12,15 @@ public: TFCSParametrizationChain(const char* name=nullptr, const char* title=nullptr):TFCSParametrization(name,title) {}; TFCSParametrizationChain(const TFCSParametrizationChain& ref):TFCSParametrization(ref.GetName(),ref.GetTitle()),m_chain(ref.chain()) {}; + ///Status bit for chain persistency + enum FCSSplitChainObjects { + kSplitChainObjects = BIT(16) ///< Set this bit in the TObject bit field if the TFCSParametrizationBase objects in the chain should be written as separate keys into the root file instead of directly writing the objects. This is needed if the sum of all objects in the chain use >1GB of memory, which can't be handeled by TBuffer. Drawback is that identical objects will get stored as multiple instances + }; + + bool SplitChainObjects() const {return TestBit(kSplitChainObjects);}; + void set_SplitChainObjects() {SetBit(kSplitChainObjects);}; + void reset_SplitChainObjects() {ResetBit(kSplitChainObjects);}; + typedef std::vector< TFCSParametrizationBase* > Chain_t; virtual unsigned int size() const override {return m_chain.size();}; virtual const TFCSParametrizationBase* operator[](unsigned int ind) const override {return m_chain[ind];}; @@ -26,6 +35,9 @@ public: virtual FCSReturnCode simulate(TFCSSimulationState& simulstate,const TFCSTruthState* truth, const TFCSExtrapolationState* extrapol) override; void Print(Option_t *option = "") const override; + + //THIS CLASS HAS A CUSTOM STREAMER! CHANGES IN THE VERSIONING OR DATA TYPES NEED TO BE IMPLEMENTED BY HAND! + //void TFCSParametrizationChain::Streamer(TBuffer &R__b) protected: void recalc_pdgid_intersect(); void recalc_pdgid_union(); @@ -46,13 +58,13 @@ protected: private: Chain_t m_chain; - ClassDefOverride(TFCSParametrizationChain,1) //TFCSParametrizationChain + ClassDefOverride(TFCSParametrizationChain,2) //TFCSParametrizationChain }; #include "ISF_FastCaloSimEvent/TFCSParametrizationChain.icc" #if defined(__ROOTCLING__) && defined(__FastCaloSimStandAlone__) -#pragma link C++ class TFCSParametrizationChain+; +#pragma link C++ class TFCSParametrizationChain-; #endif #endif diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCSParametrizationPlaceholder.h b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCSParametrizationPlaceholder.h new file mode 100644 index 0000000000000000000000000000000000000000..ccfc30f42b6dbe972455a57e15d23005660dea0a --- /dev/null +++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCSParametrizationPlaceholder.h @@ -0,0 +1,27 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef ISF_FASTCALOSIMEVENT_TFCSParametrizationPlaceholder_h +#define ISF_FASTCALOSIMEVENT_TFCSParametrizationPlaceholder_h + +#include "ISF_FastCaloSimEvent/TFCSParametrizationBase.h" + +class TFCSParametrizationPlaceholder:public TFCSParametrizationBase { +public: + TFCSParametrizationPlaceholder(const char* name=nullptr, const char* title=nullptr):TFCSParametrizationBase(name,title) {}; + + virtual bool is_match_Ekin_bin(int /*Ekin_bin*/) const override {return true;}; + virtual bool is_match_calosample(int /*calosample*/) const override {return true;}; + + virtual FCSReturnCode simulate(TFCSSimulationState& simulstate,const TFCSTruthState* truth, const TFCSExtrapolationState* extrapol) override; +private: + + ClassDefOverride(TFCSParametrizationPlaceholder,1) //TFCSParametrizationPlaceholder +}; + +#if defined(__ROOTCLING__) && defined(__FastCaloSimStandAlone__) +#pragma link C++ class TFCSParametrizationPlaceholder+; +#endif + +#endif diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSParametrizationBase.cxx b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSParametrizationBase.cxx index 2b5ec52785edecab66065bca78eb0f43532888b0..772b2a6ddbde2d76dc19dbb2322f0d976475cd01 100644 --- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSParametrizationBase.cxx +++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSParametrizationBase.cxx @@ -10,6 +10,7 @@ //============================================= std::set< int > TFCSParametrizationBase::s_no_pdgid; +std::vector< TFCSParametrizationBase* > TFCSParametrizationBase::s_cleanup_list; #ifndef __FastCaloSimStandAlone__ //Initialize only in constructor to make sure the needed services are ready @@ -75,3 +76,14 @@ void TFCSParametrizationBase::Print(Option_t *option) const ATH_MSG_INFO(optprint<<GetTitle()); } } + +void TFCSParametrizationBase::DoCleanup() +{ + //Do cleanup only at the end of read/write operations + for(auto ptr:s_cleanup_list) if(ptr) { + delete ptr; + } + s_cleanup_list.resize(0); +} + + diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSParametrizationChain.cxx b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSParametrizationChain.cxx index 0fa9806b76e5fe45af8253935bcf4cf77741b794..69db3e27aff4eebceb36e9a7b6d6521f91c6d5b7 100644 --- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSParametrizationChain.cxx +++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSParametrizationChain.cxx @@ -3,8 +3,11 @@ */ #include "ISF_FastCaloSimEvent/TFCSParametrizationChain.h" +#include "ISF_FastCaloSimEvent/TFCSParametrizationPlaceholder.h" #include <algorithm> #include <iterator> +#include "TBuffer.h" +#include "TDirectory.h" //============================================= //======= TFCSParametrizationChain ========= @@ -149,3 +152,97 @@ void TFCSParametrizationChain::Print(Option_t *option) const count++; } } + +void TFCSParametrizationChain::Streamer(TBuffer &R__b) +{ + // Stream an object of class TFCSParametrizationChain. + + UInt_t R__s, R__c; + TDirectory* dir=nullptr; + + if (R__b.IsReading()) { + Version_t R__v = R__b.ReadVersion(&R__s, &R__c); + if (R__v==1) { + R__b.SetBufferOffset(R__s); + R__b.ReadClassBuffer(TFCSParametrizationChain::Class(),this); + } else { + TFCSParametrization::Streamer(R__b); + + TObject* parent=R__b.GetParent(); + if(R__b.GetParent()) { + if(parent->InheritsFrom(TDirectory::Class())) { + dir=(TDirectory*)parent; + } + } + + TFCSParametrizationChain::Chain_t &R__stl = m_chain; + R__stl.clear(); + TClass *R__tcl1 = TFCSParametrizationBase::Class(); + if (R__tcl1==0) { + Error("m_chain streamer","Missing the TClass object for class TFCSParametrizationBase *!"); + return; + } + int R__i, R__n; + R__b >> R__n; + R__stl.reserve(R__n); + for (R__i = 0; R__i < R__n; R__i++) { + TFCSParametrizationBase* R__t; + R__t = (TFCSParametrizationBase*)R__b.ReadObjectAny(R__tcl1); + if(R__t!=nullptr) { + if(R__t->InheritsFrom(TFCSParametrizationPlaceholder::Class())) { + TFCSParametrizationBase* new_R__t=nullptr; + + if(dir) new_R__t=(TFCSParametrizationBase*)dir->Get(R__t->GetName()); + + if(new_R__t) { + delete R__t; + R__t=new_R__t; + } else { + Error("TFCSParametrizationChain::Streamer","Found placeholder object in the parametrization chain, but could not read the real object from the file!"); + } + } + } + R__stl.push_back(R__t); + } + + R__b.CheckByteCount(R__s, R__c, TFCSParametrizationChain::IsA()); + } + } else { + R__c = R__b.WriteVersion(TFCSParametrizationChain::IsA(), kTRUE); + TFCSParametrization::Streamer(R__b); + + if(SplitChainObjects()) { + TObject* parent=R__b.GetParent(); + if(R__b.GetParent()) { + if(parent->InheritsFrom(TDirectory::Class())) { + dir=(TDirectory*)parent; + } + } + } + + TFCSParametrizationChain::Chain_t &R__stl = m_chain; + int R__n=int(R__stl.size()); + R__b << R__n; + if(R__n) { + TFCSParametrizationChain::Chain_t::iterator R__k; + int R__i=0; + for (R__k = R__stl.begin(); R__k != R__stl.end(); ++R__k) { + TFCSParametrizationBase* R__t = *R__k; + TFCSParametrizationBase* new_R__t=nullptr; + if(dir && R__t!=nullptr) { + dir->WriteTObject(R__t); + new_R__t=new TFCSParametrizationPlaceholder(R__t->GetName(),TString("Placeholder for: ")+R__t->GetTitle()); + R__t=new_R__t; + } + R__b << R__t; + + //delete new_R__t only after the end of read/write operations by calling TFCSParametrizationBase::DoCleanup(); + if(new_R__t) s_cleanup_list.push_back(new_R__t); + + ++R__i; + } + } + R__b.SetByteCount(R__c, kTRUE); + } +} + diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSParametrizationPlaceholder.cxx b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSParametrizationPlaceholder.cxx new file mode 100644 index 0000000000000000000000000000000000000000..96c1fcea73250463997f34132832cffe83fed992 --- /dev/null +++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSParametrizationPlaceholder.cxx @@ -0,0 +1,16 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#include "ISF_FastCaloSimEvent/TFCSParametrizationPlaceholder.h" + +//============================================= +//======= TFCSParametrizationPlaceholder ========= +//============================================= + +FCSReturnCode TFCSParametrizationPlaceholder::simulate(TFCSSimulationState& /*simulstate*/,const TFCSTruthState* /*truth*/, const TFCSExtrapolationState* /*extrapol*/) +{ + ATH_MSG_ERROR("TFCSParametrizationPlaceholder::simulate(). This is a placeholder and should never get called. Likely a problem in the reading of the parametrization file occured and this class was not replaced with the real parametrization"); + return FCSFatal; +} + diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/src/FastCaloSimSvcV2.cxx b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/src/FastCaloSimSvcV2.cxx index 4513a725306d2909a7e5d4afad30def11fedac1e..b5c016701657065a24b3404923578f947e8bb660 100644 --- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/src/FastCaloSimSvcV2.cxx +++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/src/FastCaloSimSvcV2.cxx @@ -126,7 +126,7 @@ StatusCode ISF::FastCaloSimSvcV2::finalize() StatusCode ISF::FastCaloSimSvcV2::setupEvent() { - ATH_MSG_INFO(m_screenOutputPrefix << "setupEvent NEW EVENT!"); + ATH_MSG_VERBOSE(m_screenOutputPrefix << "setupEvent NEW EVENT!"); m_theContainer = new CaloCellContainer(SG::VIEW_ELEMENTS); @@ -157,7 +157,7 @@ StatusCode ISF::FastCaloSimSvcV2::setupEvent() StatusCode ISF::FastCaloSimSvcV2::releaseEvent() { - ATH_MSG_INFO(m_screenOutputPrefix << "release Event"); + ATH_MSG_VERBOSE(m_screenOutputPrefix << "release Event"); CHECK( m_caloCellMakerToolsRelease.retrieve() ); @@ -166,7 +166,7 @@ StatusCode ISF::FastCaloSimSvcV2::releaseEvent() ToolHandleArray<ICaloCellMakerTool>::iterator endTool = m_caloCellMakerToolsRelease.end(); for (; itrTool != endTool; ++itrTool) { - ATH_MSG_INFO( m_screenOutputPrefix << "Calling tool " << itrTool->name() ); + ATH_MSG_VERBOSE( m_screenOutputPrefix << "Calling tool " << itrTool->name() ); StatusCode sc = (*itrTool)->process(m_theContainer); @@ -184,31 +184,20 @@ StatusCode ISF::FastCaloSimSvcV2::releaseEvent() StatusCode ISF::FastCaloSimSvcV2::simulate(const ISF::ISFParticle& isfp) { - ATH_MSG_INFO("NEW PARTICLE! FastCaloSimSvcV2 called with ISFParticle: " << isfp); + ATH_MSG_VERBOSE("NEW PARTICLE! FastCaloSimSvcV2 called with ISFParticle: " << isfp); int pdgid = fabs(isfp.pdgCode()); - int barcode=isfp.barcode(); - - if(barcode!=10001) - { - ATH_MSG_INFO("ISF particle barcode is barcode "<<barcode<<". Go to next Particle."); - return StatusCode::SUCCESS; - } + + //int barcode=isfp.barcode(); // isfp barcode, eta and phi: in case we need them + // float eta_isfp = particle_position.eta(); + // float phi_isfp = particle_position.phi(); - Amg::Vector3D particle_position = isfp.position(); - /* - float eta_isfp = particle_position.eta(); // isfp eta and phi, in case we need them - //float phi_isfp = particle_position.phi(); - if(abs(eta_isfp) > 0.3 || abs(eta_isfp) < 0.15) //somewhat enlarged to not cut off too many particles - { - ATH_MSG_INFO("ISF particle is out of eta range: "<<eta_isfp<<". Go to next Particle."); - return StatusCode::SUCCESS; - } - */ + Amg::Vector3D particle_position = isfp.position(); + - if(!(pdgid==22 || pdgid==211 || pdgid==11)) + if(!(pdgid==22 || pdgid==11)) { - ATH_MSG_INFO("Oh no! ISF particle has pdgid "<<pdgid<<" . That's not supported yet :("); + ATH_MSG_VERBOSE("ISF particle has pdgid "<<pdgid<<", that's not supported yet"); return StatusCode::SUCCESS; } @@ -224,10 +213,10 @@ StatusCode ISF::FastCaloSimSvcV2::simulate(const ISF::ISFParticle& isfp) return StatusCode::FAILURE; } - ATH_MSG_INFO("Energy returned: " << simulstate.E()); - ATH_MSG_INFO("Energy fraction for layer: "); + ATH_MSG_DEBUG("Energy returned: " << simulstate.E()); + ATH_MSG_DEBUG("Energy fraction for layer: "); for (int s = 0; s < CaloCell_ID_FCS::MaxSample; s++) - ATH_MSG_INFO(" Sampling " << s << " energy " << simulstate.E(s)); + ATH_MSG_DEBUG(" Sampling " << s << " energy " << simulstate.E(s)); //Now deposit all cell energies into the CaloCellContainer for(const auto& iter : simulstate.cells()) { diff --git a/Simulation/Tools/AtlasCLHEP_RandomGenerators/AtlasCLHEP_RandomGenerators/dSFMTEngine.h b/Simulation/Tools/AtlasCLHEP_RandomGenerators/AtlasCLHEP_RandomGenerators/dSFMTEngine.h index 8943d52dc8c0bc1c13c78bf409d594e559d8c0dd..9acaaac4e1c86663237f88c4341ab45ca3cc05a2 100755 --- a/Simulation/Tools/AtlasCLHEP_RandomGenerators/AtlasCLHEP_RandomGenerators/dSFMTEngine.h +++ b/Simulation/Tools/AtlasCLHEP_RandomGenerators/AtlasCLHEP_RandomGenerators/dSFMTEngine.h @@ -40,46 +40,47 @@ public: dSFMTEngine & operator=( const dSFMTEngine & p ); // Copy constructor and operator=. - double flat(); + virtual double flat() override; // Returns a pseudo random number between 0 and 1 (excluding the end points). - void flatArray(const int size, double* vect); + virtual void flatArray(const int size, double* vect) override; // Fills an array "vect" of specified size with flat random values. - void setSeed(long seed, int k=0); + virtual void setSeed(long seed, int k=0) override; // Sets the state of the algorithm according to seed. void setSeeds(const uint32_t * seeds, int k=0); // Sets the state of the algorithm according to the zero terminated // array of seeds. It is allowed to ignore one or many seeds in this array. - void setSeeds(const long * seeds, int k=0); + virtual void setSeeds(const long * seeds, int k=0) override; // Sets the state of the algorithm according to the zero terminated // array of seeds. It is allowed to ignore one or many seeds in this array. - void saveStatus( const char filename[] = "MTwist.conf") const; + virtual void saveStatus( const char filename[] = "MTwist.conf") const override; // Saves the current engine status in the named file - void restoreStatus( const char filename[] = "MTwist.conf" ); + virtual void restoreStatus( const char filename[] = "MTwist.conf" ) override; // Reads from named file the the last saved engine status and restores it. - void showStatus() const; + virtual void showStatus() const override; // Dumps the current engine status on the screen. - operator float(); // returns flat, without worrying about filling bits - operator unsigned int(); // 32-bit flat, quickest of all + using HepRandomEngine::operator double; + virtual operator float() override; // returns flat, without worrying about filling bits + virtual operator unsigned int() override; // 32-bit flat, quickest of all - virtual std::ostream & put (std::ostream & os) const; - virtual std::istream & get (std::istream & is); + virtual std::ostream & put (std::ostream & os) const override; + virtual std::istream & get (std::istream & is) override; static std::string beginTag ( ); - virtual std::istream & getState ( std::istream & is ); + virtual std::istream & getState ( std::istream & is ) override; - std::string name() const; + virtual std::string name() const override; static std::string engineName() {return "MTwistEngine";} - std::vector<unsigned long> put () const; - bool get (const std::vector<unsigned long> & v); - bool getState (const std::vector<unsigned long> & v); + virtual std::vector<unsigned long> put () const override; + virtual bool get (const std::vector<unsigned long> & v) override; + virtual bool getState (const std::vector<unsigned long> & v) override; private: DSFMT_T* m_dsfmt; diff --git a/Simulation/Tools/RDOAnalysis/share/RDOAnalysis_commonOptions.py b/Simulation/Tools/RDOAnalysis/share/RDOAnalysis_commonOptions.py index c6bfbe705f37ea67f908754c42f5951226293a52..9aeea52feca4afa5a0ad64374f643fc6335c57ae 100644 --- a/Simulation/Tools/RDOAnalysis/share/RDOAnalysis_commonOptions.py +++ b/Simulation/Tools/RDOAnalysis/share/RDOAnalysis_commonOptions.py @@ -83,6 +83,24 @@ include("RecExCond/AllDet_detDescr.py") import MuonCnvExample.MuonCablingConfig - +# Update Pixel conditions services +include("PixelConditionsServices/PixelDCSSvc_jobOptions.py") +from SiLorentzAngleSvc.LorentzAngleSvcSetup import lorentzAngleSvc +from SiPropertiesSvc.SiPropertiesSvcConf import SiPropertiesSvc +pixelSiPropertiesSvc = SiPropertiesSvc(name = "PixelSiPropertiesSvc",DetectorName="Pixel",SiConditionsServices=lorentzAngleSvc.pixelSiliconConditionsSvc) +ServiceMgr += pixelSiPropertiesSvc + +# Add conditions database folders +from IOVDbSvc.CondDB import conddb +conddb.addFolder("DCS_OFL","/SCT/DCS/CHANSTAT") +conddb.addFolder("DCS_OFL","/SCT/DCS/MODTEMP") +conddb.addFolder("DCS_OFL","/SCT/DCS/HV") + +# Set the SCT conditions services for `lorentzAngleSvc` +from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_DCSConditionsSvc +InDetSCT_DCSConditionsSvc = SCT_DCSConditionsSvc(name="InDetSCT_DCSConditionsSvc") +ServiceMgr += InDetSCT_DCSConditionsSvc +sctSiPropertiesSvc = SiPropertiesSvc(name = "SCT_SiPropertiesSvc", DetectorName="SCT", SiConditionsServices=lorentzAngleSvc.sctSiliconConditionsSvc) +ServiceMgr += sctSiPropertiesSvc diff --git a/TileCalorimeter/TileConditions/CMakeLists.txt b/TileCalorimeter/TileConditions/CMakeLists.txt index fbb558a81d1bd5206a2f1f4bf56423e207a09082..31755bea0f36cf6d1e01faada4a6a22853390fec 100644 --- a/TileCalorimeter/TileConditions/CMakeLists.txt +++ b/TileCalorimeter/TileConditions/CMakeLists.txt @@ -59,17 +59,10 @@ atlas_add_dictionary( TileConditionsDict LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} CaloConditions CaloIdentifier AthenaBaseComps AthenaKernel SGTools StoreGateLib SGtests AthenaPoolUtilities Identifier GaudiKernel TileCalibBlobObjs TileIdentifier CaloDetDescrLib TileDetDescr PathResolver TileConditionsLib ) # Test(s) in the package: -atlas_add_test( TileCondToolOfcCool_test - SOURCES test/TileCondToolOfcCool_test.cxx - LINK_LIBRARIES TileConditionsLib TileCalibBlobObjs AthenaBaseComps TestTools GaudiKernel ${CORAL_LIBRARIES} ) - atlas_add_test( TileCondToolTMDB_test SOURCES test/TileCondToolTMDB_test.cxx - LINK_LIBRARIES TileConditionsLib TileCalibBlobObjs AthenaBaseComps TestTools GaudiKernel ${CORAL_LIBRARIES} ) - -atlas_add_test( TileCondToolDspThreshold_test - SOURCES test/TileCondToolDspThreshold_test.cxx - LINK_LIBRARIES TileConditionsLib TileCalibBlobObjs AthenaBaseComps TestTools GaudiKernel ${CORAL_LIBRARIES} ) + LINK_LIBRARIES TileConditionsLib TileCalibBlobObjs AthenaBaseComps TestTools GaudiKernel ${CORAL_LIBRARIES} + POST_EXEC_SCRIPT nopost.sh) atlas_add_test( TileCablingService_test SOURCES test/TileCablingService_test.cxx @@ -79,9 +72,28 @@ atlas_add_test( TileCablingService_UpgradeABC_test SOURCES test/TileCablingService_UpgradeABC_test.cxx LINK_LIBRARIES TileConditionsLib TileIdentifier StoreGateLib IdDictParser TestTools CxxUtils ) +atlas_add_test( TileConditionTools_test + SOURCES test/TileConditionTools_test.cxx + LINK_LIBRARIES TileConditionsLib TileCalibBlobObjs AthenaBaseComps StoreGateLib GaudiKernel TestTools ${CORAL_LIBRARIES} + POST_EXEC_SCRIPT nopost.sh) + +atlas_add_test( TileEMScaleComponents_test + SOURCES test/TileEMScaleComponents_test.cxx + LINK_LIBRARIES TileConditionsLib TileIdentifier TileCalibBlobObjs AthenaBaseComps StoreGateLib GaudiKernel IdDictParser TestTools ${CORAL_LIBRARIES} + POST_EXEC_SCRIPT nopost.sh) + +atlas_add_test( TileNoiseTools_test + SOURCES test/TileNoiseTools_test.cxx + LINK_LIBRARIES TileConditionsLib TileCalibBlobObjs AthenaBaseComps StoreGateLib GaudiKernel TestTools ${CORAL_LIBRARIES} + POST_EXEC_SCRIPT nopost.sh) + +atlas_add_test( TileDCSComponents_test + SOURCES test/TileDCSComponents_test.cxx + LINK_LIBRARIES TileConditionsLib AthenaBaseComps StoreGateLib GaudiKernel IdDictParser TestTools ${CORAL_LIBRARIES} + POST_EXEC_SCRIPT nopost.sh) + # Install files from the package: atlas_install_python_modules( python/*.py ) atlas_install_joboptions( share/*.py ) atlas_install_runtime( share/*.txt share/Tile2003.* share/Tile2004.* share/TileDefault.* share/TileNo*.* share/dleak*.dat share/dsleak*.dat share/leak*.dat share/dpulse*.dat share/pulse*.dat share/noise*.dat share/ai_lo*.dat share/ai_hi*.dat share/bi_lo*.dat share/bi_hi*.dat share/ci_lo*.dat share/ci_hi*.dat share/DCS*.dat share/BadHVChannels.dat ) - diff --git a/TileCalorimeter/TileConditions/TileConditions/ITileBadChanTool.h b/TileCalorimeter/TileConditions/TileConditions/ITileBadChanTool.h index 13bab9e5b33d9dc71a9889a2dc83f71b9ff1e5af..8850f154c98387a3c28df152baeb2d83e1d654af 100644 --- a/TileCalorimeter/TileConditions/TileConditions/ITileBadChanTool.h +++ b/TileCalorimeter/TileConditions/TileConditions/ITileBadChanTool.h @@ -11,29 +11,59 @@ #include <stdint.h> #include <set> +/** + * @class ITileBadChanTool + * @brief An abstract inteface to get Tile channel and ADC status + */ + class ITileBadChanTool: virtual public IAlgTool { public: virtual ~ITileBadChanTool() {} - static const InterfaceID& interfaceID() { - static const InterfaceID IID_ITileBadChanTool("ITileBadChanTool", 1, 0); - return IID_ITileBadChanTool; - } - + /** + * @brief Return Tile ADC status + * @param adc_id Tile hardware (online) ADC identifier + * @return Tile ADC status + */ virtual const TileBchStatus& getAdcStatus(const HWIdentifier& adc_id) const = 0; + + /** + * @brief Return Tile ADC status + * @param drawerIdx Tile drawer index in range [0..275] + * @param channel Tile channel number in range [0..47] + * @param adc Tile ADC number + * @return Tile ADC status + */ virtual const TileBchStatus& getAdcStatus(unsigned int drawerIdx , unsigned int channel , unsigned int adc) const = 0; - virtual const TileBchStatus& getChannelStatus(const HWIdentifier& adc_id) const = 0; + /** + * @brief Return Tile channel status + * @param channel_id Tile hardware (online) channel identifier + * @return Tile channel status + */ + virtual const TileBchStatus& getChannelStatus(const HWIdentifier& channel_id) const = 0; + + /** + * @brief Return Tile channel status + * @param drawerIdx Tile drawer index in range [0..275] + * @param channel Tile channel number in range [0..47] + * @return Tile channel status + */ virtual const TileBchStatus& getChannelStatus(unsigned int drawerIdx , unsigned int channel) const = 0; virtual uint32_t encodeStatus(const TileBchStatus& status) const = 0; + /** + * @brief Return trips probabilities for all Tile drawers + * @return Trip probabilites for all Tile drawers + */ virtual const std::vector<float>& getTripsProbabilities(unsigned int ros) const = 0; + DeclareInterfaceID(ITileBadChanTool, 1, 0); }; -#endif +#endif // TILECONDITIONS_ITILEBADCHANTOOL_H diff --git a/TileCalorimeter/TileConditions/TileConditions/ITileCondProxy.h b/TileCalorimeter/TileConditions/TileConditions/ITileCondProxy.h index ba720e66ab37c7d2db50433c79761e76d94c1c72..6929b4ef621baefca1491dbdaf4564a651cdd8a1 100644 --- a/TileCalorimeter/TileConditions/TileConditions/ITileCondProxy.h +++ b/TileCalorimeter/TileConditions/TileConditions/ITileCondProxy.h @@ -5,20 +5,35 @@ #ifndef TILECONDITIONS_ITILECONDPROXY_H #define TILECONDITIONS_ITILECONDPROXY_H +#include "TileConditions/TileCalibData.h" + #include "GaudiKernel/IAlgTool.h" +#include "GaudiKernel/EventIDRange.h" +/** + * @class ITileCondProxy + * @brief An abstract interface to get Tile conditions data from source (file, DB) + * + */ template<typename T> class ITileCondProxy : virtual public IAlgTool { - public: + public: + + virtual ~ITileCondProxy() {} + + static const InterfaceID& interfaceID() { + static const InterfaceID IID_ITileCondProxy("ITileCondProxy", 1 , 0); + return IID_ITileCondProxy; + } - virtual ~ITileCondProxy() {} + virtual const T* getCalibDrawer(unsigned int drawerIdx) const = 0; - static const InterfaceID& interfaceID() { - static const InterfaceID IID_ITileCondProxy("ITileCondProxy", 1 , 0); - return IID_ITileCondProxy; - } - - virtual const T* getCalibDrawer(unsigned int drawerIdx) const = 0; + /** + * @brief Fill TileCalibData with Tile conditions data from source (file, DB) + * @param[out] calibData TileCalibData to fill with Tile conditions data + * @param[out] eventRange EventIDRange during wich Tile conditions data are valid + */ + virtual StatusCode fillCalibData(TileCalibData<T>& calibData, EventIDRange& eventRange) const = 0; }; diff --git a/TileCalorimeter/TileConditions/TileConditions/ITileDCSTool.h b/TileCalorimeter/TileConditions/TileConditions/ITileDCSTool.h new file mode 100644 index 0000000000000000000000000000000000000000..4588fb503d31a2e2efd24370e76c6075dfa735ca --- /dev/null +++ b/TileCalorimeter/TileConditions/TileConditions/ITileDCSTool.h @@ -0,0 +1,78 @@ +//Dear emacs, this is -*- c++ -*- + +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef TILECONDITIONS_ITILEDCSTOOL_H +#define TILECONDITIONS_ITILEDCSTOOL_H + +// Tile includes +#include "TileConditions/TileDCSState.h" + +// Gaudi includes +#include "GaudiKernel/IAlgTool.h" + +/** + * @class ITileDCSTool + * @brief An abstract interface to get Tile DCS information from DB + */ + +class ITileDCSTool: virtual public IAlgTool { + + public: + + virtual ~ITileDCSTool() {}; + + /** + * @copydoc TileDCSState::getChannelHV(unsigned int ros, unsigned int drawer, unsigned int channel) const + */ + virtual float getChannelHV(unsigned int ros, unsigned int drawer, unsigned int channel) const = 0; + + /** + * @copydoc TileDCSState::getChannelHVSet(unsigned int ros, unsigned int drawer, unsigned int channel) const + */ + virtual float getChannelHVSet(unsigned int ros, unsigned int drawer, unsigned int channel) const = 0; + + /** + * @copydoc TileDCSState::getDrawerStates(unsigned int ros, unsigned int drawer) const + */ + virtual int getDrawerStates(unsigned int ros, unsigned int drawer) const = 0; + + /** + * @copydoc TileDCSState::getDCSHVStatus(unsigned int ros, unsigned int drawer, unsigned int channel) const + */ + virtual TileDCSState::TileDCSStatus getDCSHVStatus(unsigned int ros, unsigned int drawer, unsigned int channel) const = 0; + + /** + * @copydoc TileDCSState::getDCSStatus(unsigned int ros, unsigned int drawer) const + */ + virtual TileDCSState::TileDCSStatus getDCSStatus(unsigned int ros, unsigned int drawer) const = 0; + + /** + * @copydoc TileDCSState::getDCSStatus(unsigned int ros, unsigned int drawer, unsigned int channel) const + */ + virtual TileDCSState::TileDCSStatus getDCSStatus(unsigned int ros, unsigned int drawer, unsigned int channel) const = 0; + + /** + * @copydoc TileDCSState::isStatusHVBad(unsigned int ros, unsigned int drawer, unsigned int channel) const + */ + virtual bool isStatusHVBad(unsigned int ros, unsigned int drawer, unsigned int channel) const = 0; + + /** + * @copydoc TileDCSState::isStatusBad (unsigned int ros, unsigned int drawer) const + */ + virtual bool isStatusBad (unsigned int ros, unsigned int drawer) const = 0; + + /** + * @copydoc TileDCSState::isStatusBad(unsigned int ros, unsigned int drawer, unsigned int channel) const + */ + virtual bool isStatusBad(unsigned int ros, unsigned int drawer, unsigned int channel) const = 0; + + DeclareInterfaceID(ITileDCSTool, 1, 0); + +}; + + + +#endif // TILECONDITIONS_ITILEDCSTOOL_H diff --git a/TileCalorimeter/TileConditions/TileConditions/TileBadChanLegacyTool.h b/TileCalorimeter/TileConditions/TileConditions/TileBadChanLegacyTool.h new file mode 100644 index 0000000000000000000000000000000000000000..ef68d379dc626cbbd4899585a54fe2b5a496758d --- /dev/null +++ b/TileCalorimeter/TileConditions/TileConditions/TileBadChanLegacyTool.h @@ -0,0 +1,103 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef TILECONDITIONS_TILEBADCHANLEGACYTOOL_H +#define TILECONDITIONS_TILEBADCHANLEGACYTOOL_H + +// Gaudi includes +#include "GaudiKernel/ToolHandle.h" + +// Athena includes +#include "AthenaBaseComps/AthAlgTool.h" +#include "AthenaKernel/IOVSvcDefs.h" +#include "Identifier/HWIdentifier.h" +#include "Identifier/IdentifierHash.h" + +// Calo includes +#include "CaloConditions/ICaloBadChanTool.h" +#include "CaloConditions/CaloBadChannel.h" + +// Tile includes +#include "TileConditions/ITileBadChanTool.h" +#include "TileConditions/ITileCondProxy.h" +#include "TileConditions/TileCondIdTransforms.h" +#include "TileCalibBlobObjs/TileBchStatus.h" +#include "TileCalibBlobObjs/TileCalibUtils.h" + +#include <map> +#include <vector> +#include <string> + +class TileHWID; +class TileDetDescrManager; +class IdContext; +class TileBchDecoder; +class TileCalibDrawerBch; + +class TileBadChanLegacyTool: public AthAlgTool + , virtual public ITileBadChanTool + , virtual public ICaloBadChanTool { + public: + + TileBadChanLegacyTool(const std::string& type, const std::string& name, const IInterface* parent); + virtual ~TileBadChanLegacyTool(); + + StatusCode initialize(); + StatusCode finalize(); + static const InterfaceID& interfaceID(); + + //=============================================================== + //=== ICaloBadChanTool methods + //=============================================================== + + /** @brief ICaloBadChanTool interface. + @param id Calo cell identifier */ + CaloBadChannel caloStatus(Identifier id) const; + + //=============================================================== + //=== ITileBadChanTool methods + //=============================================================== + const TileBchStatus& getAdcStatus(const HWIdentifier& adc_id) const; + const TileBchStatus& getAdcStatus(IdentifierHash hash_id, unsigned int adc) const; + const TileBchStatus& getAdcStatus(unsigned int drawerIdx + , unsigned int channel + , unsigned int adc) const; + + const TileBchStatus& getChannelStatus(IdentifierHash hash_id) const; + const TileBchStatus& getChannelStatus(const HWIdentifier& channel_id) const; + const TileBchStatus& getChannelStatus(unsigned int drawerIdx, unsigned int channel) const; + + uint32_t encodeStatus(const TileBchStatus& status) const; + + const std::vector<float>& getTripsProbabilities(unsigned int ros) const { return m_tripsProbs[ros - 1]; }; + + private: + StatusCode recache(IOVSVC_CALLBACK_ARGS); + + const TileDetDescrManager* m_tileMgr; + const IdContext* m_channel_context; + ToolHandle<TileCondIdTransforms> m_tileIdTrans; + + ToolHandle<ITileCondProxy<TileCalibDrawerBch> > m_pryOnlBch; + ToolHandle<ITileCondProxy<TileCalibDrawerBch> > m_pryOflBch; + + std::vector<const TileBchDecoder*> m_tileBchDecoder; + std::map<HWIdentifier, TileBchStatus> m_statusMapAdc; + std::map<HWIdentifier, TileBchStatus> m_statusMapChn; + + TileBchStatus m_defaultStatus; + + // dummy declarations just to make new gccreflex happy + TileBadChanLegacyTool& operator=(const TileBadChanLegacyTool&); + + std::vector<std::vector<float> > m_tripsProbs; + bool m_useOflBch; + + const TileHWID* m_tileHWID; + std::vector<unsigned int> m_roses; + std::vector<unsigned int> m_drawers; +}; + + +#endif diff --git a/TileCalorimeter/TileConditions/TileConditions/TileBadChanTool.h b/TileCalorimeter/TileConditions/TileConditions/TileBadChanTool.h index be1a50f0dffd757267ad864297427dbd244409d9..4071acfc965cca306567f166f4af52111ae9e8de 100644 --- a/TileCalorimeter/TileConditions/TileConditions/TileBadChanTool.h +++ b/TileCalorimeter/TileConditions/TileConditions/TileBadChanTool.h @@ -1,29 +1,25 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef TILECONDITIONS_TILEBADCHANTOOL_H #define TILECONDITIONS_TILEBADCHANTOOL_H -// Gaudi includes -#include "GaudiKernel/ToolHandle.h" - -// Athena includes -#include "AthenaBaseComps/AthAlgTool.h" -#include "AthenaKernel/IOVSvcDefs.h" -#include "Identifier/HWIdentifier.h" -#include "Identifier/IdentifierHash.h" +// Tile includes +#include "TileConditions/ITileBadChanTool.h" +#include "TileCalibBlobObjs/TileBchStatus.h" +#include "TileConditions/TileBadChannels.h" // Calo includes #include "CaloConditions/ICaloBadChanTool.h" #include "CaloConditions/CaloBadChannel.h" -// Tile includes -#include "TileConditions/ITileBadChanTool.h" -#include "TileConditions/ITileCondProxy.h" -#include "TileConditions/TileCondIdTransforms.h" -#include "TileCalibBlobObjs/TileBchStatus.h" -#include "TileCalibBlobObjs/TileCalibUtils.h" +// Athena includes +#include "AthenaBaseComps/AthAlgTool.h" +#include "Identifier/Identifier.h" +#include "Identifier/IdentifierHash.h" +#include "Identifier/HWIdentifier.h" +#include "StoreGate/ReadCondHandleKey.h" #include <map> #include <vector> @@ -31,72 +27,91 @@ class TileHWID; class TileDetDescrManager; -class IdContext; -class TileBchDecoder; -class TileCalibDrawerBch; -class TileBadChanTool: public AthAlgTool - , virtual public ITileBadChanTool - , virtual public ICaloBadChanTool { +/** + * @class TileBadChanTool + * @brief The tool to get Tile channel and ADC status + */ + +class TileBadChanTool: public extends<AthAlgTool, ITileBadChanTool, ICaloBadChanTool> { + public: TileBadChanTool(const std::string& type, const std::string& name, const IInterface* parent); virtual ~TileBadChanTool(); - StatusCode initialize(); - StatusCode finalize(); - static const InterfaceID& interfaceID(); + virtual StatusCode initialize() override; + virtual StatusCode finalize() override; //=============================================================== //=== ICaloBadChanTool methods //=============================================================== - /** @brief ICaloBadChanTool interface. - @param id Calo cell identifier */ - CaloBadChannel caloStatus(Identifier id) const; + /** + * @brief ICaloBadChanTool interface. + * @param cell_id Calo cell identifier + */ + virtual CaloBadChannel caloStatus(Identifier cell_id) const override; //=============================================================== //=== ITileBadChanTool methods //=============================================================== - const TileBchStatus& getAdcStatus(const HWIdentifier& adc_id) const; + const TileBchStatus& getAdcStatus(IdentifierHash hash_id, unsigned int adc) const; - const TileBchStatus& getAdcStatus(unsigned int drawerIdx + + /** + * @copydoc ITileBadChanTool::getAdcStatus(const HWIdentifier& adc_id) const + */ + virtual const TileBchStatus& getAdcStatus(const HWIdentifier& adc_id) const override; + + /** + * @copydoc ITileBadChanTool::getAdcStatus(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const + */ + virtual const TileBchStatus& getAdcStatus(unsigned int drawerIdx , unsigned int channel - , unsigned int adc) const; + , unsigned int adc) const override; const TileBchStatus& getChannelStatus(IdentifierHash hash_id) const; - const TileBchStatus& getChannelStatus(const HWIdentifier& channel_id) const; - const TileBchStatus& getChannelStatus(unsigned int drawerIdx, unsigned int channel) const; - uint32_t encodeStatus(const TileBchStatus& status) const; + /** + * @copydoc ITileBadChanTool::getChannelStatus(const HWIdentifier& channel_id) const + */ + virtual const TileBchStatus& getChannelStatus(const HWIdentifier& channel_id) const override; - const std::vector<float>& getTripsProbabilities(unsigned int ros) const { return m_tripsProbs[ros - 1]; }; + /** + * @copydoc ITileBadChanTool::getChannelStatus(unsigned int drawerIdx, unsigned int channel) const + */ + virtual const TileBchStatus& getChannelStatus(unsigned int drawerIdx, unsigned int channel) const override; - private: - StatusCode recache(IOVSVC_CALLBACK_ARGS); + virtual uint32_t encodeStatus(const TileBchStatus& status) const override; - const TileDetDescrManager* m_tileMgr; - const IdContext* m_channel_context; - ToolHandle<TileCondIdTransforms> m_tileIdTrans; + /** + * @copydoc ITileBadChanTool::getTripsProbabilities(unsigned int ros) const + */ + virtual const std::vector<float>& getTripsProbabilities(unsigned int ros) const override; - ToolHandle<ITileCondProxy<TileCalibDrawerBch> > m_pryOnlBch; - ToolHandle<ITileCondProxy<TileCalibDrawerBch> > m_pryOflBch; - std::vector<const TileBchDecoder*> m_tileBchDecoder; - std::map<HWIdentifier, TileBchStatus> m_statusMapAdc; - std::map<HWIdentifier, TileBchStatus> m_statusMapChn; + private: + + /** + * @brief Name of TileBadChannels in condition store + */ + SG::ReadCondHandleKey<TileBadChannels> m_badChannelsKey{this, + "TileBadChannels", "TileBadChannels", "Input Tile bad channel status"}; + + const TileDetDescrManager* m_tileMgr; + const TileHWID* m_tileHWID; TileBchStatus m_defaultStatus; // dummy declarations just to make new gccreflex happy TileBadChanTool& operator=(const TileBadChanTool&); - std::vector<std::vector<float> > m_tripsProbs; - bool m_useOflBch; + std::vector<float> m_defaultTripsProbs; - const TileHWID* m_tileHWID; std::vector<unsigned int> m_roses; std::vector<unsigned int> m_drawers; + }; diff --git a/TileCalorimeter/TileConditions/TileConditions/TileBadChannels.h b/TileCalorimeter/TileConditions/TileConditions/TileBadChannels.h new file mode 100644 index 0000000000000000000000000000000000000000..3496db8b39cc80ab586563f07d9fd4dc474b3e5b --- /dev/null +++ b/TileCalorimeter/TileConditions/TileConditions/TileBadChannels.h @@ -0,0 +1,88 @@ +//Dear emacs, this is -*- c++ -*- + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef TILECONDITIONS_TILEBADCHANNELS_H +#define TILECONDITIONS_TILEBADCHANNELS_H + +// Tile includes +#include "TileCalibBlobObjs/TileBchStatus.h" + +// Athena includes +#include "Identifier/HWIdentifier.h" + +/** + * @class TileBadChannels + * @brief Condition object to keep Tile channel and ADC status + */ + +#include <map> + +class TileBadChannels { + + public: + + TileBadChannels(); + virtual ~TileBadChannels(); + + /** + * @brief Add status for given Tile ADC and corresponding channel + * @param channel_id Tile hardware (online) channel identifier + * @param adc_id Tile hardware (online) ADC identifier + * @param adcStatus Tile ADC status + */ + void addAdcStatus(const HWIdentifier channel_id, const HWIdentifier adc_id, TileBchStatus adcStatus); + + + /** + * @brief Return Tile ADC status + * @param adc_id Tile hardware (online) ADC identifier + * @return Tile ADC status + */ + const TileBchStatus& getAdcStatus(const HWIdentifier adc_id) const; + + /** + * @brief Return Tile channel status + * @param channel_id Tile hardware (online) channel identifier + * @return Tile channel status + */ + const TileBchStatus& getChannelStatus(const HWIdentifier channel_id) const; + + /** + * @brief Store trips probabilities for all Tile drawers + * @param tripsProbs Trips probabilites for all Tile drawers + */ + void setTripsProbabilities(std::vector<std::vector<float>>& tripsProbs); + + /** + * @brief Return trips probabilities for all Tile drawers + * @return Trips probabilites for all Tile drawers + */ + const std::vector<std::vector<float>>& getTripsProbabilities(void) const {return m_tripsProbs;}; + + private: + + TileBchStatus m_defaultStatus; + + std::map<const HWIdentifier, TileBchStatus> m_adcStatus; + std::map<const HWIdentifier, TileBchStatus> m_channelStatus; + + std::vector<std::vector<float>> m_tripsProbs; +}; + + +#include "AthenaKernel/CLASS_DEF.h" +#include "AthenaKernel/CondCont.h" + +CLASS_DEF( TileBadChannels, 186938202, 0) +CONDCONT_DEF ( TileBadChannels, 136686108); + +// inlines +inline +void TileBadChannels::setTripsProbabilities(std::vector<std::vector<float>>& tripsProbs) { + m_tripsProbs = std::move(tripsProbs); +} + +#endif // TILECONDITIONS_TILEBADCHANNELS_H diff --git a/TileCalorimeter/TileConditions/TileConditions/TileCalibData.h b/TileCalorimeter/TileConditions/TileConditions/TileCalibData.h new file mode 100644 index 0000000000000000000000000000000000000000..ff97ba80adb4aa19b133a5addc6ce714706c88e0 --- /dev/null +++ b/TileCalorimeter/TileConditions/TileConditions/TileCalibData.h @@ -0,0 +1,78 @@ +//Dear emacs, this is -*- c++ -*- + +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef TILECONDITIONS_TILECALIBDDATA_H +#define TILECONDITIONS_TILECALIBDDATA_H + + + +#include <vector> + +/** + * @class TileCalibData + * @brief Templated condition object to keep TileCalibDrawers + * + * + * Can keep TileCalibDrawers of the following types: + * - TileCalibDrawerFlt + * - TileCalibDrawerBch + * - TileCalibDrawerOfc + */ + +template<class T> +class TileCalibData { + + public: + + TileCalibData(); + virtual ~TileCalibData(); + + /** + * @brief Return TileCalibDrawer of type T + * @returns TileCalibDrawer of type T + * @param drawerIdx Tile drawer index in range [0..275] + */ + const T* getCalibDrawer(unsigned int drawerIdx) const; + + /** + * @brief Store TileCalibDrawer of type T + * The TileCalibData takes ownership of TileCalibDrawer + * @param drawerIdx Tile drawer index in range [0..275] + * @param calibDrawer TileCalibDrawer of type T to store + */ + void setCalibDrawer(unsigned int drawerIdx, const T* calibDrawer); + + TileCalibData (const TileCalibData&) = delete; + TileCalibData& operator= (const TileCalibData&) = delete; + + private: + + std::vector<const T*> m_calibDrawers; +}; + + +#include "AthenaKernel/CLASS_DEF.h" +#include "AthenaKernel/CondCont.h" + +#include "TileCalibBlobObjs/TileCalibDrawerFlt.h" +typedef TileCalibData<TileCalibDrawerFlt> TileCalibDataFlt; +template class TileCalibData<TileCalibDrawerFlt>; +CLASS_DEF(TileCalibData<TileCalibDrawerFlt>, 111225290, 0) +CONDCONT_DEF(TileCalibData<TileCalibDrawerFlt>, 149264696); + +#include "TileCalibBlobObjs/TileCalibDrawerOfc.h" +typedef TileCalibData<TileCalibDrawerOfc> TileCalibDataOfc; +template class TileCalibData<TileCalibDrawerOfc>; +CLASS_DEF(TileCalibData<TileCalibDrawerOfc>, 141822674, 0) +CONDCONT_DEF(TileCalibData<TileCalibDrawerOfc>, 262948840); + +#include "TileCalibBlobObjs/TileCalibDrawerBch.h" +typedef TileCalibData<TileCalibDrawerBch> TileCalibDataBch; +template class TileCalibData<TileCalibDrawerBch>; +CLASS_DEF(TileCalibData<TileCalibDrawerBch>, 88425733, 0) +CONDCONT_DEF(TileCalibData<TileCalibDrawerBch>, 218165589); + +#endif // TILECONDITIONS_TILECALIBDDATA_H diff --git a/TileCalorimeter/TileConditions/TileConditions/TileCellNoiseTool.h b/TileCalorimeter/TileConditions/TileConditions/TileCellNoiseTool.h index b7ffac693e0f0886fb09a7907748378c7712af8f..012e9d1c42d82df4946423a475ad3a33a03a870b 100644 --- a/TileCalorimeter/TileConditions/TileConditions/TileCellNoiseTool.h +++ b/TileCalorimeter/TileConditions/TileConditions/TileCellNoiseTool.h @@ -5,18 +5,17 @@ #ifndef TILECONDITIONS_TILECELLNOISETOOL_H #define TILECONDITIONS_TILECELLNOISETOOL_H -// Gaudi includes -#include "GaudiKernel/ServiceHandle.h" -#include "GaudiKernel/ToolHandle.h" +// Tile includes +#include "TileConditions/ITileCellNoiseTool.h" // Athena includes #include "AthenaBaseComps/AthAlgTool.h" +#include "StoreGate/ReadCondHandleKey.h" + +// Gaudi includes +#include "GaudiKernel/ServiceHandle.h" +#include "GaudiKernel/ToolHandle.h" -// Tile includes -#include "TileConditions/ITileCellNoiseTool.h" -//#include "TileConditions/TileCablingSvc.h" -//#include "TileConditions/TileCondIdTransforms.h" -//#include "TileConditions/ITileCondToolNoise.h" // Forward declaration class TileCablingSvc; @@ -31,8 +30,8 @@ class TileCellNoiseTool: public AthAlgTool TileCellNoiseTool(const std::string& type, const std::string& name, const IInterface* parent); virtual ~TileCellNoiseTool(); - StatusCode initialize(); - StatusCode finalize(); + virtual StatusCode initialize() override; + virtual StatusCode finalize() override; float getCellNoise(const Identifier& cell_id, CaloGain::CaloGain caloGain) const; diff --git a/TileCalorimeter/TileConditions/TileConditions/TileCondProxyCool.h b/TileCalorimeter/TileConditions/TileConditions/TileCondProxyCool.h index 93eb4cd8c67b8f92f26d0c53bc15edd48c5cb321..0a80cc53b24f5e0f6f9d506421cd95d3a88fed0f 100644 --- a/TileCalorimeter/TileConditions/TileConditions/TileCondProxyCool.h +++ b/TileCalorimeter/TileConditions/TileConditions/TileCondProxyCool.h @@ -5,44 +5,60 @@ #ifndef TILECONDITIONS_TILECONDPROXYCOOL_H #define TILECONDITIONS_TILECONDPROXYCOOL_H +// Tile includes +#include "TileConditions/ITileCondProxy.h" +#include "TileConditions/Exception.h" + // Athena includes #include "AthenaBaseComps/AthAlgTool.h" #include "AthenaKernel/IOVSvcDefs.h" #include "StoreGate/DataHandle.h" + +#include "StoreGate/ReadCondHandleKey.h" #include "AthenaPoolUtilities/CondAttrListCollection.h" -// Tile includes -#include "TileConditions/ITileCondProxy.h" -#include "TileConditions/Exception.h" #include <string> #include <vector> + +/** + * @class TileCondProxyCool + * @brief The tool to get Tile conditions data from DB + * + */ template<typename T> class TileCondProxyCool: public AthAlgTool, virtual public ITileCondProxy<T> { public: TileCondProxyCool(const std::string& type, const std::string& name, const IInterface* parent); virtual ~TileCondProxyCool() {}; - StatusCode initialize(); - StatusCode finalize(); + virtual StatusCode initialize() override; + virtual StatusCode finalize() override; - const T* getCalibDrawer(unsigned int drawerIdx) const; + /** + * @brief Fill TileCalibData with Tile conditions data from DB + * @param[out] calibData TileCalibData to fill with Tile conditions data + * @param[out] eventRange EventIDRange during wich Tile conditions data are valid + */ + virtual StatusCode fillCalibData(TileCalibData<T>& calibData, EventIDRange& eventRange) const override; + virtual const T* getCalibDrawer(unsigned int drawerIdx) const override; /** @brief Callback function, called if folder changed IOV */ StatusCode callback( IOVSVC_CALLBACK_ARGS); private: - /** Source = COOL folder */ - std::string m_source; - /** CalibDrawer vector to keep updated */ - std::vector<const T*> m_drawerVec; + std::unique_ptr<TileCalibData<T>> m_calibData; /** Data handle */ const DataHandle<CondAttrListCollection> m_dataHandle; + + + SG::ReadCondHandleKey<CondAttrListCollection> m_sourceKey{this, "Source", "", "The COOL folder name"}; + }; #endif diff --git a/TileCalorimeter/TileConditions/TileConditions/TileCondProxyFile.h b/TileCalorimeter/TileConditions/TileConditions/TileCondProxyFile.h index 69683c5f3eb6dee0b16d192e94dc35a53b9ce1de..229d1cba64b678104179101ce2429a59e0efd5c3 100644 --- a/TileCalorimeter/TileConditions/TileConditions/TileCondProxyFile.h +++ b/TileCalorimeter/TileConditions/TileConditions/TileCondProxyFile.h @@ -5,16 +5,25 @@ #ifndef TILECONDITIONS_TILECONDPROXYFILE_H #define TILECONDITIONS_TILECONDPROXYFILE_H -// Athena includes -#include "AthenaBaseComps/AthAlgTool.h" // Tile includes #include "TileConditions/ITileCondProxy.h" -#include "CoralBase/Blob.h" +// Athena includes +#include "AthenaBaseComps/AthAlgTool.h" + + + #include <string> #include <vector> - +#include <tuple> +#include <memory> + +/** + * @class TileCondProxyFile + * @brief The tool to get Tile conditions data from file + * + */ template<typename T> class TileCondProxyFile: public AthAlgTool, virtual public ITileCondProxy<T> { public: @@ -22,40 +31,32 @@ class TileCondProxyFile: public AthAlgTool, virtual public ITileCondProxy<T> { TileCondProxyFile(const std::string& type, const std::string& name, const IInterface* parent); virtual ~TileCondProxyFile() {}; - StatusCode initialize(); - StatusCode finalize(); + virtual StatusCode initialize() override; + virtual StatusCode finalize() override; + /** + * @brief Fill TileCalibData with Tile conditions data from file + * @param[out] calibData TileCalibData to fill with Tile conditions data + * @param[out] eventRange EventIDRange during wich Tile conditions data are valid + */ + virtual StatusCode fillCalibData(TileCalibData<T>& calibData, EventIDRange& eventRange) const override; const T* getCalibDrawer(unsigned int drawerIdx) const; private: - /** @brief Returns cache index used for online calibration constants. - @details Returns cache index used for the calibration constant applied in the DSP - @param drawerIdx Drawer index @param channel Tile channel @param adc Gain - */ - inline unsigned int cacheIndex(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const { - return m_drawerCacheSize * drawerIdx + m_maxChannels * adc + channel; - }; - - typedef std::map<unsigned int, std::vector<float> > DataMap; + typedef std::tuple<unsigned int, unsigned int, unsigned int> DataKey; + typedef std::map<DataKey, std::vector<float> > DataMap; /** Creates a calibDrawer of type T */ - const T* createCalibDrawer(unsigned int drawerIdx, unsigned int nChannels - , unsigned int objVers, const DataMap& dataMap); + std::unique_ptr<const T> createCalibDrawer(unsigned int drawerIdx, unsigned int nChannels + , unsigned int objVers, const DataMap& dataMap) const; /** Source = COOL folder */ std::string m_source; /** CalibDrawer vector to keep updated */ - std::vector<const T*> m_drawerVec; - - /** Keep track of coral::Blobs for later deletion */ - std::vector<coral::Blob*> m_blobStore; - - unsigned int m_maxChannels; - unsigned int m_maxGains; - unsigned int m_drawerCacheSize; + std::unique_ptr<TileCalibData<T>> m_calibData; }; -#endif +#endif // TILECONDITIONS_TILECONDPROXYFILE_H diff --git a/TileCalorimeter/TileConditions/TileConditions/TileCondToolAutoCr.h b/TileCalorimeter/TileConditions/TileConditions/TileCondToolAutoCr.h index dec996b2e19564669b310f21dfef40a207485418..ac518c83be1a09a4e248ce514770aec69c07db50 100644 --- a/TileCalorimeter/TileConditions/TileConditions/TileCondToolAutoCr.h +++ b/TileCalorimeter/TileConditions/TileConditions/TileCondToolAutoCr.h @@ -5,39 +5,36 @@ #ifndef TILECONDITIONS_TILECONDTOOLAUTOCR_H #define TILECONDITIONS_TILECONDTOOLAUTOCR_H -// Gaudi includes -#include "GaudiKernel/ToolHandle.h" +// Tile inlcudes +#include "TileConditions/TileCalibData.h" // Athena includes -#include "AthenaBaseComps/AthAlgTool.h"\ +#include "AthenaBaseComps/AthAlgTool.h" +#include "StoreGate/ReadCondHandleKey.h" -// Tile inlcudes -#include "TileIdentifier/TileRawChannelUnit.h" -#include "TileCalibBlobObjs/TileCalibDrawerFlt.h" -//#include "TileConditions/ITileCondToolAutoCr.h" -#include "TileConditions/ITileCondProxy.h" #include <vector> -class TileCondToolAutoCr: public AthAlgTool -//, public ITileCondToolAutoCr -{ +class TileCondToolAutoCr: public AthAlgTool { public: static const InterfaceID& interfaceID(); TileCondToolAutoCr(const std::string& type, const std::string& name, const IInterface* parent); virtual ~TileCondToolAutoCr(); - StatusCode initialize(); - StatusCode finalize(); + virtual StatusCode initialize() override; + virtual StatusCode finalize() override; void getAutoCorr(unsigned int drawerIdx, unsigned int channel, unsigned int adc, - std::vector<float>& vec) const; + std::vector<float>& vec) const; private: - //=== TileCondProxies - ToolHandle<ITileCondProxy<TileCalibDrawerFlt> > m_pryNoiseAutoCr; + //=== TileCalibData + SG::ReadCondHandleKey<TileCalibDataFlt> m_calibAutorCorrelationKey{this, + "TileAutoCorrelation", "TileAutoCorrelation", + "Input Tile auto correlation calibration constants"}; + }; #endif diff --git a/TileCalorimeter/TileConditions/TileConditions/TileCondToolDspThreshold.h b/TileCalorimeter/TileConditions/TileConditions/TileCondToolDspThreshold.h index c5eec5906ceffc1c00a8f1fdd2a00c005181d225..7ce88a5ab311829eb28ba1c904879ab7dee91c0d 100644 --- a/TileCalorimeter/TileConditions/TileConditions/TileCondToolDspThreshold.h +++ b/TileCalorimeter/TileConditions/TileConditions/TileCondToolDspThreshold.h @@ -7,22 +7,19 @@ // Tile includes #include "TileConditions/ITileCondToolDspThreshold.h" -#include "TileConditions/ITileCondProxy.h" +#include "TileConditions/TileCalibData.h" // Athena includes #include "AthenaBaseComps/AthAlgTool.h" +#include "StoreGate/ReadCondHandleKey.h" -// Gaudi includes -#include "GaudiKernel/ToolHandle.h" - -class TileCalibDrawerFlt; class TileCondToolDspThreshold: public AthAlgTool, virtual public ITileCondToolDspThreshold { public: static const InterfaceID& interfaceID() { - static const InterfaceID IID_TileCondToolDspThreshold("TileCondToolDspThreshold", 1, 0); + static const InterfaceID IID_TileCondToolDspThreshold("TileCondToolDspThreshold", 1, 0); return IID_TileCondToolDspThreshold; }; @@ -34,14 +31,16 @@ class TileCondToolDspThreshold: public AthAlgTool, virtual public ITileCondToolD virtual float getMinimumAmplitudeThreshold(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const override; virtual float getMaximumAmplitudeThreshold(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const override; - virtual void getAmplitudeThresholds(unsigned int drawerIdx, unsigned int channel, unsigned int adc, + virtual void getAmplitudeThresholds(unsigned int drawerIdx, unsigned int channel, unsigned int adc, float& minimumThreshold, float& maximumThreshold) const override; virtual float getDspThreshold(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const override; private: - //=== TileCondProxies - ToolHandle<ITileCondProxy<TileCalibDrawerFlt> > m_pryDspThreshold; + //=== TileCalibData + SG::ReadCondHandleKey<TileCalibDataFlt> m_calibDspThresholdKey{this, + "TileDSP_Threshold", "TileDSP_Threshold", "Input Tile DSP thresholds"}; + }; diff --git a/TileCalorimeter/TileConditions/TileConditions/TileCondToolEmscale.h b/TileCalorimeter/TileConditions/TileConditions/TileCondToolEmscale.h index f0a678f3954654342111038bae7a69b8fd9201a2..29a1b6053abe6c85ad111fa2a137e2bcc3905e16 100644 --- a/TileCalorimeter/TileConditions/TileConditions/TileCondToolEmscale.h +++ b/TileCalorimeter/TileConditions/TileConditions/TileCondToolEmscale.h @@ -5,93 +5,52 @@ #ifndef TILECONDITIONS_TILECONDTOOLEMSCALE_H #define TILECONDITIONS_TILECONDTOOLEMSCALE_H -/** - @brief Calibration of TileCal channels and access to calibration factors. - @author Nils Gollub <nils.gollub@cern.ch> - - @details In order to calibrate signals from TileCal to the - electromagnetic (EM) scale, a set of calibration constants need to - be applied. They are obtained by the independent CIS, Laser and - Cesium calibration system. The final calibration constant from pC - to the EM scale is determinded in dedicated electron and muon - testbeam analyses. This AlgTool provides access to the calibration - constants stored in the COOL database and functions to perform the - actual calibrations. - - The central function of this AlgTool is channelCalib(), which - enables the user to calibrate any TileCal channel from a given - input unit (usually ADC counts or the online unit stored in the - bytestream) to the desired output unit (usually MeV). In addition, - functions performing the individual calibration steps are - provided. They also give access to the calibration constants - stored in the COOL DB by using unit amplitude as input. - - A first "online" calibration is already applied during the signal - reconstruction in the ROD. The used calibration constants are - preserved in special database folders that do not allow to modify - calibration constants for runs already taken. This ensures that - the calibrations applied online in a given run can always be - undone later in order to apply updated calibration constants in a - reprocessing step. In addition, CIS and Laser calibrations might - contain non-linear parts which are only applied during the offline - calibration using this AlgTool. - - - @b Configuration - - TileCondToolConf.py provices a getter function for this - TileCondTool. TileCondToolEmscale needs the following input data - sources, connected through TileCondProxies: - - - \ref TileCondToolEmscale::m_pryOflCisLin "ProxyOflCisLin": Linear part of the the CIS calibration - - \ref TileCondToolEmscale::m_pryOflCisNln "ProxyOflCisNln": Non-linear part of the the CIS calibration - - \ref TileCondToolEmscale::m_pryOflLasLin "ProxyOflLasLin": Linear part of the the Laser calibration - - \ref TileCondToolEmscale::m_pryOflLasNln "ProxyOflLasNln": Non-linear part of the the Laser calibration - - \ref TileCondToolEmscale::m_pryOflCes "ProxyOflCes": Cesim calibration constants (inlcuding Laser, HV and temperature references) - - \ref TileCondToolEmscale::m_pryOflEms "ProxyOflEms": pC to MeV calibration constants - - The calibration constants applied in the ROD reconstruction have - to be supplied through the "online" TileCondProxies: - - - \ref TileCondToolEmscale::m_pryOnlCis "ProxyOnlCis": Linear part of CIS calibration applied in ROD - - \ref TileCondToolEmscale::m_pryOnlLas "ProxyOnlLas": Linear part of Laser calibration applied in ROD - - \ref TileCondToolEmscale::m_pryOnlCes "ProxyOnlCes": Cesium factor applied in ROD - - \ref TileCondToolEmscale::m_pryOnlEms "ProxyOnlEms": EM calibration factor applied in ROD - - - Since the calibration factor applied in the ROD is the product of - up to four numbers, associated to the four calibration steps - listed above, the total ROD calibration factor is cached. The unit - of the cache is configurable through the \ref - TileCondToolEmscale::m_onlCacheUnit "OnlCacheUnit" property and - should be set to the ROD output unit present in the bytestream - (otherwise the total factor will be recomputed event by event). - The \ref TileCondToolEmscale::m_onlCacheUnit "OnlCacheUnit" - property recognizes the following string arguments: - - - "OnlineADCcounts" - - "OnlinePicoCoulombs" - - "OnlineCesiumPicoCoulombs" - - "OnlineMegaElectronVolts" - - "Invalid" - - If the ROD calibration should not be undone (or is not available - as for simulated data), \ref TileCondToolEmscale::m_onlCacheUnit - "OnlCacheUnit" should be set to "Invalid" (which is the default). +/** + * @brief Calibration of TileCal channels and access to calibration factors. + * @author Nils Gollub <nils.gollub@cern.ch> + * + * @details In order to calibrate signals from TileCal to the + * electromagnetic (EM) scale, a set of calibration constants need to + * be applied. They are obtained by the independent CIS, Laser and + * Cesium calibration system. The final calibration constant from pC + * to the EM scale is determinded in dedicated electron and muon + * testbeam analyses. This AlgTool provides access to the calibration + * constants stored in the COOL database and functions to perform the + * actual calibrations. + * + * The central function of this AlgTool is channelCalib(), which + * enables the user to calibrate any TileCal channel from a given + * input unit (usually ADC counts or the online unit stored in the + * bytestream) to the desired output unit (usually MeV). In addition, + * functions performing the individual calibration steps are + * provided. They also give access to the calibration constants + * stored in the COOL DB by using unit amplitude as input. + * + * A first "online" calibration is already applied during the signal + * reconstruction in the ROD. The used calibration constants are + * preserved in special database folders that do not allow to modify + * calibration constants for runs already taken. This ensures that + * the calibrations applied online in a given run can always be + * undone later in order to apply updated calibration constants in a + * reprocessing step. In addition, CIS and Laser calibrations might + * contain non-linear parts which are only applied during the offline + * calibration using this AlgTool. + * + * + * @b Configuration + * + * TileCondToolConf.py provices a getter function for this TileCondTool. + * TileCondToolEmscale needs the TileCalibEms input data. */ -// Gaudi includes -#include "GaudiKernel/ToolHandle.h" +// Tile includes +#include "TileConditions/TileEMScale.h" +#include "TileIdentifier/TileRawChannelUnit.h" // Athena includes -#include "AthenaKernel/IOVSvcDefs.h" #include "AthenaBaseComps/AthAlgTool.h" +#include "StoreGate/ReadCondHandleKey.h" -// Tile includes -#include "TileIdentifier/TileRawChannelUnit.h" -#include "TileCalibBlobObjs/TileCalibDrawerFlt.h" -#include "TileConditions/TileCondIdTransforms.h" -#include "TileConditions/ITileCondProxy.h" #include <vector> #include <array> @@ -103,229 +62,204 @@ class TileCondToolEmscale: public AthAlgTool { TileCondToolEmscale(const std::string& type, const std::string& name, const IInterface* parent); virtual ~TileCondToolEmscale(); - StatusCode initialize(); - StatusCode finalize(); - - /** @brief Calibrates a Tile channel. - @details Transforms the input amplitude with unit rawDataUnitIn to output amplitude with unit rawDataUnitOut. - Note that "upstream" calibrations are not supported, i.e. calibration requests from eg. MeV to ADC counts - will result in an exception being thrown. - @returns The input amplitude after calibration - @param drawerIdx Drawer index - @param channel Tile channel - @param adc Gain - @param amplitude Input ampitude in units of rawDataUnitIn - @param rawDataUnitIn Input unit, see TileIdentifier/TileRawChannelUnit.h - @param rawDataUnitOut Output unit, see TileIdentifier/TileRawChannelUnit.h */ + virtual StatusCode initialize() override; + virtual StatusCode finalize() override; + + /** + * @brief Calibrates a Tile channel. + * @details Transforms the input amplitude with unit rawDataUnitIn to output amplitude with unit rawDataUnitOut. + * Note that "upstream" calibrations are not supported, i.e. calibration requests from eg. MeV to ADC counts + * will result in an exception being thrown. + * @returns The input amplitude after calibration + * @param drawerIdx Drawer index + * @param channel Tile channel + * @param adc Gain + * @param amplitude Input ampitude in units of rawDataUnitIn + * @param rawDataUnitIn Input unit, see TileIdentifier/TileRawChannelUnit.h + * @param rawDataUnitOut Output unit, see TileIdentifier/TileRawChannelUnit.h + */ float channelCalib(unsigned int drawerIdx, unsigned int channel, unsigned int adc, float amplitude , TileRawChannelUnit::UNIT rawDataUnitIn, TileRawChannelUnit::UNIT rawDataUnitOut) const; - /** @brief Calibration to EM scale: Equalized pC -> MeV. - @details Applies the pC to MeV calibration constant - @returns The input amplitude after calibration [MeV] - @param drawerIdx Drawer index - @param channel Tile channel - @param amplitude Input ampitude in pC */ + /** + * @brief Calibration to EM scale: Equalized pC -> MeV. + * @details Applies the pC to MeV calibration constant + * @returns The input amplitude after calibration [MeV] + * @param drawerIdx Drawer index + * @param channel Tile channel + * @param amplitude Input ampitude in pC + */ float doCalibEms(unsigned int drawerIdx, unsigned int channel, float amplitude) const; - /** @brief Application of cesium calibration constant. - @returns The input amplitude after calibration [pC] - @param drawerIdx Drawer index - @param channel Tile channel - @param amplitude Input ampitude in pC - @param applyLasCorr Apply the (not yet implemented) relative laser correction */ + /** + * @brief Application of cesium calibration constant. + * @returns The input amplitude after calibration [pC] + * @param drawerIdx Drawer index + * @param channel Tile channel + * @param amplitude Input ampitude in pC + * @param applyLasCorr Apply the (not yet implemented) relative laser correction + */ float doCalibCes(unsigned int drawerIdx, unsigned int channel, float amplitude, bool applyLasCorr = true) const; - /** @brief Application of laser (PMT linearity) correction. - @details Applies both the linear and non-linear part of the laser calibration - @returns The input amplitude after calibration [pC] - @param drawerIdx Drawer index - @param channel Tile channel - @param amplitude Input ampitude in pC */ + /** + * @brief Application of laser (PMT linearity) correction. + * @details Applies both the linear and non-linear part of the laser calibration + * @returns The input amplitude after calibration [pC] + * @param drawerIdx Drawer index + * @param channel Tile channel + * @param amplitude Input ampitude in pC + */ float doCalibLas(unsigned int drawerIdx, unsigned int channel, float amplitude) const; - /** @brief Application of CIS calibration: ADC counts -> pC. - @details Applies both the linear and non-linear part of the CIS calibration - @returns The input amplitude after calibration [pC] - @param drawerIdx Drawer index - @param channel Tile channel - @param adc Gain - @param amplitude Input ampitude in units of ADC counts */ + /** + * @brief Application of CIS calibration: ADC counts -> pC. + * @details Applies both the linear and non-linear part of the CIS calibration + * @returns The input amplitude after calibration [pC] + * @param drawerIdx Drawer index + * @param channel Tile channel + * @param adc Gain + * @param amplitude Input ampitude in units of ADC counts + */ float doCalibCis(unsigned int drawerIdx, unsigned int channel, unsigned int adc, float amplitude) const; - /** @brief Calibrates an online Tile channel from OnlineADCcounts to an arbitrary Online unit, no NLN corrections applied - @details Transforms the input amplitude with unit rawDataUnitIn to output amplitude with unit rawDataUnitOut. - Note that "upstream" calibrations are not supported, i.e. calibration requests from eg. MeV to ADC counts - will result in an exception being thrown. - @returns The total online calibration constant - @param drawerIdx Drawer index - @param channel Tile channel - @param adc Gain - @param onlUnitIn Input unit, see TileIdentifier/TileRawChannelUnit.h */ + /** + * @brief Calibrates an online Tile channel from OnlineADCcounts to an arbitrary Online unit, no NLN corrections applied + * @details Transforms the input amplitude with unit rawDataUnitIn to output amplitude with unit rawDataUnitOut. + * Note that "upstream" calibrations are not supported, i.e. calibration requests from eg. MeV to ADC counts + * will result in an exception being thrown. + * @returns The total online calibration constant + * @param drawerIdx Drawer index + * @param channel Tile channel + * @param adc Gain + * @param amplitude Input amplitude in OnlineADCcounts unit + * @param onlUnit Output online unit, see TileIdentifier/TileRawChannelUnit.h + */ float channelCalibOnl(unsigned int drawerIdx, unsigned int channel, unsigned int adc, float amplitude , TileRawChannelUnit::UNIT onlUnit) const; - /** @brief Online calibration to EM scale: Equalized pC -> MeV. - @details Applies the pC to MeV calibration constant - @returns The input amplitude after calibration [MeV] - @param drawerIdx Drawer index - @param channel Tile channel - @param amplitude Input ampitude in pC */ + /** + * @brief Online calibration to EM scale: Equalized pC -> MeV. + * @details Applies the pC to MeV calibration constant + * @returns The input amplitude after calibration [MeV] + * @param drawerIdx Drawer index + * @param channel Tile channel + * @param amplitude Input ampitude in pC + */ float doCalibEmsOnl(unsigned int drawerIdx, unsigned int channel, float amplitude) const; - /** @brief Online application of cesium calibration constant. - @returns The input amplitude after calibration [pC] - @param drawerIdx Drawer index - @param channel Tile channel - @param amplitude Input ampitude in pC - @param applyLasCorr Apply the (not yet implemented) relative laser correction */ + /** + * @brief Online application of cesium calibration constant. + * @returns The input amplitude after calibration [pC] + * @param drawerIdx Drawer index + * @param channel Tile channel + * @param amplitude Input ampitude in pC + * @param applyLasCorr Apply the (not yet implemented) relative laser correction + */ float doCalibCesOnl(unsigned int drawerIdx, unsigned int channel, float amplitude, bool applyLasCorr = true) const; - /** @brief Online application of laser (PMT linearity) correction. - @details Applies only the linear part of the laser calibration - @returns The input amplitude after calibration [pC] - @param drawerIdx Drawer index - @param channel Tile channel - @param amplitude Input ampitude in pC */ + /** + * @brief Online application of laser (PMT linearity) correction. + * @details Applies only the linear part of the laser calibration + * @returns The input amplitude after calibration [pC] + * @param drawerIdx Drawer index + * @param channel Tile channel + * @param amplitude Input ampitude in pC + */ float doCalibLasOnl(unsigned int drawerIdx, unsigned int channel, float amplitude) const; - /** @brief Online Application of CIS calibration: ADC counts -> pC. - @details Applies only the linear part of the CIS calibration - @returns The input amplitude after calibration [pC] - @param drawerIdx Drawer index - @param channel Tile channel - @param adc Gain - @param amplitude Input ampitude in units of ADC counts */ + /** + * @brief Online Application of CIS calibration: ADC counts -> pC. + * @details Applies only the linear part of the CIS calibration + * @returns The input amplitude after calibration [pC] + * @param drawerIdx Drawer index + * @param channel Tile channel + * @param adc Gain + * @param amplitude Input ampitude in units of ADC counts + */ float doCalibCisOnl(unsigned int drawerIdx, unsigned int channel, unsigned int adc, float amplitude) const; - /** @brief Undoes the calibration applied in ROD signal reconstruction - @details At the run configuration stage, calibration constants are loaded into TileCal RODs, enabling - the output of the signal reconstruction run online in DSPs to be sent in units of MeV. However, in this - first raw calibration only the linear part of corrections are applied. In order to apply the full - (and maybe in the meantime updated) calibration including all non-linear corrections, - the calibrations applied in the ROD need to be undone first. - @returns The signal as reconstructed in the DSP in units of ADC counts. - @param drawerIdx Drawer index - @param channel Tile channel - @param adc Gain - @param amplitude Input ampitude in online units onlUnit - @param onlUnit The output unit of the DSP, preserved in the bytestream */ + /** + * @brief Undoes the calibration applied in ROD signal reconstruction + * @details At the run configuration stage, calibration constants are loaded into TileCal RODs, enabling + * the output of the signal reconstruction run online in DSPs to be sent in units of MeV. However, in this + * first raw calibration only the linear part of corrections are applied. In order to apply the full + * (and maybe in the meantime updated) calibration including all non-linear corrections, + * the calibrations applied in the ROD need to be undone first. + * @returns The signal as reconstructed in the DSP in units of ADC counts. + * @param drawerIdx Drawer index + * @param channel Tile channel + * @param adc Gain + * @param amplitude Input ampitude in online units onlUnit + * @param onlUnit The output unit of the DSP, preserved in the bytestream + */ float undoOnlCalib(unsigned int drawerIdx, unsigned int channel, unsigned int adc, float amplitude , TileRawChannelUnit::UNIT onlUnit) const; - /** @brief Returns the PMT gain reference as measured by the laser system. - @details Continous PMT gain measurements with the laser system enable to correct for PMT - gain drifts between cesium calibration runs. Corrections are applied relative to the PMT - gain measured by the laser system directly after the last cesium equalization. - @returns The PMT gain reference at the last cesium scan. - @param drawerIdx Drawer index - @param channel Tile channel - @param adc Gain */ + /** + * @brief Returns the PMT gain reference as measured by the laser system. + * @details Continous PMT gain measurements with the laser system enable to correct for PMT + * gain drifts between cesium calibration runs. Corrections are applied relative to the PMT + * gain measured by the laser system directly after the last cesium equalization. + * @returns The PMT gain reference at the last cesium scan. + * @param drawerIdx Drawer index + * @param channel Tile channel + * @param adc Gain + */ float getCesRefLas(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const; - /** @brief Returns the reference PMT HV set in last cesium calibration. - @returns The PMT HV applied as result of last cesium calibration - @param drawerIdx Drawer index - @param channel Tile channel */ + /** + * @brief Returns the reference PMT HV set in last cesium calibration. + * @returns The PMT HV applied as result of last cesium calibration + * @param drawerIdx Drawer index + * @param channel Tile channel + */ float getCesRefHv(unsigned int drawerIdx, unsigned int channel) const; - /** @brief Returns the drawer temperature as measured during last cesium equalization. - @returns The drawer temperature during last cesium equalization - @param drawerIdx Drawer index - @param channel Tile channel */ + /** + * @brief Returns the drawer temperature as measured during last cesium equalization. + * @returns The drawer temperature during last cesium equalization + * @param drawerIdx Drawer index + * @param channel Tile channel + */ float getCesRefTemp(unsigned int drawerIdx, unsigned int channel) const; - /** @brief Returns laser fiber relative variation - @param drawerIdx Drawer index - @param channel Tile channel */ + /** + * @brief Returns laser fiber relative variation + * @param drawerIdx Drawer index + * @param channel Tile channel + */ float getLasFiber(unsigned int drawerIdx, unsigned int channel) const; - /** @brief Returns laser partition relative variation - @details The partition is defined by the drawerIdx which belongs to this partition. - The relative partition variation values are stored in m_pryOflLasFib proxy in the first - drawer of each partition at tile channel LAS_PART_CHAN (it is 43), which is empty both - in barrel and in extended barrel tile modules. Hence its value is not useful - for getLasFiber, which reads from the same proxy. - @param drawerIdx Drawer index */ + /** + * @brief Returns laser partition relative variation + * @details The partition is defined by the drawerIdx which belongs to this partition. + * The relative partition variation values are stored in m_pryOflLasFib proxy in the first + * drawer of each partition at tile channel LAS_PART_CHAN (it is 43), which is empty both + * in barrel and in extended barrel tile modules. Hence its value is not useful + * for getLasFiber, which reads from the same proxy. + * @param drawerIdx Drawer index + */ float getLasPartition(unsigned int drawerIdx) const; - /** @brief Returns the reference PMT HV from appropriate laser calibration. - @returns The PMT HV applied as result of laser calibration - @param drawerIdx Drawer index - @param channel Tile channel */ + /** + * @brief Returns the reference PMT HV from appropriate laser calibration. + * @returns The PMT HV applied as result of laser calibration + * @param drawerIdx Drawer index + * @param channel Tile channel + */ float getLasRefHv(unsigned int drawerIdx, unsigned int channel) const; - /** @brief Returns the unit of cached online calibration constants. */ - TileRawChannelUnit::UNIT getOnlCacheUnit() const { - return m_onlCacheUnit; - } + /** + * @brief Returns the unit of cached online calibration constants. + */ + TileRawChannelUnit::UNIT getOnlCacheUnit() const; protected: - /** @brief Recaches the total online calibration constant applied in ROD. - @details This callback is called if any of the "online" proxies callback function - has been called due to an updated COOL DB IOV. The cache is cleared and refilled with - the current valid values of the unit specified in the - \ref TileCondToolEmscale::m_onlCacheUnit "OnlCacheUnit" property. */ - StatusCode resetOnlCache( IOVSVC_CALLBACK_ARGS); - - /** @brief Returns the calibration constant applied in the DSP. - @param drawerIdx Drawer index - @param channel Tile channel - @param adc Gain - @param onlUnit The output unit of the DSP */ - float getOnlCalib(unsigned int drawerIdx, unsigned int channel, unsigned int adc - , TileRawChannelUnit::UNIT onlUnit) const; - - /** @brief Check if offline linear laser calibration will be used - @details This callback is called if offline linear laser of the proxies callback function - has been called due to an updated COOL DB IOV. - \ref TileCondToolEmscale::m_OflLasLinUsed property. */ - StatusCode checkIfOflLasLinCalibUsed( IOVSVC_CALLBACK_ARGS); - - /** @brief Check if offline nonlinear laser calibration will be used - @details This callback is called if offline nonlinear laser of the proxies callback function - has been called due to an updated COOL DB IOV. - \ref TileCondToolEmscale::m_OflLasNlnUsed property. */ - StatusCode checkIfOflLasNlnCalibUsed( IOVSVC_CALLBACK_ARGS); - - /** @brief Returns cache index used for online calibration constants. - @details Returns cache index used for the calibration constant applied in the DSP - @param drawerIdx Drawer index @param channel Tile channel @param adc Gain - */ - inline unsigned int cacheIndex(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const { - return m_drawerCacheSize * drawerIdx + m_maxChannels * adc + channel; - }; - - //=== cache of total online calibration factors - std::string m_onlCacheUnitStr; - TileRawChannelUnit::UNIT m_onlCacheUnit; - std::vector<float> m_onlCache; - - bool m_OflLasLinUsed; - bool m_OflLasNlnUsed; - - //=== TileCondProxies are needed by the TileExpertToolEmscale - //--- offline proxies - ToolHandle<ITileCondProxy<TileCalibDrawerFlt> > m_pryOflCisLin; - ToolHandle<ITileCondProxy<TileCalibDrawerFlt> > m_pryOflCisNln; - ToolHandle<ITileCondProxy<TileCalibDrawerFlt> > m_pryOflLasLin; - ToolHandle<ITileCondProxy<TileCalibDrawerFlt> > m_pryOflLasNln; - ToolHandle<ITileCondProxy<TileCalibDrawerFlt> > m_pryOflLasFib; - ToolHandle<ITileCondProxy<TileCalibDrawerFlt> > m_pryOflCes; - ToolHandle<ITileCondProxy<TileCalibDrawerFlt> > m_pryOflEms; - //--- online - ToolHandle<ITileCondProxy<TileCalibDrawerFlt> > m_pryOnlCis; - ToolHandle<ITileCondProxy<TileCalibDrawerFlt> > m_pryOnlLas; - ToolHandle<ITileCondProxy<TileCalibDrawerFlt> > m_pryOnlCes; - ToolHandle<ITileCondProxy<TileCalibDrawerFlt> > m_pryOnlEms; - - bool m_useOflLasFib; - - unsigned int m_maxChannels; - unsigned int m_maxGains; - unsigned int m_drawerCacheSize; - + SG::ReadCondHandleKey<TileEMScale> m_emScaleKey{this, + "TileEMScale", "TileEMScale", "Input Tile EMS calibration constants"}; + + }; #endif diff --git a/TileCalorimeter/TileConditions/TileConditions/TileCondToolIntegrator.h b/TileCalorimeter/TileConditions/TileConditions/TileCondToolIntegrator.h index 4ab980772f16ab3f6268d8e4cad46f1b12382538..f39024a9eee3f70ffc07996d0ec5c7846888ffb1 100644 --- a/TileCalorimeter/TileConditions/TileConditions/TileCondToolIntegrator.h +++ b/TileCalorimeter/TileConditions/TileConditions/TileCondToolIntegrator.h @@ -5,15 +5,13 @@ #ifndef TILECONDITIONS_TILECONDTOOLINTEGRATOR_H #define TILECONDITIONS_TILECONDTOOLINTEGRATOR_H -// Gaudi includes -#include "GaudiKernel/ToolHandle.h" +// Tile includes +#include "TileConditions/TileCalibData.h" // Athena includes #include "AthenaBaseComps/AthAlgTool.h" +#include "StoreGate/ReadCondHandleKey.h" -// Tile includes -#include "TileCalibBlobObjs/TileCalibDrawerFlt.h" -#include "TileConditions/ITileCondProxy.h" #include <vector> @@ -25,8 +23,8 @@ class TileCondToolIntegrator: public AthAlgTool { TileCondToolIntegrator(const std::string& type, const std::string& name, const IInterface* parent); virtual ~TileCondToolIntegrator(); - StatusCode initialize(); - StatusCode finalize(); + virtual StatusCode initialize() override; + virtual StatusCode finalize() override; float getGain( unsigned int drawerIdx, unsigned int channel, unsigned int adc) const; float getGainError( unsigned int drawerIdx, unsigned int channel, unsigned int adc) const; @@ -39,8 +37,10 @@ class TileCondToolIntegrator: public AthAlgTool { private: - //=== TileCondProxies - ToolHandle<ITileCondProxy<TileCalibDrawerFlt> > m_pryIntegrator; + //=== TileCalibData + SG::ReadCondHandleKey<TileCalibDataFlt> m_calibIntegratorKey{this, + "TileIntegrator", "TileIntegrator", "Input Tile integrator constants"}; + }; diff --git a/TileCalorimeter/TileConditions/TileConditions/TileCondToolMuID.h b/TileCalorimeter/TileConditions/TileConditions/TileCondToolMuID.h index eaf9c35f54eb134cbb602ad522daef4804508df5..2a97a5b51c38a12619a7bf37c4d885f8552e4f15 100644 --- a/TileCalorimeter/TileConditions/TileConditions/TileCondToolMuID.h +++ b/TileCalorimeter/TileConditions/TileConditions/TileCondToolMuID.h @@ -5,22 +5,18 @@ #ifndef TILECONDITIONS_TILECONDTOOLMUID_H #define TILECONDITIONS_TILECONDTOOLMUID_H -// Gaudi includes -#include "GaudiKernel/ToolHandle.h" +// Tile includes +#include "TileConditions/TileCalibData.h" // Athena includes +#include "Identifier/Identifier.h" #include "AthenaBaseComps/AthAlgTool.h" +#include "StoreGate/ReadCondHandleKey.h" -// Tile includes -#include "TileConditions/ITileCondProxy.h" -#include "Identifier/IdentifierHash.h" - -//#include "CaloIdentifier/TileID.h" #include <vector> // Forward declaration class CaloCell_ID; -class TileCalibDrawerFlt; class TileCondToolMuID: public AthAlgTool { public: @@ -29,21 +25,22 @@ class TileCondToolMuID: public AthAlgTool { TileCondToolMuID(const std::string& type, const std::string& name, const IInterface* parent); virtual ~TileCondToolMuID(); - StatusCode initialize(); - StatusCode finalize(); + virtual StatusCode initialize() override; + virtual StatusCode finalize() override; - void getLowThreshold(Identifier & id, int & ros, int & module, int & index); - void getHighThreshold(Identifier & id, int & ros, int & module, int & index); - float getLowThresholdValue(Identifier id); - float getHighThresholdValue(Identifier id); - // void getAllDrawerThresholdsValues(vector<double> &thresholds, int ros, int module); + void getLowThreshold(Identifier & id, int & ros, int & module, int & index) const; + void getHighThreshold(Identifier & id, int & ros, int & module, int & index) const; + float getLowThresholdValue(Identifier id) const; + float getHighThresholdValue(Identifier id) const; private: const CaloCell_ID* m_caloID; - //=== TileCondProxies - ToolHandle<ITileCondProxy<TileCalibDrawerFlt> > m_pryMuID; + //=== TileCalibData + SG::ReadCondHandleKey<TileCalibDataFlt> m_calibMuIdKey{this, + "TileMuID", "TileMuID", "Input Tile MuID constants"}; + }; diff --git a/TileCalorimeter/TileConditions/TileConditions/TileCondToolNoiseRawChn.h b/TileCalorimeter/TileConditions/TileConditions/TileCondToolNoiseRawChn.h index 3059ef5b690e478fb3b51956ad3a2da495cc0edd..39203f1da234045acdb5632f36d5bf9931650a6e 100644 --- a/TileCalorimeter/TileConditions/TileConditions/TileCondToolNoiseRawChn.h +++ b/TileCalorimeter/TileConditions/TileConditions/TileCondToolNoiseRawChn.h @@ -5,50 +5,48 @@ #ifndef TILECONDITIONS_TILECONDTOOLNOISERAWCHN_H #define TILECONDITIONS_TILECONDTOOLNOISERAWCHN_H -// Gaudi includes -#include "GaudiKernel/ToolHandle.h" +// Tile includes +#include "TileConditions/ITileCondToolNoise.h" +#include "TileConditions/TileCalibData.h" +#include "TileConditions/TileEMScale.h" +#include "TileIdentifier/TileRawChannelUnit.h" // Athena includes #include "AthenaBaseComps/AthAlgTool.h" +#include "StoreGate/ReadCondHandleKey.h" -// Tile includes -#include "TileIdentifier/TileRawChannelUnit.h" -#include "TileConditions/ITileCondToolNoise.h" -#include "TileConditions/ITileCondProxy.h" - -// Forward declaration -class TileCalibDrawerFlt; -class TileCondToolEmscale; class TileCondToolNoiseRawChn: public AthAlgTool , virtual public ITileCondToolNoise { public: static const InterfaceID& interfaceID(); - TileCondToolNoiseRawChn(const std::string& type, const std::string& name, - const IInterface* parent); + + TileCondToolNoiseRawChn(const std::string& type, const std::string& name, const IInterface* parent); + virtual ~TileCondToolNoiseRawChn(); - StatusCode initialize(); - StatusCode finalize(); + virtual StatusCode initialize() override; + virtual StatusCode finalize() override; float getElectronicNoise(unsigned int drawerIdx, unsigned int channel, unsigned int adc, - TileRawChannelUnit::UNIT unit = TileRawChannelUnit::ADCcounts) const; + TileRawChannelUnit::UNIT unit = TileRawChannelUnit::ADCcounts) const; float getPileUpNoise(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const; float getNoise(unsigned int drawerIdx, unsigned int channel, unsigned int adc, - TileRawChannelUnit::UNIT unit = TileRawChannelUnit::ADCcounts) const { + TileRawChannelUnit::UNIT unit = TileRawChannelUnit::ADCcounts) const { return getElectronicNoise(drawerIdx, channel, adc, unit); } private: - //=== used tools - ToolHandle<TileCondToolEmscale> m_tileToolEms; + SG::ReadCondHandleKey<TileCalibDataFlt> m_calibRawChannelNoiseKey{this, + "TileRawChannelNoise", "TileRawChannelNoise", "Input Tile raw channel noise constants"}; + + SG::ReadCondHandleKey<TileEMScale> m_emScaleKey{this, + "TileEMScale", "TileEMScale", "Input Tile EMS conditions"}; - //=== TileCondProxy - ToolHandle<ITileCondProxy<TileCalibDrawerFlt> > m_pryNoiseRawChn; }; #endif diff --git a/TileCalorimeter/TileConditions/TileConditions/TileCondToolNoiseSample.h b/TileCalorimeter/TileConditions/TileConditions/TileCondToolNoiseSample.h index 015e7e3baf9ddf6405f6a25bc861d3090677314c..b84211ee8b39f619cd44d31c787efd249f99d9e7 100644 --- a/TileCalorimeter/TileConditions/TileConditions/TileCondToolNoiseSample.h +++ b/TileCalorimeter/TileConditions/TileConditions/TileCondToolNoiseSample.h @@ -5,24 +5,19 @@ #ifndef TILECONDITIONS_TILECONDTOOLNOISESAMPLE_H #define TILECONDITIONS_TILECONDTOOLNOISESAMPLE_H -// Gaudi includes -#include "GaudiKernel/ToolHandle.h" +// Tile includes +#include "TileConditions/ITileCondToolNoise.h" +#include "TileConditions/TileCalibData.h" +#include "TileConditions/TileEMScale.h" +#include "TileIdentifier/TileRawChannelUnit.h" // Athena includes #include "AthenaBaseComps/AthAlgTool.h" - -// Tile includes -#include "TileIdentifier/TileRawChannelUnit.h" -#include "TileConditions/ITileCondToolNoise.h" -#include "TileConditions/ITileCondProxy.h" +#include "StoreGate/ReadCondHandleKey.h" #include <vector> -// Forward declaration -class TileCalibDrawerFlt; -class TileCondToolEmscale; - class TileCondToolNoiseSample: public AthAlgTool , virtual public ITileCondToolNoise { public: @@ -36,13 +31,13 @@ class TileCondToolNoiseSample: public AthAlgTool StatusCode finalize(); float getPed(unsigned int drawerIdx, unsigned int channel, unsigned int adc, - TileRawChannelUnit::UNIT unit = TileRawChannelUnit::ADCcounts) const; + TileRawChannelUnit::UNIT unit = TileRawChannelUnit::ADCcounts) const; float getHfn(unsigned int drawerIdx, unsigned int channel, unsigned int adc, - TileRawChannelUnit::UNIT unit = TileRawChannelUnit::ADCcounts) const; + TileRawChannelUnit::UNIT unit = TileRawChannelUnit::ADCcounts) const; float getLfn(unsigned int drawerIdx, unsigned int channel, unsigned int adc, - TileRawChannelUnit::UNIT unit = TileRawChannelUnit::ADCcounts) const; + TileRawChannelUnit::UNIT unit = TileRawChannelUnit::ADCcounts) const; float getHfn1(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const; @@ -50,10 +45,7 @@ class TileCondToolNoiseSample: public AthAlgTool float getHfnNorm(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const; - // void getAutoCorr(unsigned int drawerIdx, unsigned int channel, unsigned int adc, - // std::vector<float>& vec) const; - - float getOnlinePedestalDifference(unsigned int drawerIdx, unsigned int channel, unsigned int adc, + float getOnlinePedestalDifference(unsigned int drawerIdx, unsigned int channel, unsigned int adc, TileRawChannelUnit::UNIT onlineUnit = TileRawChannelUnit::OnlineADCcounts) const; @@ -64,13 +56,15 @@ class TileCondToolNoiseSample: public AthAlgTool private: - //=== used tools - ToolHandle<TileCondToolEmscale> m_tileToolEms; + SG::ReadCondHandleKey<TileCalibDataFlt> m_calibSampleNoiseKey{this, + "TileSampleNoise", "TileSampleNoise", "Input Tile sample noise constants"}; + + SG::ReadCondHandleKey<TileCalibDataFlt> m_calibOnlineSampleNoiseKey{this, + "TileOnlineSampleNoise", "TileOnlineSampleNoise", "Input Tile online noise sample constants"}; + + SG::ReadCondHandleKey<TileEMScale> m_emScaleKey{this, + "TileEMScale", "TileEMScale", "Input Tile EMS conditions"}; - //=== TileCondProxies - ToolHandle<ITileCondProxy<TileCalibDrawerFlt> > m_pryNoiseSample; - ToolHandle<ITileCondProxy<TileCalibDrawerFlt> > m_pryOnlineNoiseSample; - // ToolHandle<ITileCondProxy<TileCalibDrawerFlt> > m_pryNoiseAutoCr; bool m_useOnlineNoise; }; diff --git a/TileCalorimeter/TileConditions/TileConditions/TileCondToolOfcCool.h b/TileCalorimeter/TileConditions/TileConditions/TileCondToolOfcCool.h index cb7c97fa92beb9e7bdf2a359230409550179f728..3924ec734212ee12b37cf702a4131f41f7927d60 100644 --- a/TileCalorimeter/TileConditions/TileConditions/TileCondToolOfcCool.h +++ b/TileCalorimeter/TileConditions/TileConditions/TileCondToolOfcCool.h @@ -5,18 +5,15 @@ #ifndef TILECONDITIONS_TILECONDTOOLOFCCOOL_H #define TILECONDITIONS_TILECONDTOOLOFCCOOL_H -// Gaudi includes -#include "GaudiKernel/ToolHandle.h" +// Tile includes +#include "TileConditions/TileCalibData.h" +#include "TileConditions/ITileCondToolOfc.h" // Athena includes #include "AthenaBaseComps/AthAlgTool.h" -#include "AthenaKernel/IOVSvcDefs.h" +#include "StoreGate/ReadCondHandleKey.h" + -// Tile includes -#include "TileCalibBlobObjs/TileCalibDrawerOfc.h" -#include "TileCalibBlobObjs/TileCalibUtils.h" -#include "TileConditions/ITileCondProxy.h" -#include "TileConditions/ITileCondToolOfc.h" #include <vector> @@ -40,8 +37,8 @@ class TileCondToolOfcCool: public AthAlgTool, public ITileCondToolOfc { const TileOfcWeightsStruct* getOfcWeights(unsigned int drawerIdx, unsigned int channel , unsigned int adc, float& phase, bool of2); - int getOfcWeights(unsigned int drawerIdx, unsigned int channel, unsigned int adc, float& phase - , float *a, float *b, float *c, float *g, float *dg); + int getOfcWeights(unsigned int drawerIdx, unsigned int channel, unsigned int adc, float& phase, + float *a, float *b, float *c, float *g, float *dg); void getOfcParams(unsigned int drawerIdx, int &NPhases, int &NFields, int &Phamin, int &Phamax, int &NSamples); @@ -49,10 +46,9 @@ class TileCondToolOfcCool: public AthAlgTool, public ITileCondToolOfc { private: - StatusCode recache( IOVSVC_CALLBACK_ARGS); + SG::ReadCondHandleKey<TileCalibData<TileCalibDrawerOfc>> m_calibOfcKey{this, + "TileOfc", "TileOfc", "Input Tile OFC constants"}; - //=== TileCondProxies - ToolHandle<ITileCondProxy<TileCalibDrawerOfc> > m_pryOfcCool; TileOfcWeightsStruct* m_weights; diff --git a/TileCalorimeter/TileConditions/TileConditions/TileCondToolPulseShape.h b/TileCalorimeter/TileConditions/TileConditions/TileCondToolPulseShape.h index eb43666240ea01175b03c22f3afaee34d56c3925..fa1558f9d5fcee1aed51dac1330f230d3e4cbb3f 100644 --- a/TileCalorimeter/TileConditions/TileConditions/TileCondToolPulseShape.h +++ b/TileCalorimeter/TileConditions/TileConditions/TileCondToolPulseShape.h @@ -5,17 +5,13 @@ #ifndef TILECONDITIONS_TILECONDTOOLPULSESHAPE_H #define TILECONDITIONS_TILECONDTOOLPULSESHAPE_H -// Gaudi includes -#include "GaudiKernel/ToolHandle.h" +// Tile includes +#include "TileConditions/TileCalibData.h" // Athena includes #include "AthenaBaseComps/AthAlgTool.h" -#include "AthenaKernel/IOVSvcDefs.h" +#include "StoreGate/ReadCondHandleKey.h" -// Tile includes -#include "TileCalibBlobObjs/TileCalibDrawerFlt.h" -#include "TileCalibBlobObjs/TileCalibUtils.h" -#include "TileConditions/ITileCondProxy.h" #include <vector> @@ -26,18 +22,18 @@ class TileCondToolPulseShape: public AthAlgTool { TileCondToolPulseShape(const std::string& type, const std::string& name, const IInterface* parent); virtual ~TileCondToolPulseShape(); - StatusCode initialize(); - StatusCode finalize(); + virtual StatusCode initialize() override; + virtual StatusCode finalize() override; bool getPulseShapeYDY(unsigned int drawerIdx, unsigned int channel, unsigned int adc , float time, float &y, float &dy) const; private: - StatusCode recache( IOVSVC_CALLBACK_ARGS); + //=== TileCalibData + SG::ReadCondHandleKey<TileCalibDataFlt> m_calibPulseShapeKey{this, + "TilePulseShape", "TilePulseShape", "Input Tile pulse shape"}; - //=== TileCondProxies - ToolHandle<ITileCondProxy<TileCalibDrawerFlt> > m_pryPulseShape; }; #endif diff --git a/TileCalorimeter/TileConditions/TileConditions/TileCondToolTMDB.h b/TileCalorimeter/TileConditions/TileConditions/TileCondToolTMDB.h index af6c22996e93a34b573892b740844d693e51b63f..1d63fe808306c690fb72da5a58f19b068bd9d946 100644 --- a/TileCalorimeter/TileConditions/TileConditions/TileCondToolTMDB.h +++ b/TileCalorimeter/TileConditions/TileConditions/TileCondToolTMDB.h @@ -7,22 +7,18 @@ // Tile includes #include "TileConditions/ITileCondToolTMDB.h" -#include "TileConditions/ITileCondProxy.h" +#include "TileConditions/TileCalibData.h" // Athena includes #include "AthenaBaseComps/AthAlgTool.h" - -// Gaudi includes -#include "GaudiKernel/ToolHandle.h" - -class TileCalibDrawerFlt; +#include "StoreGate/ReadCondHandleKey.h" class TileCondToolTMDB: public AthAlgTool, virtual public ITileCondToolTMDB { public: static const InterfaceID& interfaceID() { - static const InterfaceID IID_TileCondToolTMDB("TileCondToolTMDB", 1, 0); + static const InterfaceID IID_TileCondToolTMDB("TileCondToolTMDB", 1, 0); return IID_TileCondToolTMDB; }; @@ -37,17 +33,25 @@ class TileCondToolTMDB: public AthAlgTool, virtual public ITileCondToolTMDB { virtual void getCalib(unsigned int drawerIdx, TMDB::CHANNEL channel, float& a, float& b) const override; virtual unsigned int getWeights(unsigned int drawerIdx, TMDB::CHANNEL channel, TMDB::Weights& weights) const override; - + virtual float channelCalib(unsigned int drawerIdx, TMDB::CHANNEL channel, const std::vector<float>& samples) const override; virtual float channelCalib(unsigned int drawerIdx, TMDB::CHANNEL channel, float amplitude) const override; private: - //=== TileCondProxies - ToolHandle<ITileCondProxy<TileCalibDrawerFlt> > m_pryThreshold; - ToolHandle<ITileCondProxy<TileCalibDrawerFlt> > m_pryDelay; - ToolHandle<ITileCondProxy<TileCalibDrawerFlt> > m_pryTMF; - ToolHandle<ITileCondProxy<TileCalibDrawerFlt> > m_pryCalib; + SG::ReadCondHandleKey<TileCalibDataFlt> m_calibThresholdKey{this, + "TileTMDBThreshold", "TileTMDBThreshold", "Input Tile TMDB threshold calibration constants"}; + + SG::ReadCondHandleKey<TileCalibDataFlt> m_calibDelayKey{this, + "TileTMDBDelay", "TileTMDBDelay", "Input Tile TMDB delay calibration constants"}; + + SG::ReadCondHandleKey<TileCalibDataFlt> m_calibTmfKey{this, + "TileTMDBTMF", "TileTMDBTMF", "Input Tile TMDB TMF calibration constants"}; + + SG::ReadCondHandleKey<TileCalibDataFlt> m_calibDataKey{this, + "TileTMDBCalib", "TileTMDBCalib", "Input Tile TMDB calibration constants"}; + + }; diff --git a/TileCalorimeter/TileConditions/TileConditions/TileCondToolTiming.h b/TileCalorimeter/TileConditions/TileConditions/TileCondToolTiming.h index 7a8ced71bdca2ef3f5e0abcec6b3730498a9583c..7f8c4f797c411b351775f76454be160f4405e1ab 100644 --- a/TileCalorimeter/TileConditions/TileConditions/TileCondToolTiming.h +++ b/TileCalorimeter/TileConditions/TileConditions/TileCondToolTiming.h @@ -5,17 +5,13 @@ #ifndef TILECONDITIONS_TILECONDTOOLTIMING_H #define TILECONDITIONS_TILECONDTOOLTIMING_H -// Gaudi includes -#include "GaudiKernel/ToolHandle.h" +// Tile includes +#include "TileConditions/TileCalibData.h" // Athena includes #include "AthenaBaseComps/AthAlgTool.h" -#include "AthenaKernel/IOVSvcDefs.h" +#include "StoreGate/ReadCondHandleKey.h" -// Tile includes -#include "TileCalibBlobObjs/TileCalibDrawerFlt.h" -#include "TileCalibBlobObjs/TileCalibUtils.h" -#include "TileConditions/ITileCondProxy.h" #include <vector> @@ -25,25 +21,26 @@ class TileCondToolTiming : public AthAlgTool { static const InterfaceID& interfaceID(); TileCondToolTiming(const std::string& type, const std::string& name, const IInterface* parent); virtual ~TileCondToolTiming(); - - StatusCode initialize(); - StatusCode finalize(); + + virtual StatusCode initialize() override; + virtual StatusCode finalize() override; float getSignalPhase(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const; float getChannelOffset(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const; - + private: - //=== TileCondProxies - ToolHandle<ITileCondProxy<TileCalibDrawerFlt> > m_pryAdcOffset; + SG::ReadCondHandleKey<TileCalibDataFlt> m_calibTimingKey{this, + "TileTiming", "TileTiming", "Input Tile timing calibration constants"}; + }; // //____________________________________________________________________ -inline float TileCondToolTiming::getSignalPhase(unsigned int drawerIdx, - unsigned int channel, +inline float TileCondToolTiming::getSignalPhase(unsigned int drawerIdx, + unsigned int channel, unsigned int adc) const { return getChannelOffset(drawerIdx, channel, adc); } diff --git a/TileCalorimeter/TileConditions/TileConditions/TileDCSState.h b/TileCalorimeter/TileConditions/TileConditions/TileDCSState.h new file mode 100644 index 0000000000000000000000000000000000000000..504cb27abda11ef6dc6258329f97c202e534d98d --- /dev/null +++ b/TileCalorimeter/TileConditions/TileConditions/TileDCSState.h @@ -0,0 +1,368 @@ +//Dear emacs, this is -*- c++ -*- + +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef TILECONDITIONS_TILEDCSSTATE_H +#define TILECONDITIONS_TILEDCSSTATE_H + +#include "TileConditions/Exception.h" + +#include <vector> +#include <string> + +/** + * @class TileDCSState + * @brief Condition object to keep Tile DCS status from DB + * + * See <a href="https://twiki.cern.ch/twiki/bin/view/Atlas/TileCalorimeterDCS"> + * Tile Calorimeter DCS on the twiki + * </a> + */ + +class TileDCSState { + + public: + + /** + * @enum TileDCSStatus + * @brief Describes Tile DCS status + */ + enum TileDCSStatus {NON_EXISTING = 0, UNKNOWN = 1, + OK_DRAWER = 10, OK_KNOWNBADPMT, OK, + WARNING_DRAWER = 20, WARNING_KNOWNBADPMT, WARNING, + ALERT_DRAWER = 30, ALERT_KNOWNBADPMT, ALERT}; + + TileDCSState(); + virtual ~TileDCSState() {}; + + /** + * @brief Return measured HV reported by DCS for given Tile channel + * @param ros Tile ROS number: 1 == LBA, 2 == LBC, 3 == EBA, 4 == EBC + * @param drawer Tile drawer number in range [0..63] + * @param channel Tile channel number in range [0..47] + * @return measured HV reported by DCS for given Tile channel + */ + float getChannelHV(unsigned int ros, unsigned int drawer, unsigned int channel) const; + + /** + * @brief Store measured HV reported by DCS for given Tile channel + * @param ros Tile ROS number: 1 == LBA, 2 == LBC, 3 == EBA, 4 == EBC + * @param drawer Tile drawer number in range [0..63] + * @param channel Tile channel number in range [0..47] + * @param hv measured HV reported by DCS for given Tile channel + */ + void setChannelHV(unsigned int ros, unsigned int drawer, unsigned int channel, float hv); + + /** + * @brief Return requested HV reported by DCS for given Tile channel + * @param ros Tile ROS number: 1 == LBA, 2 == LBC, 3 == EBA, 4 == EBC + * @param drawer Tile drawer number in range [0..63] + * @param channel Tile channel number in range [0..47] + * @return requested HV reported by DCS for given Tile channel + */ + float getChannelHVSet(unsigned int ros, unsigned int drawer, unsigned int channel) const; + + /** + * @brief Store requested HV reported by DCS for given Tile channel + * @param ros Tile ROS number: 1 == LBA, 2 == LBC, 3 == EBA, 4 == EBC + * @param drawer Tile drawer number in range [0..63] + * @param channel Tile channel number in range [0..47] + * @param hvSet requested HV reported by DCS for given Tile channel + */ + void setChannelHVSet(unsigned int ros, unsigned int drawer, unsigned int channel, float hvSet); + + /** + * @brief Return Tile drawer summary states per LVPS reported by DCS + * @param ros Tile ROS number: 1 == LBA, 2 == LBC, 3 == EBA, 4 == EBC + * @param drawer Tile drawer number in range [0..63] + * @return Tile drawer states reported by DCS + */ + int getDrawerStates(unsigned int ros, unsigned int drawer) const; + + /** + * @brief Store Tile drawer summary states per LVPS reported by DCS + * @param ros Tile ROS number: 1 == LBA, 2 == LBC, 3 == EBA, 4 == EBC + * @param drawer Tile drawer number in range [0..63] + * @param states Tile drawer states reported by DCS + */ + void setDrawerStates(unsigned int ros, unsigned int drawer, int states); + + /** + * @brief Return TileDCSstatus for given Tile channel + * determined by deviation between measured and requested HV + * @param ros Tile ROS number: 1 == LBA, 2 == LBC, 3 == EBA, 4 == EBC + * @param drawer Tile drawer number in range [0..63] + * @param channel Tile channel number in range [0..47] + * @return TileDCSstatus for given Tile channel + * determined by deviation between measured and requested HV + */ + TileDCSStatus getDCSHVStatus(unsigned int ros, unsigned int drawer, unsigned int channel) const; + + /** + * @brief Store TileDCSstatus for given Tile channel + * determined by deviation between measured and requested HV + * @param ros Tile ROS number: 1 == LBA, 2 == LBC, 3 == EBA, 4 == EBC + * @param drawer Tile drawer number in range [0..63] + * @param channel Tile channel number in range [0..47] + * @param status TileDCSstatus for given Tile channel + * determined by deviation between measured and requested HV + */ + void setDCSHVStatus(unsigned int ros, unsigned int drawer, unsigned int channel, TileDCSStatus status); + + /** + * @brief Return TileDCSstatus for given Tile drawer + * determined by summary states per LVPS + * @param ros Tile ROS number: 1 == LBA, 2 == LBC, 3 == EBA, 4 == EBC + * @param drawer Tile drawer number in range [0..63] + * @return TileDCSstatus for given Tile drawer + */ + TileDCSStatus getDCSStatus(unsigned int ros, unsigned int drawer) const; + + /** + * @brief Return TileDCSstatus for given Tile channel + * determined by summary states per LVPS + * and deviation between measured and requested HV + * @param ros Tile ROS number: 1 == LBA, 2 == LBC, 3 == EBA, 4 == EBC + * @param drawer Tile drawer number in range [0..63] + * @param channel Tile channel number in range [0..47] + * @return TileDCSstatus for given Tile channel + */ + TileDCSStatus getDCSStatus(unsigned int ros, unsigned int drawer, unsigned int channel) const; + + /** + * @brief Store TileDCSstatus for given Tile channel + * determined by summary states per LVPS + * and deviation between measured and requested HV + * @param ros Tile ROS number: 1 == LBA, 2 == LBC, 3 == EBA, 4 == EBC + * @param drawer Tile drawer number in range [0..63] + * @param channel Tile channel number in range [0..47] + * @param status TileDCSstatus for given Tile channel + */ + TileDCSStatus setDCSStatus(unsigned int ros, unsigned int drawer, unsigned int channel, TileDCSStatus status); + + /** + * @brief Return @c true if given Tile channel considered as bad + * by deviation between measured and requested HV + * otherwise return false + * @param ros Tile ROS number: 1 == LBA, 2 == LBC, 3 == EBA, 4 == EBC + * @param drawer Tile drawer number in range [0..63] + * @param channel Tile channel number in range [0..47] + * @return @c TileDCSstatus for given channel + */ + bool isStatusHVBad(unsigned int ros, unsigned int drawer, unsigned int channel) const; + + /** + * @brief Return @c true if given Tile drawer considered as bad + * by summary drawer states per LVPS + * otherwise return false + * @param ros Tile ROS number: 1 == LBA, 2 == LBC, 3 == EBA, 4 == EBC + * @param drawer Tile drawer number in range [0..63] + * @return @c TileDCSstatus for given channel + */ + + bool isStatusBad (unsigned int ros, unsigned int drawer) const; + + /** + * @brief Return @c true if given Tile channel considered as bad + * by summary drawer states per LVPS + * and deviation between measured and requested HV + * otherwise return false + * @param ros Tile ROS number: 1 == LBA, 2 == LBC, 3 == EBA, 4 == EBC + * @param drawer Tile drawer number in range [0..63] + * @param channel Tile channel number in range [0..47] + * @return @c TileDCSstatus for given channel + */ + bool isStatusBad(unsigned int ros, unsigned int drawer, unsigned int channel) const; + + /** + * @brief Store good Tile drawer summary states per LVPS as reference + * @param goodDrawer Tile drawer states considered as good + */ + void setGoodDrawer(int goodDrawer); + + /** + * @brief Store vector of warning Tile drawer summary states per LVPS as reference + * @param warningDrawer vector of Tile drawer states considered as warning + */ + void setWarningDrawer(const std::vector<int>& warningDrawer); + + private: + + enum TileLimits { + NUMBER_OF_ROSES = 4, //!< Number of Tile ROSes + NUMBER_OF_CHANNELS = 48, //!< Number of Tile channels + NUMBER_OF_HV_CHANNELS = 55, //!< Number of Tile "channels" in DCS HV folder + NUMBER_OF_HVSET_CHANNELS = 68, //!< Number of Tile "channels" in DCS HVSET folder + NUMBER_OF_DRAWERS = 64 //!< Number of Tile drawers in one ROS + }; + + void checkDrawer(std::string description, unsigned int ros, unsigned int drawer) const; + void checkChannel(std::string description, unsigned int ros, unsigned int drawer, + unsigned int channel, unsigned int maxChannel) const; + + int m_states[NUMBER_OF_ROSES][NUMBER_OF_DRAWERS]; + float m_hv[NUMBER_OF_ROSES][NUMBER_OF_DRAWERS][NUMBER_OF_HV_CHANNELS]; + float m_hvSet[NUMBER_OF_ROSES][NUMBER_OF_DRAWERS][NUMBER_OF_HVSET_CHANNELS]; + TileDCSStatus m_status[NUMBER_OF_ROSES][NUMBER_OF_DRAWERS][NUMBER_OF_CHANNELS]; + TileDCSStatus m_hvStatus[NUMBER_OF_ROSES][NUMBER_OF_DRAWERS][NUMBER_OF_CHANNELS]; + + int m_goodDrawer; + std::vector<int> m_warningDrawer; + int m_unknownValue; + +}; + + +#include "AthenaKernel/CLASS_DEF.h" +#include "AthenaKernel/CondCont.h" + +CLASS_DEF(TileDCSState, 125804125, 0) +CONDCONT_DEF(TileDCSState, 38603143); + +// inlines + +inline +float TileDCSState::getChannelHV(unsigned int ros, unsigned int drawer, unsigned int channel) const { + + checkChannel("TileDCSState::getChannelHV()", ros, drawer, channel, NUMBER_OF_HV_CHANNELS); + + return m_hv[ros - 1][drawer][channel]; +} + +inline +void TileDCSState::setChannelHV(unsigned int ros, unsigned int drawer, unsigned int channel, float hv) { + + checkChannel("TileDCSState::setChannelHV()", ros, drawer, channel, NUMBER_OF_HV_CHANNELS); + + m_hv[ros - 1][drawer][channel] = hv; +} + +inline +float TileDCSState::getChannelHVSet(unsigned int ros, unsigned int drawer, unsigned int channel) const { + + checkChannel("TileDCSState::getChannelHVSet()", ros, drawer, channel, NUMBER_OF_HVSET_CHANNELS); + + return m_hvSet[ros - 1][drawer][channel]; // Return the HVSET +} + +inline +void TileDCSState::setChannelHVSet(unsigned int ros, unsigned int drawer, unsigned int channel, float hvSet) { + + checkChannel("TileDCSState::setChannelHVSet()", ros, drawer, channel, NUMBER_OF_HVSET_CHANNELS); + + m_hvSet[ros - 1][drawer][channel] = hvSet; // Set the HVSET +} + +inline +int TileDCSState::getDrawerStates(unsigned int ros, unsigned int drawer) const { + + checkDrawer("TileDCSState::getDrawerStates()", ros, drawer); + + return m_states[ros - 1][drawer]; +} + +inline +void TileDCSState::setDrawerStates(unsigned int ros, unsigned int drawer, int states) { + + checkDrawer("TileDCSState::setDrawerStates()", ros, drawer); + + m_states[ros - 1][drawer] = states; // Set the drawer state +} + +inline +TileDCSState::TileDCSStatus TileDCSState::getDCSHVStatus(unsigned int ros, + unsigned int drawer, + unsigned int channel) const { + + checkChannel("TileDCSState::getDCSHVStatus()", ros, drawer, channel, NUMBER_OF_CHANNELS); + + return m_hvStatus[ros - 1][drawer][channel]; +} + +inline +void TileDCSState::setDCSHVStatus(unsigned int ros, unsigned int drawer, unsigned int channel, + TileDCSState::TileDCSStatus status) { + + checkChannel("TileDCSState::setDCSHVStatus()", ros, drawer, channel, NUMBER_OF_CHANNELS); + + m_hvStatus[ros - 1][drawer][channel] = status; +} + +inline +TileDCSState::TileDCSStatus TileDCSState::getDCSStatus(unsigned int ros, + unsigned int drawer, + unsigned int channel) const { + + checkChannel("TileDCSState::getDCSStatus()", ros, drawer, channel, NUMBER_OF_CHANNELS); + + return m_status[ros - 1][drawer][channel]; // final status - the worst of 2 statuses above +} + +inline +TileDCSState::TileDCSStatus TileDCSState::setDCSStatus(unsigned int ros, + unsigned int drawer, + unsigned int channel, + TileDCSState::TileDCSStatus status) { + + checkChannel("TileDCSState::setDCSStatus()", ros, drawer, channel, NUMBER_OF_CHANNELS); + + return m_status[ros - 1][drawer][channel] = status; // final status - the worst of 2 statuses above +} + +inline +bool TileDCSState::isStatusHVBad(unsigned int ros, unsigned int drawer, unsigned int channel) const { + return getDCSHVStatus(ros, drawer, channel) > WARNING; +} + +inline +bool TileDCSState::isStatusBad (unsigned int ros, unsigned int drawer) const { + return getDCSStatus(ros, drawer) > WARNING; +} + +inline +bool TileDCSState::isStatusBad(unsigned int ros, unsigned int drawer, unsigned int channel) const { + + checkChannel("TileDCSState::isStatusBad()", ros, drawer, channel, NUMBER_OF_CHANNELS); + + return m_status[ros - 1][drawer][channel] > WARNING; +} + +inline +void TileDCSState::setGoodDrawer(int goodDrawer) { m_goodDrawer = goodDrawer;} + +inline +void TileDCSState::setWarningDrawer(const std::vector<int>& warningDrawer) { + m_warningDrawer = warningDrawer; +} + +inline +void TileDCSState::checkDrawer(std::string description, + unsigned int ros, unsigned int drawer) const { + + if (ros > NUMBER_OF_ROSES) { + throw TileCalib::IndexOutOfRange(description, ros, NUMBER_OF_ROSES); + } + + if (drawer >= NUMBER_OF_DRAWERS) { + throw TileCalib::IndexOutOfRange(description, drawer, NUMBER_OF_DRAWERS); + } + +} + + +inline +void TileDCSState::checkChannel(std::string description, + unsigned int ros, unsigned int drawer, + unsigned int channel, unsigned int maxChannel) const { + + checkDrawer(description, ros, drawer); + + if (channel >= maxChannel) { + throw TileCalib::IndexOutOfRange(description, channel, maxChannel); + } + +} + +#endif // TILECONDITIONS_TILEDCSSTATE_H diff --git a/TileCalorimeter/TileConditions/TileConditions/TileDCSSvc.h b/TileCalorimeter/TileConditions/TileConditions/TileDCSSvc.h index 516d5c2980ab8434f29bc15ee54ce9e2900ab80d..e1376a8d04e15a0bfd56f4948bae3d78b001f386 100644 --- a/TileCalorimeter/TileConditions/TileConditions/TileDCSSvc.h +++ b/TileCalorimeter/TileConditions/TileConditions/TileDCSSvc.h @@ -5,46 +5,22 @@ #ifndef TILECONDITIONS_TILECONDDCS_H #define TILECONDITIONS_TILECONDDCS_H -// Gaudi includes -#include "GaudiKernel/ToolHandle.h" -#include "GaudiKernel/ServiceHandle.h" -#include "GaudiKernel/DataHistory.h" +// Tile includes +#include "TileConditions/ITileDCSTool.h" +#include "TileConditions/TileCablingSvc.h" // Athena includes #include "AthenaBaseComps/AthService.h" -#include "AthenaPoolUtilities/AthenaAttributeList.h" -#include "AthenaPoolUtilities/CondAttrListCollection.h" -#include "AthenaKernel/IOVSvcDefs.h" -#include "AthenaKernel/IIOVDbSvc.h" -// Tile includes -#include "TileConditions/TileCablingSvc.h" -#include "TileConditions/TileCondToolEmscale.h" - -#include <utility> -#include <vector> -#include <string> -#include <list> -#include <map> +// Gaudi includes +#include "GaudiKernel/ToolHandle.h" // Forward declaration -class StoreGateSvc; -class IIOVSvc; -class ISvcLocator; -class StatusCode; -class IAthenaOutputStreamTool; -class TileCondDCS_Data; class TileCablingService; template <class TYPE> class SvcFactory; -//conversion from ROS and drawer number to index (used in array) -#define RosDrawer(ros,drawer) (((ros-1)<<6) | drawer) - -//conversion from RosDrawer and pmt-1 to index (used in map) -#define PmtIndex(RosDrawer,pmt0) ((RosDrawer<<8) | pmt0) - //Class to provide DCS information about modules from the COOL database class TileDCSSvc: virtual public AthService { @@ -53,94 +29,45 @@ class TileDCSSvc: virtual public AthService { public: static const InterfaceID& interfaceID(); /*as in TileCablingSvc.h*/ TileDCSSvc( const std::string& name, ISvcLocator* pSvcLocator ); - virtual ~TileDCSSvc(){ /*do nothing*/} + virtual ~TileDCSSvc(){ /*do nothing*/} virtual StatusCode initialize(); virtual StatusCode finalize(); StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface); - virtual StatusCode fillData(int& i, std::list<std::string>& keys ); - //Manually get the data in the structure before proceding - virtual StatusCode fillData(){return StatusCode::FAILURE;} - - enum TileDCSStatus {NON_EXISTING=0, UNKNOWN=1, - OK_DRAWER=10, OK_KNOWNBADPMT, OK, - WARNING_DRAWER=20, WARNING_KNOWNBADPMT, WARNING, + enum TileDCSStatus {NON_EXISTING=0, UNKNOWN=1, + OK_DRAWER=10, OK_KNOWNBADPMT, OK, + WARNING_DRAWER=20, WARNING_KNOWNBADPMT, WARNING, ALERT_DRAWER=30, ALERT_KNOWNBADPMT, ALERT}; // these 3 methods return values found in COOL // and they use ros=1,2,3,4, module and pmt as parameter, all three starts from "1", like in DCS - float getDCSHV (int ros, int module, int pmt) const { - return m_HV[RosDrawer(ros,(module-1))][pmt-1]; } //return the HV - float getDCSHVSET (int ros, int module, int pmt) const { - return m_HVSET[RosDrawer(ros,(module-1))][pmt-1]; } //return the HVSET - int getDCSSTATES (int ros, int module) const { - return m_STATES[RosDrawer(ros,(module-1))]; } // return drawer state + float getDCSHV (int ros, int module, int pmt) const; + float getDCSHVSET (int ros, int module, int pmt) const; + int getDCSSTATES (int ros, int module) const; // these 3 methods return status values which can be used to detect bad PMTs // ros=1,2,3,4 as usual, while drawer and channel starts from "0" TileDCSStatus getDCSHVSTATUS (int ros, int drawer, int channel) const; // status for HV deviation TileDCSStatus getDCSSTATUS (int ros, int drawer) const; // status of drawer voltages - TileDCSStatus getDCSSTATUS (int ros, int drawer, int channel) const { - return m_STATUS[RosDrawer(ros,drawer)][channel]; } // final status - the worst of 2 statuses above + TileDCSStatus getDCSSTATUS (int ros, int drawer, int channel) const; - bool statusHVIsBad (int ros, int drawer, int channel) const { - return getDCSHVSTATUS(ros,drawer,channel) > WARNING; } - bool statusIsBad (int ros, int drawer) const { - return getDCSSTATUS(ros,drawer) > WARNING; } - bool statusIsBad (int ros, int drawer, int channel) const { - return m_STATUS[RosDrawer(ros,drawer)][channel] > WARNING; } + bool statusHVIsBad (int ros, int drawer, int channel) const; + bool statusIsBad (int ros, int drawer) const; + bool statusIsBad (int ros, int drawer, int channel) const; int getNcalls() const { return m_ncalls; } // how many times callBack was triggered std::string partitionName(int ros) {return m_partName[ros];} private: - //Key for DataHandle - BooleanProperty m_readAnyFolder; - BooleanProperty m_readHV; - BooleanProperty m_readHVSET; - BooleanProperty m_readSTATES; - std::string m_folderPrefix; - float m_goodHVlimit; - float m_warningHVlimit; - int m_goodDrawer; - std::vector<int> m_warningDrawer; - int m_unknownValue; + + ToolHandle<ITileDCSTool> m_dcsTool{this, "TileDCSTool", "TileDCSTool", "Tile DCS tool"}; int m_ncalls; - //Declare Storegate container - ServiceHandle<StoreGateSvc> m_detStore; - ServiceHandle<IIOVDbSvc> m_IOVDbSvc; //!< Handle on the IOVDb service - ServiceHandle<TileCablingSvc> m_tileCablingSvc; const TileCablingService* m_cabling; - ToolHandle<TileCondToolEmscale> m_tileToolEmscale; //!< main Tile Calibration tool - - //DataHandle for callback - const DataHandle<CondAttrListCollection> m_DCSData_HV; - const DataHandle<CondAttrListCollection> m_DCSData_HVSET; - const DataHandle<CondAttrListCollection> m_DCSData_STATES; - std::vector<int> m_pModulesHV; - std::vector<int> m_pModulesHVSET; - std::vector<int> m_pModulesSTATES; - std::map<int, std::pair<float,float> > m_knownBadHV; - - int m_STATES[256]; - float m_HV[256][55]; - float m_HVSET[256][68]; - TileDCSStatus m_STATUS[256][48]; - - int m_channel2pmt[2][68]; int m_pmt2channel[2][68]; - bool m_channel_used[4][48]; // 0=LB, 1=EB, 2=EB without D4, 3=EB with special C10 - - int read_config(std::string filename, std::string substr, - std::vector<int> & m_pModules); - - int read_badhv(std::string filename); - - void fillHVref(); std::vector<std::string> m_partName; diff --git a/TileCalorimeter/TileConditions/TileConditions/TileEMScale.h b/TileCalorimeter/TileConditions/TileConditions/TileEMScale.h new file mode 100644 index 0000000000000000000000000000000000000000..b248458fe0de91603061cfef27190b1e1f4e7e3e --- /dev/null +++ b/TileCalorimeter/TileConditions/TileConditions/TileEMScale.h @@ -0,0 +1,464 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef TILECONDITIONS_TILEEMSCALE_H +#define TILECONDITIONS_TILEEMSCALE_H + +/** + * @brief Condition object to keep calibration factors of TileCal channels + * @author Nils Gollub <nils.gollub@cern.ch> + * + * @details In order to calibrate signals from TileCal to the + * electromagnetic (EM) scale, a set of calibration constants need to + * be applied. They are obtained by the independent CIS, Laser and + * Cesium calibration system. The final calibration constant from pC + * to the EM scale is determinded in dedicated electron and muon + * testbeam analyses. This AlgTool provides access to the calibration + * constants stored in the COOL database and functions to perform the + * actual calibrations. + * + * The central function of this AlgTool is calibrateChannel(), which + * enables the user to calibrate any TileCal channel from a given + * input unit (usually ADC counts or the online unit stored in the + * bytestream) to the desired output unit (usually MeV). In addition, + * functions performing the individual calibration steps are + * provided. They also give access to the calibration constants + * stored in the COOL DB by using unit amplitude as input. + * + * A first "online" calibration is already applied during the signal + * reconstruction in the ROD. The used calibration constants are + * preserved in special database folders that do not allow to modify + * calibration constants for runs already taken. This ensures that + * the calibrations applied online in a given run can always be + * undone later in order to apply updated calibration constants in a + * reprocessing step. In addition, CIS and Laser calibrations might + * contain non-linear parts which are only applied during the offline + * calibration using this AlgTool. + * + * + * @b Configuration + * + * TileCalibEms needs the following TileCalibData input data + * set up via corresponding methods + * - setCalibOflCisLin(): Linear part of the the CIS calibration + * - setCalibOflCisNln(): Non-linear part of the the CIS calibration + * - setCalibOflLasLin(): Linear part of the the Laser calibration + * - setCalibOflLasNln(): Non-linear part of the the Laser calibration + * - setCalibOflCes(): Cesim calibration constants (inlcuding Laser, HV and temperature references) + * - setCalibOflEms(): pC to MeV calibration constants + * + * The calibration constants applied in the ROD reconstruction have + * to be supplied through the "online" TileCalibData: + * + * - setCalibOnlCis(): Linear part of CIS calibration applied in ROD + * - setCalibOnlLas(): Linear part of Laser calibration applied in ROD + * - setCalibOnlCes(): Cesium factor applied in ROD + * - setCalibOnlEms(): EM calibration factor applied in ROD + * + * + * Since the calibration factor applied in the ROD is the product of + * up to four numbers, associated to the four calibration steps + * listed above, the total ROD calibration factor is cached. The unit + * of the cache is set up by setOnlCacheUnit() method and + * should be set to the ROD output unit present in the bytestream + * (otherwise the total factor will be recomputed event by event). + * The following online cache units can be used here: + * + * - TileRawChannelUnit::OnlineADCcounts + * - TileRawChannelUnit::OnlinePicoCoulombs + * - TileRawChannelUnit::OnlineCesiumPicoCoulombs + * - TileRawChannelUnit::OnlineMegaElectronVolts + * - TileRawChannelUnit::Invalid + * + * If the ROD calibration should not be undone (or is not available + * as for simulated data), online cache unit should be set to + * "Invalid" (which is the default). + */ + +// Tile includes +#include "TileConditions/TileCalibData.h" +#include "TileIdentifier/TileRawChannelUnit.h" +#include "TileCalibBlobObjs/TileCalibDrawerFlt.h" + +#include <vector> +#include <array> + +class TileEMScale { + public: + + TileEMScale(); + virtual ~TileEMScale(); + + bool initialize(); + + /** + * @brief Calibrate a Tile channel. + * @details Transforms the input amplitude with unit rawDataUnitIn to output amplitude with unit rawDataUnitOut. + * Note that "upstream" calibrations are not supported, i.e. calibration requests from eg. + * MeV to ADC counts will result in an exception being thrown. + * @returns The input amplitude after calibration + * @param drawerIdx Drawer index + * @param channel Tile channel + * @param adc Gain + * @param amplitude Input ampitude in units of rawDataUnitIn + * @param rawDataUnitIn Input unit, see TileIdentifier/TileRawChannelUnit.h + * @param rawDataUnitOut Output unit, see TileIdentifier/TileRawChannelUnit.h */ + float calibrateChannel(unsigned int drawerIdx, unsigned int channel, unsigned int adc, float amplitude, + TileRawChannelUnit::UNIT rawDataUnitIn, TileRawChannelUnit::UNIT rawDataUnitOut) const; + + /** + * @brief Calibrate a Tile channel to EM scale: Equalized pC -> MeV. + * @details Apply the pC to MeV calibration constant + * @returns The input amplitude after calibration [MeV] + * @param drawerIdx Drawer index + * @param channel Tile channel + * @param amplitude Input ampitude in pC */ + float applyEMScaleCalibration(unsigned int drawerIdx, unsigned int channel, float amplitude) const; + + /** + * @brief Apply cesium calibration constant. + * @returns The input amplitude after calibration [pC] + * @param drawerIdx Drawer index + * @param channel Tile channel + * @param amplitude Input ampitude in pC + * @param applyLasCorr Apply the (not yet implemented) relative laser correction + */ + float applyCesiumCalibration(unsigned int drawerIdx, unsigned int channel, + float amplitude, bool applyLasCorr = true) const; + + /** + * @brief Apply laser correction. + * @details Apply both the linear and non-linear part of the laser calibration + * @returns The input amplitude after calibration [pC] + * @param drawerIdx Drawer index + * @param channel Tile channel + * @param amplitude Input ampitude in pC + */ + float applyLaserCalibration(unsigned int drawerIdx, unsigned int channel, float amplitude) const; + + /** + * @brief Apply laser (PMT linearity) correction. + * @details Apply only the linear part of the laser calibration + * @returns The input amplitude after calibration [pC] + * @param drawerIdx Drawer index + * @param channel Tile channel + * @param amplitude Input ampitude in pC + */ + float applyLaserLinearCalibration(unsigned int drawerIdx, unsigned int channel, float amplitude) const; + + /** + * @brief Apply laser (PMT nonlinearity) correction. + * @details Apply only the non-linear part of the laser calibration + * @returns The input amplitude after calibration [pC] + * @param drawerIdx Drawer index + * @param channel Tile channel + * @param amplitude Input ampitude in pC + */ + float applyLaserNonLinearCalibration(unsigned int drawerIdx, unsigned int channel, float amplitude) const; + + /** + * @brief Apply CIS calibration: ADC counts -> pC. + * @details Apply both the linear and non-linear part of the CIS calibration + * @returns The input amplitude after calibration [pC] + * @param drawerIdx Drawer index + * @param channel Tile channel + * @param adc Gain + * @param amplitude Input ampitude in units of ADC counts + */ + float applyChargeCalibration(unsigned int drawerIdx, unsigned int channel, unsigned int adc, + float amplitude) const; + + /** + * @brief Apply CIS linear calibration: ADC counts -> pC. + * @details Apply only the linear part of the CIS calibration + * @returns The input amplitude after calibration [pC] + * @param drawerIdx Drawer index + * @param channel Tile channel + * @param adc Gain + * @param amplitude Input ampitude in units of ADC counts + */ + float applyChargLinearCalibration(unsigned int drawerIdx, unsigned int channel, unsigned int adc, + float amplitude) const; + + /** + * @brief Apply CIS non-linear calibration: ADC counts -> pC. + * @details Apply only the non-linear part of the CIS calibration + * @returns The input amplitude after calibration [pC] + * @param drawerIdx Drawer index + * @param channel Tile channel + * @param adc Gain + * @param amplitude Input ampitude in units of ADC counts + */ + float applyChargeNonLinearCalibration(unsigned int drawerIdx, unsigned int channel, unsigned int adc, + float amplitude) const; + + + /** + * @brief Calibrate an online Tile channel from OnlineADCcounts to an arbitrary Online unit, + * no non-linear corrections are applied + * @details Transforms the input amplitude with unit rawDataUnitIn to output amplitude with unit rawDataUnitOut. + * Note that "upstream" calibrations are not supported, i.e. calibration requests from eg. + * MeV to ADC counts will result in an exception being thrown. + * @returns The total online calibration constant + * @param drawerIdx Drawer index + * @param channel Tile channel + * @param adc Gain + * @param amplitude Input amplitude in OnlineADCcounts unit + * @param onlUnit Output online unit, see TileIdentifier/TileRawChannelUnit.h + */ + float calibrateOnlineChannel(unsigned int drawerIdx, unsigned int channel, unsigned int adc, + float amplitude, TileRawChannelUnit::UNIT onlUnit) const; + + /** + * @brief Calibrate online chnnel to EM scale: Equalized pC -> MeV. + * @details Apply the pC to MeV calibration constant + * @returns The input amplitude after calibration [MeV] + * @param drawerIdx Drawer index + * @param channel Tile channel + * @param amplitude Input ampitude in pC + */ + float applyOnlineEMScaleCalibration(unsigned int drawerIdx, unsigned int channel, float amplitude) const; + + /** + * @brief Apply online cesium calibration constant. + * @returns The input amplitude after calibration [pC] + * @param drawerIdx Drawer index + * @param channel Tile channel + * @param amplitude Input ampitude in pC + * @param applyLasCorr Apply the (not yet implemented) relative laser correction + */ + float applyOnlineCesiumCalibration(unsigned int drawerIdx, unsigned int channel, + float amplitude, bool applyLasCorr = true) const; + + /** + * @brief Apply online laser (PMT linearity) correction. + * @details Apply only the linear part of the laser calibration + * @returns The input amplitude after calibration [pC] + * @param drawerIdx Drawer index + * @param channel Tile channel + * @param amplitude Input ampitude in pC + */ + float applyOnlineLaserCalibration(unsigned int drawerIdx, unsigned int channel, float amplitude) const; + + /** + * @brief Apply online CIS calibration: ADC counts -> pC. + * @details Apply only the linear part of the CIS calibration + * @returns The input amplitude after calibration [pC] + * @param drawerIdx Drawer index + * @param channel Tile channel + * @param adc Gain + * @param amplitude Input ampitude in units of ADC counts + */ + float applyOnlineChargeCalibration(unsigned int drawerIdx, unsigned int channel, unsigned int adc, + float amplitude) const; + + /** + * @brief Undo the calibration applied in ROD signal reconstruction + * @details At the run configuration stage, calibration constants are loaded into TileCal RODs, enabling + * the output of the signal reconstruction run online in DSPs to be sent in units of MeV. + * However, in this first raw calibration only the linear part of corrections are applied. + * In order to apply the full (and maybe in the meantime updated) calibration including + * all non-linear corrections, the calibrations applied in the ROD need to be undone first. + * @returns The signal as reconstructed in the DSP in units of ADC counts. + * @param drawerIdx Drawer index + * @param channel Tile channel + * @param adc Gain + * @param amplitude Input ampitude in online units onlUnit + * @param onlUnit The output unit of the DSP, preserved in the bytestream + */ + float undoOnlineChannelCalibration(unsigned int drawerIdx, unsigned int channel, unsigned int adc, + float amplitude, TileRawChannelUnit::UNIT onlUnit) const; + + /** + * @brief Return the PMT gain reference as measured by the laser system. + * @details Continous PMT gain measurements with the laser system enable to correct for PMT + * gain drifts between cesium calibration runs. Corrections are applied relative to the PMT + * gain measured by the laser system directly after the last cesium equalization. + * @returns The PMT gain reference at the last cesium scan. + * @param drawerIdx Drawer index + * @param channel Tile channel + * @param adc Gain + */ + float getCesiumReferenceLaserGain(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const; + + /** + * @brief Return the reference PMT HV set in last cesium calibration. + * @returns The PMT HV applied as result of last cesium calibration + * @param drawerIdx Drawer index + * @param channel Tile channel + */ + float getCesiumReferenceHV(unsigned int drawerIdx, unsigned int channel) const; + + /** + * @brief Return the drawer temperature as measured during last cesium equalization. + * @returns The drawer temperature during last cesium equalization + * @param drawerIdx Drawer index + * @param channel Tile channel + */ + float getCesiumReferenceTemperature(unsigned int drawerIdx, unsigned int channel) const; + + /** + * @brief Return laser fiber relative variation + * @param drawerIdx Drawer index + * @param channel Tile channel + */ + float getLaserFiberVariation(unsigned int drawerIdx, unsigned int channel) const; + + /** + * @brief Return laser partition relative variation + * @details The partition is defined by the drawerIdx which belongs to this partition. + * The relative partition variation values are stored in the first drawer + * of each partition at tile channel LAS_PART_CHAN (it is 43), which is empty both + * in barrel and in extended barrel tile modules. Hence its value is not useful + * for getLasFiber, which reads from the same source. + * @param drawerIdx Drawer index + */ + float getLaserPartitionVariation(unsigned int drawerIdx) const; + + /** + * @brief Returns the reference PMT HV from appropriate laser calibration. + * @returns The PMT HV applied as result of laser calibration + * @param drawerIdx Drawer index + * @param channel Tile channel + */ + float getLaserReferenceHV(unsigned int drawerIdx, unsigned int channel) const; + + /** + * @brief Return the unit of cached online calibration constants. + */ + TileRawChannelUnit::UNIT getOnlineCacheUnit() const; + + /** + * @brief Set online cache unit. + * @param onlCacheUnit online cache unit + */ + void setOnlineCacheUnit(TileRawChannelUnit::UNIT onlCacheUnit); + + void setCalibOflCisLin(std::unique_ptr<TileCalibDataFlt> calibData); + void setCalibOflCisNln(std::unique_ptr<TileCalibDataFlt> calibData); + void setCalibOflLasLin(std::unique_ptr<TileCalibDataFlt> calibData); + void setCalibOflLasNln(std::unique_ptr<TileCalibDataFlt> calibData); + void setCalibOflLasFib(std::unique_ptr<TileCalibDataFlt> calibData); + void setCalibOflCes(std::unique_ptr<TileCalibDataFlt> calibData); + void setCalibOflEms(std::unique_ptr<TileCalibDataFlt> calibData); + + void setCalibOnlCis(std::unique_ptr<TileCalibDataFlt> calibData); + void setCalibOnlLas(std::unique_ptr<TileCalibDataFlt> calibData); + void setCalibOnlCes(std::unique_ptr<TileCalibDataFlt> calibData); + void setCalibOnlEms(std::unique_ptr<TileCalibDataFlt> calibData); + + void setMaxChannels(unsigned int maxChannels); + void setMaxGains(unsigned int maxGains); + + protected: + + /** + * @brief Recache the total online calibration constant applied in ROD. + * @details This callback is called if any of the "online" proxies callback function + * has been called due to an updated COOL DB IOV. The cache is cleared and + * refilled with the current valid values of the unit specified in the + * \ref TileEMScale::m_onlCacheUnit "OnlCacheUnit" property. + */ + void resetOnlineCache(); + + /** + * @brief Return the calibration constant applied in the DSP. + * @param drawerIdx Drawer index + * @param channel Tile channel + * @param adc Gain + * @param onlUnit The output unit of the DSP + */ + float getOnlineCalibration(unsigned int drawerIdx, unsigned int channel, unsigned int adc, + TileRawChannelUnit::UNIT onlUnit) const; + + /** + * @brief Check if offline linear laser calibration will be used + * @details This callback is called if offline linear laser of the proxies callback function + * has been called due to an updated COOL DB IOV. \ref TileEMScale::m_isOflLasLinUsed property. + */ + bool checkIfOflLaserLinearCalibrationUsed() const; + + /** + * @brief Check if offline nonlinear laser calibration will be used + * @details This callback is called if offline nonlinear laser of the proxies callback function + * has been called due to an updated COOL DB IOV.\ref TileEMScale::m_isOflLasNlnUsed property. + */ + bool checkIfOflLaserNonLinearCalibrationUsed() const; + + /** + * @brief Return cache index used for online calibration constants. + * @details Return cache index used for the calibration constant applied in the DSP + * @param drawerIdx Drawer index + * @param channel Tile channel + * @param adc Gain + */ + + unsigned int getCacheIndex(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const; + + //=== cache of total online calibration factors + TileRawChannelUnit::UNIT m_onlCacheUnit; + std::vector<float> m_onlCache; + + bool m_isOflLasLinUsed; + bool m_isOflLasNlnUsed; + + //=== TileCondProxies are needed by the TileCalibEms + //--- offline TileCalibData + std::unique_ptr<TileCalibDataFlt> m_calibOflCisLin; + std::unique_ptr<TileCalibDataFlt> m_calibOflCisNln; + std::unique_ptr<TileCalibDataFlt> m_calibOflLasLin; + std::unique_ptr<TileCalibDataFlt> m_calibOflLasNln; + std::unique_ptr<TileCalibDataFlt> m_calibOflLasFib; + std::unique_ptr<TileCalibDataFlt> m_calibOflCes; + std::unique_ptr<TileCalibDataFlt> m_calibOflEms; + + //--- online TileCalibData + std::unique_ptr<TileCalibDataFlt> m_calibOnlCis; + std::unique_ptr<TileCalibDataFlt> m_calibOnlLas; + std::unique_ptr<TileCalibDataFlt> m_calibOnlCes; + std::unique_ptr<TileCalibDataFlt> m_calibOnlEms; + + bool m_useOflLasFib; + + unsigned int m_maxChannels; + unsigned int m_maxGains; + unsigned int m_drawerCacheSize; + + const float m_epsilon = 1.e-5; +}; + +#include "AthenaKernel/CLASS_DEF.h" +#include "AthenaKernel/CondCont.h" +CLASS_DEF(TileEMScale, 166690091, 0) +CONDCONT_DEF(TileEMScale, 177875727); + + +// inlines + +inline +TileRawChannelUnit::UNIT TileEMScale::getOnlineCacheUnit() const { + return m_onlCacheUnit; +} + +inline +void TileEMScale::setOnlineCacheUnit(TileRawChannelUnit::UNIT onlCacheUnit) { + m_onlCacheUnit = onlCacheUnit; +} + +inline +void TileEMScale::setMaxChannels(unsigned int maxChannels) { + m_maxChannels = maxChannels; +} + +inline +void TileEMScale::setMaxGains(unsigned int maxGains) { + m_maxGains = maxGains; +} + +inline +unsigned int TileEMScale::getCacheIndex(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const { + return m_drawerCacheSize * drawerIdx + m_maxChannels * adc + channel; +} + +#endif // TILECONDITIONS_TILEEMSCALE_H diff --git a/TileCalorimeter/TileConditions/TileConditions/TileExpertToolEmscale.h b/TileCalorimeter/TileConditions/TileConditions/TileExpertToolEmscale.h index 03067768233128cc2afa8c7647c779c7040546a1..b604a2a0a9ed85f2cc59d83caccf09511a718f7f 100644 --- a/TileCalorimeter/TileConditions/TileConditions/TileExpertToolEmscale.h +++ b/TileCalorimeter/TileConditions/TileConditions/TileExpertToolEmscale.h @@ -5,18 +5,18 @@ #ifndef TILECONDITIONS_TILEEXPERTTOOLEMSCALE_H #define TILECONDITIONS_TILEEXPERTTOOLEMSCALE_H -/** - @brief (For experts only) Calibration of TileCal channels and access to calibration factors. - @author Lukas Pribyl <lukas.pribyl@cern.ch> - - @details This tool has the same functionality as the standard production TileCondToolEmscale - tool. For the description of TileExpertToolEmscale methods please consult the file - TileCondToolEmscale. The TileExpertToolEmscale tool is in addition able to switch on/off - individual calibration corrections. This is set via TileIdentifier/TileEmscaleCalibOptions - bitmap. If the calibration correction is switched on, the tool behaves exactly as TileCondToolEmscale, - from which it inherits most of the methods. If the calibration correction is switched of (the - relevant bit in m_emOptions bitmap is false), the relevant calibration method returns the input amplitude - without any change. The value of the bitmap m_emOptions is set only once at the constructor. +/** + * @brief (For experts only) Calibration of TileCal channels and access to calibration factors. + * @author Lukas Pribyl <lukas.pribyl@cern.ch> + * + * @details This tool has the same functionality as the standard production TileCondToolEmscale + * tool. For the description of TileExpertToolEmscale methods please consult the file + * TileCondToolEmscale. The TileExpertToolEmscale tool is in addition able to switch on/off + * individual calibration corrections. This is set via TileIdentifier/TileEmscaleCalibOptions + * bitmap. If the calibration correction is switched on, the tool behaves exactly as TileCondToolEmscale, + * from which it inherits most of the methods. If the calibration correction is switched of (the + * relevant bit in m_emOptions bitmap is false), the relevant calibration method returns the input amplitude + * without any change. The value of the bitmap m_emOptions is set only once at the constructor. */ // Tile includes diff --git a/TileCalorimeter/TileConditions/TileConditions/TileInfo.h b/TileCalorimeter/TileConditions/TileConditions/TileInfo.h index 67e9957062b853a68826ae3bd519a11f24e259ee..099a948f89165462cf7d48f787a4a96a8d356934 100644 --- a/TileCalorimeter/TileConditions/TileConditions/TileInfo.h +++ b/TileCalorimeter/TileConditions/TileConditions/TileInfo.h @@ -4,19 +4,19 @@ #ifndef TILECONDITIONS_TILEINFO_H #define TILECONDITIONS_TILEINFO_H -//**************************************************************************** -// Filename : TileInfo.h +//**************************************************************************** +// Filename : TileInfo.h // Author : F. Merritt, Z. Wu // Date : May, 2002 -// +// // :DESCRIPTION: // This is the first step toward creating an interface to Tile Conditions // Database. TileInfo should be used to return any detector-dependent // constants or information regarding the Tile Calorimeter. // -// HISTORY: +// HISTORY: // Jul 2007: Major clearup and reorganization, including COOL DB access (NGO) -// 10th Oct 06: add comments on Covariance matrix addition ( F Spano') +// 10th Oct 06: add comments on Covariance matrix addition ( F Spano') // 08May02: Add NchannelsPerCell to return # channels belonging to each cell. //*************************************************************************** @@ -53,7 +53,7 @@ static const CLID CLID_TileInfo = 2910; class TileInfo : public DataObject { friend class TileInfoLoader; - + public: typedef std::vector<const TileCalibDrawerFlt*> DrawerVecFlt; @@ -69,9 +69,9 @@ class TileInfo : public DataObject { //== Accessor methods for simple constants //== //================================================================== - + /** Returns the number of readout channels connected to a given cell */ - int NchannelsPerCell(const Identifier& cell_id) const + int NchannelsPerCell(const Identifier& cell_id) const { return m_tileID->is_tile_gapscin(cell_id) ? 1:2; } /** Returns the maximum ADC output (10 bits --> 1023) */ @@ -93,7 +93,7 @@ class TileInfo : public DataObject { //================================================================== /** Returns the calibration for a given ADC and amplitude. - This function should be called by most users. It returns the complete calibration + This function should be called by most users. It returns the complete calibration from rawDataUnitIn to rawDataUnitOut for a given reconstruction method specified in filterType. @param adc_id The adc of interest @param amplitude The "amplitude" in untis of rawDataUnitIn @@ -101,14 +101,14 @@ class TileInfo : public DataObject { @param rawDataUnitOut One of TileRawData::[ ADCcounts | PicoCoulombs | CesiumPicoCoulombs | MegaElectronVolts ] @param filterType The reco-method applied, specified by TileFragHash::[ Digitizer | FlatFilter | OptFilter | FitFilter | ManyAmps ] */ - double ChannelCalib(const HWIdentifier& adc_id, + double ChannelCalib(const HWIdentifier& adc_id, double amplitude, const TileRawChannelUnit::UNIT rawDataUnitIn = TileRawChannelUnit::ADCcounts, const TileRawChannelUnit::UNIT rawDataUnitOut = TileRawChannelUnit::MegaElectronVolts, const TileFragHash::TYPE filterType = TileFragHash::Digitizer) const; /** Returns the calibration factor for a given ADC. - This function should be called by most users. It returns the complete calibration + This function should be called by most users. It returns the complete calibration from rawDataUnitIn to rawDataUnitOut for a given reconstruction method specified in filterType. @param adc_id The adc of interest @param rawDataUnitIn One of TileRawData::[ ADCcounts | PicoCoulombs | CesiumPicoCoulombs | MegaElectronVolts ] @@ -120,24 +120,25 @@ class TileInfo : public DataObject { const TileRawChannelUnit::UNIT rawDataUnitOut = TileRawChannelUnit::MegaElectronVolts, const TileFragHash::TYPE filterType = TileFragHash::Digitizer) const { return ChannelCalib(adc_id, 1.0, rawDataUnitIn, rawDataUnitOut, filterType); } - + /** Returns the input amplitude corrected with the EM scale calibration. */ double EmsCalib(const HWIdentifier& channel_id, double amplitude=1.0) const; /** Returns the input amplitude corrected with the cesium calibration. - Note: The constant for D-layer cells will be around 1.2 - @param invert If set to true, the input energy is un-corrected for the calibration + Note: The constant for D-layer cells will be around 1.2 + @param channel_id Channel hardware (online) identifier + @param amplitude Input amplitude @param applyLasCorr If set to true, a laser stability correction is applied (not implemented yet) */ - double CesiumCalib(const HWIdentifier& channel_id, double amplitude=1.0, bool applyLasCorr=true) const; + double CesiumCalib(const HWIdentifier& channel_id, double amplitude=1.0, bool applyLasCorr=true) const; /** Returns the input amplitude corrected with the laser calibration. */ double LaserCalib(const HWIdentifier& channel_id, double amplitude=1.0) const; - /** Retruns the input amplitude corrected with the CIS calibration. + /** Retruns the input amplitude corrected with the CIS calibration. @param adc_id The adc of interest + @param amplitude Amplitude of pulse in units of ADC counts @param filterType The reco-method applied, specified by TileFragHash::[ Digitizer | FlatFilter | OptFilter | FitFilter | ManyAmps ] - @param adcAmplitude Amplitude of pulse in units of ADC counts */ double CisCalib(const HWIdentifier& adc_id, double amplitude=1.0, const TileFragHash::TYPE filterType = TileFragHash::Digitizer) const; @@ -169,7 +170,7 @@ class TileInfo : public DataObject { /** Returns the pedestal for a given ADC in units of ADC counts. For the simulation, slightly different levels depending on channel/gain - are returned. + are returned. */ double DigitsPedLevel(const HWIdentifier& adc_id) const; double DigitsPedLevel(int gain, int channel, int drawerHash) const @@ -185,7 +186,7 @@ class TileInfo : public DataObject { { return DigitsPedSigma(gain,channel,drawerHash)*m_noiseScaleFactor[m_noiseScaleIndex]; } /** Should in the future return the expected noise sigma for a given cell and reco-method. - As a first approach, now we use the noise sigma of an individual digit, convert it to MeV + As a first approach, now we use the noise sigma of an individual digit, convert it to MeV and multiply it by a special factor which depends on reco-method */ double CellNoiseSigma(const Identifier& cell_id, CaloGain::CaloGain gain, @@ -194,11 +195,11 @@ class TileInfo : public DataObject { /** Returns the decomposed covariance matrix*/ const TMatrixD * DecoCovariance(int ros, int drawer, int hilo) const; - /** Return the threshold value for good (filtered) TileRawChannels + /** Return the threshold value for good (filtered) TileRawChannels @param gain is ignored for now */ double ThresholdRawChannel(int /* gain */) const {return m_thresholdRawChannel;} - /** Return the threshold value for good TileDigits (cut applied to in-time digit only) + /** Return the threshold value for good TileDigits (cut applied to in-time digit only) @param gain is ignored for now */ double ThresholdDigits(int /* gain */) const {return m_thresholdDigits;} @@ -270,26 +271,26 @@ class TileInfo : public DataObject { //== Accessor methods for shaping functions and paramters //== //================================================================== - + /** Return high gain shape vector to multiply the amplitude of a TileHit to produce TileDigit */ - const std::vector<double>& digitsShapeHi() const {return m_digitsShapeHi;} + const std::vector<double>& digitsShapeHi() const {return m_digitsShapeHi;} /** Return low gain shape vector to multiply the amplitude of a TileHit to produce TileDigit */ const std::vector<double>& digitsShapeLo() const {return m_digitsShapeLo;} /** Return derivative of bins in high gain DigitShape */ const std::vector<double>& digitsDerivativeHi() const {return m_digitsDerivativeHi;} /** Return derivative of bins in log gain DigitShape */ - const std::vector<double>& digitsDerivativeLo() const {return m_digitsDerivativeLo;} + const std::vector<double>& digitsDerivativeLo() const {return m_digitsDerivativeLo;} /** Return shape vector with full binning to produce the TileDigits from sub-hits */ const std::vector<double>& digitsFullShapeHi() const {return m_digitsFullShapeHi;} /** Return shape vector with full binning to produce the TileDigits from sub-hits */ const std::vector<double>& digitsFullShapeLo() const {return m_digitsFullShapeLo;} - /** Return number of bins in high gain DigitShape */ - int digitsNBinsHi() const {return m_digitsNBinsHi;} - /** Return number of bins in low gain DigitShape */ - int digitsNBinsLo() const {return m_digitsNBinsLo;} + /** Return number of bins in high gain DigitShape */ + int digitsNBinsHi() const {return m_digitsNBinsHi;} + /** Return number of bins in low gain DigitShape */ + int digitsNBinsLo() const {return m_digitsNBinsLo;} /** Return index of in-time bin in high gain DigitShape */ int digitsTime0BinHi() const {return m_digitsTime0BinHi;} @@ -309,9 +310,9 @@ class TileInfo : public DataObject { const std::vector<double>& MuL1Shape() const {return m_MuL1Shape;} /** Return full TTL1 shape vector */ - const std::vector<double>& ttl1FullShape() const {return m_TTL1FullShape;} + const std::vector<double>& ttl1FullShape() const {return m_TTL1FullShape;} /** Return full Muon Receiver shape vector */ - const std::vector<double>& MuRcvFullShape() const {return m_MuRcvFullShape;} + const std::vector<double>& MuRcvFullShape() const {return m_MuRcvFullShape;} /** Return full TTL1 shape vector for MBTS */ const std::vector<double>& MuL1FullShape() const {return m_MuL1FullShape;} @@ -321,18 +322,18 @@ class TileInfo : public DataObject { int MuRcvNBins() const {return m_MuRcvNBins;} /** Return number of bins in TTL1Shape for MBTS */ int MuL1NBins() const {return m_MuL1NBins;} - + /** Return index of in-time bin in TTL1Shape */ - int ttl1Time0Bin() const {return m_TTL1Time0Bin;} + int ttl1Time0Bin() const {return m_TTL1Time0Bin;} /** Return index of in-time bin in Muon Receiver shape*/ - int MuRcvTime0Bin() const {return m_MuRcvTime0Bin;} + int MuRcvTime0Bin() const {return m_MuRcvTime0Bin;} /** Return index of in-time bin in TTL1Shape for MBTS */ int MuL1Time0Bin() const {return m_MuL1Time0Bin;} /** Return number of TTL1 bins per bunch-crossing */ - int ttl1BinsPerX() const {return m_TTL1BinsPerX;} + int ttl1BinsPerX() const {return m_TTL1BinsPerX;} /** Return number of Muon Receiver bins per bunch-crossing */ - int MuRcvBinsPerX() const {return m_MuRcvBinsPerX;} + int MuRcvBinsPerX() const {return m_MuRcvBinsPerX;} /** Return number of TTL1 bins per bunch-crossing for MBTS */ int MuL1BinsPerX() const {return m_MuL1BinsPerX;} @@ -341,7 +342,7 @@ class TileInfo : public DataObject { std::vector<double> &ttl1shape) const; void muRcvShape(const int nsamp, const int itrig, const double phase, - std::vector<double> &murcvshape) const; + std::vector<double> &murcvshape) const; //================================================================== //== @@ -366,10 +367,10 @@ class TileInfo : public DataObject { //== Accessor methods for external structures //== //================================================================== - + /** Return pointer to TilePulseShapes*/ TilePulseShapesStruct * getPulseShapes() const {return m_pulseShapes->TilePSstruct();} - + /** Return pointer to TileOptFilterWeight */ TileOptFilterWeightsStruct * getOptFilterWeights() const {return m_OptFilterWeights->TileOFWstruct();} @@ -385,15 +386,15 @@ class TileInfo : public DataObject { /** TileHit to TileCell energy conversion for ancillary testbeam detectors. Return the factor for converting TileHit amplitude to - TileCell energy in the simulation for ancillary detectors at the testbeam + TileCell energy in the simulation for ancillary detectors at the testbeam This method always returned 1. in the past, keep it for compatibility for now. */ double BeamElemHitCalib(const Identifier& /* pmt_id */) const {return 1.;} - - /** Method returns and returned always 1. + + /** Method returns and returned always 1. Kept for compatibility for now. */ double BeamElemChannelCalib(const HWIdentifier& /* channel_id */) const {return 1.;} - /** NGO Need description. Do we need this function? */ + /** NGO Need description. Do we need this function? */ double ttl1Phase(const int /* posneg */, const int /* ieta */, const int /* iphi */) const {return 0.;} @@ -402,7 +403,7 @@ class TileInfo : public DataObject { /** Initialization of the TileInfo object. */ StatusCode initialize(); - + /** Pointer to ServiceLocator */ ISvcLocator *m_svcLocator; @@ -418,7 +419,7 @@ class TileInfo : public DataObject { double m_emscaleA; //!< 1/sampling fraction for all normal cells - double m_emscaleC[64]; //!< 1/sampling fraction for all C10 cells + double m_emscaleC[64]; //!< 1/sampling fraction for all C10 cells double m_emscaleE[16]; //!< 1/sampling fraction for special C10 and E1-E4 cells [9]=C10, [10]=E1, [11]=E2, [13]=E3, [15]=E4 double m_emscaleMBTS[3]; //!< 1/sampling fraction for inner/outer MBTS and also for E4' @@ -427,10 +428,10 @@ class TileInfo : public DataObject { int m_iTrigSample; /** scale factor from digital noise to Opt Filter noise - for various opt filter algoritms - 0 - reserved - 1 - opt filter without iterations, - 2 - opt filter with iterations + for various opt filter algoritms + 0 - reserved + 1 - opt filter without iterations, + 2 - opt filter with iterations 3 - fit method */ double m_noiseScaleFactor[4]; @@ -507,7 +508,7 @@ class TileInfo : public DataObject { double m_emscaleTB[32]; double m_mev2adcTB[32]; - + ServiceHandle<TileCablingSvc> m_tileCablingSvc; ToolHandle<TileCondIdTransforms> m_tileIdTrans; ToolHandle<TileCondToolEmscale> m_tileToolEmscale; @@ -521,7 +522,7 @@ class TileInfo : public DataObject { // decomposed covariance matrices (partition x module x gain) // std::vector <std::vector <std::vector <TMatrixD *> > > m_decoCovaria; - + }; #endif //TILECONDITIONS_TILEINFO_H diff --git a/TileCalorimeter/TileConditions/doc/packagedoc.h b/TileCalorimeter/TileConditions/doc/packagedoc.h index aa1e491b389b20648c5e25cb7216c806ebda25cb..61faf672343bda9d6b7c444c8af711d78381d05e 100644 --- a/TileCalorimeter/TileConditions/doc/packagedoc.h +++ b/TileCalorimeter/TileConditions/doc/packagedoc.h @@ -18,7 +18,8 @@ Calibration constants and cabling description for the TileCalorimeter. This package consists of a set of tools which provide TileCal conditions data to clients running in the Athena framework. In addition to AlgTools also two Services are provided: TileCablingSvc -(see also \ref TileCablingSvcSection below) and TileInfoLoader. +(see also \ref TileConditions_TileCablingSvcSection below) +and TileInfoLoader. @section TileConditions_TileCondTools TileCondTools @@ -26,13 +27,13 @@ In the following list the currently available TileCondTools are listed, describing briefly their purpose. For more details see the individual descriptions within each tool. -- TileBadChanTool: Status information for each TileCal channel and ADC. +- TileBadChanTool: Status information for each TileCal channel and ADC. - TileCondToolEmscale: Application of CIS, Laser and Cesium calibration constants, calibration to the EM scale. - TileCondToolTiming: Signal phase for each TileCal ADC. - TileCondToolNoiseSample: High and low frequency noise and pedestal level for each ADC. - TileCondToolNoiseRawChn: Response of reco method (OF, Fit, ...) to pedestal like events. - TileCellNoiseTool: Access to noise level expected in each TileCal cell (uses TileCondToolNoise tools internally). -- TileCondToolOfc: calculates Optimal Filter Coefficients (OFCs) for each ADC on the fly +- TileCondToolOfc: calculates Optimal Filter Coefficients (OFCs) for each ADC on the fly - TileCondToolOfcCool: extracts Optimal Filter Coefficients (OFCs) for each ADC from COOL database. - TileCondToolPulseShape: Expected pulse shapes in each ADC. @@ -67,11 +68,11 @@ encoding of data into the BLOBs (see TileCalibBlobObjs package). For MC production, default conditions data values are read from text files (share/TileDefault.*), which can also be used for testing purposes in reconstruction jobs. In order to decouple the \ref -TileCondTools code from the source of conditions data (COOL DB or text -file), the \ref TileCondTools access conditions data BLOBs through -TileCondProxies: Either a TileCondProxyCool or a +TileConditions_TileCondTools code from the source of conditions data +(COOL DB or text file), the \ref TileConditions_TileCondTools access +conditions data BLOBs through TileCondProxies: Either a TileCondProxyCool or a TileCondProxyFile. The TileCondProxies are themselves AlgTools and are -set as Properties to the different \ref TileCondTools. A Python +set as Properties to the different \ref TileConditions_TileCondTools. A Python function (see \ref TileCondProxyConf) is usually used to instantiate TileCondProxies, specifying the technology to be used ("FILE" or "COOL"), the type of the TileCalibDrawer object (see @@ -89,13 +90,13 @@ files. See the example configuration shown in the \ref TileCondToolConf section. -@subsection text_file_format Text File Format +@subsection text_file_format Text File Format The format of the text file (usually containing default conditions data used for simulation) follows two rules: -- All lines not starting with either "0x" or "OBJVERSION" are ignored. -- At least one line specifying the OBJVERSION of the BLOB has to be present. +- All lines not starting with either "0x" or "OBJVERSION" are ignored. +- At least one line specifying the OBJVERSION of the BLOB has to be present. Individual ADCs are addressed by specifying 3 numbers: fragId, channel and gain. All following numbers are interpreted as conditions data. In @@ -123,8 +124,8 @@ OBJVERSION 1 An Athena Algorithm called TileInfoDump is provided to print TileCal conditions data as it is seen by the Athena framework for a given run number. Example job options exist in share/TileInfoDump_jobOptions.py, -giving also hints about how to configure \ref TileCondTools and the -access to the COOL database. +giving also hints about how to configure \ref TileConditions_TileCondTools +and the access to the COOL database. @section TileConditions_TileInfo TileInfo, TileInfoLoader, etc... @@ -138,10 +139,10 @@ conditions data volume, the TileInfo object (and its TileInfoLoader) should be phased out. However, TileInfo is used in various places throughout the TileCal code and a clean break transition was not possible. Therefore, TileInfo is kept alive and provides wrapper -functions around the individual \ref TileCondTools. The usage of -TileInfo is strongly discouraged for new code developments and old -code should be migrated to use the \ref TileCondTools directly were -possible. +functions around the individual \ref TileConditions_TileCondTools. +The usage of TileInfo is strongly discouraged for new code developments +and old code should be migrated to use the \ref TileConditions_TileCondTools +directly were possible. @@ -149,10 +150,10 @@ possible. @section TileConditions_Package_Configuration Package Configuration Python helper classes and functions exist in the python subdirectory, -helping with the configuration of the \ref TileCondTools and +helping with the configuration of the \ref TileConditions_TileCondTools and Services. Their usage is illustrated in TileInfoDump_jobOptions. -@subsection TileCoolMgr TileCoolMgr.py +@subsection TileCoolMgr TileCoolMgr.py This Python module is a mini-database, keeping track of TileCal conditions data sources. It assigns a logical name to the data source @@ -179,16 +180,16 @@ defConnStr = conddb.dblist['TILE'] #=== fill with default folders: tileCoolMgr = TileCoolMgr() #--- energy calibration -tileCoolMgr.addSource('oflCisFitLin', '/TILE/OFL01/CALIB/CIS/FIT/LIN', defConnStr, "") -tileCoolMgr.addSource('oflCisFitNln', '/TILE/OFL01/CALIB/CIS/FIT/NLN', defConnStr, "") -tileCoolMgr.addSource('oflLasLin' , '/TILE/OFL01/CALIB/LAS/LIN' , defConnStr, "") -tileCoolMgr.addSource('oflLasNln' , '/TILE/OFL01/CALIB/LAS/NLN' , defConnStr, "") -tileCoolMgr.addSource('oflCes' , '/TILE/OFL01/CALIB/CES' , defConnStr, "") -tileCoolMgr.addSource('oflEms' , '/TILE/OFL01/CALIB/EMS' , defConnStr, "") +tileCoolMgr.addSource('oflCisFitLin', '/TILE/OFL01/CALIB/CIS/FIT/LIN', defConnStr, "") +tileCoolMgr.addSource('oflCisFitNln', '/TILE/OFL01/CALIB/CIS/FIT/NLN', defConnStr, "") +tileCoolMgr.addSource('oflLasLin' , '/TILE/OFL01/CALIB/LAS/LIN' , defConnStr, "") +tileCoolMgr.addSource('oflLasNln' , '/TILE/OFL01/CALIB/LAS/NLN' , defConnStr, "") +tileCoolMgr.addSource('oflCes' , '/TILE/OFL01/CALIB/CES' , defConnStr, "") +tileCoolMgr.addSource('oflEms' , '/TILE/OFL01/CALIB/EMS' , defConnStr, "") tileCoolMgr.addSource('onlCisLin' , '/TILE/ONL01/CALIB/CIS/LIN' , defConnStr, "") -tileCoolMgr.addSource('onlLasLin' , '/TILE/ONL01/CALIB/LAS/LIN' , defConnStr, "") -tileCoolMgr.addSource('onlCes' , '/TILE/ONL01/CALIB/CES' , defConnStr, "") -tileCoolMgr.addSource('onlEms' , '/TILE/ONL01/CALIB/EMS' , defConnStr, "") +tileCoolMgr.addSource('onlLasLin' , '/TILE/ONL01/CALIB/LAS/LIN' , defConnStr, "") +tileCoolMgr.addSource('onlCes' , '/TILE/ONL01/CALIB/CES' , defConnStr, "") +tileCoolMgr.addSource('onlEms' , '/TILE/ONL01/CALIB/EMS' , defConnStr, "") #--- noise tileCoolMgr.addSource('oflNoiseAdc', '/TILE/OFL01/NOISE/SAMPLE', defConnStr, "") tileCoolMgr.addSource('oflNoiseAcr', '/TILE/OFL01/NOISE/AUTOCR', defConnStr, "") @@ -206,7 +207,7 @@ tileCoolMgr.addSource('onlStatAdc', '/TILE/ONL01/STATUS/ADC', defConnStr, "") @subsection TileCondToolConf TileCondToolConf.py This Python module provides "getter" functions to obtain fully -configured \ref TileCondTools, specifying either "COOL" or "FILE" as +configured \ref TileConditions_TileCondTools, specifying either "COOL" or "FILE" as technology. The following section of TileInfoDump_jobOptions.py illustrates the use of these functions: @@ -214,7 +215,7 @@ illustrates the use of these functions: #======================================================== #=== configure TileCondTools #=== -#=== The lines below show how to configure individual +#=== The lines below show how to configure individual #=== tools directly, without the use of TileInfoConfigurator #=== #======================================================== @@ -222,7 +223,7 @@ from TileConditions.TileCondToolConf import * ToolSvc += getTileCondToolEmscale() #--- to switch off the usage of online cache, do # ToolSvc.TileCondToolEmscale.OnlCacheUnit="Invalid" -#--- a single proxy can be exchanged, for example like this... +#--- a single proxy can be exchanged, for example like this... # from TileConditions.TileCondProxyConf import getTileCondProxy # ToolSvc.TileCondToolEmscale.ProxyOflEms = getTileCondProxy('FILE','Flt','TileDefault.ems','TileCondProxyFile_OflEms') #--- ... or directly in the creation of the Tool like this: @@ -235,7 +236,7 @@ ToolSvc += getTileCondToolNoiseSample() ToolSvc += getTileCondToolTiming() @endverbatim -@subsection TileCondProxyConf TileCondProxyConf.py +@subsection TileCondProxyConf TileCondProxyConf.py This Python module provides a "getter" function for TileCondProxies. A TileCondProxyFile is returned if "FILE" is passed in the technology @@ -266,6 +267,6 @@ svcMgr += CfgMgr.TileCablingSvc() - + */ diff --git a/TileCalorimeter/TileConditions/python/TileCondProxyConf.py b/TileCalorimeter/TileConditions/python/TileCondProxyConf.py index e47965c197fd3ae25eef3682b34d49677f1a0a89..93ecc712a653479a8b8f7ddea8f98023c14693f2 100644 --- a/TileCalorimeter/TileConditions/python/TileCondProxyConf.py +++ b/TileCalorimeter/TileConditions/python/TileCondProxyConf.py @@ -1,7 +1,7 @@ # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration #file : TileCondProxyConf.py -#author: nils.gollub@cern.ch +#author: nils.gollub@cern.ch #modified: lukas.pribyl@cern.ch from TileConditions.TileConditionsConf import TileCondProxyFile_TileCalibDrawerFlt_ as TileCondProxyFileFlt @@ -35,8 +35,8 @@ def getTileCondProxy(technology, type, source, name, **kwargs): from TileConditions.TileCoolMgr import tileCoolMgr folder = tileCoolMgr.getFolder(source) folder2 = tileCoolMgr.getFolderTwo(source) - tag = tileCoolMgr.getTag(source) - conn = tileCoolMgr.getDbConn(source) + tag = tileCoolMgr.getTag(source) + conn = tileCoolMgr.getDbConn(source) key = tileCoolMgr.getKey(source) folderstr = "" @@ -49,15 +49,15 @@ def getTileCondProxy(technology, type, source, name, **kwargs): folderstr = folder + " <key>" + folder + "</key>" folderstr2 = folder2 + " <key>" + folder2 + "</key>" - #=== add folders according to their COOL schema split type - if tileCoolMgr.isSplitMC(source): - conddb.addFolderSplitMC(conn, folderstr, folderstr2) - if tileCoolMgr.isOfflineOnly(source): - conddb.addFolder(conn, folderstr) - if tileCoolMgr.isSplitOnline(source): - conddb.addFolderSplitOnline(conn, folderstr, folderstr2) - if tileCoolMgr.isSqlite(source): - conddb.addFolder(conn, folderstr) + #=== add folders according to their COOL schema split type + if tileCoolMgr.isSplitMC(source): + conddb.addFolderSplitMC(conn, folderstr, folderstr2, className = 'CondAttrListCollection') + if tileCoolMgr.isOfflineOnly(source): + conddb.addFolder(conn, folderstr, className = 'CondAttrListCollection') + if tileCoolMgr.isSplitOnline(source): + conddb.addFolderSplitOnline(conn, folderstr, folderstr2, className = 'CondAttrListCollection') + if tileCoolMgr.isSqlite(source): + conddb.addFolder(conn, folderstr, className = 'CondAttrListCollection') #=== create the proxies if type=='Flt': @@ -66,7 +66,7 @@ def getTileCondProxy(technology, type, source, name, **kwargs): tool = TileCondProxyCoolBch(name, Source = key) elif type=='Ofc': tool = TileCondProxyCoolOfc(name, Source = key) - + return tool # @@ -75,7 +75,7 @@ def getTileCondProxy(technology, type, source, name, **kwargs): # from AthenaCommon.AppMgr import ServiceMgr as svcMgr # from IOVDbSvc.IOVDbSvcConf import IOVDbSvc # iovDbSvc=svcMgr.IOVDbSvc - + # for f in iovDbSvc.Folders: # for parts in f.replace('<',' ').replace('>',' ').split(): # if folder in parts: diff --git a/TileCalorimeter/TileConditions/python/TileCondToolConf.py b/TileCalorimeter/TileConditions/python/TileCondToolConf.py index 07ff4f1bd53dcd95d4ec0b0c2bec1e827430d712..e834e1e763810b3c5f77e7c142ec6eba3a055c74 100644 --- a/TileCalorimeter/TileConditions/python/TileCondToolConf.py +++ b/TileCalorimeter/TileConditions/python/TileCondToolConf.py @@ -19,59 +19,101 @@ isUsedDataBaseRun2 = (conddb.GetInstance() == 'CONDBR2') validRunTypes = ['PHY','LAS', 'GAPLAS','CIS','PED','CISPULSE100','CISPULSE5P2','CISLEAK100','CISLEAK5P2'] validSources = ['COOL','FILE'] +from AthenaCommon.AlgSequence import AthSequencer +condSequence = AthSequencer("AthCondSeq") + +from TileConditions.TileConditionsConf import TileCalibCondAlg_TileCalibDrawerFlt_ as TileCalibFltCondAlg + +def bookTileCalibCondAlg(calibData, proxy): + + from AthenaCommon.AlgSequence import AthSequencer + condSequence = AthSequencer("AthCondSeq") + + calibCondAlg = calibData + 'CondAlg' + if not hasattr(condSequence, calibCondAlg): + condSequence += TileCalibFltCondAlg( name = calibCondAlg, + ConditionsProxy = proxy, + TileCalibData = calibData) + + # #____________________________________________________________________________ -def getTileCondToolEmscale(source='FILE', name='TileCondToolEmscale', **kwargs): +def getTileCondToolEmscale(source = 'FILE', name = 'TileCondToolEmscale', **kwargs): - if not source in validSources: raise(Exception("Invalid source: %s"%source)) + if not source in validSources: raise(Exception("Invalid source: %s" % source)) from TileConditions.TileConditionsConf import TileCondToolEmscale - #do some check for global flag here: if source='' and flag set, adopt flag + from AthenaCommon.AlgSequence import AthSequencer + condSequence = AthSequencer("AthCondSeq") + #do some check for global flag here: if source='' and flag set, adopt flag tool = None - if source=='COOL': - #==================================================== - #=== Connect COOL TileCondProxies to the tool - #==================================================== - from AthenaCommon.GlobalFlags import globalflags - if (globalflags.DataSource() != 'data'): onlunit = "Invalid" - else: onlunit = "OnlineMegaElectronVolts" - - if isOnline and isUsedDataBaseRun2: oflLasFibProxy = None - else: oflLasFibProxy = getTileCondProxy('COOL', 'Flt', 'oflLasFib', 'TileCondProxyCool_OflLasFib') - - tool = TileCondToolEmscale(name - , OnlCacheUnit = onlunit - , ProxyOflCisLin = getTileCondProxy('COOL', 'Flt', 'oflCisFitLin', 'TileCondProxyCool_OflCisLin') - , ProxyOflCisNln = getTileCondProxy('COOL', 'Flt', 'oflCisFitNln', 'TileCondProxyCool_OflCisNln') - , ProxyOflLasLin = getTileCondProxy('COOL', 'Flt', 'oflLasLin', 'TileCondProxyCool_OflLasLin') - , ProxyOflLasNln = getTileCondProxy('COOL', 'Flt', 'oflLasNln', 'TileCondProxyCool_OflLasNln') - , ProxyOflLasFib = oflLasFibProxy - , ProxyOflCes = getTileCondProxy('COOL', 'Flt', 'oflCes', 'TileCondProxyCool_OflCes' ) - , ProxyOflEms = getTileCondProxy('COOL', 'Flt', 'oflEms', 'TileCondProxyCool_OflEms' ) - , ProxyOnlCis = getTileCondProxy('COOL', 'Flt', 'onlCisLin', 'TileCondProxyCool_OnlCis' ) - , ProxyOnlLas = getTileCondProxy('COOL', 'Flt', 'onlLasLin', 'TileCondProxyCool_OnlLas' ) - , ProxyOnlCes = getTileCondProxy('COOL', 'Flt', 'onlCes', 'TileCondProxyCool_OnlCes' ) - , ProxyOnlEms = getTileCondProxy('COOL', 'Flt', 'onlEms', 'TileCondProxyCool_OnlEms' )) - else: - #======================================================== - #=== Connect FILE TileCondProxies to the tool (default) - #======================================================== - #--- Undoing "online" calibrations makes no sense here and is disabled - tool = TileCondToolEmscale(name - , OnlCacheUnit = "Invalid" - , ProxyOflCisLin = getTileCondProxy('FILE','Flt','TileDefault.cisFitLin','TileCondProxyFile_OflCisLin') - , ProxyOflCisNln = getTileCondProxy('FILE','Flt','TileDefault.cisFitNln','TileCondProxyFile_OflCisNln') - , ProxyOflLasLin = getTileCondProxy('FILE','Flt','TileDefault.lasLin' ,'TileCondProxyFile_OflLasLin') - , ProxyOflLasNln = getTileCondProxy('FILE','Flt','TileDefault.lasNln' ,'TileCondProxyFile_OflLasNln') - , ProxyOflLasFib = getTileCondProxy('FILE','Flt','TileDefault.lasFib' ,'TileCondProxyFile_OflLasFib') - , ProxyOflCes = getTileCondProxy('FILE','Flt','TileDefault.ces' ,'TileCondProxyFile_OflCes' ) - , ProxyOflEms = getTileCondProxy('FILE','Flt','TileDefault.ems' ,'TileCondProxyFile_OflEms' ) - , ProxyOnlCis = None - , ProxyOnlLas = None - , ProxyOnlCes = None - , ProxyOnlEms = None) - + + emScale = 'TileEMScale' + emScaleCondAlg = emScale + 'CondAlg' + + if not hasattr(condSequence, emScaleCondAlg): + + onlCacheUnit = "Invalid" + + if source == 'COOL': + #==================================================== + #=== Connect COOL TileCondProxies to the tool + #==================================================== + from AthenaCommon.GlobalFlags import globalflags + if (globalflags.DataSource() == 'data'): onlCacheUnit = "OnlineMegaElectronVolts" + + if isOnline and isUsedDataBaseRun2: oflLasFibProxy = None + else: oflLasFibProxy = getTileCondProxy('COOL', 'Flt', 'oflLasFib', 'TileCondProxyCool_OflLasFib') + + oflCisLinProxy = getTileCondProxy('COOL', 'Flt', 'oflCisFitLin', 'TileCondProxyCool_OflCisLin') + oflCisNlnProxy = getTileCondProxy('COOL', 'Flt', 'oflCisFitNln', 'TileCondProxyCool_OflCisNln') + oflLasLinProxy = getTileCondProxy('COOL', 'Flt', 'oflLasLin', 'TileCondProxyCool_OflLasLin') + oflLasNlnProxy = getTileCondProxy('COOL', 'Flt', 'oflLasNln', 'TileCondProxyCool_OflLasNln') + oflCesProxy = getTileCondProxy('COOL', 'Flt', 'oflCes', 'TileCondProxyCool_OflCes' ) + oflEmsProxy = getTileCondProxy('COOL', 'Flt', 'oflEms', 'TileCondProxyCool_OflEms' ) + onlCisProxy = getTileCondProxy('COOL', 'Flt', 'onlCisLin', 'TileCondProxyCool_OnlCis' ) + onlLasProxy = getTileCondProxy('COOL', 'Flt', 'onlLasLin', 'TileCondProxyCool_OnlLas' ) + onlCesProxy = getTileCondProxy('COOL', 'Flt', 'onlCes', 'TileCondProxyCool_OnlCes' ) + onlEmsProxy = getTileCondProxy('COOL', 'Flt', 'onlEms', 'TileCondProxyCool_OnlEms' ) + + else: + #======================================================== + #=== Connect FILE TileCondProxies to the tool (default) + #======================================================== + #--- Undoing "online" calibrations makes no sense here and is disabled + oflCisLinProxy = getTileCondProxy('FILE','Flt','TileDefault.cisFitLin','TileCondProxyFile_OflCisLin') + oflCisNlnProxy = getTileCondProxy('FILE','Flt','TileDefault.cisFitNln','TileCondProxyFile_OflCisNln') + oflLasLinProxy = getTileCondProxy('FILE','Flt','TileDefault.lasLin' ,'TileCondProxyFile_OflLasLin') + oflLasNlnProxy = getTileCondProxy('FILE','Flt','TileDefault.lasNln' ,'TileCondProxyFile_OflLasNln') + oflLasFibProxy = getTileCondProxy('FILE','Flt','TileDefault.lasFib' ,'TileCondProxyFile_OflLasFib') + oflCesProxy = getTileCondProxy('FILE','Flt','TileDefault.ces' ,'TileCondProxyFile_OflCes' ) + oflEmsProxy = getTileCondProxy('FILE','Flt','TileDefault.ems' ,'TileCondProxyFile_OflEms' ) + onlCisProxy = None + onlLasProxy = None + onlCesProxy = None + onlEmsProxy = None + + + from TileConditions.TileConditionsConf import TileEMScaleCondAlg + condSequence += TileEMScaleCondAlg( name = emScaleCondAlg, + OnlCacheUnit = onlCacheUnit, + OflCisLinProxy = oflCisLinProxy, + OflCisNlnProxy = oflCisNlnProxy, + OflLasLinProxy = oflLasLinProxy, + OflLasNlnProxy = oflLasNlnProxy, + OflLasFibProxy = oflLasFibProxy, + OflCesProxy = oflCesProxy, + OflEmsProxy = oflEmsProxy, + OnlCisProxy = onlCisProxy, + OnlLasProxy = onlLasProxy, + OnlCesProxy = onlCesProxy, + OnlEmsProxy = onlEmsProxy, + TileEMScale = emScale) + + + tool = TileCondToolEmscale(name, TileEMScale = emScale) + #=== set the arguments passed and return tool for n,v in kwargs.items(): setattr(tool, n, v) @@ -80,48 +122,77 @@ def getTileCondToolEmscale(source='FILE', name='TileCondToolEmscale', **kwargs): # #____________________________________________________________________________ def getTileExpertToolEmscale(source='FILE', name='TileExpertToolEmscale', **kwargs): + if not source in validSources: raise(Exception("Invalid source: %s"%source)) from TileConditions.TileConditionsConf import TileExpertToolEmscale + from AthenaCommon.AlgSequence import AthSequencer + condSequence = AthSequencer("AthCondSeq") + #do some check for global flag here: if source='' and flag set, adopt flag tool = None - if source=='COOL': - #==================================================== - #=== Connect COOL TileCondProxies to the tool - #==================================================== - tool = TileExpertToolEmscale(name, - OnlCacheUnit = "OnlineMegaElectronVolts", - ProxyOflCisLin = getTileCondProxy('COOL','Flt','oflCisFitLin','TileCondProxyCool_OflCisLin'), - ProxyOflCisNln = getTileCondProxy('COOL','Flt','oflCisFitNln','TileCondProxyCool_OflCisNln'), - ProxyOflLasLin = getTileCondProxy('COOL','Flt','oflLasLin' ,'TileCondProxyCool_OflLasLin'), - ProxyOflLasNln = getTileCondProxy('COOL','Flt','oflLasNln' ,'TileCondProxyCool_OflLasNln'), - ProxyOflLasFib = getTileCondProxy('COOL','Flt','oflLasFib' ,'TileCondProxyCool_OflLasFib'), - ProxyOflCes = getTileCondProxy('COOL','Flt','oflCes' ,'TileCondProxyCool_OflCes' ), - ProxyOflEms = getTileCondProxy('COOL','Flt','oflEms' ,'TileCondProxyCool_OflEms' ), - ProxyOnlCis = getTileCondProxy('COOL','Flt','onlCisLin' ,'TileCondProxyCool_OnlCis' ), - ProxyOnlLas = getTileCondProxy('COOL','Flt','onlLasLin' ,'TileCondProxyCool_OnlLas' ), - ProxyOnlCes = getTileCondProxy('COOL','Flt','onlCes' ,'TileCondProxyCool_OnlCes' ), - ProxyOnlEms = getTileCondProxy('COOL','Flt','onlEms' ,'TileCondProxyCool_OnlEms' )) - else: - #======================================================== - #=== Connect FILE TileCondProxies to the tool (default) - #======================================================== - #--- Undoing "online" calibrations makes no sense here and is disabled - tool = TileExpertToolEmscale(name, - OnlCacheUnit = "Invalid", - ProxyOflCisLin = getTileCondProxy('FILE','Flt','TileDefault.cisFitLin','TileCondProxyFile_OflCisLin'), - ProxyOflCisNln = getTileCondProxy('FILE','Flt','TileDefault.cisFitNln','TileCondProxyFile_OflCisNln'), - ProxyOflLasLin = getTileCondProxy('FILE','Flt','TileDefault.lasLin' ,'TileCondProxyFile_OflLasLin'), - ProxyOflLasNln = getTileCondProxy('FILE','Flt','TileDefault.lasNln' ,'TileCondProxyFile_OflLasNln'), - ProxyOflLasFib = getTileCondProxy('FILE','Flt','TileDefault.lasFib' ,'TileCondProxyFile_OflLasFib'), - ProxyOflCes = getTileCondProxy('FILE','Flt','TileDefault.ces' ,'TileCondProxyFile_OflCes' ), - ProxyOflEms = getTileCondProxy('FILE','Flt','TileDefault.ems' ,'TileCondProxyFile_OflEms' ), - ProxyOnlCis = None, - ProxyOnlLas = None, - ProxyOnlCes = None, - ProxyOnlEms = None) - + + emScale = 'TileEMScale' + emScaleCondAlg = emScale + 'CondAlg' + + if not hasattr(condSequence, emScaleCondAlg): + + if source == 'COOL': + #==================================================== + #=== Connect COOL TileCondProxies to the tool + #==================================================== + onlCacheUnit = "OnlineMegaElectronVolts", + oflCisLinProxy = getTileCondProxy('COOL','Flt','oflCisFitLin','TileCondProxyCool_OflCisLin') + oflCisNlnProxy = getTileCondProxy('COOL','Flt','oflCisFitNln','TileCondProxyCool_OflCisNln') + oflLasLinProxy = getTileCondProxy('COOL','Flt','oflLasLin' ,'TileCondProxyCool_OflLasLin') + oflLasNlnProxy = getTileCondProxy('COOL','Flt','oflLasNln' ,'TileCondProxyCool_OflLasNln') + oflLasFibProxy = getTileCondProxy('COOL','Flt','oflLasFib' ,'TileCondProxyCool_OflLasFib') + oflCesProxy = getTileCondProxy('COOL','Flt','oflCes' ,'TileCondProxyCool_OflCes' ) + oflEmsProxy = getTileCondProxy('COOL','Flt','oflEms' ,'TileCondProxyCool_OflEms' ) + onlCisProxy = getTileCondProxy('COOL','Flt','onlCisLin' ,'TileCondProxyCool_OnlCis' ) + onlLasProxy = getTileCondProxy('COOL','Flt','onlLasLin' ,'TileCondProxyCool_OnlLas' ) + onlCesProxy = getTileCondProxy('COOL','Flt','onlCes' ,'TileCondProxyCool_OnlCes' ) + onlEmsProxy = getTileCondProxy('COOL','Flt','onlEms' ,'TileCondProxyCool_OnlEms' ) + + else: + #======================================================== + #=== Connect FILE TileCondProxies to the tool (default) + #======================================================== + #--- Undoing "online" calibrations makes no sense here and is disabled + onlCacheUnit = "Invalid", + oflCisLinProxy = getTileCondProxy('FILE','Flt','TileDefault.cisFitLin','TileCondProxyFile_OflCisLin') + oflCisNlnProxy = getTileCondProxy('FILE','Flt','TileDefault.cisFitNln','TileCondProxyFile_OflCisNln') + oflLasLinProxy = getTileCondProxy('FILE','Flt','TileDefault.lasLin' ,'TileCondProxyFile_OflLasLin') + oflLasNlnProxy = getTileCondProxy('FILE','Flt','TileDefault.lasNln' ,'TileCondProxyFile_OflLasNln') + oflLasFibProxy = getTileCondProxy('FILE','Flt','TileDefault.lasFib' ,'TileCondProxyFile_OflLasFib') + oflCesProxy = getTileCondProxy('FILE','Flt','TileDefault.ces' ,'TileCondProxyFile_OflCes' ) + oflEmsProxy = getTileCondProxy('FILE','Flt','TileDefault.ems' ,'TileCondProxyFile_OflEms' ) + onlCisProxy = None + onlLasProxy = None + onlCesProxy = None + onlEmsProxy = None + + + from TileConditions.TileConditionsConf import TileEMScaleCondAlg + condSequence += TileEMScaleCondAlg( name = emScaleCondAlg, + OnlCacheUnit = onlCacheUnit, + OflCisLinProxy = oflCisLinProxy, + OflCisNlnProxy = oflCisNlnProxy, + OflLasLinProxy = oflLasLinProxy, + OflLasNlnProxy = oflLasNlnProxy, + OflLasFibProxy = oflLasFibProxy, + OflCesProxy = oflCesProxy, + OflEmsProxy = oflEmsProxy, + OnlCisProxy = onlCisProxy, + OnlLasProxy = onlLasProxy, + OnlCesProxy = onlCesProxy, + OnlEmsProxy = onlEmsProxy, + TileEMScale = emScale) + + + tool = TileExpertToolEmscale(name, TileEMScale = emScale) + #=== set the arguments passed and return tool for n,v in kwargs.items(): setattr(tool, n, v) @@ -130,25 +201,24 @@ def getTileExpertToolEmscale(source='FILE', name='TileExpertToolEmscale', **kwar # #____________________________________________________________________________ def getTileCondToolIntegrator(source = 'FILE', name = 'TileCondToolIntegrator', **kwargs): - + from TileConditions.TileConditionsConf import TileCondToolIntegrator - + #do some check for global flag here: if source='' and flag set, adopt flag - tool = None + integrator = 'TileIntegrator' + if source == 'COOL': #==================================================== #=== Connect COOL TileCondProxies to the tool #==================================================== - tool = TileCondToolIntegrator(name, - ProxyIntegrator = getTileCondProxy('COOL','Flt','oflIntGain','TileCondProxyCool_Integrator')) - + integratorProxy = getTileCondProxy('COOL','Flt','oflIntGain','TileCondProxyCool_Integrator') + elif source == 'FILE': #======================================================== #=== Connect FILE TileCondProxies to the tool (default) #======================================================== - tool = TileCondToolIntegrator(name, - ProxyIntegrator = getTileCondProxy('FILE','Flt','TileDefault.int','TileCondProxyFile_Integrator')) + integratorProxy = getTileCondProxy('FILE','Flt','TileDefault.int','TileCondProxyFile_Integrator') else: #==================================================== @@ -157,13 +227,14 @@ def getTileCondToolIntegrator(source = 'FILE', name = 'TileCondToolIntegrator', file_name = find_data_file(source) if file_name is not None: - tool = TileCondToolIntegrator(name - , ProxyIntegrator = getTileCondProxy('FILE', 'Flt', file_name, 'TileCondProxyFile_Integrator')) + integratorProxy = getTileCondProxy('FILE', 'Flt', file_name, 'TileCondProxyFile_Integrator') else: raise(Exception("Invalid source: %s" %source )) - + bookTileCalibCondAlg(integrator, integratorProxy) + tool = TileCondToolIntegrator(name, integrator) + #=== set the arguments passed and return tool for n,v in kwargs.items(): setattr(tool, n, v) @@ -172,39 +243,35 @@ def getTileCondToolIntegrator(source = 'FILE', name = 'TileCondToolIntegrator', # #____________________________________________________________________________ def getTileCondToolMuID(source = 'FILE', name = 'TileCondToolMuID', **kwargs): - + from TileConditions.TileConditionsConf import TileCondToolMuID - + #do some check for global flag here: if source='' and flag set, adopt flag - tool = None + muID = 'TileMuID' + if source == 'COOL': #==================================================== #=== Connect COOL TileCondProxies to the tool #==================================================== - tool = TileCondToolMuID(name - , ProxyMuID = getTileCondProxy('COOL','Flt','onlMuID','TileCondProxyCool_MuID')) - + muIdProxy = getTileCondProxy('COOL','Flt','onlMuID','TileCondProxyCool_MuID') elif source == 'FILE': #======================================================== #=== Connect FILE TileCondProxies to the tool (default) #======================================================== - tool = TileCondToolMuID(name - , ProxyMuID = getTileCondProxy('FILE','Flt','TileDefault.muid','TileCondProxyFile_MuID')) - + muIdProxy = getTileCondProxy('FILE','Flt','TileDefault.muid','TileCondProxyFile_MuID') else: #==================================================== #=== guess source is file name #==================================================== - file_name = find_data_file(source) if file_name is not None: - tool = TileCondToolMuID(name - , ProxyMuID = getTileCondProxy('FILE', 'Flt', file_name, 'TileCondProxyFile_MuID')) - + muIdProxy = getTileCondProxy('FILE', 'Flt', file_name, 'TileCondProxyFile_MuID') else: raise(Exception("Invalid source: %s" %source )) + bookTileCalibCondAlg(muID, muIdProxy) + tool = TileCondToolMuID(name, muID) #=== set the arguments passed and return tool for n,v in kwargs.items(): @@ -215,40 +282,34 @@ def getTileCondToolMuID(source = 'FILE', name = 'TileCondToolMuID', **kwargs): #____________________________________________________________________________ def getTileCondToolTiming(source = 'FILE', runType = 'PHY', online = False, name = 'TileCondToolTiming', **kwargs): - if not runType in validRunTypes: raise(Exception("Invalid run type %s"%runType)) from TileConditions.TileConditionsConf import TileCondToolTiming #do some check for global flag here: if source='' and flag set, adopt flag tool = None + timing = 'TileOnlineTiming' if online else 'TileTiming' + if source == 'COOL': sourcePrefix = 'onl' if online else 'ofl' if runType == 'PHY' or runType == 'PED': - tool = TileCondToolTiming(name - , ProxyAdcOffset = getTileCondProxy('COOL','Flt', sourcePrefix + 'TimeCphy','TileCondProxyCool_AdcOffset')) + adcOffsetProxy = getTileCondProxy('COOL','Flt', sourcePrefix + 'TimeCphy','TileCondProxyCool_AdcOffset') if runType == 'LAS': - tool = TileCondToolTiming(name - , ProxyAdcOffset = getTileCondProxy('COOL','Flt', sourcePrefix + 'TimeClas','TileCondProxyCool_AdcOffset')) + adcOffsetProxy = getTileCondProxy('COOL','Flt', sourcePrefix + 'TimeClas','TileCondProxyCool_AdcOffset') if runType == 'GAPLAS': - tool = TileCondToolTiming(name - , ProxyAdcOffset = getTileCondProxy('COOL','Flt', sourcePrefix + 'TimeCgapLas','TileCondProxyCool_AdcOffset')) + adcOffsetProxy = getTileCondProxy('COOL','Flt', sourcePrefix + 'TimeCgapLas','TileCondProxyCool_AdcOffset') if runType == 'CIS': - tool = TileCondToolTiming(name - , ProxyAdcOffset = getTileCondProxy('COOL','Flt', sourcePrefix + 'TimeCcis','TileCondProxyCool_AdcOffset')) + adcOffsetProxy = getTileCondProxy('COOL','Flt', sourcePrefix + 'TimeCcis','TileCondProxyCool_AdcOffset') elif source == 'FILE': #=== create tool if runType == 'PHY' or runType == 'PED': - tool = TileCondToolTiming(name - , ProxyAdcOffset = getTileCondProxy('FILE','Flt','TileDefault.tcphy','TileCondProxyFile_AdcOffset')) + adcOffsetProxy = getTileCondProxy('FILE','Flt','TileDefault.tcphy','TileCondProxyFile_AdcOffset') if runType == 'LAS': - tool = TileCondToolTiming(name - , ProxyAdcOffset = getTileCondProxy('FILE','Flt','TileDefault.tclas','TileCondProxyFile_AdcOffset')) + adcOffsetProxy = getTileCondProxy('FILE','Flt','TileDefault.tclas','TileCondProxyFile_AdcOffset') if runType == 'GAPLAS': raise(Exception("Invalid source %s " %source)) if runType == 'CIS': - tool = TileCondToolTiming(name - , ProxyAdcOffset = getTileCondProxy('FILE','Flt','TileDefault.tccis','TileCondProxyFile_AdcOffset')) + adcOffsetProxy = getTileCondProxy('FILE','Flt','TileDefault.tccis','TileCondProxyFile_AdcOffset') else: #==================================================== @@ -257,13 +318,13 @@ def getTileCondToolTiming(source = 'FILE', runType = 'PHY', online = False, name file_name = find_data_file(source) if file_name is not None: - tool = TileCondToolTiming(name - , ProxyAdcOffset = getTileCondProxy('FILE', 'Flt', file_name, 'TileCondProxyFile_AdcOffset')) - + adcOffsetProxy = getTileCondProxy('FILE', 'Flt', file_name, 'TileCondProxyFile_AdcOffset') else: raise(Exception("Invalid source: %s" %source )) - - + + bookTileCalibCondAlg(timing, adcOffsetProxy) + tool = TileCondToolTiming(name, TileTiming = timing) + #=== set the arguments passed and return tool for n,v in kwargs.items(): setattr(tool, n, v) @@ -277,64 +338,39 @@ def getTileCondToolPulseShape(source = 'FILE', runType = 'PHY', name = 'TileCond from TileConditions.TileConditionsConf import TileCondToolPulseShape #do some check for global flag here: if source='' and flag set, adopt flag - tool = None + pulseShape = 'TilePulseShape' + if source == 'COOL': #=== create tool if runType == 'PHY': - tool = TileCondToolPulseShape(name, - ProxyPulseShape = getTileCondProxy('COOL','Flt','oflPlsPhy','TileCondProxyCool_PulseShapePhy'), - ) + pulseShapeProxy = getTileCondProxy('COOL','Flt','oflPlsPhy','TileCondProxyCool_PulseShapePhy') if runType == 'LAS': - tool = TileCondToolPulseShape(name, - ProxyPulseShape = getTileCondProxy('COOL','Flt','oflPlsLas','TileCondProxyCool_PulseShapeLas'), - ) + pulseShapeProxy = getTileCondProxy('COOL','Flt','oflPlsLas','TileCondProxyCool_PulseShapeLas') if runType == 'CISPULSE100': - tool = TileCondToolPulseShape(name, - ProxyPulseShape = getTileCondProxy('COOL','Flt','oflPlsCisPl100','TileCondProxyCool_PulseShapeCisPl100'), - ) + pulseShapeProxy = getTileCondProxy('COOL','Flt','oflPlsCisPl100','TileCondProxyCool_PulseShapeCisPl100') if runType == 'CISPULSE5P2': - tool = TileCondToolPulseShape(name, - ProxyPulseShape = getTileCondProxy('COOL','Flt','oflPlsCisPl5p2','TileCondProxyCool_PulseShapeCisPl5p2'), - ) + pulseShapeProxy = getTileCondProxy('COOL','Flt','oflPlsCisPl5p2','TileCondProxyCool_PulseShapeCisPl5p2') if runType == 'CISLEAK100': - tool = TileCondToolPulseShape(name, - ProxyPulseShape = getTileCondProxy('COOL','Flt','oflPlsCisLk100','TileCondProxyCool_PulseShapeCisLk100'), - ) + pulseShapeProxy = getTileCondProxy('COOL','Flt','oflPlsCisLk100','TileCondProxyCool_PulseShapeCisLk100') if runType == 'CISLEAK5P2': - tool = TileCondToolPulseShape(name, - ProxyPulseShape = getTileCondProxy('COOL','Flt','oflPlsCisLk5p2','TileCondProxyCool_PulseShapeCisLk5p2'), - ) - + pulseShapeProxy = getTileCondProxy('COOL','Flt','oflPlsCisLk5p2','TileCondProxyCool_PulseShapeCisLk5p2') elif source == 'FILE': #==================================================== #=== create tool #==================================================== if runType == 'PHY': - tool = TileCondToolPulseShape(name, - ProxyPulseShape = getTileCondProxy('FILE','Flt','TileDefault.plsPhy','TileCondProxyFile_PulseShapePhy'), - ) + pulseShapeProxy = getTileCondProxy('FILE','Flt','TileDefault.plsPhy','TileCondProxyFile_PulseShapePhy') if runType == 'LAS': - tool = TileCondToolPulseShape(name, - ProxyPulseShape = getTileCondProxy('FILE','Flt','TileDefault.plsLas','TileCondProxyFile_PulseShapeLas'), - ) + pulseShapeProxy = getTileCondProxy('FILE','Flt','TileDefault.plsLas','TileCondProxyFile_PulseShapeLas') if runType == 'CISPULSE100': - tool = TileCondToolPulseShape(name, - ProxyPulseShape = getTileCondProxy('FILE','Flt','TileDefault.plsCisPulse100','TileCondProxyFile_PulseShapeCisPl100'), - ) + pulseShapeProxy = getTileCondProxy('FILE','Flt','TileDefault.plsCisPulse100','TileCondProxyFile_PulseShapeCisPl100') if runType == 'CISPULSE5P2': - tool = TileCondToolPulseShape(name, - ProxyPulseShape = getTileCondProxy('FILE','Flt','TileDefault.plsCisPulse5p2','TileCondProxyFile_PulseShapeCisPl5p2'), - ) + pulseShapeProxy = getTileCondProxy('FILE','Flt','TileDefault.plsCisPulse5p2','TileCondProxyFile_PulseShapeCisPl5p2') if runType == 'CISLEAK100': - tool = TileCondToolPulseShape(name, - ProxyPulseShape = getTileCondProxy('FILE','Flt','TileDefault.plsCisLeak100','TileCondProxyFile_PulseShapeCisLk100'), - ) + pulseShapeProxy = getTileCondProxy('FILE','Flt','TileDefault.plsCisLeak100','TileCondProxyFile_PulseShapeCisLk100') if runType == 'CISLEAK5P2': - tool = TileCondToolPulseShape(name, - ProxyPulseShape = getTileCondProxy('FILE','Flt','TileDefault.plsCisLeak5p2','TileCondProxyFile_PulseShapeCisLk5p2'), - ) - + pulseShapeProxy = getTileCondProxy('FILE','Flt','TileDefault.plsCisLeak5p2','TileCondProxyFile_PulseShapeCisLk5p2') else: #==================================================== @@ -343,19 +379,18 @@ def getTileCondToolPulseShape(source = 'FILE', runType = 'PHY', name = 'TileCond file_name = find_data_file(source) if file_name is not None: - tool = TileCondToolPulseShape(name - , ProxyPulseShape = getTileCondProxy('FILE', 'Flt', file_name, 'TileCondProxyFile_PulseShape')) - + pulseShapeProxy = getTileCondProxy('FILE', 'Flt', file_name, 'TileCondProxyFile_PulseShape') else: raise(Exception("Invalid source: %s" %source )) - - + bookTileCalibCondAlg(pulseShape, pulseShapeProxy) + tool = TileCondToolPulseShape(name, TilePulseShape = pulseShape) + #=== set the arguments passed and return tool for n,v in kwargs.items(): setattr(tool, n, v) return tool - + # #____________________________________________________________________________ def getTileCondToolMuRcvPulseShape(source = 'FILE', name = 'TileCondToolMuRcvPulseShape', **kwargs): @@ -363,6 +398,8 @@ def getTileCondToolMuRcvPulseShape(source = 'FILE', name = 'TileCondToolMuRcvPul from TileConditions.TileConditionsConf import TileCondToolPulseShape tool = None + muRcvPulseShape = 'TileMuRcvPulseShape' + if source == 'COOL': #==================================================== #=== Connect COOL TileCondProxies to the tool @@ -373,25 +410,19 @@ def getTileCondToolMuRcvPulseShape(source = 'FILE', name = 'TileCondToolMuRcvPul #======================================================== #=== Connect FILE TileCondProxies to the tool (default) #======================================================== - - tool = TileCondToolPulseShape(name - , ProxyPulseShape = getTileCondProxy('FILE','Flt','TileDefault.plsMuRcv','TileCondProxyFile_PulseShapeMuRcv')) - - + muRcvPulseShapeProxy = getTileCondProxy('FILE','Flt','TileDefault.plsMuRcv','TileCondProxyFile_PulseShapeMuRcv') else: #==================================================== #=== guess source is file name #==================================================== - file_name = find_data_file(source) if file_name is not None: - tool = TileCondToolPulseShape(name - , ProxyPulseShape = getTileCondProxy('FILE', 'Flt', file_name, 'TileCondProxyFile_PulseShapeMuRcv')) - + muRcvPulseShapeProxy = getTileCondProxy('FILE', 'Flt', file_name, 'TileCondProxyFile_PulseShapeMuRcv') else: raise(Exception("Invalid source: %s" %source )) - + bookTileCalibCondAlg(muRcvPulseShape, muRcvPulseShapeProxy) + tool = TileCondToolPulseShape(name, TilePulseShape = muRcvPulseShape) #=== set the arguments passed and return tool for n,v in kwargs.items(): @@ -405,6 +436,54 @@ def getTileBadChanTool(source = 'FILE', name = 'TileBadChanTool', **kwargs): if not source in validSources: raise(Exception("Invalid source: %s"%source)) from TileConditions.TileConditionsConf import TileBadChanTool + from AthenaCommon.AlgSequence import AthSequencer + condSequence = AthSequencer("AthCondSeq") + + #do some check for global flag here: if source='' and flag set, adopt flag + + tool = None + + badChannels = 'TileBadChannels' + badChannelsCondAlg = badChannels + 'CondAlg' + + if not hasattr(condSequence, badChannelsCondAlg): + + if source == 'COOL': + #==================================================== + #=== Connect COOL TileCondProxies to the tool + #==================================================== + if isOnline and isUsedDataBaseRun2: offlineBadChannelsProxy = None + else: offlineBadChannelsProxy = getTileCondProxy('COOL','Bch','oflStatAdc','TileCondProxyCool_OflBch') + onlineBadChannelsProxy = getTileCondProxy('COOL','Bch','onlStatAdc','TileCondProxyCool_OnlBch') + else: + #======================================================== + #=== Connect FILE TileCondProxies to the tool (default) + #======================================================== + onlineBadChannelsProxy = getTileCondProxy('FILE','Bch','TileDefault.onlBch','TileCondProxyFile_OnlBch') + offlineBadChannelsProxy = getTileCondProxy('FILE','Bch','TileDefault.oflBch','TileCondProxyFile_OflBch') + + + from TileConditions.TileConditionsConf import TileBadChannelsCondAlg + condSequence += TileBadChannelsCondAlg( name = badChannelsCondAlg, + OnlBchProxy = onlineBadChannelsProxy, + OflBchProxy = offlineBadChannelsProxy, + TileBadChannels = badChannels) + + tool = TileBadChanTool(name, TileBadChannels = badChannels) + + #=== set the arguments passed and return tool + for n,v in kwargs.items(): + setattr(tool, n, v) + return tool + + +# +#____________________________________________________________________________ +def getTileBadChanLegacyTool(source = 'FILE', name = 'TileBadChanLegacyTool', **kwargs): + + if not source in validSources: raise(Exception("Invalid source: %s"%source)) + from TileConditions.TileConditionsConf import TileBadChanLegacyTool + #do some check for global flag here: if source='' and flag set, adopt flag tool = None @@ -415,56 +494,60 @@ def getTileBadChanTool(source = 'FILE', name = 'TileBadChanTool', **kwargs): if isOnline and isUsedDataBaseRun2: oflBchProxy = None else: oflBchProxy = getTileCondProxy('COOL','Bch','oflStatAdc','TileCondProxyCool_OflBch') - tool = TileBadChanTool(name - , ProxyOnlBch = getTileCondProxy('COOL','Bch','onlStatAdc','TileCondProxyCool_OnlBch') - , ProxyOflBch = oflBchProxy) - + tool = TileBadChanLegacyTool(name + , ProxyOnlBch = getTileCondProxy('COOL','Bch','onlStatAdc','TileCondProxyCool_OnlBch') + , ProxyOflBch = oflBchProxy) + else: #======================================================== #=== Connect FILE TileCondProxies to the tool (default) #======================================================== - tool = TileBadChanTool(name - , ProxyOnlBch = getTileCondProxy('FILE','Bch','TileDefault.onlBch','TileCondProxyFile_OnlBch') - , ProxyOflBch = getTileCondProxy('FILE','Bch','TileDefault.oflBch','TileCondProxyFile_OflBch')) + tool = TileBadChanLegacyTool(name + , ProxyOnlBch = getTileCondProxy('FILE','Bch','TileDefault.onlBch','TileCondProxyFile_OnlBch') + , ProxyOflBch = getTileCondProxy('FILE','Bch','TileDefault.oflBch','TileCondProxyFile_OflBch')) + - #=== set the arguments passed and return tool for n,v in kwargs.items(): setattr(tool, n, v) - return tool + return tool # #____________________________________________________________________________ def getTileCondToolNoiseSample(source = 'FILE', name = 'TileCondToolNoiseSample', **kwargs): - + from TileConditions.TileConditionsConf import TileCondToolNoiseSample - + #do some check for global flag here: if source='' and flag set, adopt flag + tool = None + sampleNoise = 'TileSampleNoise' + + if isOnline or not isUsedDataBaseRun2: onlineSampleNoiseProxy = None + else: onlineSampleNoiseProxy = getTileCondProxy('COOL','Flt','onlNoiseAdc','TileCondProxyCool_OnlineNoiseSample') - if isOnline or not isUsedDataBaseRun2: onlNoiseSampleProxy = None - else: onlNoiseSampleProxy = getTileCondProxy('COOL','Flt','onlNoiseAdc','TileCondProxyCool_OnlineNoiseSample') + onlineSampleNoise = 'TileOnlineSampleNoise' if onlineSampleNoiseProxy else '' - if source == 'COOL': + if source == 'COOL': #==================================================== #=== Connect COOL TileCondProxies to the tool #==================================================== - tool = TileCondToolNoiseSample(name, - ProxyNoiseSample = getTileCondProxy('COOL','Flt','oflNoiseAdc','TileCondProxyCool_NoiseSample'), - ProxyOnlineNoiseSample = onlNoiseSampleProxy) -# ProxyNoiseAutoCr = getTileCondProxy('COOL','Flt','oflNoiseAcr','TileCondProxyCool_NoiseAutoCr')) - + sampleNoiseProxy = getTileCondProxy('COOL','Flt','oflNoiseAdc','TileCondProxyCool_NoiseSample') else: #======================================================== #=== Connect FILE TileCondProxies to the tool (default) #======================================================== - tool = TileCondToolNoiseSample(name, - ProxyNoiseSample = getTileCondProxy('FILE','Flt','TileDefault.ped','TileCondProxyFile_NoiseSample'), - ProxyOnlineNoiseSample = None) -# ProxyNoiseAutoCr = getTileCondProxy('FILE','Flt','TileDefault.acr','TileCondProxyFile_NoiseAutoCr')) - + sampleNoiseProxy = getTileCondProxy('FILE','Flt','TileDefault.ped','TileCondProxyFile_NoiseSample') + + bookTileCalibCondAlg(sampleNoise, sampleNoiseProxy) + if (onlineSampleNoiseProxy): bookTileCalibCondAlg(onlineSampleNoise, onlineSampleNoiseProxy) + + tool = TileCondToolNoiseSample(name, + TileSampleNoise = sampleNoise, + TileOnlineSampleNoise = onlineSampleNoise) + #=== set the arguments passed and return tool for n,v in kwargs.items(): setattr(tool, n, v) @@ -473,26 +556,26 @@ def getTileCondToolNoiseSample(source = 'FILE', name = 'TileCondToolNoiseSample' # #____________________________________________________________________________ def getTileCondToolAutoCr(source = 'FILE', name = 'TileCondToolAutoCr', **kwargs): - + from TileConditions.TileConditionsConf import TileCondToolAutoCr - + #do some check for global flag here: if source='' and flag set, adopt flag - + tool = None + + autoCorrelation = 'TileAutoCorrelation' + if source == 'COOL': #==================================================== #=== Connect COOL TileCondProxies to the tool #==================================================== - tool = TileCondToolAutoCr(name - , ProxyNoiseAutoCr = getTileCondProxy('COOL','Flt','oflNoiseAcr','TileCondProxyCool_NoiseAutoCr')) - + autoCorrelationProxy = getTileCondProxy('COOL','Flt','oflNoiseAcr','TileCondProxyCool_NoiseAutoCr') + elif source == 'FILE': #======================================================== #=== Connect FILE TileCondProxies to the tool (default) #======================================================== - tool = TileCondToolAutoCr(name - , ProxyNoiseAutoCr = getTileCondProxy('FILE','Flt','TileDefault.acr','TileCondProxyFile_NoiseAutoCr')) - + autoCorrelationProxy = getTileCondProxy('FILE','Flt','TileDefault.acr','TileCondProxyFile_NoiseAutoCr') else: #==================================================== @@ -501,12 +584,13 @@ def getTileCondToolAutoCr(source = 'FILE', name = 'TileCondToolAutoCr', **kwargs file_name = find_data_file(source) if file_name is not None: - tool = TileCondToolAutoCr(name - , ProxyNoiseAutoCr = getTileCondProxy('FILE', 'Flt', file_name, 'TileCondProxyFile_NoiseAutoCr')) + autoCorrelationProxy = getTileCondProxy('FILE', 'Flt', file_name, 'TileCondProxyFile_NoiseAutoCr') else: raise(Exception("Invalid source: %s" %source )) + bookTileCalibCondAlg(autoCorrelation, autoCorrelationProxy) + tool = TileCondToolAutoCr(name, TileAutoCorrelation = autoCorrelation) #=== set the arguments passed and return tool for n,v in kwargs.items(): @@ -516,40 +600,37 @@ def getTileCondToolAutoCr(source = 'FILE', name = 'TileCondToolAutoCr', **kwargs # #____________________________________________________________________________ def getTileCondToolNoiseRawChn(source = 'FILE', name = 'TileCondToolNoiseRawChn', **kwargs): - + from TileConditions.TileConditionsConf import TileCondToolNoiseRawChn - + #do some check for global flag here: if source='' and flag set, adopt flag - + tool = None + + rawChannelNoise = 'TileRawChannelNoise' + if source == 'COOL': #==================================================== #=== Connect COOL TileCondProxies to the tool #==================================================== - tool = TileCondToolNoiseRawChn(name - , ProxyNoiseRawChn = getTileCondProxy('COOL','Flt','onlNoise1gOfni','TileCondProxyCool_NoiseRawChn')) - - elif source == 'FILE': + rawChannelNoiseProxy = getTileCondProxy('COOL','Flt','onlNoise1gOfni','TileCondProxyCool_NoiseRawChn') + elif source == 'FILE': #======================================================== #=== Connect FILE TileCondProxies to the tool (default) #======================================================== - tool = TileCondToolNoiseRawChn(name - , ProxyNoiseRawChn = getTileCondProxy('FILE','Flt','TileDefault.rchFit','TileCondProxyFile_NoiseRawChn')) - - + rawChannelNoiseProxy = getTileCondProxy('FILE','Flt','TileDefault.rchFit','TileCondProxyFile_NoiseRawChn') else: #==================================================== #=== guess source is file name #==================================================== - file_name = find_data_file(source) if file_name is not None: - tool = TileCondToolNoiseRawChn(name - , ProxyNoiseRawChn = getTileCondProxy('FILE', 'Flt', file_name, 'TileCondProxyFile_NoiseRawChn')) - + rawChannelNoiseProxy = getTileCondProxy('FILE', 'Flt', file_name, 'TileCondProxyFile_NoiseRawChn') else: raise(Exception("Invalid source: %s" %source )) + bookTileCalibCondAlg(rawChannelNoise, rawChannelNoiseProxy) + tool = TileCondToolNoiseRawChn(name, TileRawChannelNoise = rawChannelNoise) #=== set the arguments passed and return tool for n, v in kwargs.items(): @@ -560,16 +641,16 @@ def getTileCondToolNoiseRawChn(source = 'FILE', name = 'TileCondToolNoiseRawChn' # #____________________________________________________________________________ def getTileCellNoiseTool(source = 'FILE', name = 'TileCellNoiseTool', **kwargs): - + if not source in validSources: raise(Exception("Invalid source: %s"%source)) from TileConditions.TileConditionsConf import TileCellNoiseTool - + #do some check for global flag here: if source='' and flag set, adopt flag #=== create private noise source noiseSource = getTileCondToolNoiseRawChn(source, "TileToolNoiseRawChnForNoiseTool") tool = TileCellNoiseTool(name, NoiseSource = noiseSource) - + #=== set the arguments passed and return tool for n,v in kwargs.items(): setattr(tool, n, v) @@ -582,32 +663,48 @@ def getTileCondToolOfcCool(source = 'FILE', runType = 'PHY', ofcType = 'OF2', na if not source in validSources : raise(Exception("Invalid source: %s" % source )) if not runType in validRunTypes: raise(Exception("Invalid run type %s" % runType)) + from TileConditions.TileConditionsConf import TileCondToolOfcCool + from AthenaCommon.AlgSequence import AthSequencer + condSequence = AthSequencer("AthCondSeq") + #do some check for global flag here: if source='' and flag set, adopt flag from AthenaCommon.GlobalFlags import globalflags isMC = (globalflags.DataSource() != 'data') tool = None + if source == 'COOL': # There are OFC for OF1 only in DB used in Run2 if ofcType == 'OF1' and not (isUsedDataBaseRun2 or isMC): return None from TileCoolMgr import GetTileOfcCoolSource, AddTileOfcCoolSource, tileCoolMgr - - proxySource = GetTileOfcCoolSource(ofcType, runType) - if not tileCoolMgr.isSourceAvailable(proxySource): - splitOnline = isUsedDataBaseRun2 and (runType == 'PHY') - AddTileOfcCoolSource(ofcType, runType, splitOnline) - - proxyName = 'TileCondProxyCool_' + proxySource - tool = TileCondToolOfcCool(name, ProxyOfcCool = getTileCondProxy('COOL', 'Ofc', proxySource, proxyName)) + ofc = 'TileOfc' + ofcType.capitalize() + ofcCondAlg = ofc + 'CondAlg' + + if not hasattr(condSequence, ofcCondAlg): + proxySource = GetTileOfcCoolSource(ofcType, runType) + if not tileCoolMgr.isSourceAvailable(proxySource): + splitOnline = isUsedDataBaseRun2 and (runType == 'PHY') + AddTileOfcCoolSource(ofcType, runType, splitOnline) + + proxyName = 'TileCondProxyCool_' + proxySource + ofcCoolProxy = getTileCondProxy('COOL', 'Ofc', proxySource, proxyName) + + from TileConditions.TileConditionsConf import TileCalibCondAlg_TileCalibDrawerOfc_ as TileCalibOfcCondAlg + condSequence += TileCalibOfcCondAlg( name = ofcCondAlg, + ConditionsProxy = ofcCoolProxy, + TileCalibData = ofc) + + tool = TileCondToolOfcCool(name, TileOfc = ofc) else: raise(Exception("Invalid source %s" % source)) - + + #=== set the arguments passed and return tool for n,v in kwargs.items(): setattr(tool, n, v) @@ -625,28 +722,39 @@ def getTileCondToolTMDB(source = 'FILE', runType = 'PHY', name = 'TileCondToolTM tool = None if not isUsedDataBaseRun2: return None - - if source == 'COOL': + + TMDBThreshold = 'TileTMDBThreshold' + TMDBDelay = 'TileTMDBDelay' + TMDBTMF = 'TileTMDBTMF' + TMDBCalib = 'TileTMDBCalib' + + if source == 'COOL': run = string.capwords(runType) #==================================================== #=== Connect COOL TileCondProxies to the tool #==================================================== - tool = TileCondToolTMDB(name, - ProxyThreshold = getTileCondProxy('COOL', 'Flt', 'onlTmdbThreshold' + run, 'TileCondProxyCool_TmdbThreshold' + run), - ProxyDelay = getTileCondProxy('COOL', 'Flt', 'onlTmdbDelay' + run, 'TileCondProxyCool_TmdbDelay' + run), - ProxyTMF = getTileCondProxy('COOL', 'Flt', 'onlTmdbTmf' + run, 'TileCondProxyCool_TmdbTmf' + run), - ProxyCalib = getTileCondProxy('COOL', 'Flt', 'onlTmdbCalibPhy', 'TileCondProxyCool_TmdbCalibPhy')) - - + TMDBThresholdProxy = getTileCondProxy('COOL', 'Flt', 'onlTmdbThreshold' + run, 'TileCondProxyCool_TMDBThreshold' + run) + TMDBDelayProxy = getTileCondProxy('COOL', 'Flt', 'onlTmdbDelay' + run, 'TileCondProxyCool_TMDBDelay' + run) + TMDBTMFProxy = getTileCondProxy('COOL', 'Flt', 'onlTmdbTmf' + run, 'TileCondProxyCool_TMDBTmf' + run) + TMDBCalibProxy = getTileCondProxy('COOL', 'Flt', 'onlTmdbCalibPhy', 'TileCondProxyCool_TMDBCalibPhy') - else: #======================================================== #=== Connect FILE TileCondProxies to the tool (default) #======================================================== raise(Exception("Invalid source %s" % source)) - + bookTileCalibCondAlg(TMDBThreshold, TMDBThresholdProxy) + bookTileCalibCondAlg(TMDBDelay, TMDBDelayProxy) + bookTileCalibCondAlg(TMDBTMF, TMDBTMFProxy) + bookTileCalibCondAlg(TMDBCalib, TMDBCalibProxy) + + tool = TileCondToolTMDB(name, + TileTMDBThreshold = TMDBThreshold, + TileTMDBDelay = TMDBDelay, + TileTMDBTMF = TMDBTMF, + TileTMDBCalib = TMDBCalib) + #=== set the arguments passed and return tool for n,v in kwargs.items(): setattr(tool, n, v) @@ -657,45 +765,38 @@ def getTileCondToolTMDB(source = 'FILE', runType = 'PHY', name = 'TileCondToolTM # #____________________________________________________________________________ def getTileCondToolDspThreshold(source = 'FILE', name = 'TileCondToolDspThreshold', **kwargs): - + from TileConditions.TileConditionsConf import TileCondToolDspThreshold - + #do some check for global flag here: if source='' and flag set, adopt flag - tool = None + dspThreshold = 'TileDSP_Threshold' if source == 'COOL': #==================================================== #=== Connect COOL TileCondProxies to the tool #==================================================== - if not isUsedDataBaseRun2: return None - - tool = TileCondToolDspThreshold(name, - ProxyDspThreshold = getTileCondProxy('COOL', 'Flt', 'oflDspThreshold', 'TileCondProxyCool_DspThreshold')) - + dspThresholdProxy = getTileCondProxy('COOL', 'Flt', 'oflDspThreshold', 'TileCondProxyCool_DspThreshold') elif source == 'FILE': #======================================================== #=== Connect FILE TileCondProxies to the tool (default) #======================================================== - tool = TileCondToolDspThreshold(name, - ProxyDspThreshold = getTileCondProxy('FILE', 'Flt', 'TileDefault.dspThreshold', 'TileCondProxyFile_DspThreshold')) - - + dspThresholdProxy = getTileCondProxy('FILE', 'Flt', 'TileDefault.dspThreshold', 'TileCondProxyFile_DspThreshold') else: #==================================================== #=== guess source is file name #==================================================== - file_name = find_data_file(source) if file_name is not None: - tool = TileCondToolDspThreshold(name, - ProxyDspThreshold = getTileCondProxy('FILE', 'Flt', file_name, 'TileCondProxyFile_DspThreshold')) - + dspThresholdProxy = getTileCondProxy('FILE', 'Flt', file_name, 'TileCondProxyFile_DspThreshold') else: raise(Exception("Invalid source: %s" %source )) + bookTileCalibCondAlg(dspThreshold, dspThresholdProxy) + tool = TileCondToolDspThreshold(name, TileDSP_Threshold = dspThreshold) + #=== set the arguments passed and return tool for n, v in kwargs.items(): setattr(tool, n, v) @@ -717,5 +818,5 @@ def find_data_file(fname, pathlist = None, access = os.R_OK): f = os.path.join( path, fname ) if os.access( f, access ): return f - + return None diff --git a/TileCalorimeter/TileConditions/python/TileInfoConfigurator.py b/TileCalorimeter/TileConditions/python/TileInfoConfigurator.py index db7b5ce05cbd783c5f942c7dc2187307dc946fe2..884160686ac1affb7a97e7d7f99cd6e394d7f497 100644 --- a/TileCalorimeter/TileConditions/python/TileInfoConfigurator.py +++ b/TileCalorimeter/TileConditions/python/TileInfoConfigurator.py @@ -2,7 +2,7 @@ ############################################################## # -# TileInfoConfigurator class +# TileInfoConfigurator class # # used to set up the TileInfoLoader service # @@ -10,6 +10,7 @@ # Modified: lukas.pribyl@cern.ch ############################################################# + from AthenaCommon import CfgMgr TileInfoLoader = CfgMgr.TileInfoLoader @@ -18,7 +19,7 @@ class _TileInfoConfigurator( TileInfoLoader ): TileInfoLoader with additional state """ __slots__ = { - '_coolIsConfigured' : False, + '_coolIsConfigured' : False, '_coolofcIsConfigured': False, '_coolof1ofcIsConfigured': False, '_coolcispulseIsConfigured': False, @@ -54,7 +55,7 @@ class _TileInfoConfigurator( TileInfoLoader ): """ #=== One can use loggers but not as a datamember of configurables as loggers' #=== instances can't be pickled. Hence we use _msg as a property - + #=== initialize logger with INFO level import AthenaCommon.Logging as L msg = L.logging.getLogger('TileInfoConf.') @@ -78,11 +79,15 @@ class _TileInfoConfigurator( TileInfoLoader ): #=== connect all tools to COOL from AthenaCommon.AppMgr import ToolSvc - + self._msg.info("Changing default TileBadChanTool configuration to COOL source") from .TileCondToolConf import getTileBadChanTool ToolSvc += getTileBadChanTool('COOL') + self._msg.info("Changing default TileBadChanLegacyTool configuration to COOL source") + from .TileCondToolConf import getTileBadChanLegacyTool + ToolSvc += getTileBadChanLegacyTool('COOL') + self._msg.info("Changing default TileCondToolEmscale configuration to COOL source") from .TileCondToolConf import getTileCondToolEmscale ToolSvc += getTileCondToolEmscale('COOL') @@ -94,15 +99,15 @@ class _TileInfoConfigurator( TileInfoLoader ): # self._msg.info("Changing default TileCondToolNoiseAutoCr configuration to COOL source") # from .TileCondToolConf import getTileCondToolAutoCr # ToolSvc += getTileCondToolAutoCr('COOL') - + #self._msg.info("Changing default TileCondToolNoiseRawChn configuration to COOL source") #from .TileCondToolConf import getTileCondToolNoiseRawChn #ToolSvc += getTileCondToolNoiseRawChn('COOL') - + self._msg.info("Changing default TileCondToolTiming configuration to COOL source") from .TileCondToolConf import getTileCondToolTiming ToolSvc += getTileCondToolTiming('COOL',type) - + # self._msg.info("Changing default TileCondToolPulseShape configuration to COOL source") # from .TileCondToolConf import getTileCondToolPulseShape # ToolSvc += getTileCondToolPulseShape('COOL') @@ -166,7 +171,7 @@ class _TileInfoConfigurator( TileInfoLoader ): - defTag : Tag to be added to each folder tag (NGO change this to a hierarchical tag!) - dbConnection : The DB connection string to use [default "": auto-initialization by CondDBSetup.py] - type Pulse type - PHY or LAS or CIS - - online : Read time from online COOL folder always + - online : Read time from online COOL folder always """ name = 'TileCondToolTiming' @@ -185,7 +190,7 @@ class _TileInfoConfigurator( TileInfoLoader ): #=== connect TileCondToolTiming to COOL from AthenaCommon.AppMgr import ToolSvc - + self._msg.info("Changing default TileCondToolTiming configuration to COOL source") from .TileCondToolConf import getTileCondToolTiming ToolSvc += getTileCondToolTiming('COOL', type, online, name ) @@ -226,7 +231,7 @@ class _TileInfoConfigurator( TileInfoLoader ): #=== connect all tools to COOL from AthenaCommon.AppMgr import ToolSvc - + self._msg.info("Changing default TileCondToolPulseShape configuration to COOL source") from .TileCondToolConf import getTileCondToolPulseShape ToolSvc += getTileCondToolPulseShape('COOL','CISPULSE100','TileCondToolPulseShape') @@ -251,7 +256,7 @@ class _TileInfoConfigurator( TileInfoLoader ): #=== connect TileCondToolOfcCool to COOL from AthenaCommon.AppMgr import ToolSvc - + self._msg.info("Changing default TileCondToolPulseShape configuration to COOL source") from .TileCondToolConf import getTileCondToolPulseShape ToolSvc += getTileCondToolPulseShape('COOL','LAS','TileCondToolPulseShape') @@ -273,7 +278,7 @@ class _TileInfoConfigurator( TileInfoLoader ): #=== connect TileCondToolOfcCool to COOL from AthenaCommon.AppMgr import ToolSvc - + self._msg.info("Changing default TileCondToolPHYPULSECool configuration to COOL source") from .TileCondToolConf import getTileCondToolPulseShape ToolSvc += getTileCondToolPulseShape('COOL') @@ -295,7 +300,7 @@ class _TileInfoConfigurator( TileInfoLoader ): #=== connect TileCondToolIntegrator to COOL from AthenaCommon.AppMgr import ToolSvc - + self._msg.info("Changing default TileCondToolIntegrator configuration to COOL source") from .TileCondToolConf import getTileCondToolIntegrator ToolSvc += getTileCondToolIntegrator('COOL','TileCondToolIntegrator') @@ -317,7 +322,7 @@ class _TileInfoConfigurator( TileInfoLoader ): #=== connect TileCondToolMuID to COOL from AthenaCommon.AppMgr import ToolSvc - + self._msg.info("Changing default TileCondToolMuID configuration to COOL source") from .TileCondToolConf import getTileCondToolMuID ToolSvc += getTileCondToolMuID('COOL','TileCondToolMuID') @@ -340,7 +345,7 @@ class _TileInfoConfigurator( TileInfoLoader ): #=== connect TileCondToolMuID to COOL from AthenaCommon.AppMgr import ToolSvc - + self._msg.info("Changing default TileCondToolNoiseAutoCr configuration to COOL source") from .TileCondToolConf import getTileCondToolAutoCr ToolSvc += getTileCondToolAutoCr('COOL','TileCondToolAutoCr') @@ -362,10 +367,10 @@ class _TileInfoConfigurator( TileInfoLoader ): #=== connect TileExpertToolEmscale to COOL from AthenaCommon.AppMgr import ToolSvc - + self._msg.info("Changing default TileExpertToolEmscale configuration to COOL source") from .TileCondToolConf import getTileExpertToolEmscale - ToolSvc += getTileExpertToolEmscale('COOL') + ToolSvc += getTileExpertToolEmscale('COOL') return @@ -377,26 +382,41 @@ class _TileInfoConfigurator( TileInfoLoader ): - defTag : Tag to be added to each folder tag (NGO change this to a hierarchical tag!) - dbConnection : The DB connection string to use [default "": auto-initialization by CondDBSetup.py] """ + from AthenaCommon.AlgSequence import AthSequencer + condSequence = AthSequencer("AthCondSeq") #=== prevent a second initialization if self._coolDCSIsConfigured: self._msg.info("setupCOOLDCS already called previously, ignoring this repeated call!") return self._coolDCSIsConfigured = True - + ## #=== ensure the availability of TileDCSSvc from AthenaCommon.GlobalFlags import globalflags from AthenaCommon.AthenaCommonFlags import athenaCommonFlags TileUseDCS = (not athenaCommonFlags.isOnline()) and globalflags.DataSource()=='data' ## get a handle to the ServiceManager - from AthenaCommon.AppMgr import ServiceMgr as svcMgr - if TileUseDCS and not hasattr(svcMgr, "TileDCSSvc"): + + dcs = 'TileDCS' + dcsCondAlg = dcs + 'CondAlg' + if TileUseDCS and not hasattr(condSequence, dcsCondAlg): self._msg.info("setting up DCS TileCal conditions data") dbConnStr = 'DCS_OFL' from IOVDbSvc.CondDB import conddb - if useHV: conddb.addFolder(dbConnStr, "/TILE/DCS/HV") - if useHVSET: conddb.addFolder(dbConnStr, "/TILE/DCS/HVSET") - if useSTATUS: conddb.addFolder(dbConnStr, "/TILE/DCS/STATES") + if useHV: conddb.addFolder(dbConnStr, "/TILE/DCS/HV", className = 'CondAttrListCollection') + if useHVSET: conddb.addFolder(dbConnStr, "/TILE/DCS/HVSET", className = 'CondAttrListCollection') + if useSTATUS: conddb.addFolder(dbConnStr, "/TILE/DCS/STATES", className = 'CondAttrListCollection') + + from TileConditions.TileConditionsConf import TileDCSCondAlg + condSequence += TileDCSCondAlg(name = dcsCondAlg, + ReadHV = useHV, + ReadHVSET = useHVSET, + ReadSTATES = useSTATUS, + TileDCS = dcs) + + from AthenaCommon.AppMgr import ServiceMgr as svcMgr + if TileUseDCS and not hasattr(svcMgr, "TileDCSSvc"): + self._msg.info("Adding TileDCSSvc to ServiceMgr") svcMgr += CfgMgr.TileDCSSvc() @@ -435,9 +455,9 @@ class _TileInfoConfigurator( TileInfoLoader ): else: return False - + #_______________________________________________________________ - + def TileInfoConfigurator(name="TileInfoLoader", **kwargs): """ factory function to create readily configured TileInfoLoader instances @@ -451,11 +471,11 @@ def TileInfoConfigurator(name="TileInfoLoader", **kwargs): svc = getattr (svcMgr, svcName) #--- trying to create duplicate, returning original return svc - + svc = _TileInfoConfigurator(svcName, **kwargs) from AthenaCommon import CfgMgr - + #=== add to ServiceMgr from AthenaCommon.AppMgr import ServiceMgr as svcMgr if not hasattr( svcMgr , svcName ): @@ -474,26 +494,33 @@ def TileInfoConfigurator(name="TileInfoLoader", **kwargs): #=== ensure the configuration of all needed tools from AthenaCommon.AppMgr import ToolSvc - if not hasattr(ToolSvc, "TileBadChanTool"): - svc._msg.info("Adding default TileBadChanTool to ToolSvc") - from .TileCondToolConf import getTileBadChanTool - ToolSvc += getTileBadChanTool() - if not hasattr(ToolSvc, "TileCondToolOfc"): - svc._msg.info("Adding default TileCondToolOfc to ToolSvc") - from .TileConditionsConf import TileCondToolOfc - ToolSvc += TileCondToolOfc() - if not hasattr(ToolSvc, "TileCondToolEmscale"): - svc._msg.info("Adding default TileCondToolEmscale to ToolSvc") - from .TileCondToolConf import getTileCondToolEmscale - ToolSvc += getTileCondToolEmscale() + +# if not hasattr(ToolSvc, "TileBadChanTool"): +# svc._msg.info("Adding default TileBadChanTool to ToolSvc") +# from .TileCondToolConf import getTileBadChanTool +# ToolSvc += getTileBadChanTool() +# if not hasattr(ToolSvc, "TileCondToolOfc"): +# svc._msg.info("Adding default TileCondToolOfc to ToolSvc") +# from .TileConditionsConf import TileCondToolOfc +# ToolSvc += TileCondToolOfc() +# if not hasattr(ToolSvc, "TileCondToolEmscale"): +# svc._msg.info("Adding default TileCondToolEmscale to ToolSvc") +# from .TileCondToolConf import getTileCondToolEmscale +# ToolSvc += getTileCondToolEmscale() + + #if not hasattr(ToolSvc, "TileCondToolIntegrator"): # svc._msg.info("Adding default TileCondToolIntegrator to ToolSvc") # from .TileCondToolConf import getTileCondToolIntegrator # ToolSvc += getTileCondToolIntegrator() - if not hasattr(ToolSvc, "TileCondToolNoiseSample"): - svc._msg.info("Adding default TileCondToolNoiseSample to ToolSvc") - from .TileCondToolConf import getTileCondToolNoiseSample - ToolSvc += getTileCondToolNoiseSample() + + +# if not hasattr(ToolSvc, "TileCondToolNoiseSample"): +# svc._msg.info("Adding default TileCondToolNoiseSample to ToolSvc") +# from .TileCondToolConf import getTileCondToolNoiseSample +# ToolSvc += getTileCondToolNoiseSample() + + # if not hasattr(ToolSvc, "TileCondToolNoiseAutoCr"): # svc._msg.info("Adding default TileCondToolNoiseAutoCr to ToolSvc") # from .TileCondToolConf import getTileCondToolAutoCr @@ -502,10 +529,14 @@ def TileInfoConfigurator(name="TileInfoLoader", **kwargs): # svc._msg.info("Adding default TileCondToolNoiseRawChn to ToolSvc") # from .TileCondToolConf import getTileCondToolNoiseRawChn # ToolSvc += getTileCondToolNoiseRawChn() - if not hasattr(ToolSvc, "TileCondToolTiming"): - svc._msg.info("Adding default TileCondToolTiming to ToolSvc") - from .TileCondToolConf import getTileCondToolTiming - ToolSvc += getTileCondToolTiming() + + +# if not hasattr(ToolSvc, "TileCondToolTiming"): +# svc._msg.info("Adding default TileCondToolTiming to ToolSvc") +# from .TileCondToolConf import getTileCondToolTiming +# ToolSvc += getTileCondToolTiming() + + # if not hasattr(ToolSvc, "TileCondToolPulseShape"): # svc._msg.info("Adding default TileCondToolPulseShape to ToolSvc") # from .TileCondToolConf import getTileCondToolPulseShape @@ -533,4 +564,4 @@ def TileInfoConfigurator(name="TileInfoLoader", **kwargs): svc._cooltimeIsConfigured = False svc._coolonlinetimeIsConfigured = False svc._coolDspThresholdIsConfigured = False - return svc + return svc diff --git a/TileCalorimeter/TileConditions/share/TileCondToolDspThreshold_test.ref b/TileCalorimeter/TileConditions/share/TileCondToolDspThreshold_test.ref deleted file mode 100644 index 4ab83fd8a078eee21f868f1e25e391508a2a448a..0000000000000000000000000000000000000000 --- a/TileCalorimeter/TileConditions/share/TileCondToolDspThreshold_test.ref +++ /dev/null @@ -1,12 +0,0 @@ -test1 -ApplicationMgr SUCCESS -==================================================================================================================================== - Welcome to ApplicationMgr (GaudiCoreSvc v27r1p99) - running on karma on Tue May 30 22:32:49 2017 -==================================================================================================================================== -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 diff --git a/TileCalorimeter/TileConditions/share/TileCondToolOfcCool_test.ref b/TileCalorimeter/TileConditions/share/TileCondToolOfcCool_test.ref deleted file mode 100644 index a37f926b817b4f3cb22670172c8235007ebc114c..0000000000000000000000000000000000000000 --- a/TileCalorimeter/TileConditions/share/TileCondToolOfcCool_test.ref +++ /dev/null @@ -1,12 +0,0 @@ -test1 -ApplicationMgr SUCCESS -==================================================================================================================================== - Welcome to ApplicationMgr (GaudiCoreSvc v27r1p99) - running on karma on Tue May 30 22:33:58 2017 -==================================================================================================================================== -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 diff --git a/TileCalorimeter/TileConditions/src/TileBadChanLegacyTool.cxx b/TileCalorimeter/TileConditions/src/TileBadChanLegacyTool.cxx new file mode 100644 index 0000000000000000000000000000000000000000..e765f7b18d2b1a5743f003391e8fe73f44cbcb80 --- /dev/null +++ b/TileCalorimeter/TileConditions/src/TileBadChanLegacyTool.cxx @@ -0,0 +1,449 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// Tile includes +#include "TileConditions/TileBadChanLegacyTool.h" +#include "TileConditions/TileCondProxyWrapper.h" +#include "TileCalibBlobObjs/TileCalibDrawerBch.h" +#include "TileCalibBlobObjs/TileBchDecoder.h" +#include "TileCalibBlobObjs/TileBchPrbs.h" +#include "TileIdentifier/TileHWID.h" +#include "TileDetDescr/TileDetDescrManager.h" + +// Calo includes +#include "CaloDetDescr/CaloDetDescrElement.h" + +// Athena incldues +#include "Identifier/IdContext.h" +#include "StoreGate/StoreGateSvc.h" +#include "AthenaKernel/errorcheck.h" + +// Gaudi includes +#include "GaudiKernel/ServiceHandle.h" + +#include <string> + +// +//____________________________________________________________________ +const InterfaceID& +TileBadChanLegacyTool::interfaceID() { + return ITileBadChanTool::interfaceID(); +} + +// +//____________________________________________________________________ +TileBadChanLegacyTool::TileBadChanLegacyTool(const std::string& type, const std::string& name, const IInterface* parent) + : AthAlgTool(type, name, parent) + , m_tileMgr(0) + , m_channel_context(0) + , m_tileIdTrans("TileCondIdTransforms") + , m_pryOnlBch("TileCondProxyFile_TileCalibDrawerBch_/TileCondProxyDefault_onlBch", this) + , m_pryOflBch("TileCondProxyFile_TileCalibDrawerBch_/TileCondProxyDefault_oflBch", this) + , m_defaultStatus(TileBchStatus()) + , m_tripsProbs(TileCalibUtils::MAX_ROS - 1, std::vector<float>(TileCalibUtils::MAX_DRAWER, 0)) + , m_useOflBch(true) + , m_tileHWID(nullptr) +{ + declareInterface<ITileBadChanTool>(this); + declareInterface<TileBadChanLegacyTool>(this); + declareInterface<ICaloBadChanTool>(this); + declareProperty("ProxyOnlBch", m_pryOnlBch); + declareProperty("ProxyOflBch", m_pryOflBch); + +} + +// +//____________________________________________________________________ +TileBadChanLegacyTool::~TileBadChanLegacyTool() { + for (std::vector<const TileBchDecoder*>::iterator i = m_tileBchDecoder.begin(); + i != m_tileBchDecoder.end(); ++i) { + delete *i; + } +} + + +// +//____________________________________________________________________ +StatusCode TileBadChanLegacyTool::initialize() { + ATH_MSG_DEBUG( "in initialize()" ); + + //=== TileDetDescrManager + CHECK( detStore()->retrieve(m_tileMgr) ); + + //=== initialize bit pattern decoders for all possible versions + m_tileBchDecoder.resize(TileBchDecoder::MaxVersion); + for (unsigned int i = 0; i < TileBchDecoder::MaxVersion; ++i) { + ATH_MSG_DEBUG( "Creating TileBchDecoder(" << i << ")" ); + m_tileBchDecoder[i] = new TileBchDecoder(static_cast<TileBchDecoder::BitPatVer>(i)); + } + + //=== TileCondIdTransforms + CHECK( m_tileIdTrans.retrieve() ); + + //=== initialize channel context + m_channel_context = new IdContext(m_tileIdTrans->getTileHWID()->channel_context()); + + //=== retrieve online proxy + CHECK( m_pryOnlBch.retrieve() ); + + m_useOflBch = !(m_pryOflBch.empty()); + if (m_useOflBch) { + //=== retrieve offline proxy + CHECK( m_pryOflBch.retrieve() ); + ATH_MSG_INFO("ProxyOnlBch and ProxyOflBch will be used for bad channel status"); + } else { + ATH_MSG_INFO("Only ProxyOnlBch will be used for bad channel status"); + } + + //=== recache function needs to be bound to IOV updates only for COOL proxies + const TileCondProxyCoolBch* ptrPryOnlBch = dynamic_cast<const TileCondProxyCoolBch*>(&(*m_pryOnlBch)); + const TileCondProxyCoolBch* ptrPryOflBch(0); + if (m_useOflBch) { + ptrPryOflBch = dynamic_cast<const TileCondProxyCoolBch*>(&(*m_pryOflBch)); + } + + //=== call recache if both proxies are FILE proxies + if (!ptrPryOnlBch && !ptrPryOflBch) { + int idx = 0; + std::list<std::string> keys; + keys.push_back("ASCII files"); + CHECK( recache(idx, keys) ); + } + + //=== if at least one COOL proxy is loaded, then the linked callback will take care of recaching + else { + if (ptrPryOnlBch) { + CHECK( detStore()->regFcn(&TileCondProxyCoolBch::callback + , ptrPryOnlBch + , &TileBadChanLegacyTool::recache + , this, true) ); + + } + + if (m_useOflBch && ptrPryOflBch) { + CHECK( detStore()->regFcn(&TileCondProxyCoolBch::callback + , ptrPryOflBch + , &TileBadChanLegacyTool::recache + , this, true) ); + } + } + + + m_roses.resize(TileCalibUtils::MAX_DRAWERIDX); + m_drawers.resize(TileCalibUtils::MAX_DRAWERIDX); + + for (unsigned int ros = 0; ros < TileCalibUtils::MAX_ROS; ++ros) { + for (unsigned int drawer = 0; drawer < TileCalibUtils::getMaxDrawer(ros); ++drawer) { + unsigned int drawerIdx = TileCalibUtils::getDrawerIdx(ros, drawer); + m_roses[drawerIdx] = ros; + m_drawers[drawerIdx] = drawer; + } + } + + + return StatusCode::SUCCESS; +} + +// +//____________________________________________________________________ +StatusCode TileBadChanLegacyTool::finalize() { + ATH_MSG_DEBUG( "finalize called" ); + + if (m_channel_context) delete m_channel_context; + m_channel_context = 0; + + return StatusCode::SUCCESS; +} + +// +//____________________________________________________________________ +StatusCode TileBadChanLegacyTool::recache(IOVSVC_CALLBACK_ARGS_K(keys)) { + msg(MSG::INFO) << "TileBadChanLegacyTool::recache() has been triggered by: "; + std::list<std::string>::const_iterator itr; + for (itr = keys.begin(); itr != keys.end(); ++itr) { + msg(MSG::INFO) << "\'" << *itr << "' "; + } + msg(MSG::INFO) << endmsg; + + //=== clear old hash maps + m_statusMapAdc.clear(); + m_statusMapChn.clear(); + + try { + + //=== loop over the whole detector, hash affected ADCs + uint32_t adcBits(0), channelBits(0); + + m_tileHWID = m_tileIdTrans->getTileHWID(); + + IdContext adcContext = m_tileHWID->adc_context(); + unsigned int maxAdcHash = m_tileHWID->adc_hash_max(); + + unsigned int drawerIdx(0); + unsigned int channel(0); + unsigned int adc(0); + + for (IdentifierHash adcHash = 0; adcHash < maxAdcHash; adcHash += 1) { + HWIdentifier adcId; + if (m_tileHWID->get_id(adcHash, adcId, &adcContext) == 0) { + // ATH_MSG_ALWAYS(m_tileHWID->to_string(adcId)); + if (m_tileHWID->ros(adcId) == 0) continue; + + m_tileIdTrans->getIndices(adcId, drawerIdx, channel, adc); + + //=== online status ... + const TileCalibDrawerBch* calibDrawer = m_pryOnlBch->getCalibDrawer(drawerIdx); + TileBchDecoder::BitPatVer bitPatVer = calibDrawer->getBitPatternVersion(); + calibDrawer->getStatusWords(channel, adc, adcBits, channelBits); + TileBchStatus adcStatus(m_tileBchDecoder[bitPatVer]->decode(channelBits, adcBits)); + + if (m_useOflBch) { + //=== ... add offline status + calibDrawer = m_pryOflBch->getCalibDrawer(drawerIdx); + bitPatVer = calibDrawer->getBitPatternVersion(); + calibDrawer->getStatusWords(channel, adc, adcBits, channelBits); + adcStatus += m_tileBchDecoder[bitPatVer]->decode(channelBits, adcBits); + } + + if (!adcStatus.isGood()) { + //=== only add problematic adcs to map + m_statusMapAdc[adcId] = adcStatus; + HWIdentifier channelId = m_tileHWID->channel_id(adcId); + m_statusMapChn[channelId] += adcStatus; + } + } + } + + + //============================================================ + //=== Set definition of bad and noisy channel if specified. + //--- These definitions are stored in drawerIdx=1, since + //--- drawers 1,...,3 are not used in the default chain. + //--- + //--- drawerIdx=1, channel=0: definition of bad channel + //--- drawerIdx=1, channel=1: definition of noisy channel + //--- drawerIdx=1, channel=2: definition of NoGainLevel1 channel + //--- drawerIdx=1, channel=3: definition of bad timing channel + //--- .... (this list could be extended if needed) + //============================================================ + //=== Reset defintion to hard-coded defaults + TileBchStatus::initClassifierDefinitions(); + + const TileCalibDrawerBch* definitionsCalibDrawer; + if (m_useOflBch) definitionsCalibDrawer = m_pryOflBch->getCalibDrawer(TileCalibUtils::DEFINITIONS_DRAWERIDX); + else definitionsCalibDrawer = m_pryOnlBch->getCalibDrawer(TileCalibUtils::DEFINITIONS_DRAWERIDX); + + TileBchDecoder::BitPatVer bitPatVer = definitionsCalibDrawer->getBitPatternVersion(); + + //=== TileBchStatus.isBad() definition + definitionsCalibDrawer->getStatusWords(TileCalibUtils::BAD_DEFINITION_CHAN, 0, adcBits, channelBits); + TileBchStatus chnStatus(m_tileBchDecoder[bitPatVer]->decode(channelBits, adcBits)); + if (chnStatus.isAffected()) { + ATH_MSG_INFO( "Updating TileBchStatus::isBad() definition from DB" ); + TileBchStatus::defineBad(chnStatus); + } else { + ATH_MSG_INFO( "No TileBchStatus::isBad() definition found in DB, using defaults" ); + } + + //=== TileBchStatus.isNoisy() definition + definitionsCalibDrawer->getStatusWords(TileCalibUtils::NOISY_DEFINITION_CHAN, 0, adcBits, channelBits); + chnStatus = m_tileBchDecoder[bitPatVer]->decode(channelBits, adcBits); + if (chnStatus.isAffected()) { + ATH_MSG_INFO( "Updating TileBchStatus::isNoisy() definition from DB" ); + TileBchStatus::defineNoisy(chnStatus); + } else { + ATH_MSG_INFO( "No TileBchStatus::isNoisy() definition found in DB, using defaults" ); + } + + //=== TileBchStatus.isNoGainL1() definition + definitionsCalibDrawer->getStatusWords(TileCalibUtils::NOGAINL1_DEFINITION_CHAN, 0, adcBits, channelBits); + chnStatus = m_tileBchDecoder[bitPatVer]->decode(channelBits, adcBits); + if (chnStatus.isAffected()) { + ATH_MSG_INFO( "Updating TileBchStatus::isNoGainL1() definition from DB" ); + TileBchStatus::defineNoGainL1(chnStatus); + } else { + ATH_MSG_INFO( "No TileBchStatus::isNoGainL1() definition found in DB, using defaults" ); + } + + + //=== TileBchStatus.isBadTiming() definition + definitionsCalibDrawer->getStatusWords(TileCalibUtils::BADTIMING_DEFINITION_CHAN, 0, adcBits, channelBits); + chnStatus = m_tileBchDecoder[bitPatVer]->decode(channelBits, adcBits); + if (chnStatus.isAffected()) { + ATH_MSG_INFO( "Updating TileBchStatus::isBadTiming() definition from DB" ); + TileBchStatus::defineBadTiming(chnStatus); + } else { + ATH_MSG_INFO( "No TileBchStatus::isBadTiming() definition found in DB, using defaults" ); + } + + + //=== report current definitions + ATH_MSG_INFO( "TileBchStatus::isBad() is defined by: " + << TileBchStatus::getDefinitionBad().getString() ); + ATH_MSG_INFO( "TileBchStatus::isNoisy() is defined by: " + << TileBchStatus::getDefinitionNoisy().getString() ); + ATH_MSG_INFO( "TileBchStatus::isNoGainL1() is defined by: " + << TileBchStatus::getDefinitionNoGainL1().getString() ); + ATH_MSG_INFO( "TileBchStatus::isBadTiming() is defined by: " + << TileBchStatus::getDefinitionBadTiming().getString() ); + + + // Check if drawer trips probabilities for simulation are exist in DB. + // By special convention trips probabilities are stored in drawer number: 2 + // like integers number plus one denominator per ros + //--- drawerIdx=2, channel=1: 64 integers + denominator for LBA + //--- drawerIdx=2, channel=2: 64 integers + denominator for LBC + //--- drawerIdx=2, channel=3: 64 integers + denominator for EBA + //--- drawerIdx=2, channel=4: 64 integers + denominator for EBC + //============================================================ + if (m_useOflBch) { + const TileCalibDrawerBch* tripsCalibDrawer = m_pryOflBch->getCalibDrawer(TileCalibUtils::TRIPS_DRAWERIDX); + + if (tripsCalibDrawer->getObjSizeUint32() == TileCalibUtils::MAX_DRAWER + 1 + && tripsCalibDrawer->getNChans() == TileCalibUtils::MAX_ROS) { + + ATH_MSG_INFO("Found drawer trips probabilities in DB"); + + // Fill up arrays with trips probabilities for simulation purposes + // Trips probabilities are cached like floats: number / denominator. + + for (unsigned int ros = 1; ros < TileCalibUtils::MAX_ROS; ++ros) { + const float denominator = (float) tripsCalibDrawer->getData(ros, 0, TileCalibUtils::MAX_DRAWER); + const float inv_denominator = 1. / denominator; + for (unsigned int mod = 0; mod < TileCalibUtils::MAX_DRAWER; ++mod) { + m_tripsProbs[ros - 1][mod] = ((float) tripsCalibDrawer->getData(ros, 0, mod)) * inv_denominator; + } + } + + } else { + ATH_MSG_INFO("No drawer trips probabilities found in DB"); + } + } + } catch (TileCalib::Exception& e) { + ATH_MSG_ERROR( "Caught exception: " << e.what() ); + return StatusCode::FAILURE; + } + + return StatusCode::SUCCESS; +} + +// +//____________________________________________________________________ +CaloBadChannel TileBadChanLegacyTool::caloStatus(Identifier id) const { + CaloBadChannel::BitWord res = 0; + + //=== get the TileHWIDs of the two channels connected to the caloCell id + const CaloDetDescrElement* elem = m_tileMgr->get_cell_element(id); + + if (!elem) { + //=== this should never happen + ATH_MSG_ERROR( "CaloMgr returns NULL CaloDetDescrElement" ); + std::abort(); + } + + //=== status of 1. connected channel + TileBchStatus chn1Stat(getChannelStatus(elem->onl1())); + + //=== status of 2. connected channel + TileBchStatus chn2Stat(getChannelStatus(elem->onl2())); + + //=== set cell status depending on channel status + if (chn1Stat.isBad() && chn2Stat.isBad()) { + CaloBadChannel::setBit(CaloBadChannel::deadBit, res); + } else if (chn1Stat.isAffected() || chn2Stat.isAffected()) { + CaloBadChannel::setBit(CaloBadChannel::affectedBit, res); + } + + return CaloBadChannel(res); +} + +// +//____________________________________________________________________ +const TileBchStatus& +TileBadChanLegacyTool::getAdcStatus(const HWIdentifier& adc_id) const { + + std::map<HWIdentifier, TileBchStatus>::const_iterator iStatusMap = m_statusMapAdc.find(adc_id); + if (iStatusMap == m_statusMapAdc.end()) { + return m_defaultStatus; + } else { + return iStatusMap->second; + } + +} + +// +//____________________________________________________________________ +const TileBchStatus& +TileBadChanLegacyTool::getAdcStatus(IdentifierHash hash_id, unsigned int adc) const { + if (hash_id != TileHWID::NOT_VALID_HASH) { + HWIdentifier adc_id = m_tileHWID->adc_id(hash_id, adc); + return getAdcStatus(adc_id); + } else { + return m_defaultStatus; + } +} + +// +//____________________________________________________________________ +const TileBchStatus& +TileBadChanLegacyTool::getChannelStatus(IdentifierHash hash_id) const { + if (hash_id != TileHWID::NOT_VALID_HASH) { + HWIdentifier channel_id = m_tileHWID->channel_id(hash_id); + return getChannelStatus(channel_id); + } else { + return m_defaultStatus; + } +} + +// +//____________________________________________________________________ +const TileBchStatus& +TileBadChanLegacyTool::getChannelStatus(const HWIdentifier& channel_id) const { + + std::map<HWIdentifier, TileBchStatus>::const_iterator iStatusMap = m_statusMapChn.find(channel_id); + if (iStatusMap == m_statusMapChn.end()) { + return m_defaultStatus; + } else { + return iStatusMap->second; + } + +} + +// +//____________________________________________________________________ +const TileBchStatus& +TileBadChanLegacyTool::getChannelStatus(unsigned int drawerIdx, unsigned int channel) const { + + HWIdentifier channel_id = m_tileHWID->channel_id(m_roses[drawerIdx], m_drawers[drawerIdx], channel); + return getChannelStatus(channel_id); + +} + +// +//____________________________________________________________________ +const TileBchStatus& +TileBadChanLegacyTool::getAdcStatus(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const { + + HWIdentifier adc_id = m_tileHWID->adc_id(m_roses[drawerIdx], m_drawers[drawerIdx], channel, adc); + return getAdcStatus(adc_id); + +} + + +uint32_t TileBadChanLegacyTool::encodeStatus(const TileBchStatus& status) const { + uint32_t bad; + + if (status.isGood()) + bad = 0; + else if (status.isBad()) + bad = 3; + else if (status.isNoisy()) + bad = 1; + else if (status.isAffected()) + bad = 2; + else + bad = 4; + + return bad; +} diff --git a/TileCalorimeter/TileConditions/src/TileBadChanTool.cxx b/TileCalorimeter/TileConditions/src/TileBadChanTool.cxx index 10ec0e3d9b38ca5bd0d5be0544309678d2f9b089..add44754badcd00f54da4177c506ca49fdec3cc3 100644 --- a/TileCalorimeter/TileConditions/src/TileBadChanTool.cxx +++ b/TileCalorimeter/TileConditions/src/TileBadChanTool.cxx @@ -1,65 +1,47 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ // Tile includes #include "TileConditions/TileBadChanTool.h" -#include "TileConditions/TileCondProxyWrapper.h" -#include "TileCalibBlobObjs/TileCalibDrawerBch.h" -#include "TileCalibBlobObjs/TileBchDecoder.h" -#include "TileCalibBlobObjs/TileBchPrbs.h" #include "TileIdentifier/TileHWID.h" #include "TileDetDescr/TileDetDescrManager.h" +#include "TileCalibBlobObjs/TileCalibUtils.h" // Calo includes #include "CaloDetDescr/CaloDetDescrElement.h" // Athena incldues -#include "Identifier/IdContext.h" -#include "StoreGate/StoreGateSvc.h" #include "AthenaKernel/errorcheck.h" - -// Gaudi includes -#include "GaudiKernel/ServiceHandle.h" +#include "StoreGate/ReadCondHandle.h" #include <string> // //____________________________________________________________________ -const InterfaceID& -TileBadChanTool::interfaceID() { +/* +const InterfaceID& TileBadChanTool::interfaceID() { + return ITileBadChanTool::interfaceID(); } +*/ // //____________________________________________________________________ TileBadChanTool::TileBadChanTool(const std::string& type, const std::string& name, const IInterface* parent) - : AthAlgTool(type, name, parent) - , m_tileMgr(0) - , m_channel_context(0) - , m_tileIdTrans("TileCondIdTransforms") - , m_pryOnlBch("TileCondProxyFile_TileCalibDrawerBch_/TileCondProxyDefault_onlBch", this) - , m_pryOflBch("TileCondProxyFile_TileCalibDrawerBch_/TileCondProxyDefault_oflBch", this) - , m_defaultStatus(TileBchStatus()) - , m_tripsProbs(TileCalibUtils::MAX_ROS - 1, std::vector<float>(TileCalibUtils::MAX_DRAWER, 0)) - , m_useOflBch(true) + : base_class(type, name, parent) + , m_tileMgr(nullptr) , m_tileHWID(nullptr) + , m_defaultStatus(TileBchStatus()) + , m_defaultTripsProbs(TileCalibUtils::MAX_DRAWER, 0.0F) { - declareInterface<ITileBadChanTool>(this); - declareInterface<TileBadChanTool>(this); - declareInterface<ICaloBadChanTool>(this); - declareProperty("ProxyOnlBch", m_pryOnlBch); - declareProperty("ProxyOflBch", m_pryOflBch); } // //____________________________________________________________________ TileBadChanTool::~TileBadChanTool() { - for (std::vector<const TileBchDecoder*>::iterator i = m_tileBchDecoder.begin(); - i != m_tileBchDecoder.end(); ++i) { - delete *i; - } + } @@ -67,68 +49,15 @@ TileBadChanTool::~TileBadChanTool() { //____________________________________________________________________ StatusCode TileBadChanTool::initialize() { ATH_MSG_DEBUG( "in initialize()" ); - - //=== TileDetDescrManager - CHECK( detStore()->retrieve(m_tileMgr) ); - - //=== initialize bit pattern decoders for all possible versions - m_tileBchDecoder.resize(TileBchDecoder::MaxVersion); - for (unsigned int i = 0; i < TileBchDecoder::MaxVersion; ++i) { - ATH_MSG_DEBUG( "Creating TileBchDecoder(" << i << ")" ); - m_tileBchDecoder[i] = new TileBchDecoder(static_cast<TileBchDecoder::BitPatVer>(i)); - } - - //=== TileCondIdTransforms - CHECK( m_tileIdTrans.retrieve() ); - - //=== initialize channel context - m_channel_context = new IdContext(m_tileIdTrans->getTileHWID()->channel_context()); - - //=== retrieve online proxy - CHECK( m_pryOnlBch.retrieve() ); - - m_useOflBch = !(m_pryOflBch.empty()); - if (m_useOflBch) { - //=== retrieve offline proxy - CHECK( m_pryOflBch.retrieve() ); - ATH_MSG_INFO("ProxyOnlBch and ProxyOflBch will be used for bad channel status"); - } else { - ATH_MSG_INFO("Only ProxyOnlBch will be used for bad channel status"); - } - - //=== recache function needs to be bound to IOV updates only for COOL proxies - const TileCondProxyCoolBch* ptrPryOnlBch = dynamic_cast<const TileCondProxyCoolBch*>(&(*m_pryOnlBch)); - const TileCondProxyCoolBch* ptrPryOflBch(0); - if (m_useOflBch) { - ptrPryOflBch = dynamic_cast<const TileCondProxyCoolBch*>(&(*m_pryOflBch)); - } - - //=== call recache if both proxies are FILE proxies - if (!ptrPryOnlBch && !ptrPryOflBch) { - int idx = 0; - std::list<std::string> keys; - keys.push_back("ASCII files"); - CHECK( recache(idx, keys) ); - } - //=== if at least one COOL proxy is loaded, then the linked callback will take care of recaching - else { - if (ptrPryOnlBch) { - CHECK( detStore()->regFcn(&TileCondProxyCoolBch::callback - , ptrPryOnlBch - , &TileBadChanTool::recache - , this, true) ); + //=== Initialize bad channels key + ATH_CHECK( m_badChannelsKey.initialize() ); - } - - if (m_useOflBch && ptrPryOflBch) { - CHECK( detStore()->regFcn(&TileCondProxyCoolBch::callback - , ptrPryOflBch - , &TileBadChanTool::recache - , this, true) ); - } - } + //=== TileDetDescrManager + ATH_CHECK( detStore()->retrieve(m_tileMgr) ); + //=== TileDetDescrManager + ATH_CHECK( detStore()->retrieve(m_tileHWID) ); m_roses.resize(TileCalibUtils::MAX_DRAWERIDX); m_drawers.resize(TileCalibUtils::MAX_DRAWERIDX); @@ -141,200 +70,27 @@ StatusCode TileBadChanTool::initialize() { } } - + return StatusCode::SUCCESS; } // //____________________________________________________________________ StatusCode TileBadChanTool::finalize() { - ATH_MSG_DEBUG( "finalize called" ); - - if (m_channel_context) delete m_channel_context; - m_channel_context = 0; + ATH_MSG_DEBUG( "finalize called" ); return StatusCode::SUCCESS; -} - -// -//____________________________________________________________________ -StatusCode TileBadChanTool::recache(IOVSVC_CALLBACK_ARGS_K(keys)) { - msg(MSG::INFO) << "TileBadChanTool::recache() has been triggered by: "; - std::list<std::string>::const_iterator itr; - for (itr = keys.begin(); itr != keys.end(); ++itr) { - msg(MSG::INFO) << "\'" << *itr << "' "; - } - msg(MSG::INFO) << endmsg; - - //=== clear old hash maps - m_statusMapAdc.clear(); - m_statusMapChn.clear(); - - try { - - //=== loop over the whole detector, hash affected ADCs - uint32_t adcBits(0), channelBits(0); - - m_tileHWID = m_tileIdTrans->getTileHWID(); - - IdContext adcContext = m_tileHWID->adc_context(); - unsigned int maxAdcHash = m_tileHWID->adc_hash_max(); - - unsigned int drawerIdx(0); - unsigned int channel(0); - unsigned int adc(0); - - for (IdentifierHash adcHash = 0; adcHash < maxAdcHash; adcHash += 1) { - HWIdentifier adcId; - if (m_tileHWID->get_id(adcHash, adcId, &adcContext) == 0) { - // ATH_MSG_ALWAYS(m_tileHWID->to_string(adcId)); - if (m_tileHWID->ros(adcId) == 0) continue; - - m_tileIdTrans->getIndices(adcId, drawerIdx, channel, adc); - - //=== online status ... - const TileCalibDrawerBch* calibDrawer = m_pryOnlBch->getCalibDrawer(drawerIdx); - TileBchDecoder::BitPatVer bitPatVer = calibDrawer->getBitPatternVersion(); - calibDrawer->getStatusWords(channel, adc, adcBits, channelBits); - TileBchStatus adcStatus(m_tileBchDecoder[bitPatVer]->decode(channelBits, adcBits)); - - if (m_useOflBch) { - //=== ... add offline status - calibDrawer = m_pryOflBch->getCalibDrawer(drawerIdx); - bitPatVer = calibDrawer->getBitPatternVersion(); - calibDrawer->getStatusWords(channel, adc, adcBits, channelBits); - adcStatus += m_tileBchDecoder[bitPatVer]->decode(channelBits, adcBits); - } - - if (!adcStatus.isGood()) { - //=== only add problematic adcs to map - m_statusMapAdc[adcId] = adcStatus; - HWIdentifier channelId = m_tileHWID->channel_id(adcId); - m_statusMapChn[channelId] += adcStatus; - } - } - } - - - //============================================================ - //=== Set definition of bad and noisy channel if specified. - //--- These definitions are stored in drawerIdx=1, since - //--- drawers 1,...,3 are not used in the default chain. - //--- - //--- drawerIdx=1, channel=0: definition of bad channel - //--- drawerIdx=1, channel=1: definition of noisy channel - //--- drawerIdx=1, channel=2: definition of NoGainLevel1 channel - //--- drawerIdx=1, channel=3: definition of bad timing channel - //--- .... (this list could be extended if needed) - //============================================================ - //=== Reset defintion to hard-coded defaults - TileBchStatus::initClassifierDefinitions(); - - const TileCalibDrawerBch* definitionsCalibDrawer; - if (m_useOflBch) definitionsCalibDrawer = m_pryOflBch->getCalibDrawer(TileCalibUtils::DEFINITIONS_DRAWERIDX); - else definitionsCalibDrawer = m_pryOnlBch->getCalibDrawer(TileCalibUtils::DEFINITIONS_DRAWERIDX); - - TileBchDecoder::BitPatVer bitPatVer = definitionsCalibDrawer->getBitPatternVersion(); - - //=== TileBchStatus.isBad() definition - definitionsCalibDrawer->getStatusWords(TileCalibUtils::BAD_DEFINITION_CHAN, 0, adcBits, channelBits); - TileBchStatus chnStatus(m_tileBchDecoder[bitPatVer]->decode(channelBits, adcBits)); - if (chnStatus.isAffected()) { - ATH_MSG_INFO( "Updating TileBchStatus::isBad() definition from DB" ); - TileBchStatus::defineBad(chnStatus); - } else { - ATH_MSG_INFO( "No TileBchStatus::isBad() definition found in DB, using defaults" ); - } - //=== TileBchStatus.isNoisy() definition - definitionsCalibDrawer->getStatusWords(TileCalibUtils::NOISY_DEFINITION_CHAN, 0, adcBits, channelBits); - chnStatus = m_tileBchDecoder[bitPatVer]->decode(channelBits, adcBits); - if (chnStatus.isAffected()) { - ATH_MSG_INFO( "Updating TileBchStatus::isNoisy() definition from DB" ); - TileBchStatus::defineNoisy(chnStatus); - } else { - ATH_MSG_INFO( "No TileBchStatus::isNoisy() definition found in DB, using defaults" ); - } - - //=== TileBchStatus.isNoGainL1() definition - definitionsCalibDrawer->getStatusWords(TileCalibUtils::NOGAINL1_DEFINITION_CHAN, 0, adcBits, channelBits); - chnStatus = m_tileBchDecoder[bitPatVer]->decode(channelBits, adcBits); - if (chnStatus.isAffected()) { - ATH_MSG_INFO( "Updating TileBchStatus::isNoGainL1() definition from DB" ); - TileBchStatus::defineNoGainL1(chnStatus); - } else { - ATH_MSG_INFO( "No TileBchStatus::isNoGainL1() definition found in DB, using defaults" ); - } - - - //=== TileBchStatus.isBadTiming() definition - definitionsCalibDrawer->getStatusWords(TileCalibUtils::BADTIMING_DEFINITION_CHAN, 0, adcBits, channelBits); - chnStatus = m_tileBchDecoder[bitPatVer]->decode(channelBits, adcBits); - if (chnStatus.isAffected()) { - ATH_MSG_INFO( "Updating TileBchStatus::isBadTiming() definition from DB" ); - TileBchStatus::defineBadTiming(chnStatus); - } else { - ATH_MSG_INFO( "No TileBchStatus::isBadTiming() definition found in DB, using defaults" ); - } - - - //=== report current definitions - ATH_MSG_INFO( "TileBchStatus::isBad() is defined by: " - << TileBchStatus::getDefinitionBad().getString() ); - ATH_MSG_INFO( "TileBchStatus::isNoisy() is defined by: " - << TileBchStatus::getDefinitionNoisy().getString() ); - ATH_MSG_INFO( "TileBchStatus::isNoGainL1() is defined by: " - << TileBchStatus::getDefinitionNoGainL1().getString() ); - ATH_MSG_INFO( "TileBchStatus::isBadTiming() is defined by: " - << TileBchStatus::getDefinitionBadTiming().getString() ); - - - // Check if drawer trips probabilities for simulation are exist in DB. - // By special convention trips probabilities are stored in drawer number: 2 - // like integers number plus one denominator per ros - //--- drawerIdx=2, channel=1: 64 integers + denominator for LBA - //--- drawerIdx=2, channel=2: 64 integers + denominator for LBC - //--- drawerIdx=2, channel=3: 64 integers + denominator for EBA - //--- drawerIdx=2, channel=4: 64 integers + denominator for EBC - //============================================================ - if (m_useOflBch) { - const TileCalibDrawerBch* tripsCalibDrawer = m_pryOflBch->getCalibDrawer(TileCalibUtils::TRIPS_DRAWERIDX); - - if (tripsCalibDrawer->getObjSizeUint32() == TileCalibUtils::MAX_DRAWER + 1 - && tripsCalibDrawer->getNChans() == TileCalibUtils::MAX_ROS) { - - ATH_MSG_INFO("Found drawer trips probabilities in DB"); - - // Fill up arrays with trips probabilities for simulation purposes - // Trips probabilities are cached like floats: number / denominator. - - for (unsigned int ros = 1; ros < TileCalibUtils::MAX_ROS; ++ros) { - const float denominator = (float) tripsCalibDrawer->getData(ros, 0, TileCalibUtils::MAX_DRAWER); - const float inv_denominator = 1. / denominator; - for (unsigned int mod = 0; mod < TileCalibUtils::MAX_DRAWER; ++mod) { - m_tripsProbs[ros - 1][mod] = ((float) tripsCalibDrawer->getData(ros, 0, mod)) * inv_denominator; - } - } - - } else { - ATH_MSG_INFO("No drawer trips probabilities found in DB"); - } - } - } catch (TileCalib::Exception& e) { - ATH_MSG_ERROR( "Caught exception: " << e.what() ); - return StatusCode::FAILURE; - } - - return StatusCode::SUCCESS; } // //____________________________________________________________________ -CaloBadChannel TileBadChanTool::caloStatus(Identifier id) const { +CaloBadChannel TileBadChanTool::caloStatus(Identifier cell_id) const { + CaloBadChannel::BitWord res = 0; - //=== get the TileHWIDs of the two channels connected to the caloCell id - const CaloDetDescrElement* elem = m_tileMgr->get_cell_element(id); + //=== get the TileHWIDs of the two channels connected to the caloCellnxs id + const CaloDetDescrElement* elem = m_tileMgr->get_cell_element(cell_id); if (!elem) { //=== this should never happen @@ -342,16 +98,23 @@ CaloBadChannel TileBadChanTool::caloStatus(Identifier id) const { std::abort(); } + SG::ReadCondHandle<TileBadChannels> badChannels(m_badChannelsKey); + + IdentifierHash hash1_id(elem->onl1()); + IdentifierHash hash2_id(elem->onl2()); + //=== status of 1. connected channel - TileBchStatus chn1Stat(getChannelStatus(elem->onl1())); + TileBchStatus channel1_status = (hash1_id != TileHWID::NOT_VALID_HASH) ? + badChannels->getChannelStatus(m_tileHWID->channel_id(hash1_id)) : m_defaultStatus; //=== status of 2. connected channel - TileBchStatus chn2Stat(getChannelStatus(elem->onl2())); - + TileBchStatus channel2_status = (hash2_id != TileHWID::NOT_VALID_HASH) ? + badChannels->getChannelStatus(m_tileHWID->channel_id(hash2_id)) : m_defaultStatus; + //=== set cell status depending on channel status - if (chn1Stat.isBad() && chn2Stat.isBad()) { + if (channel1_status.isBad() && channel2_status.isBad()) { CaloBadChannel::setBit(CaloBadChannel::deadBit, res); - } else if (chn1Stat.isAffected() || chn2Stat.isAffected()) { + } else if (channel1_status.isAffected() || channel2_status.isAffected()) { CaloBadChannel::setBit(CaloBadChannel::affectedBit, res); } @@ -363,12 +126,8 @@ CaloBadChannel TileBadChanTool::caloStatus(Identifier id) const { const TileBchStatus& TileBadChanTool::getAdcStatus(const HWIdentifier& adc_id) const { - std::map<HWIdentifier, TileBchStatus>::const_iterator iStatusMap = m_statusMapAdc.find(adc_id); - if (iStatusMap == m_statusMapAdc.end()) { - return m_defaultStatus; - } else { - return iStatusMap->second; - } + SG::ReadCondHandle<TileBadChannels> badChannels(m_badChannelsKey); + return badChannels->getAdcStatus(adc_id); } @@ -376,24 +135,32 @@ TileBadChanTool::getAdcStatus(const HWIdentifier& adc_id) const { //____________________________________________________________________ const TileBchStatus& TileBadChanTool::getAdcStatus(IdentifierHash hash_id, unsigned int adc) const { + if (hash_id != TileHWID::NOT_VALID_HASH) { HWIdentifier adc_id = m_tileHWID->adc_id(hash_id, adc); - return getAdcStatus(adc_id); + + SG::ReadCondHandle<TileBadChannels> badChannels(m_badChannelsKey); + return badChannels->getAdcStatus(adc_id); } else { return m_defaultStatus; } + } // //____________________________________________________________________ const TileBchStatus& TileBadChanTool::getChannelStatus(IdentifierHash hash_id) const { + if (hash_id != TileHWID::NOT_VALID_HASH) { HWIdentifier channel_id = m_tileHWID->channel_id(hash_id); - return getChannelStatus(channel_id); + + SG::ReadCondHandle<TileBadChannels> badChannels(m_badChannelsKey); + return badChannels->getChannelStatus(channel_id); } else { return m_defaultStatus; } + } // @@ -401,12 +168,8 @@ TileBadChanTool::getChannelStatus(IdentifierHash hash_id) const { const TileBchStatus& TileBadChanTool::getChannelStatus(const HWIdentifier& channel_id) const { - std::map<HWIdentifier, TileBchStatus>::const_iterator iStatusMap = m_statusMapChn.find(channel_id); - if (iStatusMap == m_statusMapChn.end()) { - return m_defaultStatus; - } else { - return iStatusMap->second; - } + SG::ReadCondHandle<TileBadChannels> badChannels(m_badChannelsKey); + return badChannels->getChannelStatus(channel_id); } @@ -416,7 +179,9 @@ const TileBchStatus& TileBadChanTool::getChannelStatus(unsigned int drawerIdx, unsigned int channel) const { HWIdentifier channel_id = m_tileHWID->channel_id(m_roses[drawerIdx], m_drawers[drawerIdx], channel); - return getChannelStatus(channel_id); + + SG::ReadCondHandle<TileBadChannels> badChannels(m_badChannelsKey); + return badChannels->getChannelStatus(channel_id); } @@ -426,14 +191,17 @@ const TileBchStatus& TileBadChanTool::getAdcStatus(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const { HWIdentifier adc_id = m_tileHWID->adc_id(m_roses[drawerIdx], m_drawers[drawerIdx], channel, adc); - return getAdcStatus(adc_id); + + SG::ReadCondHandle<TileBadChannels> badChannels(m_badChannelsKey); + return badChannels->getAdcStatus(adc_id); } uint32_t TileBadChanTool::encodeStatus(const TileBchStatus& status) const { + uint32_t bad; - + if (status.isGood()) bad = 0; else if (status.isBad()) @@ -446,4 +214,18 @@ uint32_t TileBadChanTool::encodeStatus(const TileBchStatus& status) const { bad = 4; return bad; + +} + +const std::vector<float>& TileBadChanTool::getTripsProbabilities(unsigned int ros) const { + + SG::ReadCondHandle<TileBadChannels> badChannels(m_badChannelsKey); + + const std::vector<std::vector<float>>& tripsProbs = badChannels->getTripsProbabilities(); + + if (tripsProbs.size()) { + return tripsProbs.at(ros - 1); + } + + return m_defaultTripsProbs; } diff --git a/TileCalorimeter/TileConditions/src/TileBadChannels.cxx b/TileCalorimeter/TileConditions/src/TileBadChannels.cxx new file mode 100644 index 0000000000000000000000000000000000000000..fe2c5726e825d5d2fc596725f35fdcd9fb2104fd --- /dev/null +++ b/TileCalorimeter/TileConditions/src/TileBadChannels.cxx @@ -0,0 +1,43 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#include "TileConditions/TileBadChannels.h" + + +TileBadChannels::TileBadChannels() { + +} + + +TileBadChannels::~TileBadChannels() { + +} + +void TileBadChannels::addAdcStatus(const HWIdentifier channel_id, const HWIdentifier adc_id, TileBchStatus adcStatus) { + m_channelStatus[channel_id] += adcStatus; + m_adcStatus[adc_id] += adcStatus; +} + + +const TileBchStatus& TileBadChannels::getAdcStatus(const HWIdentifier adc_id) const { + + std::map<const HWIdentifier, TileBchStatus>::const_iterator adcStatus = m_adcStatus.find(adc_id); + if (adcStatus == m_adcStatus.end()) { + return m_defaultStatus; + } else { + return adcStatus->second; + } + +} + +const TileBchStatus& TileBadChannels::getChannelStatus(const HWIdentifier channel_id) const { + + std::map<const HWIdentifier, TileBchStatus>::const_iterator channelStatus = m_channelStatus.find(channel_id); + if (channelStatus == m_channelStatus.end()) { + return m_defaultStatus; + } else { + return channelStatus->second; + } + +} diff --git a/TileCalorimeter/TileConditions/src/TileBadChannelsCondAlg.cxx b/TileCalorimeter/TileConditions/src/TileBadChannelsCondAlg.cxx new file mode 100644 index 0000000000000000000000000000000000000000..bfe4a90b799693422bdcfe5df3e42ab14e521408 --- /dev/null +++ b/TileCalorimeter/TileConditions/src/TileBadChannelsCondAlg.cxx @@ -0,0 +1,285 @@ +//Dear emacs, this is -*- c++ -*- +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + + +// Tile includes +#include "TileBadChannelsCondAlg.h" +#include "TileConditions/TileCalibData.h" +#include "TileCalibBlobObjs/TileCalibUtils.h" +#include "TileIdentifier/TileHWID.h" + +// Athena includes +#include "StoreGate/ReadCondHandle.h" +#include "StoreGate/WriteCondHandle.h" + + +TileBadChannelsCondAlg::TileBadChannelsCondAlg(const std::string& name, ISvcLocator* pSvcLocator) : + AthAlgorithm(name, pSvcLocator), + m_condSvc("CondSvc", name), + m_useOflBch(true) +{ +} + + +TileBadChannelsCondAlg::~TileBadChannelsCondAlg() { + + for (const TileBchDecoder* tileBchDecoder : m_tileBchDecoder) { + delete tileBchDecoder; + } + +} + + +StatusCode TileBadChannelsCondAlg::initialize() { + + // CondSvc + ATH_CHECK( m_condSvc.retrieve() ); + + ATH_CHECK( m_badChannelsKey.initialize() ); + // Register write handle + if (m_condSvc->regHandle(this, m_badChannelsKey).isFailure()) { + ATH_MSG_ERROR("unable to register WriteCondHandle " << m_badChannelsKey.fullKey() << " with CondSvc"); + return StatusCode::FAILURE; + } + + //=== initialize bit pattern decoders for all possible versions + m_tileBchDecoder.resize(TileBchDecoder::MaxVersion); + for (unsigned int i = 0; i < TileBchDecoder::MaxVersion; ++i) { + ATH_MSG_DEBUG( "Creating TileBchDecoder(" << i << ")" ); + m_tileBchDecoder[i] = new TileBchDecoder(static_cast<TileBchDecoder::BitPatVer>(i)); + } + + + //=== TileCondIdTransforms + CHECK( m_tileIdTrans.retrieve() ); + + ATH_CHECK( m_onlBchProxy.retrieve() ); + + m_useOflBch = !(m_oflBchProxy.empty()); + if (m_useOflBch) { + //=== retrieve offline proxy + CHECK( m_oflBchProxy.retrieve() ); + ATH_MSG_INFO("ProxyOnlBch and ProxyOflBch will be used for bad channel status"); + } else { + m_oflBchProxy.disable(); + ATH_MSG_INFO("Only ProxyOnlBch will be used for bad channel status"); + } + + + return StatusCode::SUCCESS; +} + + +StatusCode TileBadChannelsCondAlg::execute() { + + SG::WriteCondHandle<TileBadChannels> badChannels{m_badChannelsKey}; + + if (badChannels.isValid()) { + ATH_MSG_DEBUG("Found valid TileBadChannels: " << badChannels.key()); + return StatusCode::SUCCESS; + } + + EventIDRange eventRange; + + // Define validity of the output cond object + std::unique_ptr<TileCalibData<TileCalibDrawerBch>> onlBchData + = std::make_unique<TileCalibData<TileCalibDrawerBch>>(); + + ATH_CHECK( m_onlBchProxy->fillCalibData(*onlBchData, eventRange) ); + + + std::unique_ptr<TileCalibData<TileCalibDrawerBch>> oflBchData + = std::make_unique<TileCalibData<TileCalibDrawerBch>>(); + + if (m_useOflBch) { + EventIDRange oflBchRange; + ATH_CHECK( m_oflBchProxy->fillCalibData(*oflBchData, oflBchRange) ); + eventRange = EventIDRange::intersect(eventRange, oflBchRange); + } + + + std::unique_ptr<TileBadChannels> badChannelsData = std::make_unique<TileBadChannels>(); + + try { + + //=== loop over the whole detector, hash affected ADCs + uint32_t adcBits(0), channelBits(0); + + const TileHWID* tileHWID = m_tileIdTrans->getTileHWID(); + + IdContext adcContext = tileHWID->adc_context(); + unsigned int maxAdcHash = tileHWID->adc_hash_max(); + + unsigned int drawerIdx(0); + unsigned int channel(0); + unsigned int adc(0); + + for (IdentifierHash adcHash = 0; adcHash < maxAdcHash; adcHash += 1) { + HWIdentifier adcId; + if (tileHWID->get_id(adcHash, adcId, &adcContext) == 0) { + + if (tileHWID->ros(adcId) == 0) continue; + + m_tileIdTrans->getIndices(adcId, drawerIdx, channel, adc); + + //=== online status ... + const TileCalibDrawerBch* calibDrawer = onlBchData->getCalibDrawer(drawerIdx); + TileBchDecoder::BitPatVer bitPatVer = calibDrawer->getBitPatternVersion(); + calibDrawer->getStatusWords(channel, adc, adcBits, channelBits); + TileBchStatus adcStatus(m_tileBchDecoder[bitPatVer]->decode(channelBits, adcBits)); + + if (m_useOflBch) { + //=== ... add offline status + calibDrawer = oflBchData->getCalibDrawer(drawerIdx); + bitPatVer = calibDrawer->getBitPatternVersion(); + calibDrawer->getStatusWords(channel, adc, adcBits, channelBits); + adcStatus += m_tileBchDecoder[bitPatVer]->decode(channelBits, adcBits); + } + + if (!adcStatus.isGood()) { + //=== only add problematic adcs to map + HWIdentifier channelId = tileHWID->channel_id(adcId); + badChannelsData->addAdcStatus(channelId, adcId, adcStatus); + } + } + } + + + //============================================================ + //=== Set definition of bad and noisy channel if specified. + //--- These definitions are stored in drawerIdx=1, since + //--- drawers 1,...,3 are not used in the default chain. + //--- + //--- drawerIdx=1, channel=0: definition of bad channel + //--- drawerIdx=1, channel=1: definition of noisy channel + //--- drawerIdx=1, channel=2: definition of NoGainLevel1 channel + //--- drawerIdx=1, channel=3: definition of bad timing channel + //--- .... (this list could be extended if needed) + //============================================================ + //=== Reset defintion to hard-coded defaults + TileBchStatus::initClassifierDefinitions(); + + const TileCalibDrawerBch* definitionsCalibDrawer; + if (m_useOflBch) definitionsCalibDrawer = oflBchData->getCalibDrawer(TileCalibUtils::DEFINITIONS_DRAWERIDX); + else definitionsCalibDrawer = onlBchData->getCalibDrawer(TileCalibUtils::DEFINITIONS_DRAWERIDX); + + TileBchDecoder::BitPatVer bitPatVer = definitionsCalibDrawer->getBitPatternVersion(); + + //=== TileBchStatus.isBad() definition + definitionsCalibDrawer->getStatusWords(TileCalibUtils::BAD_DEFINITION_CHAN, 0, adcBits, channelBits); + TileBchStatus channelStatus(m_tileBchDecoder[bitPatVer]->decode(channelBits, adcBits)); + if (channelStatus.isAffected()) { + ATH_MSG_INFO( "Updating TileBchStatus::isBad() definition from DB" ); + TileBchStatus::defineBad(channelStatus); + } else { + ATH_MSG_INFO( "No TileBchStatus::isBad() definition found in DB, using defaults" ); + } + + //=== TileBchStatus.isNoisy() definition + definitionsCalibDrawer->getStatusWords(TileCalibUtils::NOISY_DEFINITION_CHAN, 0, adcBits, channelBits); + channelStatus = m_tileBchDecoder[bitPatVer]->decode(channelBits, adcBits); + if (channelStatus.isAffected()) { + ATH_MSG_INFO( "Updating TileBchStatus::isNoisy() definition from DB" ); + TileBchStatus::defineNoisy(channelStatus); + } else { + ATH_MSG_INFO( "No TileBchStatus::isNoisy() definition found in DB, using defaults" ); + } + + //=== TileBchStatus.isNoGainL1() definition + definitionsCalibDrawer->getStatusWords(TileCalibUtils::NOGAINL1_DEFINITION_CHAN, 0, adcBits, channelBits); + channelStatus = m_tileBchDecoder[bitPatVer]->decode(channelBits, adcBits); + if (channelStatus.isAffected()) { + ATH_MSG_INFO( "Updating TileBchStatus::isNoGainL1() definition from DB" ); + TileBchStatus::defineNoGainL1(channelStatus); + } else { + ATH_MSG_INFO( "No TileBchStatus::isNoGainL1() definition found in DB, using defaults" ); + } + + + //=== TileBchStatus.isBadTiming() definition + definitionsCalibDrawer->getStatusWords(TileCalibUtils::BADTIMING_DEFINITION_CHAN, 0, adcBits, channelBits); + channelStatus = m_tileBchDecoder[bitPatVer]->decode(channelBits, adcBits); + if (channelStatus.isAffected()) { + ATH_MSG_INFO( "Updating TileBchStatus::isBadTiming() definition from DB" ); + TileBchStatus::defineBadTiming(channelStatus); + } else { + ATH_MSG_INFO( "No TileBchStatus::isBadTiming() definition found in DB, using defaults" ); + } + + + //=== report current definitions + ATH_MSG_INFO( "TileBchStatus::isBad() is defined by: " + << TileBchStatus::getDefinitionBad().getString() ); + ATH_MSG_INFO( "TileBchStatus::isNoisy() is defined by: " + << TileBchStatus::getDefinitionNoisy().getString() ); + ATH_MSG_INFO( "TileBchStatus::isNoGainL1() is defined by: " + << TileBchStatus::getDefinitionNoGainL1().getString() ); + ATH_MSG_INFO( "TileBchStatus::isBadTiming() is defined by: " + << TileBchStatus::getDefinitionBadTiming().getString() ); + + + // Check if drawer trips probabilities for simulation are exist in DB. + // By special convention trips probabilities are stored in drawer number: 2 + // like integers number plus one denominator per ros + //--- drawerIdx=2, channel=1: 64 integers + denominator for LBA + //--- drawerIdx=2, channel=2: 64 integers + denominator for LBC + //--- drawerIdx=2, channel=3: 64 integers + denominator for EBA + //--- drawerIdx=2, channel=4: 64 integers + denominator for EBC + //============================================================ + if (m_useOflBch) { + const TileCalibDrawerBch* tripsCalibDrawer = oflBchData->getCalibDrawer(TileCalibUtils::TRIPS_DRAWERIDX); + + if (tripsCalibDrawer->getObjSizeUint32() == TileCalibUtils::MAX_DRAWER + 1 + && tripsCalibDrawer->getNChans() == TileCalibUtils::MAX_ROS) { + + + ATH_MSG_INFO("Found drawer trips probabilities in DB"); + + std::vector<std::vector<float>> tripsProbs(TileCalibUtils::MAX_ROS - 1, std::vector<float>(TileCalibUtils::MAX_DRAWER, 0)); + + // Fill up arrays with trips probabilities for simulation purposes + // Trips probabilities are cached like floats: number / denominator. + + for (unsigned int ros = 1; ros < TileCalibUtils::MAX_ROS; ++ros) { + const float denominator = (float) tripsCalibDrawer->getData(ros, 0, TileCalibUtils::MAX_DRAWER); + const float inv_denominator = 1. / denominator; + for (unsigned int mod = 0; mod < TileCalibUtils::MAX_DRAWER; ++mod) { + tripsProbs[ros - 1][mod] = ((float) tripsCalibDrawer->getData(ros, 0, mod)) * inv_denominator; + } + } + + badChannelsData->setTripsProbabilities(tripsProbs); + + } else { + ATH_MSG_INFO("No drawer trips probabilities found in DB"); + } + } + } catch (TileCalib::Exception& e) { + ATH_MSG_ERROR( "Caught exception: " << e.what() ); + return StatusCode::FAILURE; + } + + + + + if(badChannels.record(eventRange, badChannelsData.release()).isFailure()) { + ATH_MSG_ERROR("Could not record TileBadChannels object with " + << badChannels.key() + << " with EventRange " << eventRange + << " into Conditions Store"); + return StatusCode::FAILURE; + } else { + + ATH_MSG_VERBOSE("Recorded TileBadChannels object with " + << badChannels.key() + << " with EventRange " << eventRange + << " into Conditions Store"); + } + + + + return StatusCode::SUCCESS; + +} diff --git a/TileCalorimeter/TileConditions/src/TileBadChannelsCondAlg.h b/TileCalorimeter/TileConditions/src/TileBadChannelsCondAlg.h new file mode 100644 index 0000000000000000000000000000000000000000..c98650bc2f98f2427d5f529dbf19c74f2b5dae3a --- /dev/null +++ b/TileCalorimeter/TileConditions/src/TileBadChannelsCondAlg.h @@ -0,0 +1,75 @@ +//Dear emacs, this is -*- c++ -*- + +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef TILECONDITIONS_TILEBADCHANNELSCONDALG_H +#define TILECONDITIONS_TILEBADCHANNELSCONDALG_H + +// Tile includes +#include "TileConditions/TileBadChannels.h" +#include "TileConditions/ITileCondProxy.h" +#include "TileConditions/TileCondIdTransforms.h" +#include "TileCalibBlobObjs/TileCalibDrawerBch.h" +#include "TileCalibBlobObjs/TileBchDecoder.h" + +// Athena includes +#include "AthenaBaseComps/AthAlgorithm.h" +#include "StoreGate/ReadCondHandleKey.h" +#include "StoreGate/WriteCondHandleKey.h" + +// Gaudi includes +#include "GaudiKernel/ICondSvc.h" +#include "GaudiKernel/ToolHandle.h" + +/** + * @class TileBadChannelsCondAlg + * @brief Condition algorithm to prepare TileBadChannels and put it into condition store + */ + +class TileBadChannelsCondAlg: public AthAlgorithm { + public: + + TileBadChannelsCondAlg(const std::string& name, ISvcLocator* pSvcLocator); + ~TileBadChannelsCondAlg(); + + virtual StatusCode initialize() override; + virtual StatusCode execute() override; + virtual StatusCode finalize() override {return StatusCode::SUCCESS;} + + private: + + /** + * @brief Tool to provide online Tile bad channel status + */ + ToolHandle<ITileCondProxy<TileCalibDrawerBch> > m_onlBchProxy{this, "OnlBchProxy", "", + "Tile online bad channels proxy tool"}; + /** + * @brief Tool to provide ofline Tile bad channel status + * If it is provided online and offline Tile bad channel status will be merged + */ + ToolHandle<ITileCondProxy<TileCalibDrawerBch> > m_oflBchProxy{this, "OflBchProxy", "", + "Tile offline bad channels proxy tool"}; + + /** + * @brief Name of output TileBadChannels + */ + SG::WriteCondHandleKey<TileBadChannels> m_badChannelsKey{this, "TileBadChannels", "TileBadChannels", + "Output Tile bad channels status"}; + + ServiceHandle<ICondSvc> m_condSvc; + + + ToolHandle<TileCondIdTransforms> m_tileIdTrans{this, "TileCondIdTransforms", "TileCondIdTransforms", + "Tile Id transform helper"}; + + std::vector<const TileBchDecoder*> m_tileBchDecoder; + + + bool m_useOflBch; + +}; + + +#endif // TILECONDITIONS_TILEBADCHANNELSCONDALG_H diff --git a/TileCalorimeter/TileConditions/src/TileCalibCondAlg.h b/TileCalorimeter/TileConditions/src/TileCalibCondAlg.h new file mode 100644 index 0000000000000000000000000000000000000000..7f296265af79c6bd073e7e65808c605316730517 --- /dev/null +++ b/TileCalorimeter/TileConditions/src/TileCalibCondAlg.h @@ -0,0 +1,62 @@ +//Dear emacs, this is -*- c++ -*- + +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef TILECONDITIONS_TILECALIBCONDALG_H +#define TILECONDITIONS_TILECALIBCONDALG_H + +#include "TileConditions/TileCalibData.h" +#include "TileConditions/ITileCondProxy.h" + +#include "AthenaBaseComps/AthAlgorithm.h" +#include "StoreGate/ReadCondHandleKey.h" +#include "StoreGate/WriteCondHandleKey.h" +#include "AthenaPoolUtilities/CondAttrListCollection.h" +#include "GaudiKernel/ICondSvc.h" + +/** + * @class TileCalibCondAlg + * @brief Condition algorithm to prepare TileCalibData object and put it into condition store + * + */ +template<class T> +class TileCalibCondAlg: public AthAlgorithm { + public: + + TileCalibCondAlg(const std::string& name, ISvcLocator* pSvcLocator); + ~TileCalibCondAlg(); + + virtual StatusCode initialize() override; + virtual StatusCode execute() override; + virtual StatusCode finalize() override; + + private: + + /** + * @brief Proxy tool to get Tile conditions data from source (file, DB) + */ + ToolHandle<ITileCondProxy<T> > m_conditionsProxy{this, "ConditionsProxy", "", + "Tile conditions proxy"}; + + /** + * @brief Name of output TileCalibData + */ + SG::WriteCondHandleKey<TileCalibData<T> > m_calibDataKey{this, "TileCalibData", "", + "Output Tile calibration constants"}; + + ServiceHandle<ICondSvc> m_condSvc; + +}; + +#include "TileCalibCondAlg.icc" + +#include "TileCalibBlobObjs/TileCalibDrawerFlt.h" +typedef TileCalibCondAlg<TileCalibDrawerFlt> TileCalibFltCondAlg; + +#include "TileCalibBlobObjs/TileCalibDrawerOfc.h" +typedef TileCalibCondAlg<TileCalibDrawerOfc> TileCalibOfcCondAlg; + + +#endif // TILECONDITIONS_TILECALIBCONDALG_H diff --git a/TileCalorimeter/TileConditions/src/TileCalibCondAlg.icc b/TileCalorimeter/TileConditions/src/TileCalibCondAlg.icc new file mode 100644 index 0000000000000000000000000000000000000000..4d2d7a608087b20f9a6c158cedb52607f8539f34 --- /dev/null +++ b/TileCalorimeter/TileConditions/src/TileCalibCondAlg.icc @@ -0,0 +1,80 @@ +//Dear emacs, this is -*- c++ -*- +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +//#include "TileCalibCondAlg.h" +#include "TileCalibBlobObjs/TileCalibUtils.h" + +#include "StoreGate/ReadCondHandle.h" +#include "StoreGate/WriteCondHandle.h" + +template<class T> +TileCalibCondAlg<T>::TileCalibCondAlg(const std::string& name, ISvcLocator* pSvcLocator) : + AthAlgorithm(name, pSvcLocator), + m_condSvc("CondSvc", name) +{ + +} + +template<class T> +TileCalibCondAlg<T>::~TileCalibCondAlg() { +} + +template<class T> +StatusCode TileCalibCondAlg<T>::initialize() { + + // CondSvc + ATH_CHECK( m_condSvc.retrieve() ); + + ATH_CHECK( m_conditionsProxy.retrieve() ); + ATH_CHECK( m_calibDataKey.initialize() ); + + // Register write handle + if (m_condSvc->regHandle(this, m_calibDataKey).isFailure()) { + ATH_MSG_ERROR("unable to register WriteCondHandle " << m_calibDataKey.fullKey() << " with CondSvc"); + return StatusCode::FAILURE; + } + + return StatusCode::SUCCESS; +} + +template<class T> +StatusCode TileCalibCondAlg<T>::execute() { + + SG::WriteCondHandle<TileCalibData<T> > calibData{m_calibDataKey}; + + if (calibData.isValid()) { + ATH_MSG_DEBUG("Found valid TileCalibData: " << calibData.key()); + return StatusCode::SUCCESS; + } + + // Define validity of the output cond object + EventIDRange eventRange; + std::unique_ptr<TileCalibData<T>> data = std::make_unique<TileCalibData<T>>(); + + ATH_CHECK( m_conditionsProxy->fillCalibData(*data, eventRange) ); + + if(calibData.record(eventRange, data.release()).isFailure()) { + ATH_MSG_ERROR("Could not record TileCalibData object with " + << calibData.key() + << " with EventRange " << eventRange + << " into Conditions Store"); + return StatusCode::FAILURE; + } else { + + ATH_MSG_VERBOSE("Recorded TileCalibData object with " + << calibData.key() + << " with EventRange " << eventRange + << " into Conditions Store"); + } + + + return StatusCode::SUCCESS; + +} + +template<class T> +StatusCode TileCalibCondAlg<T>::finalize() { + return StatusCode::SUCCESS; +} diff --git a/TileCalorimeter/TileConditions/src/TileCalibData.cxx b/TileCalorimeter/TileConditions/src/TileCalibData.cxx new file mode 100644 index 0000000000000000000000000000000000000000..af1b7674202c1f9319a31e6f92fe734f188a675a --- /dev/null +++ b/TileCalorimeter/TileConditions/src/TileCalibData.cxx @@ -0,0 +1,47 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#include "TileConditions/TileCalibData.h" +#include "TileCalibBlobObjs/TileCalibUtils.h" +#include "TileCalibBlobObjs/Exception.h" + +template<class T> +TileCalibData<T>::TileCalibData() : m_calibDrawers(TileCalibUtils::MAX_DRAWERIDX, nullptr) { + +} + +template<class T> +TileCalibData<T>::~TileCalibData() { + + //=== Delete TileCalibDrawers (which do not own the blob) + std::set<const T*> uniqueDrawers(m_calibDrawers.begin(), m_calibDrawers.end()); + for (const T* calibDrawer : uniqueDrawers) { + delete calibDrawer; + } + +} + +template<class T> +const T* TileCalibData<T>::getCalibDrawer(unsigned int drawerIdx) const { + + if (drawerIdx >= TileCalibUtils::MAX_DRAWERIDX) { + + throw TileCalib::IndexOutOfRange("TileCalibData::getCalibDrawer()", + drawerIdx, TileCalibUtils::MAX_DRAWERIDX); + } + + return m_calibDrawers[drawerIdx]; +} + +template<class T> +void TileCalibData<T>::setCalibDrawer(unsigned int drawerIdx, const T* calibDrawer) { + + if (drawerIdx >= TileCalibUtils::MAX_DRAWERIDX) { + + throw TileCalib::IndexOutOfRange("TileCalibData::setCalibDrawer()", + drawerIdx, TileCalibUtils::MAX_DRAWERIDX); + } + + m_calibDrawers[drawerIdx] = calibDrawer; +} diff --git a/TileCalorimeter/TileConditions/src/TileCellNoiseTool.cxx b/TileCalorimeter/TileConditions/src/TileCellNoiseTool.cxx index 62e9c036585e344d5df5783c06973a00b977ea43..abf865ba8ee8a99f5855fe78c485ea4ef8c6257d 100644 --- a/TileCalorimeter/TileConditions/src/TileCellNoiseTool.cxx +++ b/TileCalorimeter/TileConditions/src/TileCellNoiseTool.cxx @@ -2,16 +2,17 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -// Athena includes -#include "AthenaKernel/errorcheck.h" // Tile includes #include "TileConditions/TileCellNoiseTool.h" +#include "TileConditions/ITileCondToolNoise.h" #include "TileConditions/TileCablingSvc.h" #include "TileConditions/TileCondIdTransforms.h" -#include "TileConditions/ITileCondToolNoise.h" #include "TileConditions/Exception.h" +// Athena includes +#include "AthenaKernel/errorcheck.h" + #include <cmath> #include <algorithm> @@ -122,7 +123,7 @@ float TileCellNoiseTool::getCellNoise(const Identifier& cell_id, } unsigned int gain1 = gain & 3; // gain for first PMT - unsigned int gain2 = (gain >> 2) & 3; // gain for second PMT + unsigned int gain2 = (gain >> 2) & 3; // gain for second PMT float noise1(0.), noise2(0.), noise12(0.), noise21(0.); unsigned int drawerIdx(0), channel(0), adc(0); diff --git a/TileCalorimeter/TileConditions/src/TileCondProxyCool.icc b/TileCalorimeter/TileConditions/src/TileCondProxyCool.icc index 4cef683060039151db4ebf16188a5b64f2ce7ecc..e8939bcc6e7809390bac3e3484a3591054644f5d 100644 --- a/TileCalorimeter/TileConditions/src/TileCondProxyCool.icc +++ b/TileCalorimeter/TileConditions/src/TileCondProxyCool.icc @@ -1,10 +1,9 @@ +//Dear emacs, this is -*- c++ -*- + /* Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -// Athena includes -#include "AthenaKernel/errorcheck.h" - // Tile includes #include "TileConditions/TileCondProxyCool.h" #include "TileCalibBlobObjs/TileCalibDrawerFlt.h" @@ -12,17 +11,20 @@ #include "TileCalibBlobObjs/TileCalibDrawerOfc.h" #include "TileCalibBlobObjs/TileCalibUtils.h" +// Athena includes +#include "AthenaKernel/errorcheck.h" +#include "StoreGate/ReadCondHandle.h" +#include "StoreGate/WriteCondHandle.h" + + // //____________________________________________________________________ template<typename T> TileCondProxyCool<T>::TileCondProxyCool(const std::string& type, const std::string& name, const IInterface* parent) - : AthAlgTool(type, name, parent) - , m_source("") - , m_drawerVec( std::vector<const T*>(TileCalibUtils::MAX_DRAWERIDX, static_cast<const T*>(0))) + : AthAlgTool(type, name, parent) { declareInterface<ITileCondProxy<T> >(this); - declareProperty("Source", m_source = "", "The COOL folder to read"); } // @@ -31,11 +33,28 @@ template<typename T> StatusCode TileCondProxyCool<T>::initialize() { ATH_MSG_DEBUG( "In initialize() for " << name() ); + ATH_MSG_INFO( "Creating TileCondProxyCool(" << name() - << ") for folder: \"" << m_source << "\"" ); + << ") for folder: \"" << m_sourceKey.key() << "\"" ); + + const INamedInterface* owner = dynamic_cast<const INamedInterface*>(parent()); + std::string parentName = (owner) ? owner->name() : ""; + std::string condAlgSuffix("CondAlg"); + if (parentName.size() < condAlgSuffix.size() + || parentName.compare(parentName.size() - condAlgSuffix.size(), + condAlgSuffix.size(), condAlgSuffix) != 0) { + + //=== Register callback for this data handle + CHECK( detStore()->regFcn(&TileCondProxyCool<T>::callback, this, m_dataHandle, m_sourceKey.key(), true) ); + + ATH_MSG_DEBUG("It seems that parent [" << parentName << "] is not condition algorithm." << endmsg + << "Callback function has been registered for " << m_sourceKey.key() << "."); + } else { + ATH_CHECK( m_sourceKey.initialize() ); + ATH_MSG_DEBUG("It seems that parent [" << parentName << "] is condition algorithm." << endmsg + << "No callback functions have been registered for " << m_sourceKey.key() << "."); + } - //=== Register callback for this data handle - CHECK( detStore()->regFcn(&TileCondProxyCool<T>::callback, this, m_dataHandle, m_source, true) ); return StatusCode::SUCCESS; } @@ -46,16 +65,68 @@ template<typename T> StatusCode TileCondProxyCool<T>::finalize() { ATH_MSG_DEBUG( "finalize called for " << name() ); + return StatusCode::SUCCESS; + +} + +template<typename T> +StatusCode TileCondProxyCool<T>::fillCalibData(TileCalibData<T>& calibData, + EventIDRange& eventRange) const { + + ATH_MSG_DEBUG( "createCalibData called for " << name() ); - //=== Delete TileCalibDrawers (which do not own the blob) - std::set<const T*> unique(m_drawerVec.begin(), m_drawerVec.end()); - for (typename std::set<const T*>::iterator i = unique.begin(); i != unique.end(); ++i) { - delete *i; + SG::ReadCondHandle<CondAttrListCollection> source{m_sourceKey}; + const CondAttrListCollection* attrListCollection{*source}; + + if (!attrListCollection) { + ATH_MSG_ERROR("Failed to retrieve CondAttributeListCollection with key " << m_sourceKey.key()); + return StatusCode::FAILURE; } + //=== Loop over collection by increasing channel number (defaults first!) + for (unsigned int drawerIdx = 0; drawerIdx < TileCalibUtils::MAX_DRAWERIDX; ++drawerIdx) { + + //=== get the BLOB + CondAttrListCollection::const_iterator attrListPair = attrListCollection->chanAttrListPair(drawerIdx); + const coral::Blob& blob = (attrListPair->second)[0].data<coral::Blob>(); + + if (blob.size()) { + + //=== Get new TileCalibDrawer instance, interpreting current blob + std::unique_ptr<const T> calibDrawer(T::getInstance(blob)); + calibData.setCalibDrawer(drawerIdx, calibDrawer.release()); + + } else { + + //=== Default policy + if (drawerIdx == 0) { + ATH_MSG_ERROR( "No default available!?" ); + return StatusCode::FAILURE; + } + //=== Determine default index + unsigned int defaultDrawerIdx = TileCalibUtils::getDefaultDrawerIdx(drawerIdx); + calibData.setCalibDrawer(drawerIdx, calibData.getCalibDrawer(defaultDrawerIdx)); + + ATH_MSG_VERBOSE( "Using default drawer " << defaultDrawerIdx + << " for drawerIdx=" << drawerIdx << endmsg + << "... i.e. TileCalibDrawer @ " << calibData.getCalibDrawer(drawerIdx)); + + } + + } // End drawerIdx + + + // Define validity of the output cond object + if(!source.range(eventRange)) { + ATH_MSG_ERROR("Failed to retrieve validity range for " << source.key()); + return StatusCode::FAILURE; + } + + return StatusCode::SUCCESS; } + // //_____________________________________________________________________________ template<typename T> @@ -68,36 +139,36 @@ StatusCode TileCondProxyCool<T>::callback( IOVSVC_CALLBACK_ARGS_K(keys)) { } msg(MSG::INFO) << endmsg; - //=== Delete outdated TileCalibDrawers (which do not own the blob) - std::set<const T*> unique(m_drawerVec.begin(), m_drawerVec.end()); - for (typename std::set<const T*>::iterator i = unique.begin(); i != unique.end(); ++i) { - delete *i; - } + m_calibData = std::make_unique<TileCalibData<T>>(); //=== Loop over collection by increasing channel number (defaults first!) for (unsigned int drawerIdx = 0; drawerIdx < TileCalibUtils::MAX_DRAWERIDX; ++drawerIdx) { + //=== get the BLOB - CondAttrListCollection::const_iterator iColl = m_dataHandle->chanAttrListPair(drawerIdx); - const coral::Blob& blob = (iColl->second)[0].data<coral::Blob>(); + CondAttrListCollection::const_iterator attrListPair = m_dataHandle->chanAttrListPair(drawerIdx); + const coral::Blob& blob = (attrListPair->second)[0].data<coral::Blob>(); if (blob.size()) { + //=== Get new TileCalibDrawer instance, interpreting current blob - const T* drawer = T::getInstance(blob); - m_drawerVec[drawerIdx] = drawer; + std::unique_ptr<const T> calibDrawer(T::getInstance(blob)); + m_calibData->setCalibDrawer(drawerIdx, calibDrawer.release()); + } else { //=== Default policy if (drawerIdx == 0) { ATH_MSG_ERROR( "No default available!?" ); return StatusCode::FAILURE; } + //=== Determine default index - unsigned int defIdx = TileCalibUtils::getDefaultDrawerIdx(drawerIdx); - m_drawerVec[drawerIdx] = m_drawerVec[defIdx]; + unsigned int defaultDrawerIdx = TileCalibUtils::getDefaultDrawerIdx(drawerIdx); + m_calibData->setCalibDrawer(drawerIdx, m_calibData->getCalibDrawer(defaultDrawerIdx)); + + ATH_MSG_VERBOSE( "Using default drawer " << defaultDrawerIdx + << " for drawerIdx=" << drawerIdx << endmsg + << "... i.e. TileCalibDrawer @ " << m_calibData->getCalibDrawer(drawerIdx)); - if (msgLvl(MSG::VERBOSE)) { - msg(MSG::VERBOSE) << "Using default drawer " << defIdx << " for drawerIdx=" << drawerIdx << endmsg; - msg(MSG::VERBOSE) << "... i.e. TileCalibDrawer @ " << m_drawerVec[drawerIdx] << endmsg; - } } } // End drawerIdx @@ -109,11 +180,7 @@ StatusCode TileCondProxyCool<T>::callback( IOVSVC_CALLBACK_ARGS_K(keys)) { //_____________________________________________________________________________ template<typename T> const T* TileCondProxyCool<T>::getCalibDrawer(unsigned int drawerIdx) const { - if (drawerIdx >= TileCalibUtils::MAX_DRAWERIDX) { - ATH_MSG_ERROR( "Requested TileCalibDrawer with out of range index: " << drawerIdx ); - throw TileCalib::IndexOutOfRange("TileCondProxyCool::getCalibDrawer()", drawerIdx, TileCalibUtils::MAX_DRAWERIDX); - } - return m_drawerVec[drawerIdx]; -} + return (m_calibData) ? m_calibData->getCalibDrawer(drawerIdx) : nullptr; +} diff --git a/TileCalorimeter/TileConditions/src/TileCondProxyFile.icc b/TileCalorimeter/TileConditions/src/TileCondProxyFile.icc index d56dd397096142959c369d18428c30bfc654bcf7..b587c229b56f473274b47bdb9419c519e3048253 100644 --- a/TileCalorimeter/TileConditions/src/TileCondProxyFile.icc +++ b/TileCalorimeter/TileConditions/src/TileCondProxyFile.icc @@ -7,17 +7,18 @@ // Tile includes #include "TileConditions/TileCondProxyFile.h" -#include "TileConditions/TileCablingService.h" -#include "TileConditions/TileCablingSvc.h" - #include "TileCalibBlobObjs/TileCalibDrawerFlt.h" #include "TileCalibBlobObjs/TileCalibDrawerBch.h" #include "TileCalibBlobObjs/TileBchDecoder.h" #include "TileCalibBlobObjs/TileCalibUtils.h" #include "PathResolver/PathResolver.h" + +#include "CoralBase/Blob.h" + #include <fstream> + // //____________________________________________________________________ template<typename T> @@ -25,7 +26,6 @@ TileCondProxyFile<T>::TileCondProxyFile(const std::string& type, const std::stri const IInterface* parent) : AthAlgTool(type, name, parent) , m_source("") - , m_drawerVec(std::vector<const T*>(TileCalibUtils::MAX_DRAWERIDX, static_cast<const T*>(0))) { declareInterface<ITileCondProxy<T> >(this); declareProperty("Source", m_source = "", "The ASCII file to read"); @@ -36,7 +36,33 @@ TileCondProxyFile<T>::TileCondProxyFile(const std::string& type, const std::stri template<typename T> StatusCode TileCondProxyFile<T>::initialize() { - //=== file name needs to be set to read correct defaults + const INamedInterface* owner = dynamic_cast<const INamedInterface*>(parent()); + std::string parentName = (owner) ? owner->name() : ""; + std::string condAlgSuffix("CondAlg"); + if (parentName.size() < condAlgSuffix.size() + || parentName.compare(parentName.size() - condAlgSuffix.size(), + condAlgSuffix.size(), condAlgSuffix) != 0) { + + EventIDRange eventRange; + m_calibData = std::make_unique<TileCalibData<T>>(); + ATH_CHECK(fillCalibData(*m_calibData, eventRange)); + + ATH_MSG_DEBUG("It seems that parent [" << parentName << "] is not condition algorithm." << endmsg + << "Tile calibration drawers have been prepared in advance."); + } else { + ATH_MSG_DEBUG("It seems that parent [" << parentName << "] is condition algorithm." << endmsg + << "Tile calibration drawers have not been prepared in advance." ); + } + + return StatusCode::SUCCESS; +} + + +template<typename T> +StatusCode TileCondProxyFile<T>::fillCalibData(TileCalibData<T>& calibData, + EventIDRange& eventRange) const { + + //=== file name needs to be set to read correct defaults if (!m_source.size()) { ATH_MSG_ERROR( name() << ": Empty file name detected, initialization not possible." ); return StatusCode::FAILURE; @@ -60,19 +86,7 @@ StatusCode TileCondProxyFile<T>::initialize() { return StatusCode::FAILURE; } - ServiceHandle<TileCablingSvc> cablingSvc("TileCablingSvc", name()); - CHECK( cablingSvc.retrieve()); - - const TileCablingService* cabling = cablingSvc->cablingService(); - if (!cabling) { - ATH_MSG_ERROR( "Unable to retrieve TileCablingService" ); - return StatusCode::FAILURE; - } - - m_maxChannels = cabling->getMaxChannels(); - m_maxGains = cabling->getMaxGains(); - m_drawerCacheSize = m_maxChannels * m_maxGains; - + //======================================================== //=== loop through the file and fill data maps @@ -113,17 +127,6 @@ StatusCode TileCondProxyFile<T>::initialize() { return StatusCode::FAILURE; } - if (channel >= m_maxChannels) { - ATH_MSG_ERROR( "Detected invalid channel index in file \"" - << fileName << "\": " << channel ); - - return StatusCode::FAILURE; - } - - if (gain >= m_maxGains) { - ATH_MSG_ERROR( "Detected invalid gain index in file \"" << fileName << "\": " << gain ); - return StatusCode::FAILURE; - } //=== Mark module as affected if (drawerStat.find(drawerIdx) == drawerStat.end()) { @@ -151,8 +154,7 @@ StatusCode TileCondProxyFile<T>::initialize() { } //=== Save dataVector in map - unsigned int adcIdx = cacheIndex(drawerIdx, channel, gain); - dataMap[adcIdx] = dataVec; + dataMap[std::make_tuple(drawerIdx, channel, gain)] = dataVec; } // End loop over file @@ -178,57 +180,79 @@ StatusCode TileCondProxyFile<T>::initialize() { //=== if no data for drawer, link to default drawer... if (drawerStat.find(drawerIdx) == drawerStat.end()) { - unsigned int defIdx = TileCalibUtils::getDefaultDrawerIdx(drawerIdx); - m_drawerVec[drawerIdx] = m_drawerVec[defIdx]; - if (msgLvl(MSG::VERBOSE)) { - msg(MSG::VERBOSE) << "Using default drawer " << defIdx << " for drawerIdx=" << drawerIdx << endmsg; - msg(MSG::VERBOSE) << "... i.e. TileCalibDrawer @ " << m_drawerVec[drawerIdx] << endmsg; - } + + unsigned int defaultDrawerIdx = TileCalibUtils::getDefaultDrawerIdx(drawerIdx); + calibData.setCalibDrawer(drawerIdx, calibData.getCalibDrawer(defaultDrawerIdx)); + + ATH_MSG_VERBOSE( "Using default drawer " << defaultDrawerIdx + << " for drawerIdx=" << drawerIdx << endmsg + << "... i.e. TileCalibDrawer @ " << calibData.getCalibDrawer(drawerIdx)); + continue; } unsigned int nChannels = drawerStat[drawerIdx] + 1; - m_drawerVec[drawerIdx] = createCalibDrawer(drawerIdx, nChannels, objVersion, dataMap); + + calibData.setCalibDrawer(drawerIdx, createCalibDrawer(drawerIdx, nChannels, objVersion, dataMap).release()); } // End drawerIdx + + eventRange = EventIDRange{ + EventIDBase{0, // Run number + EventIDBase::UNDEFEVT, + EventIDBase::UNDEFNUM, + EventIDBase::UNDEFNUM, + 0}, // Lumi block + EventIDBase{EventIDBase::UNDEFNUM - 1, // Run number + EventIDBase::UNDEFEVT, + EventIDBase::UNDEFNUM, + EventIDBase::UNDEFNUM, + EventIDBase::UNDEFNUM - 1} // Lumi block + }; + return StatusCode::SUCCESS; + } + // //_____________________________________________________________________________ template<> -const TileCalibDrawerFlt* TileCondProxyFile<TileCalibDrawerFlt>::createCalibDrawer(unsigned int drawerIdx, unsigned int nChannels, - unsigned int objVers, const DataMap& dataMap) { +std::unique_ptr<const TileCalibDrawerFlt> TileCondProxyFile<TileCalibDrawerFlt>::createCalibDrawer(unsigned int drawerIdx, + unsigned int nChannels, + unsigned int objVers, + const DataMap& dataMap) const { //=== Prepare vector with defaults //--- Low gain is always there TileCalibDrawerFlt::DefType defaultVec; - unsigned int nGains = 1; - TileCondProxyFile::DataMap::const_iterator iDataMap = dataMap.find(cacheIndex(0, 0, 0)); - defaultVec.push_back(iDataMap->second); - //--- Another gains present? - for (unsigned int gain = 1; gain < m_maxGains; ++gain) { - iDataMap = dataMap.find(cacheIndex(0, 0, gain)); - if (iDataMap != dataMap.end()) { - ++nGains; - defaultVec.push_back(iDataMap->second); - } else { - break; - } + unsigned int gain(0); + + TileCondProxyFile::DataMap::const_iterator iDataMap = dataMap.find(std::make_tuple(drawerIdx, 0, gain)); + while (iDataMap != dataMap.end()) { + defaultVec.push_back(iDataMap->second); + ++gain; + iDataMap = dataMap.find(std::make_tuple(drawerIdx, 0, gain)); } + unsigned int nGains(gain); + //=== create the calibDrawer - coral::Blob* blob = new coral::Blob(0); - m_blobStore.push_back(blob); - TileCalibDrawerFlt* calibDrawer = TileCalibDrawerFlt::getInstance(*blob, defaultVec, nChannels, objVers); + std::unique_ptr<coral::Blob> blob = std::make_unique<coral::Blob>(0); + std::unique_ptr<TileCalibDrawerFlt> tmpCalibDrawer(TileCalibDrawerFlt::getInstance(*blob, + defaultVec, + nChannels, + objVers)); + // Trick to make calib drawer to own blob + std::unique_ptr<TileCalibDrawerFlt> calibDrawer = std::make_unique<TileCalibDrawerFlt>(*tmpCalibDrawer); //=== fill calibDrawer with settings in dataMap - for (unsigned int chn = 0; chn < nChannels; ++chn) { + for (unsigned int channel = 0; channel < nChannels; ++channel) { for (unsigned int adc = 0; adc < nGains; ++adc) { - iDataMap = dataMap.find(cacheIndex(drawerIdx, chn, adc)); + iDataMap = dataMap.find(std::make_tuple(drawerIdx, channel, adc)); if (iDataMap != dataMap.end()) { - calibDrawer->setData(chn, adc, iDataMap->second); + calibDrawer->setData(channel, adc, iDataMap->second); } } } @@ -239,31 +263,35 @@ const TileCalibDrawerFlt* TileCondProxyFile<TileCalibDrawerFlt>::createCalibDraw // //_____________________________________________________________________________ template<> -const TileCalibDrawerBch* TileCondProxyFile<TileCalibDrawerBch>::createCalibDrawer(unsigned int drawerIdx, unsigned int nChannels, - unsigned int objVers, const DataMap& dataMap) { +std::unique_ptr<const TileCalibDrawerBch> TileCondProxyFile<TileCalibDrawerBch>::createCalibDrawer(unsigned int drawerIdx, + unsigned int nChannels, + unsigned int objVers, + const DataMap& dataMap) const { //------------------------------------------------------------------------------- //--- Observed special case for TileCalibDrawerBch, which always expects 3 gains: //--- 0=low gain, 1=high gain, 2=common channel problems! - //--- However, in the file format only up to 2 gains can be encoded. + //--- However, in the file format only up to 2 gains can be encoded. //--- Therefore the convention is assumed that the words for the three gains are //--- all listed under gain 0 in the file. //------------------------------------------------------------------------------- //=== prepare vector with defaults (no bad channels) - TileCalibDrawerBch::DefType defaultVec(3); - defaultVec[0].push_back(0); - defaultVec[1].push_back(0); - defaultVec[2].push_back(0); + TileCalibDrawerBch::DefType defaultVec{{0}, {0}, {0}}; //=== create the calibDrawer - coral::Blob* blob = new coral::Blob(0); - m_blobStore.push_back(blob); + std::unique_ptr<coral::Blob> blob = std::make_unique<coral::Blob>(0); TileBchDecoder::BitPatVer bitPatVer = static_cast<TileBchDecoder::BitPatVer>(objVers); - TileCalibDrawerBch* calibDrawer = TileCalibDrawerBch::getInstance(*blob, defaultVec, nChannels, bitPatVer); + std::unique_ptr<TileCalibDrawerBch> tmpCalibDrawer(TileCalibDrawerBch::getInstance(*blob, + defaultVec, + nChannels, + bitPatVer)); + // Trick to make calib drawer to own blob + std::unique_ptr<TileCalibDrawerBch> calibDrawer = std::make_unique<TileCalibDrawerBch>(*tmpCalibDrawer); + //=== fill calibDrawer with settings in dataMap for (unsigned int channel = 0; channel < nChannels; ++channel) { - TileCondProxyFile::DataMap::const_iterator iDataMap = dataMap.find( cacheIndex(drawerIdx, channel, 0)); + TileCondProxyFile::DataMap::const_iterator iDataMap = dataMap.find( std::make_tuple(drawerIdx, channel, 0)); if (iDataMap != dataMap.end()) { const std::vector<float>& dataVec = iDataMap->second; for (unsigned int idx = 0; idx < dataVec.size(); ++idx) { @@ -280,15 +308,8 @@ const TileCalibDrawerBch* TileCondProxyFile<TileCalibDrawerBch>::createCalibDraw //_____________________________________________________________________________ template<typename T> StatusCode TileCondProxyFile<T>::finalize() { - ATH_MSG_DEBUG( "finalize called for " << name() ); - - //=== Delete TileCalibDrawers (which do not own the blob) - std::set<const T*> unique(m_drawerVec.begin(), m_drawerVec.end()); - for (const T* calibDrawer : unique) delete calibDrawer; - - //=== Delete all blobs - for (coral::Blob* b : m_blobStore) delete b; + ATH_MSG_DEBUG( "finalize called for " << name() ); return StatusCode::SUCCESS; } @@ -296,11 +317,7 @@ StatusCode TileCondProxyFile<T>::finalize() { //_____________________________________________________________________________ template<typename T> const T* TileCondProxyFile<T>::getCalibDrawer(unsigned int drawerIdx) const { - if (drawerIdx >= TileCalibUtils::MAX_DRAWERIDX) { - ATH_MSG_ERROR( "Requested TileCalibDrawer with out of range index: " << drawerIdx ); - throw TileCalib::IndexOutOfRange("TileCondProxyFile::getCalibDrawer()", drawerIdx, TileCalibUtils::MAX_DRAWERIDX); - } - return m_drawerVec[drawerIdx]; -} + return (m_calibData) ? m_calibData->getCalibDrawer(drawerIdx) : nullptr; +} diff --git a/TileCalorimeter/TileConditions/src/TileCondToolAutoCr.cxx b/TileCalorimeter/TileConditions/src/TileCondToolAutoCr.cxx index 2404ed0cdef475904e7dfeb1c688fdc782852861..e4431181e7fbe03462a02db0d5e716412f1d07b2 100644 --- a/TileCalorimeter/TileConditions/src/TileCondToolAutoCr.cxx +++ b/TileCalorimeter/TileConditions/src/TileCondToolAutoCr.cxx @@ -2,13 +2,14 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -// Athena includes -#include "AthenaKernel/errorcheck.h" // Tile includes #include "TileConditions/TileCondToolAutoCr.h" -#include "TileCalibBlobObjs/TileCalibUtils.h" -#include "TileCalibBlobObjs/Exception.h" +#include "TileCalibBlobObjs/TileCalibDrawerFlt.h" + +// Athena includes +#include "AthenaKernel/errorcheck.h" +#include "StoreGate/ReadCondHandle.h" // //____________________________________________________________________ @@ -23,11 +24,9 @@ const InterfaceID& TileCondToolAutoCr::interfaceID() { TileCondToolAutoCr::TileCondToolAutoCr(const std::string& type, const std::string& name, const IInterface* parent) : AthAlgTool(type, name, parent) - , m_pryNoiseAutoCr("TileCondProxyFile_TileCalibDrawerFlt_/TileCondProxyDefault_NoiseAutoCr", this) { - // declareInterface<ITileCondToolAutoCr>(this); declareInterface<TileCondToolAutoCr>(this); - declareProperty("ProxyNoiseAutoCr", m_pryNoiseAutoCr); + } // @@ -41,8 +40,8 @@ StatusCode TileCondToolAutoCr::initialize() { ATH_MSG_DEBUG( "In initialize()" ); - //=== Retrieve proxy - CHECK( m_pryNoiseAutoCr.retrieve() ); + //=== Initialize conditions data key with auto correlations + ATH_CHECK( m_calibAutorCorrelationKey.initialize() ); return StatusCode::SUCCESS; } @@ -58,17 +57,21 @@ StatusCode TileCondToolAutoCr::finalize() { // //____________________________________________________________________ -void TileCondToolAutoCr::getAutoCorr(unsigned int drawerIdx, unsigned int channel, unsigned int adc, - std::vector<float>& vec) const { - const TileCalibDrawerFlt* calibDrawer = m_pryNoiseAutoCr->getCalibDrawer(drawerIdx); - unsigned int nNum = calibDrawer->getObjSizeUint32(); +void TileCondToolAutoCr::getAutoCorr(unsigned int drawerIdx, + unsigned int channel, + unsigned int adc, + std::vector<float>& vec) const { + - if (vec.size() != nNum) { - vec.resize(nNum); + SG::ReadCondHandle<TileCalibDataFlt> calibAutoCorrelation(m_calibAutorCorrelationKey); + const TileCalibDrawerFlt* calibDrawer = calibAutoCorrelation->getCalibDrawer(drawerIdx); + const unsigned int nElements(calibDrawer->getObjSizeUint32()); + + if (vec.size() != nElements) { + vec.resize(nElements); } - for (unsigned int i = 0; i < nNum; ++i) { + for (unsigned int i = 0; i < nElements; ++i) { vec[i] = calibDrawer->getData(channel, adc, i); } } - diff --git a/TileCalorimeter/TileConditions/src/TileCondToolDspThreshold.cxx b/TileCalorimeter/TileConditions/src/TileCondToolDspThreshold.cxx index 7b55e6717fe1b670cf5f0c11c0e21c2be74b88eb..30a2d085155f79c073ee3b85ab8ded53876c88ad 100644 --- a/TileCalorimeter/TileConditions/src/TileCondToolDspThreshold.cxx +++ b/TileCalorimeter/TileConditions/src/TileCondToolDspThreshold.cxx @@ -2,28 +2,22 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ - -#include "TileConditions/TileCondToolDspThreshold.h" - // Tile includes +#include "TileConditions/TileCondToolDspThreshold.h" #include "TileCalibBlobObjs/TileCalibDrawerFlt.h" -#include "TileCalibBlobObjs/TileCalibUtils.h" -#include "TileCalibBlobObjs/Exception.h" // Athena includes #include "AthenaKernel/errorcheck.h" - +#include "StoreGate/ReadCondHandle.h" // //____________________________________________________________________ TileCondToolDspThreshold::TileCondToolDspThreshold(const std::string& type, const std::string& name, const IInterface* parent) : AthAlgTool(type, name, parent) - , m_pryDspThreshold("TileCondProxyFile_TileCalibDrawerFlt_/TileCondProxyDefault_Threshold", this) { declareInterface<ITileCondToolDspThreshold>(this); declareInterface<TileCondToolDspThreshold>(this); - declareProperty("ProxyDspThreshold", m_pryDspThreshold); } // @@ -37,8 +31,8 @@ StatusCode TileCondToolDspThreshold::initialize() { ATH_MSG_DEBUG( "In initialize()" ); - //=== retrieve proxy - CHECK( m_pryDspThreshold.retrieve() ); + //=== Initialize conditions data key with DSP thresholds + ATH_CHECK( m_calibDspThresholdKey.initialize() ); return StatusCode::SUCCESS; } @@ -55,22 +49,20 @@ StatusCode TileCondToolDspThreshold::finalize() { // //____________________________________________________________________ float TileCondToolDspThreshold::getMinimumAmplitudeThreshold(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const { - if (drawerIdx >= TileCalibUtils::MAX_DRAWERIDX) { - throw TileCalib::IndexOutOfRange("TileCondToolDspThreshold::getThreshold", drawerIdx, TileCalibUtils::MAX_DRAWERIDX); - } - return m_pryDspThreshold->getCalibDrawer(drawerIdx)->getData(channel, adc, 0); + SG::ReadCondHandle<TileCalibData<TileCalibDrawerFlt>> calibDspThreshold(m_calibDspThresholdKey); + return calibDspThreshold->getCalibDrawer(drawerIdx)->getData(channel, adc, 0); + } // //____________________________________________________________________ float TileCondToolDspThreshold::getMaximumAmplitudeThreshold(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const { - if (drawerIdx >= TileCalibUtils::MAX_DRAWERIDX) { - throw TileCalib::IndexOutOfRange("TileCondToolDspThreshold::getThreshold", drawerIdx, TileCalibUtils::MAX_DRAWERIDX); - } - return m_pryDspThreshold->getCalibDrawer(drawerIdx)->getData(channel, adc, 1); + SG::ReadCondHandle<TileCalibData<TileCalibDrawerFlt>> calibDspThreshold(m_calibDspThresholdKey); + return calibDspThreshold->getCalibDrawer(drawerIdx)->getData(channel, adc, 1); + } @@ -78,22 +70,20 @@ float TileCondToolDspThreshold::getMaximumAmplitudeThreshold(unsigned int drawer //____________________________________________________________________ void TileCondToolDspThreshold::getAmplitudeThresholds(unsigned int drawerIdx, unsigned int channel, unsigned int adc, float& minimumThreshold, float& maximumThreshold) const { - if (drawerIdx >= TileCalibUtils::MAX_DRAWERIDX) { - throw TileCalib::IndexOutOfRange("TileCondToolDspThreshold::getThreshold", drawerIdx, TileCalibUtils::MAX_DRAWERIDX); - } - minimumThreshold = m_pryDspThreshold->getCalibDrawer(drawerIdx)->getData(channel, adc, 0); - maximumThreshold = m_pryDspThreshold->getCalibDrawer(drawerIdx)->getData(channel, adc, 1); + SG::ReadCondHandle<TileCalibData<TileCalibDrawerFlt>> calibDspThreshold(m_calibDspThresholdKey); + minimumThreshold = calibDspThreshold->getCalibDrawer(drawerIdx)->getData(channel, adc, 0); + maximumThreshold = calibDspThreshold->getCalibDrawer(drawerIdx)->getData(channel, adc, 1); + } // //____________________________________________________________________ float TileCondToolDspThreshold::getDspThreshold(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const { - if (drawerIdx >= TileCalibUtils::MAX_DRAWERIDX) { - throw TileCalib::IndexOutOfRange("TileCondToolDspThreshold::getThreshold", drawerIdx, TileCalibUtils::MAX_DRAWERIDX); - } - return m_pryDspThreshold->getCalibDrawer(drawerIdx)->getData(channel, adc, 2); + SG::ReadCondHandle<TileCalibData<TileCalibDrawerFlt>> calibDspThreshold(m_calibDspThresholdKey); + return calibDspThreshold->getCalibDrawer(drawerIdx)->getData(channel, adc, 2); + } diff --git a/TileCalorimeter/TileConditions/src/TileCondToolEmscale.cxx b/TileCalorimeter/TileConditions/src/TileCondToolEmscale.cxx index 72c40c05d020ad06897c6ecc8393fc032aad6a4e..b4cb50cfa6986f803b6792a721a903ff061b35bd 100644 --- a/TileCalorimeter/TileConditions/src/TileCondToolEmscale.cxx +++ b/TileCalorimeter/TileConditions/src/TileCondToolEmscale.cxx @@ -4,15 +4,11 @@ // Tile includes #include "TileConditions/TileCondToolEmscale.h" -#include "TileConditions/TileCablingService.h" -#include "TileConditions/TileCablingSvc.h" - #include "TileCalibBlobObjs/TileCalibUtils.h" -#include "TileCalibBlobObjs/Exception.h" -#include "TileConditions/TileCondProxyWrapper.h" // Athena includes #include "AthenaKernel/errorcheck.h" +#include "StoreGate/ReadCondHandle.h" // @@ -28,44 +24,9 @@ const InterfaceID& TileCondToolEmscale::interfaceID() { TileCondToolEmscale::TileCondToolEmscale(const std::string& type, const std::string& name, const IInterface* parent) : AthAlgTool(type, name, parent) - , m_onlCacheUnit( TileRawChannelUnit::Invalid) - , m_onlCache(std::vector<float>(0)) - , m_OflLasLinUsed(true) - , m_OflLasNlnUsed(true) - //=== Offline folders are by default read from ASCII file - , m_pryOflCisLin("TileCondProxyFile_TileCalibDrawerFlt_/TileCondProxyDefault_OflCisLin", this) - , m_pryOflCisNln("TileCondProxyFile_TileCalibDrawerFlt_/TileCondProxyDefault_OflCisNln", this) - , m_pryOflLasLin("TileCondProxyFile_TileCalibDrawerFlt_/TileCondProxyDefault_OflLasLin", this) - , m_pryOflLasNln("TileCondProxyFile_TileCalibDrawerFlt_/TileCondProxyDefault_OflLasNln", this) - , m_pryOflLasFib("TileCondProxyFile_TileCalibDrawerFlt_/TileCondProxyDefault_OflLasFib", this) - , m_pryOflCes("TileCondProxyFile_TileCalibDrawerFlt_/TileCondProxyDefault_OflCes", this) - , m_pryOflEms("TileCondProxyFile_TileCalibDrawerFlt_/TileCondProxyDefault_OflEms", this) - //=== Online folders can only be read from the COOL DB - , m_pryOnlCis("TileCondProxyCool_TileCalibDrawerFlt_/TileCondProxyDefault_OnlCis", this) - , m_pryOnlLas("TileCondProxyCool_TileCalibDrawerFlt_/TileCondProxyDefault_OnlLas", this) - , m_pryOnlCes("TileCondProxyCool_TileCalibDrawerFlt_/TileCondProxyDefault_OnlCes", this) - , m_pryOnlEms("TileCondProxyCool_TileCalibDrawerFlt_/TileCondProxyDefault_OnlEms", this) - , m_useOflLasFib(false) - , m_maxChannels(0) - , m_maxGains(0) - , m_drawerCacheSize(0) { declareInterface<TileCondToolEmscale>(this); - declareProperty("OnlCacheUnit", m_onlCacheUnitStr = "Invalid"); - //=== "offline" proxies - declareProperty("ProxyOflCisLin", m_pryOflCisLin); - declareProperty("ProxyOflCisNln", m_pryOflCisNln); - declareProperty("ProxyOflLasLin", m_pryOflLasLin); - declareProperty("ProxyOflLasNln", m_pryOflLasNln); - declareProperty("ProxyOflLasFib", m_pryOflLasFib); - declareProperty("ProxyOflCes", m_pryOflCes); - declareProperty("ProxyOflEms", m_pryOflEms); - //=== "Online" proxies - declareProperty("ProxyOnlCis", m_pryOnlCis); - declareProperty("ProxyOnlLas", m_pryOnlLas); - declareProperty("ProxyOnlCes", m_pryOnlCes); - declareProperty("ProxyOnlEms", m_pryOnlEms); } // @@ -78,227 +39,28 @@ TileCondToolEmscale::~TileCondToolEmscale() { StatusCode TileCondToolEmscale::initialize() { ATH_MSG_DEBUG( "In initialize()" ); - - //=== Configure online cache unit - if (m_onlCacheUnitStr == "Invalid") { - m_onlCacheUnit = TileRawChannelUnit::Invalid; - } else if (m_onlCacheUnitStr == "OnlineADCcounts") { - m_onlCacheUnit = TileRawChannelUnit::OnlineADCcounts; - } else if (m_onlCacheUnitStr == "OnlinePicoCoulombs") { - m_onlCacheUnit = TileRawChannelUnit::OnlinePicoCoulombs; - } else if (m_onlCacheUnitStr == "OnlineCesiumPicoCoulombs") { - m_onlCacheUnit = TileRawChannelUnit::OnlineCesiumPicoCoulombs; - } else if (m_onlCacheUnitStr == "OnlineMegaElectronVolts") { - m_onlCacheUnit = TileRawChannelUnit::OnlineMegaElectronVolts; - } else { - ATH_MSG_WARNING( "Unrecoginzed jobOption OnlCacheUnit=" << m_onlCacheUnitStr << ". " - << "Setting it to \"Invalid\"!" ); - m_onlCacheUnit = TileRawChannelUnit::Invalid; - } - - //=== Retrieve offline proxies - CHECK( m_pryOflCisLin.retrieve() ); - CHECK( m_pryOflCisNln.retrieve() ); - CHECK( m_pryOflLasLin.retrieve() ); - CHECK( m_pryOflLasNln.retrieve() ); - CHECK( m_pryOflCes.retrieve() ); - CHECK( m_pryOflEms.retrieve() ); - - m_useOflLasFib = !(m_pryOflLasFib.empty()); - if (m_useOflLasFib) { - //=== retrieve offline proxy - CHECK( m_pryOflLasFib.retrieve() ); - ATH_MSG_INFO("ProxyOflLasFib is set up and can be used"); - } else { - ATH_MSG_INFO("ProxyOflLasFib is not set up and cannot be used"); - m_pryOflLasFib.disable(); - } - - //=== Attempt to load online folders only if online cache unit is valid - if (m_onlCacheUnit != TileRawChannelUnit::Invalid) { - - //=== Retrieve offline proxies - CHECK( m_pryOnlCis.retrieve() ); - CHECK( m_pryOnlLas.retrieve() ); - CHECK( m_pryOnlCes.retrieve() ); - CHECK( m_pryOnlEms.retrieve() ); - - //=== Undoing online corrections works only with connection to COOL DB - //=== i.e. ensure that we have only TileCondProxyCool tools - const TileCondProxyCoolFlt* ptrPryOnlCis = dynamic_cast<const TileCondProxyCoolFlt*>(&(*m_pryOnlCis)); - const TileCondProxyCoolFlt* ptrPryOnlLas = dynamic_cast<const TileCondProxyCoolFlt*>(&(*m_pryOnlLas)); - const TileCondProxyCoolFlt* ptrPryOnlCes = dynamic_cast<const TileCondProxyCoolFlt*>(&(*m_pryOnlCes)); - const TileCondProxyCoolFlt* ptrPryOnlEms = dynamic_cast<const TileCondProxyCoolFlt*>(&(*m_pryOnlEms)); - - if (!ptrPryOnlCis || !ptrPryOnlLas || !ptrPryOnlCes || !ptrPryOnlEms) { - ATH_MSG_ERROR( "Requested valid OnlCacheUnit (" << m_onlCacheUnitStr << ") " - << "but at least one ProxyOnl{Cis|Las|Ces|Ems} is not connected to a COOL folder!" ); - return StatusCode::FAILURE; - } - - // - const TileCondProxyCoolFlt* ptrPryOflLasLin = dynamic_cast<const TileCondProxyCoolFlt*>(&(*m_pryOflLasLin)); - const TileCondProxyCoolFlt* ptrPryOflLasNln = dynamic_cast<const TileCondProxyCoolFlt*>(&(*m_pryOflLasNln)); - if (!ptrPryOflLasLin || !ptrPryOflLasNln) { - ATH_MSG_ERROR( "At least one ProxyOfl{LasLin|LasNln} is not connected to a COOL folder!" ); - return StatusCode::FAILURE; - } - - //=== Register resetCache callback function for online folders - //--- - //--- This below is a bit tricky: - //--- The regFcn needs a pointer to the function actually called, a pointer to a callback function in a base class - //--- (for example a purely virtual function in ITileCondProxy) does NOT work. - //--- Therefore we need to provide a pointer to the callback function of the derived class. Hence we ensured - //--- with above code that we really have a TileCondProxyCool connected to the ToolHandle. - //--- - CHECK( detStore()->regFcn(&TileCondProxyCoolFlt::callback, ptrPryOnlCis, &TileCondToolEmscale::resetOnlCache, this, true) ); - CHECK( detStore()->regFcn(&TileCondProxyCoolFlt::callback, ptrPryOnlLas, &TileCondToolEmscale::resetOnlCache, this, true) ); - CHECK( detStore()->regFcn(&TileCondProxyCoolFlt::callback, ptrPryOnlCes, &TileCondToolEmscale::resetOnlCache, this, true) ); - CHECK( detStore()->regFcn(&TileCondProxyCoolFlt::callback, ptrPryOnlEms, &TileCondToolEmscale::resetOnlCache, this, true) ); - - //=== Register checkIfOflLasLinCalibUsed callback function for offline linear laser folder - CHECK( detStore()->regFcn(&TileCondProxyCoolFlt::callback, ptrPryOflLasLin, &TileCondToolEmscale::checkIfOflLasLinCalibUsed, this, true) ); - - //=== Register checkIfOflLasNlnCalibUsed callback function for offline nonlinear laser folder - CHECK( detStore()->regFcn(&TileCondProxyCoolFlt::callback, ptrPryOflLasNln, &TileCondToolEmscale::checkIfOflLasNlnCalibUsed, this, true) ); - - //=== Resize onlCache to desired size - - ServiceHandle<TileCablingSvc> cablingSvc("TileCablingSvc", name()); - CHECK( cablingSvc.retrieve()); - - const TileCablingService* cabling = cablingSvc->cablingService(); - if (!cabling) { - ATH_MSG_ERROR( "Unable to retrieve TileCablingService" ); - return StatusCode::FAILURE; - } - - m_maxChannels = cabling->getMaxChannels(); - m_maxGains = cabling->getMaxGains(); - m_drawerCacheSize = m_maxChannels * m_maxGains; - - m_onlCache.resize(m_drawerCacheSize * TileCalibUtils::MAX_DRAWERIDX); - - } else { - ATH_MSG_INFO( "Loading of online calibration folders not requested, " - << "since OnlCacheUnit=" << m_onlCacheUnitStr ); - - m_pryOnlCis.disable(); - m_pryOnlLas.disable(); - m_pryOnlCes.disable(); - m_pryOnlEms.disable(); - } - + ATH_CHECK( m_emScaleKey.initialize() ); return StatusCode::SUCCESS; } // //____________________________________________________________________ StatusCode TileCondToolEmscale::finalize() { + ATH_MSG_DEBUG( "finalize called" ); return StatusCode::SUCCESS; -} -// -//____________________________________________________________________ -StatusCode TileCondToolEmscale::resetOnlCache( IOVSVC_CALLBACK_ARGS_K(keys)) { - msg(MSG::INFO) << "TileCondToolEmscale::resetOnlCache() has been triggered by: "; - std::list<std::string>::const_iterator itr; - for (itr = keys.begin(); itr != keys.end(); ++itr) { - msg(MSG::INFO) << "\'" << *itr << "' "; - } - msg(MSG::INFO) << endmsg; - - //=== recalculate online cache - for (unsigned int drawerIdx = 0; drawerIdx < TileCalibUtils::MAX_DRAWERIDX; ++ drawerIdx) { - for (unsigned int channel = 0; channel < m_maxChannels; ++channel) { - for (unsigned int adc = 0; adc < m_maxGains; ++adc) { - m_onlCache[cacheIndex(drawerIdx, channel, adc)] = getOnlCalib(drawerIdx, channel, adc, m_onlCacheUnit); - } - } - } - - return StatusCode::SUCCESS; } -// -//____________________________________________________________________ -float TileCondToolEmscale::getOnlCalib(unsigned int drawerIdx, unsigned int channel, unsigned int adc - , TileRawChannelUnit::UNIT onlUnit) const { - - if (drawerIdx >= TileCalibUtils::MAX_DRAWERIDX) { - throw TileCalib::IndexOutOfRange("TileCondToolEmscale::getOnlineCalib", drawerIdx, TileCalibUtils::MAX_DRAWERIDX); - } - - ATH_MSG_VERBOSE( "Recalculating total online constant for " - << drawerIdx << "/" << channel << "/" << adc << " , " << onlUnit ); - - float val(1.); - //=== CIS calibration - if (onlUnit > TileRawChannelUnit::OnlineADCcounts) { - val = m_pryOnlCis->getCalibDrawer(drawerIdx)->getCalib(channel, adc, val); - ATH_MSG_VERBOSE( "---> val after CIS: " << val ); - - //=== LAS+CES calibration - if (onlUnit > TileRawChannelUnit::OnlinePicoCoulombs) { - val = m_pryOnlLas->getCalibDrawer(drawerIdx)->getCalib(channel, adc, val); - ATH_MSG_VERBOSE( "---> val after LAS: " << val ); - - val = m_pryOnlCes->getCalibDrawer(drawerIdx)->getCalib(channel, adc, val); - ATH_MSG_VERBOSE( "---> val after CES: " << val ); - } - //=== EMSCALE calibration - if (onlUnit > TileRawChannelUnit::OnlineCesiumPicoCoulombs) { - val = m_pryOnlEms->getCalibDrawer(drawerIdx)->getCalib(channel, adc, val); - ATH_MSG_VERBOSE( "---> val after EMS: " << val ); - } - } - //=== Convert float to 16 bit fixed point DSP precision - val = TileCalibUtils::fixedPointPrecision(val); - ATH_MSG_VERBOSE( "---> val in fixed point precision: " << val ); - - return val; -} // //____________________________________________________________________ float TileCondToolEmscale::undoOnlCalib(unsigned int drawerIdx, unsigned int channel, unsigned int adc , float amplitude, TileRawChannelUnit::UNIT onlUnit) const { - //=== Check if online folders are available - if (m_onlCacheUnit == TileRawChannelUnit::Invalid) { - ATH_MSG_FATAL( "Trying to undo online calibration, but COOL folders were not loaded" ); - std::abort(); - } - - //=== Check for valid unit request - if (onlUnit < TileRawChannelUnit::OnlineADCcounts - || onlUnit > TileRawChannelUnit::OnlineMegaElectronVolts) { - throw TileCalib::InvalidRawChanUnit("TileCondToolEmscale::channelCalib(onl)", onlUnit); - } - - float val(0.); - //=== Look up total calib constant in cache if possible ... - if (onlUnit == m_onlCacheUnit) { - unsigned int idx = cacheIndex(drawerIdx, channel, adc); - if (idx >= m_onlCache.size()) { - throw TileCalib::IndexOutOfRange("TileCondToolEmscale::undoOnlineCalib", idx, m_onlCache.size()); - } - - val = m_onlCache[idx]; - } - //=== ... otherwise compute on the fly - else { - val = getOnlCalib(drawerIdx, channel, adc, onlUnit); - } - - //=== Sanity check - if (val == 0.) { - throw TileCalib::InvalidValue("TileCondToolEmscale::undoOnlCalib", val); - } - - return amplitude / val; + SG::ReadCondHandle<TileEMScale> emScale(m_emScaleKey); + return emScale->undoOnlineChannelCalibration(drawerIdx, channel, adc, amplitude, onlUnit); + } // @@ -307,133 +69,45 @@ float TileCondToolEmscale::channelCalib(unsigned int drawerIdx, unsigned int cha , float amplitude, TileRawChannelUnit::UNIT rawDataUnitIn , TileRawChannelUnit::UNIT rawDataUnitOut) const { - //=== Undo online calibration, result is offline ADC counts - if (rawDataUnitIn >= TileRawChannelUnit::OnlineADCcounts) { - if (rawDataUnitIn > TileRawChannelUnit::OnlineMegaElectronVolts) { - throw TileCalib::InvalidRawChanUnit("TileCondToolEmscale::channelCalib(onl)", rawDataUnitIn); - } else if (rawDataUnitIn > TileRawChannelUnit::OnlineADCcounts) { - amplitude = undoOnlCalib(drawerIdx, channel, adc, amplitude, rawDataUnitIn); - } - rawDataUnitIn = TileRawChannelUnit::ADCcounts; - } - - //=== Allow only "forward" calibration from here on - if (rawDataUnitOut < rawDataUnitIn || rawDataUnitOut > TileRawChannelUnit::MegaElectronVolts) { - ATH_MSG_ERROR( "Invalid unit combination: " - << "in=" << rawDataUnitIn << " ," - << "out=" << rawDataUnitOut ); - - throw TileCalib::InvalidRawChanUnit("TileCondToolEmscale::channelCalib(out)", rawDataUnitOut); - } - - //=== decide which calibrations to apply - switch (rawDataUnitIn) { - - case TileRawChannelUnit::ADCcounts: - case TileRawChannelUnit::OnlineADCcounts: - if (rawDataUnitOut > TileRawChannelUnit::ADCcounts) { - amplitude = doCalibCis(drawerIdx, channel, adc, amplitude); - if (rawDataUnitOut > TileRawChannelUnit::PicoCoulombs) { - amplitude = doCalibLas(drawerIdx, channel, amplitude); - amplitude = doCalibCes(drawerIdx, channel, amplitude); - if (rawDataUnitOut > TileRawChannelUnit::CesiumPicoCoulombs) { - amplitude = doCalibEms(drawerIdx, channel, amplitude); - } - } - } - break; - - case TileRawChannelUnit::PicoCoulombs: - if (rawDataUnitOut > TileRawChannelUnit::PicoCoulombs) { - amplitude = doCalibLas(drawerIdx, channel, amplitude); - amplitude = doCalibCes(drawerIdx, channel, amplitude); - if (rawDataUnitOut > TileRawChannelUnit::CesiumPicoCoulombs) { - amplitude = doCalibEms(drawerIdx, channel, amplitude); - } - } - break; - - case TileRawChannelUnit::CesiumPicoCoulombs: - if (rawDataUnitOut > TileRawChannelUnit::CesiumPicoCoulombs) { - amplitude = doCalibEms(drawerIdx, channel, amplitude); - } - break; - - case TileRawChannelUnit::MegaElectronVolts: - break; - - default: - ATH_MSG_ERROR( "We should never come here: " - << "in=" << rawDataUnitIn << " ," - << "out=" << rawDataUnitOut ); - - throw TileCalib::InvalidRawChanUnit("TileCondToolEmscale::channelCalib", rawDataUnitIn); - - } - - return amplitude; + SG::ReadCondHandle<TileEMScale> emScale(m_emScaleKey); + return emScale->calibrateChannel(drawerIdx, channel, adc, amplitude, rawDataUnitIn, rawDataUnitOut); + } // //____________________________________________________________________ float TileCondToolEmscale::doCalibEms(unsigned int drawerIdx, unsigned int channel, float amplitude) const { - if (drawerIdx >= TileCalibUtils::MAX_DRAWERIDX) { - throw TileCalib::IndexOutOfRange("TileCondToolEmscale::doCalibEms", drawerIdx, TileCalibUtils::MAX_DRAWERIDX); - } - return m_pryOflEms->getCalibDrawer(drawerIdx)->getCalib(channel, 0, amplitude); + SG::ReadCondHandle<TileEMScale> emScale(m_emScaleKey); + return emScale->applyEMScaleCalibration(drawerIdx, channel, amplitude); + } // //____________________________________________________________________ float TileCondToolEmscale::doCalibCes(unsigned int drawerIdx, unsigned int channel, float amplitude, bool applyLasCorr) const { - if (drawerIdx >= TileCalibUtils::MAX_DRAWERIDX) { - throw TileCalib::IndexOutOfRange("TileCondToolEmscale::doCalibCes", drawerIdx, TileCalibUtils::MAX_DRAWERIDX); - } + SG::ReadCondHandle<TileEMScale> emScale(m_emScaleKey); + return emScale->applyCesiumCalibration(drawerIdx, channel, amplitude, applyLasCorr); - amplitude = m_pryOflCes->getCalibDrawer(drawerIdx)->getCalib(channel, 0, amplitude); - - if (applyLasCorr) { - //=== At some point a correction relative to the mono-energy laser reference - //=== taken with each Cesium calibration run needs to be implemented here. - } - - return amplitude; } // //____________________________________________________________________ float TileCondToolEmscale::doCalibLas(unsigned int drawerIdx, unsigned int channel, float amplitude) const { - if (m_OflLasLinUsed || m_OflLasNlnUsed) { - if (drawerIdx >= TileCalibUtils::MAX_DRAWERIDX) { - throw TileCalib::IndexOutOfRange("TileCondToolLascale::doCalibLas", drawerIdx, TileCalibUtils::MAX_DRAWERIDX); - } + SG::ReadCondHandle<TileEMScale> emScale(m_emScaleKey); + return emScale->applyLaserCalibration(drawerIdx, channel, amplitude); - //=== Linear correction - if (m_OflLasLinUsed) - amplitude = m_pryOflLasLin->getCalibDrawer(drawerIdx)->getCalib(channel, 0, amplitude); - //=== Non-linear correction - if (m_OflLasNlnUsed) - amplitude = m_pryOflLasNln->getCalibDrawer(drawerIdx)->getCalib(channel, 0, amplitude); - } - - return amplitude; } // //____________________________________________________________________ float TileCondToolEmscale::doCalibCis(unsigned int drawerIdx, unsigned int channel, unsigned int adc, float amplitude) const { - if (drawerIdx >= TileCalibUtils::MAX_DRAWERIDX) { - throw TileCalib::IndexOutOfRange("TileCondToolCiscale::doCalibCis", drawerIdx, TileCalibUtils::MAX_DRAWERIDX); - } - //=== Linear correction - amplitude = m_pryOflCisLin->getCalibDrawer(drawerIdx)->getCalib(channel, adc, amplitude); + SG::ReadCondHandle<TileEMScale> emScale(m_emScaleKey); + return emScale->applyChargeCalibration(drawerIdx, channel, adc, amplitude); - //=== Non-linear correction - return m_pryOflCisNln->getCalibDrawer(drawerIdx)->getCalib(channel, adc, amplitude); } // @@ -441,223 +115,107 @@ float TileCondToolEmscale::doCalibCis(unsigned int drawerIdx, unsigned int chann float TileCondToolEmscale::channelCalibOnl(unsigned int drawerIdx, unsigned int channel, unsigned int adc , float amplitude, TileRawChannelUnit::UNIT onlUnit) const { - if (drawerIdx >= TileCalibUtils::MAX_DRAWERIDX) { - throw TileCalib::IndexOutOfRange("TileCondToolEmscale::channelCalibOnl", drawerIdx, TileCalibUtils::MAX_DRAWERIDX); - } - - ATH_MSG_VERBOSE( "Recalculating total online constant for " - << drawerIdx << "/" << channel << "/" << adc << " , " << onlUnit ); - - - //=== CIS calibration - if (onlUnit > TileRawChannelUnit::OnlineADCcounts) { - amplitude = m_pryOnlCis->getCalibDrawer(drawerIdx)->getCalib(channel, adc, amplitude); - ATH_MSG_VERBOSE( "---> amplitude after CIS: " << amplitude ); - - //=== LAS+CES calibration - if (onlUnit > TileRawChannelUnit::OnlinePicoCoulombs) { - amplitude = m_pryOnlLas->getCalibDrawer(drawerIdx)->getCalib(channel, adc, amplitude); - ATH_MSG_VERBOSE( "---> amplitude after LAS: " << amplitude ); - - amplitude = m_pryOnlCes->getCalibDrawer(drawerIdx)->getCalib(channel, adc, amplitude); - ATH_MSG_VERBOSE( "---> amplitude after CES: " << amplitude ); - } - - //=== EMSCALE calibration - if (onlUnit > TileRawChannelUnit::OnlineCesiumPicoCoulombs) { - amplitude = m_pryOnlEms->getCalibDrawer(drawerIdx)->getCalib(channel, adc, amplitude); - ATH_MSG_VERBOSE( "---> amplitude after EMS: " << amplitude ); - } - } - - //=== convert float to 16 bit fixed point DSP precision - amplitude = TileCalibUtils::fixedPointPrecision(amplitude); - ATH_MSG_VERBOSE( "---> amplitude in fixed point precision: " << amplitude ); - - return amplitude; + SG::ReadCondHandle<TileEMScale> emScale(m_emScaleKey); + return emScale->calibrateOnlineChannel(drawerIdx, channel, adc, amplitude, onlUnit); } // //____________________________________________________________________ float TileCondToolEmscale::doCalibEmsOnl(unsigned int drawerIdx, unsigned int channel, float amplitude) const { - if (drawerIdx >= TileCalibUtils::MAX_DRAWERIDX) { - throw TileCalib::IndexOutOfRange("TileCondToolEmscale::doCalibEmsOnl", drawerIdx, TileCalibUtils::MAX_DRAWERIDX); - } - return m_pryOnlEms->getCalibDrawer(drawerIdx)->getCalib(channel, 0, amplitude); + SG::ReadCondHandle<TileEMScale> emScale(m_emScaleKey); + return emScale->applyOnlineEMScaleCalibration(drawerIdx, channel, amplitude); + } // //____________________________________________________________________ float TileCondToolEmscale::doCalibCesOnl(unsigned int drawerIdx, unsigned int channel, float amplitude, bool applyLasCorr) const { - if (drawerIdx >= TileCalibUtils::MAX_DRAWERIDX) { - throw TileCalib::IndexOutOfRange("TileCondToolEmscale::doCalibCesOnl", drawerIdx, TileCalibUtils::MAX_DRAWERIDX); - } - - amplitude = m_pryOnlCes->getCalibDrawer(drawerIdx)->getCalib(channel, 0, amplitude); - if (applyLasCorr) { - //=== At some point a correction relative to the mono-energy laser reference - //=== taken with each Cesium calibration run needs to be implemented here. - } + SG::ReadCondHandle<TileEMScale> emScale(m_emScaleKey); + return emScale->applyOnlineCesiumCalibration(drawerIdx, channel, amplitude, applyLasCorr); - return amplitude; } // //____________________________________________________________________ float TileCondToolEmscale::doCalibLasOnl(unsigned int drawerIdx, unsigned int channel, float amplitude) const { - if (drawerIdx >= TileCalibUtils::MAX_DRAWERIDX) { - throw TileCalib::IndexOutOfRange("TileCondToolLascale::doCalibLasOnl", drawerIdx, TileCalibUtils::MAX_DRAWERIDX); - } - //=== Linear correction only - return m_pryOnlLas->getCalibDrawer(drawerIdx)->getCalib(channel, 0, amplitude); + SG::ReadCondHandle<TileEMScale> emScale(m_emScaleKey); + return emScale->applyOnlineLaserCalibration(drawerIdx, channel, amplitude); + } // //____________________________________________________________________ float TileCondToolEmscale::doCalibCisOnl(unsigned int drawerIdx, unsigned int channel, unsigned int adc, float amplitude) const { - if (drawerIdx >= TileCalibUtils::MAX_DRAWERIDX) { - throw TileCalib::IndexOutOfRange("TileCondToolCiscale::doCalibCisOnl", drawerIdx, TileCalibUtils::MAX_DRAWERIDX); - } + SG::ReadCondHandle<TileEMScale> emScale(m_emScaleKey); + return emScale->applyOnlineChargeCalibration(drawerIdx, channel, adc, amplitude); - //=== Linear correction only - return m_pryOnlCis->getCalibDrawer(drawerIdx)->getCalib(channel, adc, amplitude); } // //____________________________________________________________________ float TileCondToolEmscale::getCesRefLas(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const { - if (drawerIdx >= TileCalibUtils::MAX_DRAWERIDX) { - throw TileCalib::IndexOutOfRange("TileCondToolEmscale::getCesRefLas", drawerIdx, TileCalibUtils::MAX_DRAWERIDX); - } + SG::ReadCondHandle<TileEMScale> emScale(m_emScaleKey); + return emScale->getCesiumReferenceLaserGain(drawerIdx, channel, adc); - return m_pryOflCes->getCalibDrawer(drawerIdx)->getData(channel, adc, 1); } // //____________________________________________________________________ float TileCondToolEmscale::getCesRefHv(unsigned int drawerIdx, unsigned int channel) const { - if (drawerIdx >= TileCalibUtils::MAX_DRAWERIDX) { - throw TileCalib::IndexOutOfRange("TileCondToolEmscale::getCesRefHv", drawerIdx, TileCalibUtils::MAX_DRAWERIDX); - } + SG::ReadCondHandle<TileEMScale> emScale(m_emScaleKey); + return emScale->getCesiumReferenceHV(drawerIdx, channel); - return m_pryOflCes->getCalibDrawer(drawerIdx)->getData(channel, 0, 2); } // //____________________________________________________________________ float TileCondToolEmscale::getCesRefTemp(unsigned int drawerIdx, unsigned int channel) const { - if (drawerIdx >= TileCalibUtils::MAX_DRAWERIDX) { - throw TileCalib::IndexOutOfRange("TileCondToolEmscale::getCesRefTemp", drawerIdx, TileCalibUtils::MAX_DRAWERIDX); - } + SG::ReadCondHandle<TileEMScale> emScale(m_emScaleKey); + return emScale->getCesiumReferenceTemperature(drawerIdx, channel); - return m_pryOflCes->getCalibDrawer(drawerIdx)->getData(channel, 0, 3); } // //____________________________________________________________________ float TileCondToolEmscale::getLasFiber(unsigned int drawerIdx, unsigned int channel) const { - if (drawerIdx >= TileCalibUtils::MAX_DRAWERIDX) { - throw TileCalib::IndexOutOfRange("TileCondToolEmscale::getLasFiber", drawerIdx, TileCalibUtils::MAX_DRAWERIDX); - } + SG::ReadCondHandle<TileEMScale> emScale(m_emScaleKey); + return emScale->getLaserFiberVariation(drawerIdx, channel); - return m_pryOflLasFib->getCalibDrawer(drawerIdx)->getData(channel, 0, 0); } // //____________________________________________________________________ float TileCondToolEmscale::getLasPartition(unsigned int drawerIdx) const { - if (drawerIdx >= TileCalibUtils::MAX_DRAWERIDX) { - throw TileCalib::IndexOutOfRange("TileCondToolEmscale::getLasFiber", drawerIdx, TileCalibUtils::MAX_DRAWERIDX); - } + SG::ReadCondHandle<TileEMScale> emScale(m_emScaleKey); + return emScale->getLaserPartitionVariation(drawerIdx); - return m_pryOflLasFib->getCalibDrawer(TileCalibUtils::getFirstDrawerInPartitionIdx(drawerIdx))->getData( TileCalibUtils::LAS_PART_CHAN, 0, 0); } // //____________________________________________________________________ float TileCondToolEmscale::getLasRefHv(unsigned int drawerIdx, unsigned int channel) const { - float val = -4.; - - if (drawerIdx >= TileCalibUtils::MAX_DRAWERIDX) { - throw TileCalib::IndexOutOfRange("TileCondToolEmscale::getLasRefHv", drawerIdx, TileCalibUtils::MAX_DRAWERIDX); - } - - const TileCalibDrawerFlt* calibDrawer = m_pryOflLasLin->getCalibDrawer(drawerIdx); - int size = calibDrawer->getObjSizeUint32(); - if (size > 1) { - val = m_pryOflLasLin->getCalibDrawer(drawerIdx)->getData(channel, 0, 1); - } + SG::ReadCondHandle<TileEMScale> emScale(m_emScaleKey); + return emScale->getLaserReferenceHV(drawerIdx, channel); - return val; } -// -StatusCode TileCondToolEmscale::checkIfOflLasLinCalibUsed( IOVSVC_CALLBACK_ARGS_K(keys)) { - - msg(MSG::INFO) << "TileCondToolEmscale::checkIfOflLasLinCalibUsed() has been triggered by: "; - std::list<std::string>::const_iterator itr; - for (itr = keys.begin(); itr != keys.end(); ++itr) { - msg(MSG::INFO) << "\'" << *itr << "' "; - } - msg(MSG::INFO) << endmsg; - - const float defval = 1.0; - const float epsilon = 1.e-5; - float val(defval); - for (unsigned int drawerIdx = 0; drawerIdx < TileCalibUtils::MAX_DRAWERIDX; ++drawerIdx) { - for (unsigned int chn = 0; chn < TileCalibUtils::MAX_CHAN; ++chn) { - val = m_pryOflLasLin->getCalibDrawer(drawerIdx)->getCalib(chn, 0, val); - if (fabs(val - defval) > epsilon) { - ATH_MSG_INFO( "The offline linear laser calibration will be used" ); - m_OflLasLinUsed = true; - return StatusCode::SUCCESS; - } - } - } - - ATH_MSG_INFO( "The offline linear laser calibration will not be used" ); - m_OflLasLinUsed = false; - return StatusCode::SUCCESS; -} +// +//____________________________________________________________________ +TileRawChannelUnit::UNIT TileCondToolEmscale::getOnlCacheUnit() const { -StatusCode TileCondToolEmscale::checkIfOflLasNlnCalibUsed( IOVSVC_CALLBACK_ARGS_K(keys)) { - - msg(MSG::INFO) << "TileCondToolEmscale::checkIfOflLasNlnCalibUsed() has been triggered by: "; - std::list<std::string>::const_iterator itr; - for (itr = keys.begin(); itr != keys.end(); ++itr) { - msg(MSG::INFO) << "\'" << *itr << "' "; - } - msg(MSG::INFO) << endmsg; - - const float defval = 100.0; - const float epsilon = 1.e-3; - float val(defval); - - for (unsigned int drawerIdx = 0; drawerIdx < TileCalibUtils::MAX_DRAWERIDX; ++drawerIdx) { - for (unsigned int chn = 0; chn < TileCalibUtils::MAX_CHAN; ++chn) { - val = m_pryOflLasNln->getCalibDrawer(drawerIdx)->getCalib(chn, 0, val); - if (fabs(val - defval) > epsilon) { - ATH_MSG_INFO( "The offline nonlinear laser calibration will be used" ); - m_OflLasNlnUsed = true; - return StatusCode::SUCCESS; - } - } - } - - ATH_MSG_INFO( "The offline nonlinear laser calibration will not be used" ); - m_OflLasNlnUsed = false; + SG::ReadCondHandle<TileEMScale> emScale(m_emScaleKey); + return emScale->getOnlineCacheUnit(); - return StatusCode::SUCCESS; } diff --git a/TileCalorimeter/TileConditions/src/TileCondToolIntegrator.cxx b/TileCalorimeter/TileConditions/src/TileCondToolIntegrator.cxx index 9412e47601561cfdd02d1630ab0868ce3ef9e822..61c2f1ff5e2cda26018ffa0ba9a60551605a7035 100644 --- a/TileCalorimeter/TileConditions/src/TileCondToolIntegrator.cxx +++ b/TileCalorimeter/TileConditions/src/TileCondToolIntegrator.cxx @@ -2,13 +2,13 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -// Athena includes -#include "AthenaKernel/errorcheck.h" - // Tile includes #include "TileConditions/TileCondToolIntegrator.h" -#include "TileCalibBlobObjs/TileCalibUtils.h" -#include "TileCalibBlobObjs/Exception.h" +#include "TileCalibBlobObjs/TileCalibDrawerFlt.h" + +// Athena includes +#include "AthenaKernel/errorcheck.h" +#include "StoreGate/ReadCondHandle.h" // //____________________________________________________________________ @@ -23,10 +23,8 @@ const InterfaceID& TileCondToolIntegrator::interfaceID() { TileCondToolIntegrator::TileCondToolIntegrator(const std::string& type, const std::string& name, const IInterface* parent) : AthAlgTool(type, name, parent) - , m_pryIntegrator("TileCondProxyFile_TileCalibDrawerFlt_/TileCondProxyDefault_Integrator", this) { declareInterface<TileCondToolIntegrator>(this); - declareProperty("ProxyIntegrator", m_pryIntegrator); } // @@ -39,8 +37,8 @@ TileCondToolIntegrator::~TileCondToolIntegrator() { StatusCode TileCondToolIntegrator::initialize() { ATH_MSG_DEBUG( "In initialize()" ); - //=== Retrieve proxy - CHECK( m_pryIntegrator.retrieve() ); + //=== Initialize integrator conditions data key + ATH_CHECK( m_calibIntegratorKey.initialize() ); return StatusCode::SUCCESS; } @@ -56,55 +54,71 @@ StatusCode TileCondToolIntegrator::finalize() { //____________________________________________________________________ float TileCondToolIntegrator::getGain(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const { - return m_pryIntegrator->getCalibDrawer(drawerIdx)->getData(channel, adc, 0); + SG::ReadCondHandle<TileCalibData<TileCalibDrawerFlt>> calibIntegrator(m_calibIntegratorKey); + return calibIntegrator->getCalibDrawer(drawerIdx)->getData(channel, adc, 0); + } // //____________________________________________________________________ float TileCondToolIntegrator::getGainError(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const { - return m_pryIntegrator->getCalibDrawer(drawerIdx)->getData(channel, adc, 1); + SG::ReadCondHandle<TileCalibData<TileCalibDrawerFlt>> calibIntegrator(m_calibIntegratorKey); + return calibIntegrator->getCalibDrawer(drawerIdx)->getData(channel, adc, 1); + } // //____________________________________________________________________ float TileCondToolIntegrator::getChi2(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const { - return m_pryIntegrator->getCalibDrawer(drawerIdx)->getData(channel, adc, 2); + SG::ReadCondHandle<TileCalibData<TileCalibDrawerFlt>> calibIntegrator(m_calibIntegratorKey); + return calibIntegrator->getCalibDrawer(drawerIdx)->getData(channel, adc, 2); + } // //____________________________________________________________________ float TileCondToolIntegrator::getPedestal(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const { - return m_pryIntegrator->getCalibDrawer(drawerIdx)->getData(channel, adc, 3); + SG::ReadCondHandle<TileCalibData<TileCalibDrawerFlt>> calibIntegrator(m_calibIntegratorKey); + return calibIntegrator->getCalibDrawer(drawerIdx)->getData(channel, adc, 3); + } // //____________________________________________________________________ float TileCondToolIntegrator::getDACForPed(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const { - return m_pryIntegrator->getCalibDrawer(drawerIdx)->getData(channel, adc, 4); + SG::ReadCondHandle<TileCalibData<TileCalibDrawerFlt>> calibIntegrator(m_calibIntegratorKey); + return calibIntegrator->getCalibDrawer(drawerIdx)->getData(channel, adc, 4); + } // //____________________________________________________________________ float TileCondToolIntegrator::getSigmaOfPed(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const { - return m_pryIntegrator->getCalibDrawer(drawerIdx)->getData(channel, adc, 5); + SG::ReadCondHandle<TileCalibData<TileCalibDrawerFlt>> calibIntegrator(m_calibIntegratorKey); + return calibIntegrator->getCalibDrawer(drawerIdx)->getData(channel, adc, 5); + } // //____________________________________________________________________ float TileCondToolIntegrator::getRMSOfPed(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const { - return m_pryIntegrator->getCalibDrawer(drawerIdx)->getData(channel, adc, 6); + SG::ReadCondHandle<TileCalibData<TileCalibDrawerFlt>> calibIntegrator(m_calibIntegratorKey); + return calibIntegrator->getCalibDrawer(drawerIdx)->getData(channel, adc, 6); + } // //____________________________________________________________________ float TileCondToolIntegrator::getSigmaOfRMS(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const { - return m_pryIntegrator->getCalibDrawer(drawerIdx)->getData(channel, adc, 7); + SG::ReadCondHandle<TileCalibData<TileCalibDrawerFlt>> calibIntegrator(m_calibIntegratorKey); + return calibIntegrator->getCalibDrawer(drawerIdx)->getData(channel, adc, 7); + } diff --git a/TileCalorimeter/TileConditions/src/TileCondToolMuID.cxx b/TileCalorimeter/TileConditions/src/TileCondToolMuID.cxx index 3e0d0c59b1e3ccf928ecb94b51350723e55b4f4d..bb65fe16ad644245a2c2b227d8b4c4254bef4d6b 100644 --- a/TileCalorimeter/TileConditions/src/TileCondToolMuID.cxx +++ b/TileCalorimeter/TileConditions/src/TileCondToolMuID.cxx @@ -2,17 +2,17 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -// Athena includes -#include "AthenaKernel/errorcheck.h" - -// Calo includes -#include "CaloIdentifier/CaloCell_ID.h" - // Tile includes #include "TileConditions/TileCondToolMuID.h" #include "TileCalibBlobObjs/TileCalibDrawerFlt.h" #include "TileCalibBlobObjs/TileCalibUtils.h" -#include "TileCalibBlobObjs/Exception.h" + +// Calo includes +#include "CaloIdentifier/CaloCell_ID.h" + +// Athena includes +#include "AthenaKernel/errorcheck.h" +#include "StoreGate/ReadCondHandle.h" // @@ -27,11 +27,9 @@ TileCondToolMuID::interfaceID() { //____________________________________________________________________ TileCondToolMuID::TileCondToolMuID(const std::string& type, const std::string& name, const IInterface* parent) : AthAlgTool(type, name, parent) - , m_caloID(0) - , m_pryMuID( "TileCondProxyFile_TileCalibDrawerFlt_/TileCondProxyDefault_MuID", this) + , m_caloID(nullptr) { declareInterface<TileCondToolMuID>(this); - declareProperty("ProxyMuID", m_pryMuID); } // @@ -45,11 +43,11 @@ StatusCode TileCondToolMuID::initialize() { ATH_MSG_DEBUG( "In initialize()" ); - //=== retrieve proxy - CHECK( m_pryMuID.retrieve() ); + //=== Initialize MuID conditions data key + ATH_CHECK( m_calibMuIdKey.initialize() ); // Retrieve CaloIdManager - CHECK( detStore()->retrieve(m_caloID) ); + ATH_CHECK( detStore()->retrieve(m_caloID) ); return StatusCode::SUCCESS; } @@ -63,7 +61,7 @@ StatusCode TileCondToolMuID::finalize() { // //____________________________________________________________________ -void TileCondToolMuID::getLowThreshold(Identifier & id, int & ros, int & module, int & index) { +void TileCondToolMuID::getLowThreshold(Identifier & id, int & ros, int & module, int & index) const { module = m_caloID->module(id); @@ -171,7 +169,7 @@ void TileCondToolMuID::getLowThreshold(Identifier & id, int & ros, int & module, // //____________________________________________________________________ -void TileCondToolMuID::getHighThreshold(Identifier & id, int & ros, int & module, int & index) { +void TileCondToolMuID::getHighThreshold(Identifier & id, int & ros, int & module, int & index) const { index = ros = -999; module = m_caloID->module(id); @@ -280,39 +278,57 @@ void TileCondToolMuID::getHighThreshold(Identifier & id, int & ros, int & module // //____________________________________________________________________ -float TileCondToolMuID::getLowThresholdValue(Identifier id) { - int ros, module, index, blob_size; +float TileCondToolMuID::getLowThresholdValue(Identifier id) const { + + int ros; + int module; + int index; + getLowThreshold(id, ros, module, index); + unsigned int drawerIdx = TileCalibUtils::getDrawerIdx(ros, module); - blob_size = m_pryMuID->getCalibDrawer(drawerIdx)->getObjSizeUint32(); - if (index >= blob_size) { - ATH_MSG_ERROR( "getLowThresholdValue: index out of range! -> ros/mod/blob_size/ind " - << ros << " " << module << " " << blob_size << " " << index ); + + SG::ReadCondHandle<TileCalibData<TileCalibDrawerFlt>> calibMuID(m_calibMuIdKey); + int nValues = calibMuID->getCalibDrawer(drawerIdx)->getObjSizeUint32(); + + + if (index >= nValues) { + ATH_MSG_ERROR( "getLowThresholdValue: index out of range! -> ros/mod/num_values/ind " + << ros << " " << module << " " << nValues << " " << index ); return -999.; } else { - ATH_MSG_DEBUG( "getLowThresholdValue: ros/mod/drawer_ind/blob_size/ind " << ros << " " - << module << " " << drawerIdx << " " << blob_size << " " << index ); + ATH_MSG_DEBUG( "getLowThresholdValue: ros/mod/drawer_ind/num_values/ind " << ros << " " + << module << " " << drawerIdx << " " << nValues << " " << index ); - return m_pryMuID->getCalibDrawer(drawerIdx)->getData(0, 0, index); + return calibMuID->getCalibDrawer(drawerIdx)->getData(0, 0, index); } } // //____________________________________________________________________ -float TileCondToolMuID::getHighThresholdValue(Identifier id) { - int ros, module, index, blob_size; +float TileCondToolMuID::getHighThresholdValue(Identifier id) const { + + int ros; + int module; + int index; + getHighThreshold(id, ros, module, index); + unsigned int drawerIdx = TileCalibUtils::getDrawerIdx(ros, module); - blob_size = m_pryMuID->getCalibDrawer(drawerIdx)->getObjSizeUint32(); - if (index >= blob_size) { - ATH_MSG_ERROR( "getHighThresholdValue: index out of range! -> ros/mod/blob_size/ind " - << ros << " " << module << " " << blob_size << " " << index ); + + SG::ReadCondHandle<TileCalibData<TileCalibDrawerFlt>> calibMuID(m_calibMuIdKey); + int nValues = calibMuID->getCalibDrawer(drawerIdx)->getObjSizeUint32(); + + if (index >= nValues) { + ATH_MSG_ERROR( "getHighThresholdValue: index out of range! -> ros/mod/num_values/ind " + << ros << " " << module << " " << nValues << " " << index ); return -999.; } else { - ATH_MSG_DEBUG( "getHighThresholdValue: ros/mod/drawer_ind/blob_size/ind " << ros << " " - << module << " " << drawerIdx << " " << blob_size << " " << index ); + ATH_MSG_DEBUG( "getHighThresholdValue: ros/mod/drawer_ind/num_values/ind " << ros << " " + << module << " " << drawerIdx << " " << nValues << " " << index ); + + return calibMuID->getCalibDrawer(drawerIdx)->getData(0, 0, index); - return m_pryMuID->getCalibDrawer(drawerIdx)->getData(0, 0, index); } } diff --git a/TileCalorimeter/TileConditions/src/TileCondToolNoiseRawChn.cxx b/TileCalorimeter/TileConditions/src/TileCondToolNoiseRawChn.cxx index 0216600c0c67b81c518d214b3e767e8ab73b5419..f31175c55b7cf53e036c1cce27e63d9052a94eaf 100644 --- a/TileCalorimeter/TileConditions/src/TileCondToolNoiseRawChn.cxx +++ b/TileCalorimeter/TileConditions/src/TileCondToolNoiseRawChn.cxx @@ -3,16 +3,16 @@ */ #include "TileConditions/TileCondToolNoiseRawChn.h" -#include "TileCalibBlobObjs/TileCalibUtils.h" -#include "TileCalibBlobObjs/Exception.h" #include "TileCalibBlobObjs/TileCalibDrawerFlt.h" -#include "TileConditions/TileCondToolEmscale.h" + +// Athena includes +#include "AthenaKernel/errorcheck.h" +#include "StoreGate/ReadCondHandle.h" // //____________________________________________________________________ static const InterfaceID IID_TileCondToolNoiseRawChn("TileCondToolNoiseRawChn", 1, 0); -const InterfaceID& -TileCondToolNoiseRawChn::interfaceID() { +const InterfaceID& TileCondToolNoiseRawChn::interfaceID() { return IID_TileCondToolNoiseRawChn; } @@ -20,12 +20,9 @@ TileCondToolNoiseRawChn::interfaceID() { //____________________________________________________________________ TileCondToolNoiseRawChn::TileCondToolNoiseRawChn(const std::string& type, const std::string& name, const IInterface* parent) : AthAlgTool(type, name, parent) - , m_tileToolEms("TileCondToolEmscale") - , m_pryNoiseRawChn( "TileCondProxyFile_TileCalibDrawerFlt_/TileCondProxyDefault_NoiseRawChn", this) { declareInterface<ITileCondToolNoise>(this); declareInterface<TileCondToolNoiseRawChn>(this); - declareProperty("ProxyNoiseRawChn", m_pryNoiseRawChn); } // @@ -39,11 +36,8 @@ StatusCode TileCondToolNoiseRawChn::initialize() { ATH_MSG_DEBUG( "In initialize()" ); - //=== TileCondToolEmscale - CHECK( m_tileToolEms.retrieve() ); - - //=== retrieve proxy - CHECK( m_pryNoiseRawChn.retrieve() ); + ATH_CHECK( m_calibRawChannelNoiseKey.initialize() ); + ATH_CHECK( m_emScaleKey.initialize() ); return StatusCode::SUCCESS; } @@ -51,6 +45,7 @@ StatusCode TileCondToolNoiseRawChn::initialize() { // //____________________________________________________________________ StatusCode TileCondToolNoiseRawChn::finalize() { + ATH_MSG_DEBUG( "finalize called" ); return StatusCode::SUCCESS; @@ -58,19 +53,26 @@ StatusCode TileCondToolNoiseRawChn::finalize() { // //____________________________________________________________________ -float TileCondToolNoiseRawChn::getElectronicNoise(unsigned int drawerIdx, unsigned int channel, - unsigned int adc, TileRawChannelUnit::UNIT unit) const { - float val = m_pryNoiseRawChn->getCalibDrawer(drawerIdx)->getData(channel, adc, 0); +float TileCondToolNoiseRawChn::getElectronicNoise(unsigned int drawerIdx, unsigned int channel, unsigned int adc, + TileRawChannelUnit::UNIT unit) const { + + SG::ReadCondHandle<TileCalibDataFlt> calibRawChannelNoise(m_calibRawChannelNoiseKey); + float val = calibRawChannelNoise->getCalibDrawer(drawerIdx)->getData(channel, adc, 0); + if (unit > TileRawChannelUnit::ADCcounts) { - val = m_tileToolEms->channelCalib(drawerIdx, channel, adc, val, TileRawChannelUnit::ADCcounts, - unit); + SG::ReadCondHandle<TileEMScale> emScale (m_emScaleKey); + val = emScale->calibrateChannel(drawerIdx, channel, adc, val, TileRawChannelUnit::ADCcounts, unit); } + return val; + } // //____________________________________________________________________ float TileCondToolNoiseRawChn::getPileUpNoise(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const { - return m_pryNoiseRawChn->getCalibDrawer(drawerIdx)->getData(channel, adc, 1); -} + SG::ReadCondHandle<TileCalibDataFlt> calibRawChannelNoise(m_calibRawChannelNoiseKey); + return calibRawChannelNoise->getCalibDrawer(drawerIdx)->getData(channel, adc, 1); + +} diff --git a/TileCalorimeter/TileConditions/src/TileCondToolNoiseSample.cxx b/TileCalorimeter/TileConditions/src/TileCondToolNoiseSample.cxx index 67c9ef8a1786b179991074753d3f930fd69e441c..f99cc8724707b796dd3452eaa11e26122e522ba4 100644 --- a/TileCalorimeter/TileConditions/src/TileCondToolNoiseSample.cxx +++ b/TileCalorimeter/TileConditions/src/TileCondToolNoiseSample.cxx @@ -2,21 +2,18 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -// Athena includes -#include "AthenaKernel/errorcheck.h" - // Tile includes -#include "TileCalibBlobObjs/TileCalibDrawerFlt.h" -#include "TileConditions/TileCondToolEmscale.h" #include "TileConditions/TileCondToolNoiseSample.h" -#include "TileCalibBlobObjs/TileCalibUtils.h" -#include "TileCalibBlobObjs/Exception.h" +#include "TileCalibBlobObjs/TileCalibDrawerFlt.h" + +// Athena includes +#include "AthenaKernel/errorcheck.h" +#include "StoreGate/ReadCondHandle.h" // //____________________________________________________________________ static const InterfaceID IID_TileCondToolNoiseSample("TileCondToolNoiseSample", 1, 0); -const InterfaceID& -TileCondToolNoiseSample::interfaceID() { +const InterfaceID& TileCondToolNoiseSample::interfaceID() { return IID_TileCondToolNoiseSample; } @@ -24,17 +21,10 @@ TileCondToolNoiseSample::interfaceID() { //____________________________________________________________________ TileCondToolNoiseSample::TileCondToolNoiseSample(const std::string& type, const std::string& name, const IInterface* parent) : AthAlgTool(type, name, parent) - , m_tileToolEms("TileCondToolEmscale") - , m_pryNoiseSample("TileCondProxyFile_TileCalibDrawerFlt_/TileCondProxyDefault_NoiseSample", this) - , m_pryOnlineNoiseSample("TileCondProxyFile_TileCalibDrawerFlt_/TileCondProxyDefault_NoiseSample", this) - , m_useOnlineNoise(false) -// m_pryNoiseAutoCr("TileCondProxyFile_TileCalibDrawerFlt_/TileCondProxyDefault_NoiseAutoCr", this) + , m_useOnlineNoise(false) { declareInterface<ITileCondToolNoise>(this); declareInterface<TileCondToolNoiseSample>(this); - declareProperty("ProxyNoiseSample", m_pryNoiseSample); - declareProperty("ProxyOnlineNoiseSample", m_pryOnlineNoiseSample); - // declareProperty("ProxyNoiseAutoCr", m_pryNoiseAutoCr ); } // @@ -48,18 +38,17 @@ StatusCode TileCondToolNoiseSample::initialize() { ATH_MSG_DEBUG( "In initialize()" ); - //=== TileCondToolEmscale - CHECK( m_tileToolEms.retrieve() ); - //=== retrieve proxy - CHECK( m_pryNoiseSample.retrieve() ); + ATH_CHECK( m_calibSampleNoiseKey.initialize() ); - m_useOnlineNoise = !(m_pryOnlineNoiseSample.empty()); + m_useOnlineNoise = !(m_calibOnlineSampleNoiseKey.key().empty()); if (m_useOnlineNoise) { - CHECK( m_pryOnlineNoiseSample.retrieve()); + ATH_CHECK( m_calibOnlineSampleNoiseKey.initialize()); } + ATH_CHECK( m_emScaleKey.initialize() ); + return StatusCode::SUCCESS; } @@ -73,32 +62,46 @@ StatusCode TileCondToolNoiseSample::finalize() { // //____________________________________________________________________ -float TileCondToolNoiseSample::getPed(unsigned int drawerIdx, unsigned int channel, - unsigned int adc, TileRawChannelUnit::UNIT unit) const { - float ped = m_pryNoiseSample->getCalibDrawer(drawerIdx)->getData(channel, adc, 0); +float TileCondToolNoiseSample::getPed(unsigned int drawerIdx, unsigned int channel, unsigned int adc, + TileRawChannelUnit::UNIT unit) const { + + SG::ReadCondHandle<TileCalibDataFlt> calibSampleNoise(m_calibSampleNoiseKey); + float ped = calibSampleNoise->getCalibDrawer(drawerIdx)->getData(channel, adc, 0); + if (unit > TileRawChannelUnit::ADCcounts) { - ped = m_tileToolEms->channelCalib(drawerIdx, channel, adc, ped, TileRawChannelUnit::ADCcounts, unit); + SG::ReadCondHandle<TileEMScale> emScale(m_emScaleKey); + ped = emScale->calibrateChannel(drawerIdx, channel, adc, ped, TileRawChannelUnit::ADCcounts, unit); } + return ped; + } // //____________________________________________________________________ -float TileCondToolNoiseSample::getHfn(unsigned int drawerIdx, unsigned int channel, - unsigned int adc, TileRawChannelUnit::UNIT unit) const { - float ped = m_pryNoiseSample->getCalibDrawer(drawerIdx)->getData(channel, adc, 1); +float TileCondToolNoiseSample::getHfn(unsigned int drawerIdx, unsigned int channel, unsigned int adc, + TileRawChannelUnit::UNIT unit) const { + + SG::ReadCondHandle<TileCalibDataFlt> calibSampleNoise(m_calibSampleNoiseKey); + float hfn = calibSampleNoise->getCalibDrawer(drawerIdx)->getData(channel, adc, 1); + + if (unit > TileRawChannelUnit::ADCcounts) { - ped = m_tileToolEms->channelCalib(drawerIdx, channel, adc, ped, TileRawChannelUnit::ADCcounts, unit); + SG::ReadCondHandle<TileEMScale> emScale(m_emScaleKey); + hfn = emScale->calibrateChannel(drawerIdx, channel, adc, hfn, TileRawChannelUnit::ADCcounts, unit); } - return ped; + + return hfn; + } // //____________________________________________________________________ -float TileCondToolNoiseSample::getLfn(unsigned int drawerIdx, unsigned int channel, - unsigned int adc, TileRawChannelUnit::UNIT unit) const { +float TileCondToolNoiseSample::getLfn(unsigned int drawerIdx, unsigned int channel, unsigned int adc, + TileRawChannelUnit::UNIT unit) const { - const TileCalibDrawerFlt* calibDrawer = m_pryNoiseSample->getCalibDrawer(drawerIdx); + SG::ReadCondHandle<TileCalibDataFlt> calibSampleNoise(m_calibSampleNoiseKey); + const TileCalibDrawerFlt* calibDrawer = calibSampleNoise->getCalibDrawer(drawerIdx); //=== check if Lfn is stored already if (calibDrawer->getObjSizeUint32() < 3) { @@ -106,80 +109,74 @@ float TileCondToolNoiseSample::getLfn(unsigned int drawerIdx, unsigned int chann return 0.; } - float ped = calibDrawer->getData(channel, adc, 2); + float lfn = calibDrawer->getData(channel, adc, 2); if (unit > TileRawChannelUnit::ADCcounts) { - ped = m_tileToolEms->channelCalib(drawerIdx, channel, adc, ped, TileRawChannelUnit::ADCcounts, unit); + SG::ReadCondHandle<TileEMScale> emScale(m_emScaleKey); + lfn = emScale->calibrateChannel(drawerIdx, channel, adc, lfn, TileRawChannelUnit::ADCcounts, unit); } - return ped; + + return lfn; + } // //____________________________________________________________________ -float TileCondToolNoiseSample::getHfn1(unsigned int drawerIdx, unsigned int channel, - unsigned int adc) const { - const TileCalibDrawerFlt* calibDrawer = m_pryNoiseSample->getCalibDrawer(drawerIdx); +float TileCondToolNoiseSample::getHfn1(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const { + + SG::ReadCondHandle<TileCalibDataFlt> calibSampleNoise(m_calibSampleNoiseKey); + const TileCalibDrawerFlt* calibDrawer = calibSampleNoise->getCalibDrawer(drawerIdx); + //=== check if Hfn1 is stored already, if not - return old Hfn - float ped =(calibDrawer->getObjSizeUint32() < 4) - ? m_pryNoiseSample->getCalibDrawer(drawerIdx)->getData(channel, adc, 1) - : m_pryNoiseSample->getCalibDrawer(drawerIdx)->getData(channel, adc, 3); + float hfn1 = (calibDrawer->getObjSizeUint32() < 4) ? calibDrawer->getData(channel, adc, 1) + : calibDrawer->getData(channel, adc, 3); + + return hfn1; - return ped; } // //____________________________________________________________________ -float TileCondToolNoiseSample::getHfn2(unsigned int drawerIdx, unsigned int channel, - unsigned int adc) const { - const TileCalibDrawerFlt* calibDrawer = m_pryNoiseSample->getCalibDrawer(drawerIdx); +float TileCondToolNoiseSample::getHfn2(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const { + + SG::ReadCondHandle<TileCalibDataFlt> calibSampleNoise(m_calibSampleNoiseKey); + const TileCalibDrawerFlt* calibDrawer = calibSampleNoise->getCalibDrawer(drawerIdx); + //=== check if Hfn2 is stored already, if not - return zero - float ped = (calibDrawer->getObjSizeUint32() < 5) - ? 0.0 - : m_pryNoiseSample->getCalibDrawer(drawerIdx)->getData(channel, adc, 4); + float hfn2 = (calibDrawer->getObjSizeUint32() < 5) ? 0.0 : calibDrawer->getData(channel, adc, 4); - return ped; + return hfn2; } // //____________________________________________________________________ -float TileCondToolNoiseSample::getHfnNorm(unsigned int drawerIdx, unsigned int channel, - unsigned int adc) const { - const TileCalibDrawerFlt* calibDrawer = m_pryNoiseSample->getCalibDrawer(drawerIdx); +float TileCondToolNoiseSample::getHfnNorm(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const { + + SG::ReadCondHandle<TileCalibDataFlt> calibSampleNoise(m_calibSampleNoiseKey); + const TileCalibDrawerFlt* calibDrawer = calibSampleNoise->getCalibDrawer(drawerIdx); + //=== check if HfnNorm is stored already, if not - return zero - float ped = (calibDrawer->getObjSizeUint32() < 6) - ? 0.0 - : m_pryNoiseSample->getCalibDrawer(drawerIdx)->getData(channel, adc, 5); + float hfnNorm = (calibDrawer->getObjSizeUint32() < 6) ? 0.0 : calibDrawer->getData(channel, adc, 5); + + return hfnNorm; - return ped; } -float TileCondToolNoiseSample::getOnlinePedestalDifference(unsigned int drawerIdx, unsigned int channel, - unsigned int adc, TileRawChannelUnit::UNIT onlineUnit) const { +float TileCondToolNoiseSample::getOnlinePedestalDifference(unsigned int drawerIdx, unsigned int channel, + unsigned int adc, TileRawChannelUnit::UNIT onlineUnit) const { float pedestalDifference(0.0); if (m_useOnlineNoise) { - float pedestal = m_pryNoiseSample->getCalibDrawer(drawerIdx)->getData(channel, adc, 0); - float onlinePedestal = m_pryOnlineNoiseSample->getCalibDrawer(drawerIdx)->getData(channel, adc, 0); - pedestalDifference = m_tileToolEms->channelCalibOnl(drawerIdx, channel, adc, (onlinePedestal - pedestal), onlineUnit); + SG::ReadCondHandle<TileCalibDataFlt> calibSampleNoise(m_calibSampleNoiseKey); + SG::ReadCondHandle<TileCalibDataFlt> calibOnlineSampleNoise(m_calibOnlineSampleNoiseKey); + + float pedestal = calibSampleNoise->getCalibDrawer(drawerIdx)->getData(channel, adc, 0); + float onlinePedestal = calibOnlineSampleNoise->getCalibDrawer(drawerIdx)->getData(channel, adc, 0); + + SG::ReadCondHandle<TileEMScale> emScale(m_emScaleKey); + pedestalDifference = emScale->calibrateOnlineChannel(drawerIdx, channel, adc, (onlinePedestal - pedestal), onlineUnit); } return pedestalDifference; } - - -// -//____________________________________________________________________ -/* - void - TileCondToolNoiseSample::getAutoCorr(unsigned int drawerIdx, unsigned int channel, unsigned int adc, - std::vector<float>& vec) const - { - const TileCalibDrawerFlt* calibDrawer = m_pryNoiseAutoCr->getCalibDrawer(drawerIdx); - unsigned int nNum = calibDrawer->getObjSizeUint32(); - if(vec.size()!=nNum){ vec.resize(nNum); } - for(unsigned int i=0; i<nNum; ++i){ - vec[i] = calibDrawer->getData(channel,adc,i); - } - } - */ diff --git a/TileCalorimeter/TileConditions/src/TileCondToolOfcCool.cxx b/TileCalorimeter/TileConditions/src/TileCondToolOfcCool.cxx index 0a8297fe4557d2e314c2b58fad9ac30fa91f103c..abbf84b360eaa999e41ec855b819ff2bed6ea6a9 100644 --- a/TileCalorimeter/TileConditions/src/TileCondToolOfcCool.cxx +++ b/TileCalorimeter/TileConditions/src/TileCondToolOfcCool.cxx @@ -2,16 +2,15 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -// Athena includes -#include "AthenaKernel/errorcheck.h" - // Tile includes #include "TileConditions/TileCondToolOfcCool.h" -#include "TileCalibBlobObjs/Exception.h" -#include "TileConditions/TileCondProxyWrapper.h" -#include "TileConditions/ITileCondToolOfc.h" +#include "TileCalibBlobObjs/TileCalibDrawerOfc.h" +// Athena includes +#include "AthenaKernel/errorcheck.h" +#include "StoreGate/ReadCondHandle.h" + // //____________________________________________________________________ static const InterfaceID IID_TileCondToolOfcCool("TileCondToolOfcCool", 1, 0); @@ -25,7 +24,6 @@ const InterfaceID& TileCondToolOfcCool::interfaceID() { TileCondToolOfcCool::TileCondToolOfcCool(const std::string& type, const std::string& name, const IInterface* parent) : AthAlgTool(type, name, parent) - , m_pryOfcCool("TileCondProxyCool<TileCalibDrawerOfc>/TileCondProxyDefault_OfcCool", this) , m_weights(0) , m_NPhases(0) , m_NFields(0) @@ -36,13 +34,12 @@ TileCondToolOfcCool::TileCondToolOfcCool(const std::string& type, const std::str { declareInterface<TileCondToolOfcCool>(this); declareInterface<ITileCondToolOfc>(this); - declareProperty("ProxyOfcCool", m_pryOfcCool); } // //____________________________________________________________________ TileCondToolOfcCool::~TileCondToolOfcCool() { - // if(m_weights) delete m_weights; + } // @@ -50,8 +47,7 @@ TileCondToolOfcCool::~TileCondToolOfcCool() { StatusCode TileCondToolOfcCool::initialize() { ATH_MSG_DEBUG( "In initialize()" ); - //=== Retrieve offline proxies - CHECK( m_pryOfcCool.retrieve() ); + ATH_CHECK( m_calibOfcKey.initialize() ); //=== prepare structure for OFCs m_weights = new TileOfcWeightsStruct; @@ -77,23 +73,22 @@ const TileOfcWeightsStruct* TileCondToolOfcCool::getOfcWeights(unsigned int draw float& phase, bool /* of2 */) { - if (drawerIdx >= TileCalibUtils::MAX_DRAWERIDX) { - throw TileCalib::IndexOutOfRange("TileCondToolOfcCool::getOfcWeights", drawerIdx, TileCalibUtils::MAX_DRAWERIDX); - } + + SG::ReadCondHandle<TileCalibData<TileCalibDrawerOfc>> calibOFC(m_calibOfcKey); if (m_first) { m_first = false; - m_NPhases = m_pryOfcCool->getCalibDrawer(drawerIdx)->getNPhases(); - m_NFields = m_pryOfcCool->getCalibDrawer(drawerIdx)->getNFields(); - m_NSamples = m_pryOfcCool->getCalibDrawer(drawerIdx)->getNSamples(); + m_NPhases = calibOFC->getCalibDrawer(drawerIdx)->getNPhases(); + m_NFields = calibOFC->getCalibDrawer(drawerIdx)->getNFields(); + m_NSamples = calibOFC->getCalibDrawer(drawerIdx)->getNSamples(); - ATH_MSG_DEBUG( "OFC Blob Type " << m_pryOfcCool->getCalibDrawer(drawerIdx)->getType() + ATH_MSG_DEBUG( "OFC Blob Type " << calibOFC->getCalibDrawer(drawerIdx)->getType() << " NPhases " << m_NPhases << " NFields " << m_NFields ); } - m_pryOfcCool->getCalibDrawer(drawerIdx)->fillOfc(channel, adc, phase, m_weights->w_a, m_weights->w_b, + calibOFC->getCalibDrawer(drawerIdx)->fillOfc(channel, adc, phase, m_weights->w_a, m_weights->w_b, m_weights->w_c, m_weights->g, m_weights->dg); m_weights->n_samples = m_NSamples; @@ -109,23 +104,21 @@ int TileCondToolOfcCool::getOfcWeights(unsigned int drawerIdx, float& phase, float *a, float *b, float *c, float *g, float *dg) { - if (drawerIdx >= TileCalibUtils::MAX_DRAWERIDX) { - throw TileCalib::IndexOutOfRange("TileCondToolOfcCool::getOfcWeights", drawerIdx, TileCalibUtils::MAX_DRAWERIDX); - } + SG::ReadCondHandle<TileCalibData<TileCalibDrawerOfc>> calibOFC(m_calibOfcKey); if (m_first) { m_first = false; - m_NPhases = m_pryOfcCool->getCalibDrawer(drawerIdx)->getNPhases(); - m_NFields = m_pryOfcCool->getCalibDrawer(drawerIdx)->getNFields(); - m_NSamples = m_pryOfcCool->getCalibDrawer(drawerIdx)->getNSamples(); + m_NPhases = calibOFC->getCalibDrawer(drawerIdx)->getNPhases(); + m_NFields = calibOFC->getCalibDrawer(drawerIdx)->getNFields(); + m_NSamples = calibOFC->getCalibDrawer(drawerIdx)->getNSamples(); - ATH_MSG_DEBUG( "OFC Blob Type " << m_pryOfcCool->getCalibDrawer(drawerIdx)->getType() + ATH_MSG_DEBUG( "OFC Blob Type " << calibOFC->getCalibDrawer(drawerIdx)->getType() << " NPhases " << m_NPhases << " NFields " << m_NFields ); } - m_pryOfcCool->getCalibDrawer(drawerIdx)->fillOfc(channel, adc, phase, a, b, c, g, dg); + calibOFC->getCalibDrawer(drawerIdx)->fillOfc(channel, adc, phase, a, b, c, g, dg); return m_NSamples; } @@ -139,15 +132,13 @@ void TileCondToolOfcCool::getOfcParams(unsigned int drawerIdx , int &Phamax , int &NSamples) { - if (drawerIdx >= TileCalibUtils::MAX_DRAWERIDX) { - throw TileCalib::IndexOutOfRange("TileCondToolOfcCool::getOfcWeights", drawerIdx, TileCalibUtils::MAX_DRAWERIDX); - } + SG::ReadCondHandle<TileCalibData<TileCalibDrawerOfc>> calibOFC(m_calibOfcKey); - NPhases = m_pryOfcCool->getCalibDrawer(drawerIdx)->getNPhases(); - NFields = m_pryOfcCool->getCalibDrawer(drawerIdx)->getNFields(); - Phamin = round(m_pryOfcCool->getCalibDrawer(drawerIdx)->getPhase(0, 0, 0) * (1 / PHASE_PRECISION)); - Phamax = round(m_pryOfcCool->getCalibDrawer(drawerIdx)->getPhase(0, 0, abs(NPhases) - 1) * (1 / PHASE_PRECISION)); - NSamples = m_pryOfcCool->getCalibDrawer(drawerIdx)->getNSamples(); + NPhases = calibOFC->getCalibDrawer(drawerIdx)->getNPhases(); + NFields = calibOFC->getCalibDrawer(drawerIdx)->getNFields(); + Phamin = round(calibOFC->getCalibDrawer(drawerIdx)->getPhase(0, 0, 0) * (1 / PHASE_PRECISION)); + Phamax = round(calibOFC->getCalibDrawer(drawerIdx)->getPhase(0, 0, abs(NPhases) - 1) * (1 / PHASE_PRECISION)); + NSamples = calibOFC->getCalibDrawer(drawerIdx)->getNSamples(); } // diff --git a/TileCalorimeter/TileConditions/src/TileCondToolPulseShape.cxx b/TileCalorimeter/TileConditions/src/TileCondToolPulseShape.cxx index 5d81d8d33ac523f7bf00e08d32b216b2285edf7f..704595c98ac7bf5d670ea8c8325b66e4605b69e1 100644 --- a/TileCalorimeter/TileConditions/src/TileCondToolPulseShape.cxx +++ b/TileCalorimeter/TileConditions/src/TileCondToolPulseShape.cxx @@ -2,16 +2,13 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -// Gaudi includes -#include "GaudiKernel/ServiceHandle.h" +// Tile includes +#include "TileConditions/TileCondToolPulseShape.h" +#include "TileCalibBlobObjs/TileCalibDrawerFlt.h" // Athena includes #include "AthenaKernel/errorcheck.h" - -// Tile includes -#include "TileConditions/TileCondToolPulseShape.h" -#include "TileCalibBlobObjs/Exception.h" -#include "TileConditions/TileCondProxyWrapper.h" +#include "StoreGate/ReadCondHandle.h" // //____________________________________________________________________ @@ -26,10 +23,8 @@ const InterfaceID& TileCondToolPulseShape::interfaceID() { TileCondToolPulseShape::TileCondToolPulseShape(const std::string& type, const std::string& name, const IInterface* parent) : AthAlgTool(type, name, parent) - , m_pryPulseShape("TileCondProxyFile_TileCalibDrawerFlt_/TileCondProxyDefault_PulseShape", this) { declareInterface<TileCondToolPulseShape>(this); - declareProperty("ProxyPulseShape", m_pryPulseShape); } // @@ -42,8 +37,8 @@ TileCondToolPulseShape::~TileCondToolPulseShape() { StatusCode TileCondToolPulseShape::initialize() { ATH_MSG_DEBUG( "In initialize()" ); - //=== Retrieve offline proxies - CHECK( m_pryPulseShape.retrieve() ); + //=== Initialize conditions data key with pulse shape + ATH_CHECK( m_calibPulseShapeKey.initialize() ); return StatusCode::SUCCESS; } @@ -60,11 +55,8 @@ StatusCode TileCondToolPulseShape::finalize() { bool TileCondToolPulseShape::getPulseShapeYDY(unsigned int drawerIdx, unsigned int channel, unsigned int adc , float time, float &y, float &dy) const { - if (drawerIdx >= TileCalibUtils::MAX_DRAWERIDX) { - throw TileCalib::IndexOutOfRange("TileCondToolPulseShape::getPulseShapeYDY", drawerIdx, TileCalibUtils::MAX_DRAWERIDX); - } - - return m_pryPulseShape->getCalibDrawer(drawerIdx)->getYDY(channel, adc, time, y, dy); + SG::ReadCondHandle<TileCalibData<TileCalibDrawerFlt>> calibPulseShape(m_calibPulseShapeKey); + return calibPulseShape->getCalibDrawer(drawerIdx)->getYDY(channel, adc, time, y, dy); } // diff --git a/TileCalorimeter/TileConditions/src/TileCondToolTMDB.cxx b/TileCalorimeter/TileConditions/src/TileCondToolTMDB.cxx index 8eac97a989f95b5b5e3c7146be745b753d813e87..15d155ca65a63ead1334c426e4c79f57044e61bd 100644 --- a/TileCalorimeter/TileConditions/src/TileCondToolTMDB.cxx +++ b/TileCalorimeter/TileConditions/src/TileCondToolTMDB.cxx @@ -3,33 +3,23 @@ */ -#include "TileConditions/TileCondToolTMDB.h" - // Tile includes +#include "TileConditions/TileCondToolTMDB.h" #include "TileCalibBlobObjs/TileCalibDrawerFlt.h" #include "TileCalibBlobObjs/TileCalibUtils.h" -#include "TileCalibBlobObjs/Exception.h" // Athena includes #include "AthenaKernel/errorcheck.h" - +#include "StoreGate/ReadCondHandle.h" // //____________________________________________________________________ TileCondToolTMDB::TileCondToolTMDB(const std::string& type, const std::string& name, const IInterface* parent) : AthAlgTool(type, name, parent) - , m_pryThreshold("TileCondProxyFile_TileCalibDrawerFlt_/TileCondProxyDefault_Threshold", this) - , m_pryDelay("TileCondProxyFile_TileCalibDrawerFlt_/TileCondProxyDefault_Delay", this) - , m_pryTMF("TileCondProxyFile_TileCalibDrawerFlt_/TileCondProxyDefault_TMF", this) - , m_pryCalib("TileCondProxyFile_TileCalibDrawerFlt_/TileCondProxyDefault_Calib", this) { declareInterface<ITileCondToolTMDB>(this); declareInterface<TileCondToolTMDB>(this); - declareProperty("ProxyThreshold", m_pryThreshold); - declareProperty("ProxyDelay", m_pryDelay); - declareProperty("ProxyTMF", m_pryTMF); - declareProperty("ProxyCalib", m_pryCalib); } // @@ -44,10 +34,10 @@ StatusCode TileCondToolTMDB::initialize() { ATH_MSG_DEBUG( "In initialize()" ); //=== retrieve proxy - CHECK( m_pryThreshold.retrieve() ); - CHECK( m_pryDelay.retrieve() ); - CHECK( m_pryTMF.retrieve() ); - CHECK( m_pryCalib.retrieve() ); + ATH_CHECK( m_calibThresholdKey.initialize() ); + ATH_CHECK( m_calibDelayKey.initialize() ); + ATH_CHECK( m_calibTmfKey.initialize() ); + ATH_CHECK( m_calibDataKey.initialize() ); return StatusCode::SUCCESS; } @@ -55,6 +45,7 @@ StatusCode TileCondToolTMDB::initialize() { // //____________________________________________________________________ StatusCode TileCondToolTMDB::finalize() { + ATH_MSG_DEBUG( "finalize called" ); return StatusCode::SUCCESS; @@ -65,11 +56,9 @@ StatusCode TileCondToolTMDB::finalize() { //____________________________________________________________________ float TileCondToolTMDB::getThreshold(unsigned int drawerIdx, TMDB::THRESHOLD threshold) const { - if (drawerIdx >= TileCalibUtils::MAX_DRAWERIDX) { - throw TileCalib::IndexOutOfRange("TileCondToolTMDB::getThreshold", drawerIdx, TileCalibUtils::MAX_DRAWERIDX); - } + SG::ReadCondHandle<TileCalibData<TileCalibDrawerFlt>> calibThreshold(m_calibThresholdKey); + return calibThreshold->getCalibDrawer(drawerIdx)->getData(threshold, 0, 0); - return m_pryThreshold->getCalibDrawer(drawerIdx)->getData(threshold, 0, 0); } @@ -77,23 +66,19 @@ float TileCondToolTMDB::getThreshold(unsigned int drawerIdx, TMDB::THRESHOLD thr //____________________________________________________________________ float TileCondToolTMDB::getDelay(unsigned int drawerIdx, TMDB::CHANNEL channel) const { - if (drawerIdx >= TileCalibUtils::MAX_DRAWERIDX) { - throw TileCalib::IndexOutOfRange("TileCondToolTMDB::getDelay", drawerIdx, TileCalibUtils::MAX_DRAWERIDX); - } + SG::ReadCondHandle<TileCalibData<TileCalibDrawerFlt>> calibDelay(m_calibDelayKey); + return calibDelay->getCalibDrawer(drawerIdx)->getData(channel, 0, 0); - return m_pryDelay->getCalibDrawer(drawerIdx)->getData(channel, 0, 0); } // //____________________________________________________________________ void TileCondToolTMDB::getCalib(unsigned int drawerIdx, TMDB::CHANNEL channel, float& a, float& b) const { - if (drawerIdx >= TileCalibUtils::MAX_DRAWERIDX) { - throw TileCalib::IndexOutOfRange("TileCondToolTMDB::getCalib", drawerIdx, TileCalibUtils::MAX_DRAWERIDX); - } + SG::ReadCondHandle<TileCalibData<TileCalibDrawerFlt>> calibData(m_calibDataKey); + a = calibData->getCalibDrawer(drawerIdx)->getData(channel, 0, 0); + b = calibData->getCalibDrawer(drawerIdx)->getData(channel, 0, 1); - a = m_pryCalib->getCalibDrawer(drawerIdx)->getData(channel, 0, 0); - b = m_pryCalib->getCalibDrawer(drawerIdx)->getData(channel, 0, 1); } @@ -101,22 +86,18 @@ void TileCondToolTMDB::getCalib(unsigned int drawerIdx, TMDB::CHANNEL channel, f //____________________________________________________________________ unsigned int TileCondToolTMDB::getWeights(unsigned int drawerIdx, TMDB::CHANNEL channel, TMDB::Weights& weights) const { - if (drawerIdx >= TileCalibUtils::MAX_DRAWERIDX) { - throw TileCalib::IndexOutOfRange("TileCondToolTMDB::getWeights", drawerIdx, TileCalibUtils::MAX_DRAWERIDX); - } - - unsigned int nWeights = m_pryTMF->getCalibDrawer(drawerIdx)->getObjSizeUint32(); + SG::ReadCondHandle<TileCalibData<TileCalibDrawerFlt>> calibTMF(m_calibTmfKey); + unsigned int nWeights = calibTMF->getCalibDrawer(drawerIdx)->getObjSizeUint32(); if (weights.size() < nWeights ) { - ATH_MSG_ERROR("Not enough space in output array to put all weights from DB (nothing to be done!): " + ATH_MSG_ERROR("Not enough space in output array to put all weights from DB (nothing to be done!): " << weights.size() << " < " << nWeights); return 0; } for (unsigned int iWeight = 0; iWeight < nWeights; ++iWeight) { - weights[iWeight] = m_pryTMF->getCalibDrawer(drawerIdx)->getData(channel, 0, iWeight); + weights[iWeight] = calibTMF->getCalibDrawer(drawerIdx)->getData(channel, 0, iWeight); } - return nWeights; } @@ -128,12 +109,10 @@ unsigned int TileCondToolTMDB::getWeights(unsigned int drawerIdx, TMDB::CHANNEL //____________________________________________________________________ float TileCondToolTMDB::channelCalib(unsigned int drawerIdx, TMDB::CHANNEL channel, float amplitude) const { - if (drawerIdx >= TileCalibUtils::MAX_DRAWERIDX) { - throw TileCalib::IndexOutOfRange("TileCondToolTMDB::channelCalib", drawerIdx, TileCalibUtils::MAX_DRAWERIDX); - } + SG::ReadCondHandle<TileCalibData<TileCalibDrawerFlt>> calibData(m_calibDataKey); + return calibData->getCalibDrawer(drawerIdx)->getData(channel, 0, 0) + + amplitude * calibData->getCalibDrawer(drawerIdx)->getData(channel, 0, 1); - return m_pryCalib->getCalibDrawer(drawerIdx)->getData(channel, 0, 0) - + amplitude * m_pryCalib->getCalibDrawer(drawerIdx)->getData(channel, 0, 1); } @@ -141,25 +120,20 @@ float TileCondToolTMDB::channelCalib(unsigned int drawerIdx, TMDB::CHANNEL chann //____________________________________________________________________ float TileCondToolTMDB::channelCalib(unsigned int drawerIdx, TMDB::CHANNEL channel, const std::vector<float>& samples) const { - if (drawerIdx >= TileCalibUtils::MAX_DRAWERIDX) { - throw TileCalib::IndexOutOfRange("TileCondToolTMDB::channelCalib", drawerIdx, TileCalibUtils::MAX_DRAWERIDX); - } + SG::ReadCondHandle<TileCalibData<TileCalibDrawerFlt>> calibTMF(m_calibTmfKey); - if (samples.size() != m_pryTMF->getCalibDrawer(drawerIdx)->getObjSizeUint32()) { - ATH_MSG_ERROR("Number of samples and weights in DB are not compatible (nothing to be done!): " - << samples.size() << " =! " << m_pryTMF->getCalibDrawer(drawerIdx)->getObjSizeUint32()); + if (samples.size() != calibTMF->getCalibDrawer(drawerIdx)->getObjSizeUint32()) { + ATH_MSG_ERROR("Number of samples and weights in DB are not compatible (nothing to be done!): " + << samples.size() << " =! " << calibTMF->getCalibDrawer(drawerIdx)->getObjSizeUint32()); return 0; } float amplitude(0.0F); unsigned int iWeight(0); for (float sample : samples) { - amplitude += sample * m_pryTMF->getCalibDrawer(drawerIdx)->getData(channel, 0, iWeight); + amplitude += sample * calibTMF->getCalibDrawer(drawerIdx)->getData(channel, 0, iWeight); ++iWeight; } return channelCalib(drawerIdx, channel, amplitude); } - - - diff --git a/TileCalorimeter/TileConditions/src/TileCondToolTiming.cxx b/TileCalorimeter/TileConditions/src/TileCondToolTiming.cxx index ab48e6d5202d64f850126f50f89bffaddff64b9d..85481d8271a5d8806efe74bc45719415ca2d2aa8 100644 --- a/TileCalorimeter/TileConditions/src/TileCondToolTiming.cxx +++ b/TileCalorimeter/TileConditions/src/TileCondToolTiming.cxx @@ -2,51 +2,46 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -// Athena includes -#include "AthenaKernel/errorcheck.h" - // Tile includes #include "TileConditions/TileCondToolTiming.h" -#include "TileCalibBlobObjs/Exception.h" -#include "TileConditions/TileCondProxyWrapper.h" +#include "TileCalibBlobObjs/TileCalibDrawerFlt.h" + +// Athena includes +#include "AthenaKernel/errorcheck.h" +#include "StoreGate/ReadCondHandle.h" // //____________________________________________________________________ -static const InterfaceID IID_TileCondToolTiming("TileCondToolTiming", 1, 0); -const InterfaceID& TileCondToolTiming::interfaceID() -{ +static const InterfaceID IID_TileCondToolTiming("TileCondToolTiming", 1, 0); +const InterfaceID& TileCondToolTiming::interfaceID() +{ return IID_TileCondToolTiming; } // //____________________________________________________________________ TileCondToolTiming::TileCondToolTiming(const std::string& type, const std::string& name, const IInterface* parent) - : AthAlgTool( type, name, parent) - , m_pryAdcOffset("TileCondProxyFile_TileCalibDrawerFlt_/TileCondProxyDefault_AdcOffset", this) + : AthAlgTool( type, name, parent) { - declareInterface<TileCondToolTiming>(this); - declareProperty( "ProxyAdcOffset", m_pryAdcOffset ); + declareInterface<TileCondToolTiming>(this); } // //____________________________________________________________________ -TileCondToolTiming::~TileCondToolTiming() -{ +TileCondToolTiming::~TileCondToolTiming() { } // //____________________________________________________________________ -StatusCode -TileCondToolTiming::initialize() -{ +StatusCode TileCondToolTiming::initialize() { ATH_MSG_DEBUG( "In initialize()" ); - //=== always retrieve channel offset proxies - CHECK( m_pryAdcOffset.retrieve() ); + //=== Initialize condition data key with timings + ATH_CHECK( m_calibTimingKey.initialize() ); return StatusCode::SUCCESS; @@ -54,8 +49,8 @@ TileCondToolTiming::initialize() // //____________________________________________________________________ -StatusCode TileCondToolTiming::finalize() -{ +StatusCode TileCondToolTiming::finalize() { + ATH_MSG_DEBUG( "finalize called" ); return StatusCode::SUCCESS; @@ -64,11 +59,9 @@ StatusCode TileCondToolTiming::finalize() // //____________________________________________________________________ -float TileCondToolTiming::getChannelOffset(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const -{ - if(drawerIdx>=TileCalibUtils::MAX_DRAWERIDX){ - throw TileCalib::IndexOutOfRange("TileCondToolTiming::getChannelOffset", drawerIdx, TileCalibUtils::MAX_DRAWERIDX); - } - return m_pryAdcOffset->getCalibDrawer(drawerIdx)->getData(channel, adc, 0); -} +float TileCondToolTiming::getChannelOffset(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const { + SG::ReadCondHandle<TileCalibDataFlt> calibTiming(m_calibTimingKey); + return calibTiming->getCalibDrawer(drawerIdx)->getData(channel, adc, 0); + +} diff --git a/TileCalorimeter/TileConditions/src/TileDCSCondAlg.cxx b/TileCalorimeter/TileConditions/src/TileDCSCondAlg.cxx new file mode 100644 index 0000000000000000000000000000000000000000..6ef0335f3c38ef8453272ecaa788ed41fbf457c6 --- /dev/null +++ b/TileCalorimeter/TileConditions/src/TileDCSCondAlg.cxx @@ -0,0 +1,588 @@ +//Dear emacs, this is -*- c++ -*- +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +// Tile includes +#include "TileDCSCondAlg.h" +#include "TileConditions/TileCablingService.h" +#include "TileConditions/TileCablingSvc.h" +#include "TileCalibBlobObjs/TileCalibUtils.h" + +// Athena includes +#include "StoreGate/ReadCondHandle.h" +#include "StoreGate/WriteCondHandle.h" +#include "PathResolver/PathResolver.h" +#include "AthenaPoolUtilities/AthenaAttributeList.h" + +#include "CoralBase/Attribute.h" + +#include <fstream> + +TileDCSCondAlg::TileDCSCondAlg(const std::string& name, ISvcLocator* pSvcLocator) : + AthAlgorithm(name, pSvcLocator), + m_condSvc("CondSvc", name), + m_cabling(nullptr), + m_unknownValue(-30) // should be negative +{ + +} + + +TileDCSCondAlg::~TileDCSCondAlg() { +} + + +StatusCode TileDCSCondAlg::initialize() { + + ATH_MSG_DEBUG( "In initialize()" ); + + if (m_readHV) { + ATH_CHECK( m_hvKey.initialize() ); + } + + if (m_readHVSet) { + ATH_CHECK( m_hvSetKey.initialize() ); + } else { + ATH_CHECK( m_emScaleKey.initialize() ); + } + + if (m_readStates) { + ATH_CHECK( m_statesKey.initialize() ); + } + + ATH_MSG_INFO( "Will read the following folders: " + << ((m_readHV) ? m_hvKey.key() : "") << " " + << ((m_readHVSet) ? m_hvSetKey.key() : "") << " " + << ((m_readStates) ? m_statesKey.key() : "")); + + //=== get TileCablingSvc + ServiceHandle<TileCablingSvc> cablingSvc("TileCablingSvc", name()); + ATH_CHECK( cablingSvc.retrieve() ); + + //=== cache pointers to cabling helpers + m_cabling = cablingSvc->cablingService(); + + if (!m_cabling) { + ATH_MSG_ERROR( "Pointer to TileCablingService is zero: " << m_cabling); + return StatusCode::FAILURE; + } + + std::map<TileModuleType, unsigned int> roses{{LONG_BARREL, 2}, {EXTENDED_BARREL, 3}}; + + for (TileModuleType moduleType : {LONG_BARREL, EXTENDED_BARREL}) { + + unsigned int ros = roses[moduleType]; + unsigned int channel = 0; + + for (; channel < TileCalibUtils::MAX_CHAN; ++channel) { + int pmt = m_cabling->channel2hole(ros, channel); + m_isChannelUsed[moduleType][channel] = (pmt > 0); // positive pmt - means channel is connected + + if (moduleType == EXTENDED_BARREL) { + m_isChannelUsed[EXTENDED_BARREL_SPECIAL_C10][channel] = + m_isChannelUsed[EXTENDED_BARREL_NO_D4][channel] = m_isChannelUsed[EXTENDED_BARREL][channel]; + } + + pmt = std::abs(pmt); + m_channel2pmt[moduleType][channel] = pmt - 1; + m_pmt2channel[moduleType][pmt - 1] = channel; // note - pmt-1 is used as index + } + + for (; channel < 68; ++channel) { + m_channel2pmt[moduleType][channel] = channel; + m_pmt2channel[moduleType][channel] = channel; + } + + } + + // description of EBA15 and EBC18 channel 0-3 do not exist, channel 18,19 used + m_isChannelUsed[EXTENDED_BARREL_NO_D4][0] = false; + m_isChannelUsed[EXTENDED_BARREL_NO_D4][1] = false; + m_isChannelUsed[EXTENDED_BARREL_NO_D4][2] = false; + m_isChannelUsed[EXTENDED_BARREL_NO_D4][3] = false; + m_isChannelUsed[EXTENDED_BARREL_NO_D4][18] = true; + m_isChannelUsed[EXTENDED_BARREL_NO_D4][19] = true; + // description of EB with special C10 - channel 4 (pmt 5) is not used + m_isChannelUsed[EXTENDED_BARREL_SPECIAL_C10][4] = false; + + if (m_readHVSet) { + // read special deltas for few unstable PMTs + readBadHV("BadHVChannels.dat"); + if (readConfig(m_dcsChHvSetInCool, "Drawer", m_rosDrawerHVSet)) return StatusCode::FAILURE; + } + + if (readConfig(m_dcsChStatesInCool, "_LVPS_", m_rosDrawerStates)) return StatusCode::FAILURE; + if (readConfig(m_dcsChHvInCool, "Drawer", m_rosDrawerHV)) return StatusCode::FAILURE; + + // CondSvc + ATH_CHECK( m_condSvc.retrieve() ); + ATH_CHECK( m_dcsStateKey.initialize() ); + + // Register write handle + if (m_condSvc->regHandle(this, m_dcsStateKey).isFailure()) { + ATH_MSG_ERROR("unable to register WriteCondHandle " + << m_dcsStateKey.fullKey() << " with CondSvc"); + return StatusCode::FAILURE; + } + + return StatusCode::SUCCESS; +} + + +StatusCode TileDCSCondAlg::execute() { + + SG::WriteCondHandle<TileDCSState> dcsState{m_dcsStateKey}; + + if (dcsState.isValid()) { + ATH_MSG_DEBUG("Found valid TileDCSState: " << dcsState.key()); + return StatusCode::SUCCESS; + } + + std::unique_ptr<TileDCSState> dcsStateData = std::make_unique<TileDCSState>(); + dcsStateData->setGoodDrawer(m_goodDrawer.value()); + dcsStateData->setWarningDrawer(m_warningDrawer.value()); + + EventIDRange eventRange; + + if (m_readHV) { + + SG::ReadCondHandle<CondAttrListCollection> hv(m_hvKey); + for (const CondAttrListCollection::ChanAttrListPair chanAttrListPair : **hv) { + + const CondAttrListCollection::ChanNum coolChannel = chanAttrListPair.first; + + const std::pair<int, int> rosDrawerPair = m_rosDrawerHV.at(coolChannel); + unsigned int ros = rosDrawerPair.first; + unsigned int drawer = rosDrawerPair.second; + + ATH_MSG_VERBOSE( "ros: " << ros + << ", drawer: " << drawer + << ", COOL channel: " << coolChannel + << ", payload: " << chanAttrListPair.second); + + int moduleType = (ros > 2) ? EXTENDED_BARREL : LONG_BARREL; + int pmt0 = 0; // runs over paylod parameters + for (const coral::Attribute& attribute : chanAttrListPair.second) { + int channel = m_pmt2channel[moduleType][pmt0]; + dcsStateData->setChannelHV(ros, drawer, channel, attribute.data<float>()); + ATH_MSG_VERBOSE( "HV[" << pmt0 << "] = " << attribute.data<float>() ); + ++pmt0; + } + + } + + EventIDRange hvRange; + if(!hv.range(hvRange)) { + ATH_MSG_ERROR("Failed to retrieve validity range for " << hv.key()); + return StatusCode::FAILURE; + } else { + ATH_MSG_VERBOSE("Retrieved " << hv.key() << " with range: " << hvRange); + } + + eventRange = hvRange; + } + + + if (m_readHVSet) { + + SG::ReadCondHandle<CondAttrListCollection> hvSet(m_hvSetKey); + for (const CondAttrListCollection::ChanAttrListPair chanAttrListPair : **hvSet) { + + const CondAttrListCollection::ChanNum coolChannel = chanAttrListPair.first; + + const std::pair<int, int> rosDrawerPair = m_rosDrawerHVSet.at(coolChannel); + unsigned int ros = rosDrawerPair.first; + unsigned int drawer = rosDrawerPair.second; + + ATH_MSG_VERBOSE( "ros: " << ros + << ", drawer: " << drawer + << ", COOL channel: " << coolChannel + << ", payload: " << chanAttrListPair.second); + + int moduleType = (ros > 2) ? EXTENDED_BARREL : LONG_BARREL; + int pmt0 = 0; // runs over paylod parameters + for (const coral::Attribute& attribute : chanAttrListPair.second) { + int channel = m_pmt2channel[moduleType][pmt0]; + dcsStateData->setChannelHVSet(ros, drawer, channel, attribute.data<float>()); + ATH_MSG_VERBOSE( "HVSET[" << pmt0 << "] = " << attribute.data<float>() ); + ++pmt0; + } + + } + + EventIDRange hvSetRange; + if(!hvSet.range(hvSetRange)) { + ATH_MSG_ERROR("Failed to retrieve validity range for " << hvSet.key()); + return StatusCode::FAILURE; + } else { + ATH_MSG_VERBOSE("Retrieved " << hvSet.key() << " with range: " << hvSetRange); + } + + eventRange = (m_readHV) ? EventIDRange::intersect(eventRange, hvSetRange) : hvSetRange; + + } else { + + EventIDRange hvReferenceRange; + ATH_CHECK( fillReferenceHV(*dcsStateData, hvReferenceRange) ); + + } + + + if (m_readStates) { + + SG::ReadCondHandle<CondAttrListCollection> states(m_statesKey); + for (const CondAttrListCollection::ChanAttrListPair chanAttrListPair : **states) { + + CondAttrListCollection::ChanNum coolChannel = chanAttrListPair.first; + + std::pair<int, int> rosDrawerPair = m_rosDrawerStates.at(coolChannel); + unsigned int ros = rosDrawerPair.first; + unsigned int drawer = rosDrawerPair.second; + + ATH_MSG_VERBOSE( "ros: " << ros + << ", drawer: " << drawer + << ", COOL channel: " << coolChannel + << ", payload: " << chanAttrListPair.second); + + for (const coral::Attribute& attribute : chanAttrListPair.second) { + dcsStateData->setDrawerStates(ros, drawer, attribute.data<int>()); + ATH_MSG_VERBOSE( "STATES = " << attribute.data<int>() ); + } + + } + + EventIDRange statesRange; + if(!states.range(statesRange)) { + ATH_MSG_ERROR("Failed to retrieve validity range for " << states.key()); + return StatusCode::FAILURE; + } else { + ATH_MSG_VERBOSE("Retrieved " << states.key() << " with range: " << statesRange); + } + + eventRange = (m_readHV || m_readHVSet) ? EventIDRange::intersect(eventRange, statesRange) : statesRange; + } + + + for (unsigned int ros = 1; ros < TileCalibUtils::MAX_ROS; ++ros) { + for (unsigned int drawer = 0; drawer < TileCalibUtils::MAX_DRAWER; ++drawer) { + + TileDCSState::TileDCSStatus drawerStatus = dcsStateData->getDCSStatus(ros, drawer); + + int moduleType = (ros > 2) ? EXTENDED_BARREL : LONG_BARREL; + int specialModuleType(moduleType); + if (moduleType == EXTENDED_BARREL) { + if ((ros == 3 && drawer == 14) || (ros == 4 && drawer == 17)) { + specialModuleType = EXTENDED_BARREL_NO_D4; // EBA15 EBC18 + } else if (!m_cabling->C10_connected(drawer)) { + specialModuleType = EXTENDED_BARREL_SPECIAL_C10; // EB modules with special C10 + } + } + + for (unsigned int channel = 0; channel < TileCalibUtils::MAX_CHAN; ++channel) { + if (m_isChannelUsed[specialModuleType][channel]) { + + TileDCSState::TileDCSStatus channelHVStatus(TileDCSState::UNKNOWN); + + float hvSet(dcsStateData->getChannelHVSet(ros, drawer, channel)); + float hv(dcsStateData->getChannelHV(ros, drawer, channel)); + + // ignore zero "set" and negative "measured" HV, set status to unknown + if (hvSet >= 1.0 && hv >= 0.0 // HV can't be negative + && hvSet < 999.9 && hv < 999.9) { // HV can't be greater 930V + + std::map<int, std::pair<float, float>>::const_iterator itr = + m_knownBadHV.find(getChannelKey(ros, drawer, channel)); + + if (itr != m_knownBadHV.end()) { // known unstable PMTs + + float hvGap = (m_readHVSet) ? // take into account offset if HVSET is used + fabs(hvSet + itr->second.second - hv) : fabs(hvSet - hv); + + if (hvGap <= m_goodHVLimit) channelHVStatus = TileDCSState::OK_KNOWNBADPMT; + else if (hvGap <= m_warningHVLimit) channelHVStatus = TileDCSState::WARNING_KNOWNBADPMT; + else channelHVStatus = TileDCSState::ALERT_KNOWNBADPMT; + } else { + float hvGap = fabs(hvSet - hv); + if (hvGap <= m_goodHVLimit) channelHVStatus = TileDCSState::OK; + else if (hvGap <= m_warningHVLimit) channelHVStatus = TileDCSState::WARNING; + else channelHVStatus = TileDCSState::ALERT; + } + + } + + dcsStateData->setDCSHVStatus(ros, drawer, channel, channelHVStatus); + + if (drawerStatus > TileDCSState::OK && !m_readHVSet) { + dcsStateData->setDCSStatus(ros, drawer, channel, drawerStatus); + } else { + dcsStateData->setDCSStatus(ros, drawer, channel, std::max(drawerStatus, channelHVStatus)); + } + + } else { + dcsStateData->setDCSHVStatus(ros, drawer, channel, TileDCSState::NON_EXISTING); + dcsStateData->setDCSStatus(ros, drawer, channel, TileDCSState::NON_EXISTING); + } + } + + + if (msgLvl(MSG::VERBOSE)) { + msg(MSG::VERBOSE) << "Module = " << TileCalibUtils::getDrawerString(ros, drawer) + << " Status = " << drawerStatus << endmsg; + + std::string ignored = ((drawerStatus > TileDCSState::OK && !m_readHVSet) ? " ignored" : ""); + + for (unsigned int channel = 0; channel < TileCalibUtils::MAX_CHAN; ++channel) { + int pmt0 = m_channel2pmt[moduleType][channel]; + TileDCSState::TileDCSStatus status = dcsStateData->getDCSHVStatus(ros, drawer, channel); + msg(MSG::VERBOSE) << "Module = " << TileCalibUtils::getDrawerString(ros, drawer) + << " channel = " << channel + << " pmt = " << pmt0 + 1 + << " HV = " << dcsStateData->getChannelHV(ros, drawer, channel) + << " HVSET = " << dcsStateData->getChannelHVSet(ros, drawer, channel) + << " Status = " << status + << ignored << endmsg; + } + } + + } + } + + // Define validity of the output cond object + if(dcsState.record(eventRange, dcsStateData.release()).isFailure()) { + + ATH_MSG_ERROR("Could not record TileDCSState object with " + << dcsState.key() + << " with EventRange " << eventRange + << " into Conditions Store"); + + return StatusCode::FAILURE; + } else { + + ATH_MSG_VERBOSE("Recorded TileDCSState object with " + << dcsState.key() + << " with EventRange " << eventRange + << " into Conditions Store"); + } + + return StatusCode::SUCCESS; + +} + + + +//_____________________________________________________________________________ +int TileDCSCondAlg::readConfig(std::string fileName, std::string subStr, + std::vector<std::pair<int, int>>& rosDrawer) { + + std::string fullFileName = PathResolver::find_file(fileName, "DATAPATH"); + std::ifstream file(fullFileName.c_str()); + if (!file.is_open()) { + ATH_MSG_ERROR( "Can't find " << fileName); + return 2; + } else { + ATH_MSG_DEBUG( "Reading file " << fullFileName); + } + + rosDrawer.resize(257, std::make_pair<int, int>(0xFFFF, 0xFFFF)); + + std::string compName[5] = { "XXX", "ATLTILLV01", "ATLTILLV02", "ATLTILLV00", "ATLTILLV03" }; + + unsigned int ind, ros, module; + std::string s, line; + size_t pos; + + while (true) { + + file >> s >> ind >> line; + + if (file.eof() || file.fail()) break; + + for (ros = 1; ros < TileCalibUtils::MAX_ROS; ++ros) { + pos = line.find(compName[ros]); + if (pos != std::string::npos) break; + } + + if (ros == TileCalibUtils::MAX_ROS) { + msg(MSG::WARNING) << "File " << fileName << " Wrong computer name in " << line << endmsg; + continue; + } + + pos = line.find(subStr); + if (pos == std::string::npos) { + ATH_MSG_WARNING( "File " << fileName << " Word " << subStr << " not found in " << line); + continue; + } + + module = atoi(&line[pos + subStr.size()]); + if (module < 1 || module > TileCalibUtils::MAX_DRAWER) { + ATH_MSG_WARNING( "File " << fileName << " Wrong module number in " << line); + continue; + } + + ATH_MSG_VERBOSE("Module = " << TileCalibUtils::getDrawerString(ros, module - 1) << " ind = " << ind); + + if (rosDrawer.size() <= ind) { + rosDrawer.resize(ind + 1, std::make_pair<int, int> (0xFFFF, 0xFFFF)); + } + + rosDrawer[ind] = std::make_pair<int, int>(ros, (module - 1)); + + } + + file.close(); + + return 0; +} + +//_____________________________________________________________________________ +int TileDCSCondAlg::readBadHV(std::string fileName) { + + std::string fullFileName = PathResolver::find_file(fileName, "DATAPATH"); + std::ifstream file(fullFileName.c_str()); + if (!file.is_open()) { + ATH_MSG_WARNING( "Can't find " << fileName); + return 1; + } else { + ATH_MSG_DEBUG("Reading file " << fullFileName); + } + + std::string partName[5] = { "AUX", "LBA", "LBC", "EBA", "EBC" }; + + unsigned int ros, module, pmt; + float delta, offset; + char ll[256]; + std::string line; + size_t pos = 0; + + while (true) { + + file.getline(ll, sizeof(ll)); + + if (file.eof() || file.fail()) break; + + line = std::string(ll); + + for (ros = 1; ros < TileCalibUtils::MAX_ROS; ++ros) { + pos = line.find(partName[ros]); + if (pos != std::string::npos) break; + } + if (ros == TileCalibUtils::MAX_ROS) { + ATH_MSG_WARNING( "File " << fileName << " Partition name not found in " << line); + continue; + } + + module = atoi(&line[pos + 3]); + if (module < 1 || module > TileCalibUtils::MAX_DRAWER) { + ATH_MSG_WARNING( "File " << fileName << " Wrong module number in " << line); + continue; + } + + pos = line.find("PMT number"); + if (pos == std::string::npos) { + ATH_MSG_WARNING( "File " << fileName << " Word 'PMT number' not found in " << line); + continue; + } + + pmt = atoi(&line[pos + 10]); + if (pmt < 1 || pmt > TileCalibUtils::MAX_CHAN) { + ATH_MSG_WARNING( "File " << fileName << " Wrong pmt number in " << line); + continue; + } + + pos = line.find("Step Value is"); + if (pos == std::string::npos) { + ATH_MSG_WARNING( "File " << fileName << " Word 'Step Value is' not found in " << line); + continue; + } + + delta = atof(&line[pos + 13]); + if (delta <= 0.0 || delta > 1000.0) { + ATH_MSG_WARNING( "File " << fileName << " Wrong delta number in " << line); + continue; + } + + pos = line.find("Offset is:"); + if (pos == std::string::npos) { + ATH_MSG_WARNING( "File " << fileName << " Word 'Offset is:' not found in " << line); + continue; + } + + offset = atof(&line[pos + 10]); + if (offset < -1000.0 || offset > 1000.0) { + ATH_MSG_WARNING( "File " << fileName << " Wrong offset number in " << line); + continue; + } + + ATH_MSG_WARNING( "Module = " << TileCalibUtils::getDrawerString(ros, module - 1) + << " pmt = " << pmt + << " delta = " << delta + << " offset = " << offset); + + int moduleType = (ros > 2) ? EXTENDED_BARREL : LONG_BARREL; + int channel = m_pmt2channel[moduleType][pmt - 1]; + m_knownBadHV[getChannelKey(ros, module - 1, channel)] = std::make_pair(delta, offset); + + } + + file.close(); + + return 0; +} + +StatusCode TileDCSCondAlg::fillReferenceHV(TileDCSState& dcsState, EventIDRange& eventRange) { + + SG::ReadCondHandle<TileEMScale> emScale(m_emScaleKey); + + float laserReferenceHV = -5.; + float cesReferenceHV = -5.; + + for (unsigned int ros = 1; ros < TileCalibUtils::MAX_ROS; ++ros) { + int moduleType = (ros > 2) ? EXTENDED_BARREL : LONG_BARREL; + + for (unsigned int drawer = 0; drawer < TileCalibUtils::MAX_DRAWER; ++drawer) { + unsigned int drawerIdx = TileCalibUtils::getDrawerIdx(ros, drawer); + + for (unsigned int channel = 0; channel < TileCalibUtils::MAX_CHAN; ++channel) { + int pmt0 = m_channel2pmt[moduleType][channel]; + + cesReferenceHV = emScale->getCesiumReferenceHV(drawerIdx, channel); + laserReferenceHV = emScale->getLaserReferenceHV(drawerIdx, channel); + + if (laserReferenceHV >= 0.) { + dcsState.setChannelHVSet(ros, drawer, channel, laserReferenceHV); + } else { + dcsState.setChannelHVSet(ros, drawer, channel, cesReferenceHV); + } + + if (msgLvl(MSG::VERBOSE)) { + msg(MSG::VERBOSE) << "Module = " << TileCalibUtils::getDrawerString(ros, drawer) + << " channel = " << channel + << " pmt = " << pmt0 + 1 + << " HVref = " << dcsState.getChannelHVSet(ros, drawer, channel); + + if (laserReferenceHV >= 0.) { + msg(MSG::VERBOSE) << " Taken from Laser run (replace " + << cesReferenceHV << " cesium value)" << endmsg; + } else { + msg(MSG::VERBOSE) << endmsg; + } + } + } + } + } + + if(!emScale.range(eventRange)) { + ATH_MSG_ERROR("Failed to retrieve validity range for " << emScale.key()); + return StatusCode::FAILURE; + } else { + ATH_MSG_VERBOSE("Retrieved " << emScale.key() << " with range: " << eventRange); + } + + return StatusCode::SUCCESS; +} + + +StatusCode TileDCSCondAlg::finalize() { + return StatusCode::SUCCESS; +} diff --git a/TileCalorimeter/TileConditions/src/TileDCSCondAlg.h b/TileCalorimeter/TileConditions/src/TileDCSCondAlg.h new file mode 100644 index 0000000000000000000000000000000000000000..99d55cc967e85ad907d26b6f7d20e404d8c90205 --- /dev/null +++ b/TileCalorimeter/TileConditions/src/TileDCSCondAlg.h @@ -0,0 +1,219 @@ +//Dear emacs, this is -*- c++ -*- + +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef TILECONDITIONS_TILEDCSCONDALG_H +#define TILECONDITIONS_TILEDCSCONDALG_H + +// Tile includes +#include "TileConditions/TileDCSState.h" +#include "TileConditions/TileEMScale.h" + +// Athena includes +#include "AthenaBaseComps/AthAlgorithm.h" +#include "StoreGate/ReadCondHandleKey.h" +#include "StoreGate/WriteCondHandleKey.h" +#include "AthenaPoolUtilities/CondAttrListCollection.h" + +#include "GaudiKernel/ICondSvc.h" + +class TileCablingService; + +/** + * @class TileDCSCondAlg + * @brief Condition algorithm to prepare TileDCSState object and put it into condition store + * + * This condition algorithm reads information from Tile DCS DB. + * Reference HV can be get from Tile calibration Cesium or Laser DB folder (by default) + * instead of from Tile DCS DB. In this case reference HV is used from Laser folder + * if it is not negative otherwise reference HV is used from Cesium folder. Using this information + * the algorithm prepares TileDCSState condition object and put it into condition store. + */ +class TileDCSCondAlg: public AthAlgorithm { + public: + + TileDCSCondAlg(const std::string& name, ISvcLocator* pSvcLocator); + ~TileDCSCondAlg(); + + virtual StatusCode initialize() override; + virtual StatusCode execute() override; + virtual StatusCode finalize() override; + + private: + + enum TileModuleType {LONG_BARREL = 0, // LB + EXTENDED_BARREL = 1, // EB + EXTENDED_BARREL_NO_D4 = 2, // EB without D4: EBA15, EBC18 + EXTENDED_BARREL_SPECIAL_C10 = 3 // EB with special C10 + }; + + enum TileLimits { + NUMBER_OF_CHANNELS = 48, + NUMBER_OF_HVSET_CHANNELS = 68, + NUMBER_OF_MODULE_TYPES = 2, // LB, EB + NUMBER_OF_SPECIAL_MODULE_TYPES = 4 // // LB, EB, EB without D4, EB with special C10 + }; + + /** + * @brief Read mapping of DB COOL channels into Tile ROS and drawer pairs + * @param fileName name of file with mapping of COOL channels to Tile ROS and drawer pairs + * @param subStr sub string to look for + * @param[out] rosDrawer vector of Tile ROS and drawer pairs indexed by COOL channel + * @return 0 in the case of success + */ + int readConfig(const std::string fileName, const std::string subStr, std::vector<std::pair<int, int>>& rosDrawer); + + /** + * @brief Read special deltas for few unstable PMTs + * @param fileName name of file with special deltas for few unstable PMTs + * @return 0 in the case of success + */ + int readBadHV(const std::string fileName); + + /** + * @brief Store reference HV from Tile CES or Laser DB folder in TileDCSState + * @param[out] dcsState TileDCSState to store reference HV + * @param[out] eventRange Event range within which reference HV is valid + */ + StatusCode fillReferenceHV(TileDCSState& dcsState, EventIDRange& eventRange); + + /** + * @ brief Return Tile channel key used as index in internal caches + * @ ros Tile ROS in range [1..4] + * @ drawer Tile drawer number in range [0..63] + * @ channel Tile channel number + */ + + unsigned int getChannelKey(unsigned int ros, unsigned int drawer, unsigned int channel); + + /** + * @brief The Tile DCS HV COOL folder name + */ + SG::ReadCondHandleKey<CondAttrListCollection> m_hvKey{this, + "HV", "/TILE/DCS/HV", "The Tile DCS HV COOL folder name"}; + + /** + * @brief The Tile DCS HVSET COOL folder name + */ + SG::ReadCondHandleKey<CondAttrListCollection> m_hvSetKey{this, + "HVSET", "/TILE/DCS/HVSET", "The Tile DCS HVSET COOL folder name"}; + + /** + * @brief The Tile DCS STATES COOL folder name + */ + SG::ReadCondHandleKey<CondAttrListCollection> m_statesKey{this, + "STATES", "/TILE/DCS/STATES", "The Tile DCS STATES COOL folder name"}; + + /** + * @brief The name of TileDCSState object to produce and put into condition store + */ + SG::WriteCondHandleKey<TileDCSState> m_dcsStateKey{this, + "TileDCS", "TileDCS", "Output Tile DCS status"}; + + /** + * @brief The name of TileEMScale object to get reference HV from Cesium or Laser folder + */ + SG::ReadCondHandleKey<TileEMScale> m_emScaleKey{this, + "TileEMScale", "TileEMScale", "Input Tile EMS conditions"}; + + /** + * @brief Flag to control reading Tile DCS HV folder from DB + */ + Gaudi::Property<bool> m_readHV{this, "ReadHV", true, + "Flag to control reading Tile DCS HV folder from DB"}; + + /** + * @brief Flag to control reading Tile DCS HVSET folder from DB + */ + Gaudi::Property<bool> m_readHVSet{this, "ReadHVSET", false, + "Flag to control reading Tile DCS HVSET folder from DB"}; + + /** + * @brief Flag to control reading Tile DCS STATES folder from DB + */ + Gaudi::Property<bool> m_readStates{this, "ReadSTATES", true, + "Flag to control reading Tile DCS STATES folder from DB"}; + + /** + * @brief Tile DCS Status is OK if difference + * between measured and requested HV is below this limit + */ + Gaudi::Property<float> m_goodHVLimit{this, "GoodHVLimit", 2.0F, + "Status is OK if HV difference is below this limit"}; + + /** + * @brief Mask channels with difference + * between measured and requested HV above this limit + */ + Gaudi::Property<float> m_warningHVLimit{this, "WarningHVLimit", 10.0F, + "Mask channels with HV difference above this limit"}; + + /** + * @brief Status is OK if Tile DCS drawer states is like this + */ + Gaudi::Property<int> m_goodDrawer{this, "GoodDrawer", 212222, + "Status is OK if Tile DCS drawer states is like this"}; + + /** + * @brief Status is WARNING if Tile DCS drawer states is like this + */ + Gaudi::Property<std::vector<int>> m_warningDrawer{this, "WarningDrawer", + {202221, // module in emergency mode + 202222, // 830V HV is on, no communication on HV can-bus, status is unknown (assume that it's good) + 2222, // no communication on HV can-bus, status is unknown (assume that it's good) + 212020, // no communication on LV can-bus, status is unknown (assume that it's good) + 202020, // 830V HV is on, no communication on LV and HV can-bus, status is unknown (assume that it's good) + 2020}, // no communication on LV and HV can-bus, status is unknown (assume that it's good) + "Status is WARNING if Tile DCS drawer states is like this"}; + + /** + * @brief File name with mapping Tile DCS HV DB COOL channels to ROS and drawer + */ + Gaudi::Property<std::string> m_dcsChHvInCool{this, + "DCSChHVInCOOL", "DCSChHVInCOOL.dat", + "File name with mapping Tile DCS HV DB COOL channels to ROS and drawer"}; + + /** + * @brief File name with mapping Tile DCS HVSET DB COOL channels to ROS and drawer + */ + Gaudi::Property<std::string> m_dcsChHvSetInCool{this, + "DCSChHVSETInCOOL", "DCSChHVSETInCOOL.dat", + "File name with mapping Tile DCS HVSET DB COOL channels to ROS and drawer"}; + + /** + * @brief File name with mapping Tile DCS STATES DB COOL channels to ROS and drawer + */ + Gaudi::Property<std::string> m_dcsChStatesInCool{this, + "DCSChStatesInCOOL", "DCSChStatesInCOOL.dat", + "File name with mapping Tile DCS STATES DB COOL channels to ROS and drawer"}; + + + ServiceHandle<ICondSvc> m_condSvc; + + const TileCablingService* m_cabling; + + std::vector<std::pair<int, int>> m_rosDrawerHV; + std::vector<std::pair<int, int>> m_rosDrawerHVSet; + std::vector<std::pair<int, int>> m_rosDrawerStates; + + std::map<int, std::pair<float,float> > m_knownBadHV; + + int m_unknownValue; + + int m_channel2pmt[2][NUMBER_OF_HVSET_CHANNELS]; + int m_pmt2channel[2][NUMBER_OF_HVSET_CHANNELS]; + bool m_isChannelUsed[4][NUMBER_OF_CHANNELS]; // 0=LB, 1=EB, 2=EB without D4, 3=EB with special C10 + +}; + +// inlines + +inline +unsigned int TileDCSCondAlg::getChannelKey(unsigned int ros, unsigned int drawer, unsigned int channel) { + return ( ((((ros - 1) << 6) | drawer) << 6) | channel ); +} + + +#endif // TILECONDITIONS_TILEDCSCONDALG_H diff --git a/TileCalorimeter/TileConditions/src/TileDCSState.cxx b/TileCalorimeter/TileConditions/src/TileDCSState.cxx new file mode 100644 index 0000000000000000000000000000000000000000..e42fae398389b75ee9c7b50d95f22e849420d48f --- /dev/null +++ b/TileCalorimeter/TileConditions/src/TileDCSState.cxx @@ -0,0 +1,43 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + + +// Tile includes +#include "TileConditions/TileDCSState.h" + +#include <cstring> +#include <algorithm> + +TileDCSState::TileDCSState() + : m_goodDrawer(212222), + m_unknownValue(-30) // should be negative +{ + + std::fill(&m_states[0][0], &m_states[3][64], m_unknownValue); + std::fill(&m_hv[0][0][0], &m_hv[3][63][48], m_unknownValue); + std::fill(&m_hvSet[0][0][0], &m_hvSet[3][63][68], m_unknownValue); + std::fill(&m_status[0][0][0], &m_status[3][63][48], UNKNOWN); + std::fill(&m_hvStatus[0][0][0], &m_hvStatus[3][63][48], UNKNOWN); + +} + + +//_____________________________________________________________________________ +TileDCSState::TileDCSStatus TileDCSState::getDCSStatus(unsigned int ros, unsigned int drawer) const { + + TileDCSStatus status(ALERT_DRAWER); + + int state = m_states[ros - 1][drawer]; + if (state == m_goodDrawer) { + status = OK_DRAWER; + } else if (state == m_unknownValue) { + status = UNKNOWN; + } else if (std::find(m_warningDrawer.begin(), m_warningDrawer.end(), state) != + m_warningDrawer.end()) { + + status = WARNING_DRAWER; + } + + return status; +} diff --git a/TileCalorimeter/TileConditions/src/TileDCSSvc.cxx b/TileCalorimeter/TileConditions/src/TileDCSSvc.cxx index 07028915f0769e8f81e086d53fdc9da211fa8ec7..1f9a3b14657f492fb136a01402a40abbf6b5fc02 100644 --- a/TileCalorimeter/TileConditions/src/TileDCSSvc.cxx +++ b/TileCalorimeter/TileConditions/src/TileDCSSvc.cxx @@ -2,30 +2,18 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -// Gaudi includes -#include "GaudiKernel/Property.h" -#include "StoreGate/StoreGateSvc.h" -#include "StoreGate/DataHandle.h" - -// Athena includes -// AttributeList -#include "CoralBase/Attribute.h" -#include "CoralBase/AttributeListSpecification.h" -#include "AthenaKernel/errorcheck.h" -#include "AthenaPoolUtilities/AthenaAttributeList.h" -#include "AthenaPoolUtilities/CondAttrListCollection.h" - // Tile includes -#include "TileCalibBlobObjs/TileCalibUtils.h" +//#include "TileCalibBlobObjs/TileCalibUtils.h" #include "TileConditions/TileDCSSvc.h" -#include "TileConditions/TileCondDCS_Data.h" +//#include "src/TileDCSTool.h" #include "TileConditions/TileCablingService.h" +// Athena includes +#include "AthenaKernel/errorcheck.h" -#include "PathResolver/PathResolver.h" +// Gaudi includes +#include "GaudiKernel/ServiceHandle.h" -#include <fstream> -#include <iomanip> static const InterfaceID IID_TileDCSSvc("TileDCSSvc", 1, 0); const InterfaceID& TileDCSSvc::interfaceID() { @@ -34,30 +22,11 @@ const InterfaceID& TileDCSSvc::interfaceID() { TileDCSSvc::TileDCSSvc(const std::string& name, ISvcLocator* pSvcLocator) : AthService(name, pSvcLocator) - , m_detStore("DetectorStore", name) - , m_IOVDbSvc("IOVDbSvc", name) - , m_tileCablingSvc("TileCablingSvc", name) - , m_cabling(0) - , m_tileToolEmscale("TileCondToolEmscale") + , m_cabling(nullptr) , m_version(2) { - declareProperty("TileCondToolEmscale", m_tileToolEmscale); - declareProperty("Version", m_version); // 1 - RUN1 conditions DB, 2 - RUN2 conditions - - m_goodDrawer = 212222; // good status for the drawer - - m_warningDrawer.push_back(202221); // module in emergency mode - - m_warningDrawer.push_back(202222); // 830V HV is on, no communication on HV can-bus, status is unknown (assume that it's good) - m_warningDrawer.push_back(2222); // no communication on HV can-bus, status is unknown (assume that it's good) - - m_warningDrawer.push_back(212020); // no communication on LV can-bus, status is unknown (assume that it's good) - m_warningDrawer.push_back(202020); // 830V HV is on, no communication on LV and HV can-bus, status is unknown (assume that it's good) - m_warningDrawer.push_back(2020); // no communication on LV and HV can-bus, status is unknown (assume that it's good) - // two statuses which considered as warning in 2010 - //m_warningDrawer.push_back( 2221); // emergency mode but without info about 830V HV - can't be good in 2011 - //m_warningDrawer.push_back( 12222); // 830V HV is off, can't be good status + declareProperty("Version", m_version); // 1 - RUN1 conditions DB, 2 - RUN2 conditions m_partName.push_back("AUX"); m_partName.push_back("LBA"); @@ -65,26 +34,8 @@ TileDCSSvc::TileDCSSvc(const std::string& name, ISvcLocator* pSvcLocator) m_partName.push_back("EBA"); m_partName.push_back("EBC"); - //declare variables which will be filled by jobOptions - // note that reading of HVSET is disabled by default - // and HV reference is taken from CES folder in COOL - declareProperty("ReadAnyFolder", m_readAnyFolder = true); // single flag to disable everything - declareProperty("ReadHV", m_readHV = true); // reading HV - declareProperty("ReadHVSET", m_readHVSET = false); // reading HVSET - declareProperty("ReadSTATES", m_readSTATES = true); // reading drawer state - declareProperty("FolderLocation", m_folderPrefix = "/TILE/DCS"); // global prefix - - declareProperty("GoodHVLimit", m_goodHVlimit = 2.0); // status=OK if HV diff below this limit - declareProperty("WarningHVLimit", m_warningHVlimit = 10.0); // mask channels with HV diff above limit - - declareProperty("GoodDrawer", m_goodDrawer); // status=OK if drawer status is like this - declareProperty("WarningDrawer", m_warningDrawer); // status=WARNING if drawer status is like this - m_unknownValue = -30; // should be negative - m_ncalls = 0; - for (int i = 0; i < 256; i++) - m_STATES[i] = 0; } //_____________________________________________________________________________ @@ -101,113 +52,33 @@ StatusCode TileDCSSvc::queryInterface(const InterfaceID& riid, void** ppvInterfa //_____________________________________________________________________________ StatusCode TileDCSSvc::initialize() { - CHECK( m_detStore.retrieve()); - - int cnt = 0; - if (m_readAnyFolder) { - std::string name; - if (m_readHV) { - name = m_folderPrefix + std::string("/HV"); - if (m_detStore->regFcn(&TileDCSSvc::fillData, this, m_DCSData_HV, name).isSuccess()) { - ATH_MSG_INFO( "DCS_TILE Registered callback for key: " << name); - ++cnt; - } else { - ATH_MSG_ERROR( "DCS_TILE Cannot register callback function for key " << name); - } - } - if (m_readHVSET) { - name = m_folderPrefix + std::string("/HVSET"); - if (m_detStore->regFcn(&TileDCSSvc::fillData, this, m_DCSData_HVSET, name).isSuccess()) { - ATH_MSG_INFO( "DCS_TILE Registered callback for key: " << name); - ++cnt; - } else { - ATH_MSG_ERROR( "DCS_TILE Cannot register callback function for key " << name); - } - } - if (m_readSTATES) { - name = m_folderPrefix + std::string("/STATES"); - if (m_detStore->regFcn(&TileDCSSvc::fillData, this, m_DCSData_STATES, name).isSuccess()) { - ATH_MSG_INFO( "DCS_TILE Registered callback for key: " << name); - ++cnt; - } else { - ATH_MSG_ERROR( "DCS_TILE Cannot register callback function for key " << name); - } - } - } - - ATH_MSG_INFO( "Will read " << cnt << " folders in total"); + //=== get TileDCSTool + ATH_CHECK( m_dcsTool.retrieve()); //=== get TileCablingSvc - CHECK( m_tileCablingSvc.retrieve()); + ServiceHandle<TileCablingSvc> cablingSvc("TileCablingSvc", name()); + ATH_CHECK( cablingSvc.retrieve()); //=== cache pointers to cabling helpers - m_cabling = m_tileCablingSvc->cablingService(); + m_cabling = cablingSvc->cablingService(); if (!m_cabling) { ATH_MSG_ERROR( "Pointer to TileCablingService is zero: " << m_cabling); return StatusCode::FAILURE; } - //=== get TileCondToolEmscale - CHECK( m_tileToolEmscale.retrieve()); - for (int i = 0; i < 2; ++i) { int ros = i + 2; - int chan = 0; - for (; chan < 48; ++chan) { - int pmt = m_cabling->channel2hole(ros, chan); - m_channel_used[i][chan] = (pmt > 0); // positive pmt - means channel is connected - if (i) m_channel_used[3][chan] = m_channel_used[2][chan] = m_channel_used[1][chan]; - pmt = abs(pmt); - m_channel2pmt[i][chan] = pmt - 1; - m_pmt2channel[i][pmt - 1] = chan; // note - pmt-1 is used as index + int channel = 0; + for (; channel < 48; ++channel) { + int pmt = std::abs(m_cabling->channel2hole(ros, channel)); + m_pmt2channel[i][pmt - 1] = channel; // note - pmt-1 is used as index } - for (; chan < 68; ++chan) { - m_channel2pmt[i][chan] = chan; - m_pmt2channel[i][chan] = chan; + for (; channel < 68; ++channel) { + m_pmt2channel[i][channel] = channel; } } - // description of EBA15 and EBC18 channel 0-3 do not exist, channel 18,19 used - m_channel_used[2][0] = false; - m_channel_used[2][1] = false; - m_channel_used[2][2] = false; - m_channel_used[2][3] = false; - m_channel_used[2][18] = true; - m_channel_used[2][19] = true; - // description of EB with special C10 - channel 4 (pmt 5) is not used - m_channel_used[3][4] = false; - // initialize all arrays with HV and drawer status - for (int ros = 1; ros < 5; ++ros) { - for (int drawer = 0; drawer < 64; ++drawer) { - int Drawer = RosDrawer(ros,drawer); - m_STATES[Drawer] = m_unknownValue; - for (int channel = 0; channel < 55; ++channel) { - m_HV[Drawer][channel] = m_unknownValue; - } - for (int channel = 0; channel < 68; ++channel) { - m_HVSET[Drawer][channel] = m_unknownValue; - } - for (int channel = 0; channel < 48; ++channel) { // to put either non_existing or unknown status - m_STATUS[Drawer][channel] = getDCSHVSTATUS(ros, drawer, channel); - } - } - } - // read special deltas for few unstable PMTs - if (m_readHVSET) read_badhv("BadHVChannels.dat"); - // not needed - all cool channels are the same as in RUN1 now - //if (m_version == 2) { - // ATH_MSG_INFO( "Reading config for RUN2"); - // if (read_config("DCSChStatesInCOOLR2.dat", "_LVPS_", m_pModulesSTATES)) return StatusCode::FAILURE; - // if (read_config("DCSChHVInCOOLR2.dat", "Drawer", m_pModulesHV)) return StatusCode::FAILURE; - // if (read_config("DCSChHVSETInCOOLR2.dat", "Drawer", m_pModulesHVSET)) return StatusCode::FAILURE; - //} else { - // ATH_MSG_INFO( "Reading config for RUN1"); - if (read_config("DCSChStatesInCOOL.dat", "_LVPS_", m_pModulesSTATES)) return StatusCode::FAILURE; - if (read_config("DCSChHVInCOOL.dat", "Drawer", m_pModulesHV)) return StatusCode::FAILURE; - if (read_config("DCSChHVSETInCOOL.dat", "Drawer", m_pModulesHVSET)) return StatusCode::FAILURE; - //} - return StatusCode::SUCCESS; } @@ -216,343 +87,46 @@ StatusCode TileDCSSvc::finalize() { return StatusCode::SUCCESS; } -//_____________________________________________________________________________ -TileDCSSvc::TileDCSStatus TileDCSSvc::getDCSHVSTATUS(int ros, int drawer, int channel) const { - int Drawer = RosDrawer(ros,drawer); +float TileDCSSvc::getDCSHV(int ros, int module, int pmt) const { int lb_eb = (ros > 2) ? 1 : 0; - int pmt0 = m_channel2pmt[lb_eb][channel]; // this is pmt-1 value - if (lb_eb) { - if ((ros == 3 && drawer == 14) || (ros == 4 && drawer == 17)) - lb_eb = 2; // EBA15 EBC18 - else if (!m_cabling->C10_connected(drawer)) lb_eb = 3; // EB modules with special C10 - } - - TileDCSStatus status(NON_EXISTING); - - if (m_channel_used[lb_eb][channel]) { // including only existing (and actually used) pmts - if (m_HVSET[Drawer][pmt0] < 1.0 || m_HV[Drawer][pmt0] < 0.0 // HV can't be negative - || m_HVSET[Drawer][pmt0] > 999.9 || m_HV[Drawer][pmt0] > 999.9) { // HV can't be greater 930V - status = UNKNOWN; // ignore zero "set" and negative "measured" HV, set status to unknown - } else { - std::map<int, std::pair<float, float> >::const_iterator itr = m_knownBadHV.find( - PmtIndex(Drawer,pmt0)); - if (itr != m_knownBadHV.end()) { // known unstable PMTs - float HVgap = (m_readHVSET) ? // take into account offset if HVSET is used - fabs(m_HVSET[Drawer][pmt0] + itr->second.second - m_HV[Drawer][pmt0]) : fabs(m_HVSET[Drawer][pmt0] - m_HV[Drawer][pmt0]); - if (HVgap <= m_goodHVlimit) - status = OK_KNOWNBADPMT; - else if (HVgap <= m_warningHVlimit) - status = WARNING_KNOWNBADPMT; - else - status = ALERT_KNOWNBADPMT; - } else { - float HVgap = fabs(m_HVSET[Drawer][pmt0] - m_HV[Drawer][pmt0]); - if (HVgap <= m_goodHVlimit) - status = OK; - else if (HVgap <= m_warningHVlimit) - status = WARNING; - else - status = ALERT; - } - } - } - - return status; + int channel = m_pmt2channel[lb_eb][pmt - 1]; + return m_dcsTool->getChannelHV(ros, module - 1, channel); } -//_____________________________________________________________________________ -TileDCSSvc::TileDCSStatus TileDCSSvc::getDCSSTATUS(int ros, int drawer) const { - TileDCSStatus status(ALERT_DRAWER); - - int state = m_STATES[RosDrawer(ros,drawer)]; - if (state == m_goodDrawer) status = OK_DRAWER; - else if (state == m_unknownValue) status = UNKNOWN; - else { - for (std::vector<int>::const_iterator itr = m_warningDrawer.begin(); itr != m_warningDrawer.end(); ++itr) { - if ((*itr) == state) { - status = WARNING_DRAWER; - break; - } - } - } - return status; +float TileDCSSvc::getDCSHVSET(int ros, int module, int pmt) const { + int lb_eb = (ros > 2) ? 1 : 0; + int channel = m_pmt2channel[lb_eb][pmt - 1]; + return m_dcsTool->getChannelHVSet(ros, module - 1, channel); } -//_____________________________________________________________________________ -StatusCode TileDCSSvc::fillData(int& /* i */, std::list<std::string>& keys) { - - if (!m_ncalls && !m_readHVSET) fillHVref(); - ++m_ncalls; - - ATH_MSG_VERBOSE( "fillData called " << m_ncalls <<" times"); - - std::list<std::string>::const_iterator itr_key(keys.begin()); - // Retrieve CondAttrListCollection - const CondAttrListCollection* attrListCollection; - for (; itr_key != keys.end(); ++itr_key) { - const std::string & thisFolder = *itr_key; - if (m_detStore->retrieve(attrListCollection, thisFolder).isSuccess()) { - bool case1 = (thisFolder == "/TILE/DCS/HV"); - bool case2 = (thisFolder == "/TILE/DCS/HVSET"); - // loop over collection - CondAttrListCollection::const_iterator attrList(attrListCollection->begin()); - CondAttrListCollection::const_iterator end(attrListCollection->end()); - for (; attrList != end; ++attrList) { - //A CondAttrListCollection is a map of ChanNum and AttributeList - CondAttrListCollection::ChanNum drawerNumber = (*attrList).first; - try { - int Drawer = (case1) ? m_pModulesHV.at(drawerNumber) - : ((case2) ? m_pModulesHVSET.at(drawerNumber) - : m_pModulesSTATES.at(drawerNumber)); - if (Drawer < 256) { - CondAttrListCollection::AttributeList payload = (*attrList).second; - ATH_MSG_VERBOSE( "DrawerInDCS " << Drawer - << " DrawerInCOOL " << drawerNumber - << " payload " << payload); - - //loop over AttributeListSpecification - coral::AttributeList::const_iterator attrspecb = payload.begin(); - coral::AttributeList::const_iterator attrspece = payload.end(); - int pmt0 = 0; // runs over paylod parameters - for (; attrspecb != attrspece; ++attrspecb) { - std::string param = (*attrspecb).specification().name(); - if (case1) { - try { - m_HV[Drawer][pmt0] = (float) (*attrList).second[param].data<float>(); - ATH_MSG_VERBOSE( "HV[" << pmt0 << "]= " << (float)(*attrList).second[param].data<float>() ); - } catch (...) { - } - } else if (case2) { - try { - m_HVSET[Drawer][pmt0] = (float) (*attrList).second[param].data<float>(); - ATH_MSG_VERBOSE( "HVSET[" << pmt0 << "]= " << (float)(*attrList).second[param].data<float>() ); - } catch (...) { - } - } else if (param == "FORDAQ_MBHV") { - try { - m_STATES[Drawer] = (*attrList).second[param].data<int>(); - ATH_MSG_VERBOSE( "STATES= " << (*attrList).second[param].data<int>() ); - } catch (...) { - } - } - ++pmt0; - } - } - } catch (...) { - } - } - } - } - - for (int ros = 1; ros < 5; ++ros) { - int lb_eb = (ros > 2) ? 1 : 0; - for (int drawer = 0; drawer < 64; ++drawer) { - int Drawer = RosDrawer(ros,drawer); - TileDCSStatus drawerStatus = getDCSSTATUS(ros, drawer); - if (msgLvl(MSG::VERBOSE)) { - msg(MSG::VERBOSE) << "Module=" << m_partName[ros] << std::setw(2) << std::setfill('0') << drawer + 1 - << " Status=" << drawerStatus << endmsg; - - std::string ignored = ((drawerStatus > OK && !m_readHVSET) ? " ignored" : ""); - for (int channel = 0; channel < 48; ++channel) { - int pmt0 = m_channel2pmt[lb_eb][channel]; - TileDCSStatus status = getDCSHVSTATUS(ros, drawer, channel); - msg(MSG::VERBOSE) << "Module=" << m_partName[ros] << std::setw(2) << std::setfill('0') << drawer + 1 - << " channel=" << channel - << " pmt=" << pmt0 + 1 - << " HV=" << m_HV[Drawer][pmt0] - << " HVSET=" << m_HVSET[Drawer][pmt0] - << " Status=" << status - << ignored << endmsg; - } - } - if (drawerStatus > OK && !m_readHVSET) { - for (int channel = 0; channel < 48; ++channel) { - if (m_STATUS[Drawer][channel] != NON_EXISTING) m_STATUS[Drawer][channel] = drawerStatus; - } - } else { - for (int channel = 0; channel < 48; ++channel) { - if (m_STATUS[Drawer][channel] != NON_EXISTING) - m_STATUS[Drawer][channel] = std::max(drawerStatus, getDCSHVSTATUS(ros, drawer, channel)); - } - } - } - } - return StatusCode::SUCCESS; +int TileDCSSvc::getDCSSTATES (int ros, int module) const { + return m_dcsTool->getDrawerStates(ros, module - 1); } -//_____________________________________________________________________________ -int TileDCSSvc::read_config(std::string filename, std::string substr, - std::vector<int> & pModules) { - std::string file_name = PathResolver::find_file(filename, "DATAPATH"); - std::ifstream file(file_name.c_str()); - if (!file.is_open()) { - ATH_MSG_ERROR( "Can't find " << filename); - return 2; - } else { - ATH_MSG_DEBUG( "Reading file " << file_name); - } - - pModules.resize(257, 0xFFFF); - - std::string compName[5] = { "XXX", "ATLTILLV01", "ATLTILLV02", "ATLTILLV00", "ATLTILLV03" }; - - unsigned int ind, ros, module; - std::string s, line; - size_t pos; - while (true) { - - file >> s >> ind >> line; - - if (file.eof() || file.fail()) break; - - for (ros = 1; ros < 5; ++ros) { - pos = line.find(compName[ros]); - if (pos != std::string::npos) break; - } - if (ros == 5) { - msg(MSG::WARNING) << "File " << filename << " Wrong computer name in " << line << endmsg; - continue; - } - pos = line.find(substr); - if (pos == std::string::npos) { - ATH_MSG_WARNING( "File " << filename << " Word " << substr << " not found in " << line); - continue; - } - module = atoi(&line[pos + substr.size()]); - if (module < 1 || module > 64) { - ATH_MSG_WARNING( "File " << filename << " Wrong module number in " << line); - continue; - } - - ATH_MSG_VERBOSE( - "Module="<<m_partName[ros]<<std::setw(2)<<std::setfill('0')<<module<<" ind="<<ind); - if (pModules.size() <= ind) pModules.resize(ind + 1, 0xFFFF); - pModules[ind] = RosDrawer(ros,(module-1)); - } - file.close(); - - return 0; +//_____________________________________________________________________________ +TileDCSSvc::TileDCSStatus TileDCSSvc::getDCSHVSTATUS(int ros, int drawer, int channel) const { + return static_cast<TileDCSSvc::TileDCSStatus>(m_dcsTool->getDCSHVStatus(ros, drawer, channel)); } //_____________________________________________________________________________ -int TileDCSSvc::read_badhv(std::string filename) { - std::string file_name = PathResolver::find_file(filename, "DATAPATH"); - std::ifstream file(file_name.c_str()); - if (!file.is_open()) { - ATH_MSG_WARNING( "Can't find " << filename); - return 1; - } else { - ATH_MSG_DEBUG("Reading file " << file_name); - } - - std::string partName[5] = { "AUX", "LBA", "LBC", "EBA", "EBC" }; - - int ros, module, pmt; - float delta, offset; - char ll[256]; - std::string line; - size_t pos = 0; - - while (true) { - - file.getline(ll, sizeof(ll)); - - if (file.eof() || file.fail()) break; - - line = std::string(ll); - - for (ros = 1; ros < 5; ++ros) { - pos = line.find(partName[ros]); - if (pos != std::string::npos) break; - } - if (ros == 5) { - ATH_MSG_WARNING( "File " << filename << " Partition name not found in " << line); - continue; - } - module = atoi(&line[pos + 3]); - if (module < 1 || module > 64) { - ATH_MSG_WARNING( "File " << filename << " Wrong module number in " << line); - continue; - } - - pos = line.find("PMT number"); - if (pos == std::string::npos) { - ATH_MSG_WARNING( "File " << filename << " Word 'PMT number' not found in " << line); - continue; - } - pmt = atoi(&line[pos + 10]); - if (pmt < 1 || pmt > 48) { - ATH_MSG_WARNING( "File " << filename << " Wrong pmt number in " << line); - continue; - } - - pos = line.find("Step Value is"); - if (pos == std::string::npos) { - ATH_MSG_WARNING( "File " << filename << " Word 'Step Value is' not found in " << line); - continue; - } - delta = atof(&line[pos + 13]); - if (delta <= 0.0 || delta > 1000.0) { - ATH_MSG_WARNING( "File " << filename << " Wrong delta number in " << line); - continue; - } - - pos = line.find("Offset is:"); - if (pos == std::string::npos) { - ATH_MSG_WARNING( "File " << filename << " Word 'Offset is:' not found in " << line); - continue; - } - offset = atof(&line[pos + 10]); - if (offset < -1000.0 || offset > 1000.0) { - ATH_MSG_WARNING( "File " << filename << " Wrong offset number in " << line); - continue; - } - - ATH_MSG_WARNING( "Module=" << m_partName[ros] << std::setw(2) << std::setfill('0') << module - << " pmt=" << pmt - << " delta=" << delta - << " offset=" << offset); - - m_knownBadHV[PmtIndex(RosDrawer(ros,(module-1)),(pmt-1))] = std::make_pair(delta, offset); - } - file.close(); - - return 0; +TileDCSSvc::TileDCSStatus TileDCSSvc::getDCSSTATUS(int ros, int drawer) const { + return static_cast<TileDCSSvc::TileDCSStatus>(m_dcsTool->getDCSStatus(ros, drawer)); } -void TileDCSSvc::fillHVref() { - float HV_las = -5.; - float HV_ces = -5.; +TileDCSSvc::TileDCSStatus TileDCSSvc::getDCSSTATUS(int ros, int drawer, int channel) const { + return static_cast<TileDCSSvc::TileDCSStatus>(m_dcsTool->getDCSStatus(ros, drawer, channel)); +} - for (int ros = 1; ros < 5; ++ros) { - int lb_eb = (ros > 2) ? 1 : 0; - for (int drawer = 0; drawer < 64; ++drawer) { - int Drawer = RosDrawer(ros,drawer); - unsigned int drawerIdx = TileCalibUtils::getDrawerIdx(ros, drawer); - for (int channel = 0; channel < 48; ++channel) { - int pmt0 = m_channel2pmt[lb_eb][channel]; - HV_ces = m_tileToolEmscale->getCesRefHv(drawerIdx, channel); - HV_las = m_tileToolEmscale->getLasRefHv(drawerIdx, channel); - if (HV_las >= 0.) - m_HVSET[Drawer][pmt0] = HV_las; - else - m_HVSET[Drawer][pmt0] = HV_ces; +bool TileDCSSvc::statusHVIsBad (int ros, int drawer, int channel) const { + return m_dcsTool->isStatusHVBad(ros, drawer, channel); +} - if (msgLvl(MSG::VERBOSE)) { - msg(MSG::VERBOSE) << "Module=" << m_partName[ros] << std::setw(2) << std::setfill('0') << drawer + 1 - << " channel=" << channel - << " pmt=" << pmt0 + 1 - << " HVref=" << m_HVSET[Drawer][pmt0]; +bool TileDCSSvc::statusIsBad (int ros, int drawer) const { + return m_dcsTool->isStatusBad(ros, drawer); +} - if (HV_las >= 0.) - msg(MSG::VERBOSE) << " Taken from Laser run (replace " << HV_ces << " cesium value)" << endmsg; - else - msg(MSG::VERBOSE) << endmsg; - } - } - } - } +bool TileDCSSvc::statusIsBad (int ros, int drawer, int channel) const { + return m_dcsTool->isStatusBad(ros, drawer, channel); } diff --git a/TileCalorimeter/TileConditions/src/TileDCSTool.cxx b/TileCalorimeter/TileConditions/src/TileDCSTool.cxx new file mode 100644 index 0000000000000000000000000000000000000000..6d9ea214d687adc52245f7768744ec473a566012 --- /dev/null +++ b/TileCalorimeter/TileConditions/src/TileDCSTool.cxx @@ -0,0 +1,112 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +// Tile includes +#include "TileDCSTool.h" + +// Athena incldues +#include "AthenaKernel/errorcheck.h" +#include "StoreGate/ReadCondHandle.h" + + +// +//____________________________________________________________________ +TileDCSTool::TileDCSTool(const std::string& type, const std::string& name, const IInterface* parent) + : base_class(type, name, parent) +{ + +} + + +// +//____________________________________________________________________ +TileDCSTool::~TileDCSTool() { +} + +// +//____________________________________________________________________ +StatusCode TileDCSTool::initialize() { + + ATH_MSG_DEBUG( "In initialize()" ); + + //=== Initialize conditions data key with DCS status + ATH_CHECK( m_dcsStateKey.initialize() ); + + return StatusCode::SUCCESS; +} + +// +//____________________________________________________________________ +StatusCode TileDCSTool::finalize() { + + ATH_MSG_DEBUG( "finalize called" ); + + return StatusCode::SUCCESS; +} + + +float TileDCSTool::getChannelHV(unsigned int ros, unsigned int drawer, unsigned int channel) const { + + SG::ReadCondHandle<TileDCSState> dcsState(m_dcsStateKey); + return dcsState->getChannelHV(ros, drawer, channel); + +} + +float TileDCSTool::getChannelHVSet(unsigned int ros, unsigned int drawer, unsigned int channel) const { + + SG::ReadCondHandle<TileDCSState> dcsState(m_dcsStateKey); + return dcsState->getChannelHVSet(ros, drawer, channel); + +} + +int TileDCSTool::getDrawerStates(unsigned int ros, unsigned int drawer) const { + + SG::ReadCondHandle<TileDCSState> dcsState(m_dcsStateKey); + return dcsState->getDrawerStates(ros, drawer); + +} + + +TileDCSState::TileDCSStatus TileDCSTool::getDCSHVStatus(unsigned int ros, unsigned int drawer, unsigned int channel) const { + + SG::ReadCondHandle<TileDCSState> dcsState(m_dcsStateKey); + return dcsState->getDCSHVStatus(ros, drawer, channel); + +} + +TileDCSState::TileDCSStatus TileDCSTool::getDCSStatus(unsigned int ros, unsigned int drawer) const { + + SG::ReadCondHandle<TileDCSState> dcsState(m_dcsStateKey); + return dcsState->getDCSStatus(ros, drawer); + +} + +TileDCSState::TileDCSStatus TileDCSTool::getDCSStatus(unsigned int ros, unsigned int drawer, unsigned int channel) const { + + SG::ReadCondHandle<TileDCSState> dcsState(m_dcsStateKey); + return dcsState->getDCSStatus(ros, drawer, channel); + +} + + +bool TileDCSTool::isStatusHVBad(unsigned int ros, unsigned int drawer, unsigned int channel) const { + + SG::ReadCondHandle<TileDCSState> dcsState(m_dcsStateKey); + return dcsState->isStatusHVBad(ros, drawer, channel); + +} + +bool TileDCSTool::isStatusBad (unsigned int ros, unsigned int drawer) const { + + SG::ReadCondHandle<TileDCSState> dcsState(m_dcsStateKey); + return dcsState->isStatusBad(ros, drawer); + +} + +bool TileDCSTool::isStatusBad(unsigned int ros, unsigned int drawer, unsigned int channel) const { + + SG::ReadCondHandle<TileDCSState> dcsState(m_dcsStateKey); + return dcsState->isStatusBad(ros, drawer, channel); + +} diff --git a/TileCalorimeter/TileConditions/src/TileDCSTool.h b/TileCalorimeter/TileConditions/src/TileDCSTool.h new file mode 100644 index 0000000000000000000000000000000000000000..e3eeab50228fe0f4d4ed0cbf3ef3ce97fffb1330 --- /dev/null +++ b/TileCalorimeter/TileConditions/src/TileDCSTool.h @@ -0,0 +1,89 @@ +//Dear emacs, this is -*- c++ -*- + +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef TILECONDITIONS_TILEDCSTOOL_H +#define TILECONDITIONS_TILEDCSTOOL_H + +// Tile includes +#include "TileConditions/ITileDCSTool.h" +#include "TileConditions/TileDCSState.h" + +// Athena includes +#include "AthenaBaseComps/AthAlgTool.h" +#include "StoreGate/ReadCondHandleKey.h" + +/** + * @class TileDCSTool + * @brief The tool to get Tile DCS information from DB + */ + +class TileDCSTool: public extends<AthAlgTool, ITileDCSTool> { + + public: + + TileDCSTool(const std::string& type, const std::string& name, const IInterface* parent); + virtual ~TileDCSTool(); + + virtual StatusCode initialize() override; + virtual StatusCode finalize() override; + /** + * @copydoc ITileDCSTool::getChannelHV(unsigned int ros, unsigned int drawer, unsigned int channel) const + */ + virtual float getChannelHV(unsigned int ros, unsigned int drawer, unsigned int channel) const override; + + /** + * @copydoc ITileDCSTool::getChannelHVSet(unsigned int ros, unsigned int drawer, unsigned int channel) const + */ + virtual float getChannelHVSet(unsigned int ros, unsigned int drawer, unsigned int channel) const override; + + /** + * @copydoc ITileDCSTool::getDrawerStates(unsigned int ros, unsigned int drawer) const + */ + virtual int getDrawerStates(unsigned int ros, unsigned int drawer) const override; + + /** + * @copydoc ITileDCSTool::getDCSHVStatus(unsigned int ros, unsigned int drawer, unsigned int channel) const + */ + virtual TileDCSState::TileDCSStatus getDCSHVStatus(unsigned int ros, unsigned int drawer, unsigned int channel) const override; + + /** + * @copydoc ITileDCSTool::getDCSStatus(unsigned int ros, unsigned int drawer) const + */ + virtual TileDCSState::TileDCSStatus getDCSStatus(unsigned int ros, unsigned int drawer) const; + + /** + * @copydoc ITileDCSTool::getDCSStatus(unsigned int ros, unsigned int drawer, unsigned int channel) const + */ + virtual TileDCSState::TileDCSStatus getDCSStatus(unsigned int ros, unsigned int drawer, unsigned int channel) const override; + + /** + * @copydoc ITileDCSTool::isStatusHVBad(unsigned int ros, unsigned int drawer, unsigned int channel) const + */ + virtual bool isStatusHVBad(unsigned int ros, unsigned int drawer, unsigned int channel) const override; + + /** + * @copydoc ITileDCSTool::isStatusBad (unsigned int ros, unsigned int drawer) const + */ + virtual bool isStatusBad (unsigned int ros, unsigned int drawer) const override; + + /** + * @copydoc ITileDCSTool::isStatusBad(unsigned int ros, unsigned int drawer, unsigned int channel) const + */ + virtual bool isStatusBad(unsigned int ros, unsigned int drawer, unsigned int channel) const override; + + private: + + /** + * @brief Name of TileDCSState object in condition store + */ + SG::ReadCondHandleKey<TileDCSState> m_dcsStateKey{this, + "TileDCS", "TileDCS", "Input Tile DCS status"}; + +}; + + + +#endif // TILECONDITIONS_TILEDCSTOOL_H diff --git a/TileCalorimeter/TileConditions/src/TileEMScale.cxx b/TileCalorimeter/TileConditions/src/TileEMScale.cxx new file mode 100644 index 0000000000000000000000000000000000000000..de0144d1357f3032bc982727d4d741c5407b3e00 --- /dev/null +++ b/TileCalorimeter/TileConditions/src/TileEMScale.cxx @@ -0,0 +1,485 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +// Tile includes +#include "TileConditions/TileEMScale.h" +#include "TileConditions/Exception.h" +#include "TileCalibBlobObjs/TileCalibUtils.h" + + +// +//____________________________________________________________________ +TileEMScale::TileEMScale() : + m_onlCacheUnit( TileRawChannelUnit::Invalid), + m_onlCache(std::vector<float>(0)), + m_isOflLasLinUsed(true), + m_isOflLasNlnUsed(true), + m_useOflLasFib(false), + m_maxChannels(0), + m_maxGains(0), + m_drawerCacheSize(0) +{ + +} + +// +//____________________________________________________________________ +TileEMScale::~TileEMScale() { +} + +// +//____________________________________________________________________ +bool TileEMScale::initialize() { + + m_useOflLasFib = (m_calibOflLasFib != nullptr); + m_isOflLasLinUsed = checkIfOflLaserLinearCalibrationUsed(); + m_isOflLasNlnUsed = checkIfOflLaserNonLinearCalibrationUsed(); + + m_drawerCacheSize = m_maxChannels * m_maxGains; + m_onlCache.resize(m_drawerCacheSize * TileCalibUtils::MAX_DRAWERIDX); + + if (m_onlCacheUnit >= TileRawChannelUnit::OnlineADCcounts + && m_onlCacheUnit <= TileRawChannelUnit::OnlineMegaElectronVolts) { + + resetOnlineCache(); + } + + return true; +} + + +// +//____________________________________________________________________ +void TileEMScale::resetOnlineCache() { + + //=== recalculate online cache + for (unsigned int drawerIdx = 0; drawerIdx < TileCalibUtils::MAX_DRAWERIDX; ++ drawerIdx) { + for (unsigned int channel = 0; channel < m_maxChannels; ++channel) { + for (unsigned int adc = 0; adc < m_maxGains; ++adc) { + m_onlCache[getCacheIndex(drawerIdx, channel, adc)] = getOnlineCalibration(drawerIdx, channel, adc, m_onlCacheUnit); + } + } + } + +} + +// +//____________________________________________________________________ +float TileEMScale::getOnlineCalibration(unsigned int drawerIdx, unsigned int channel, + unsigned int adc, TileRawChannelUnit::UNIT onlUnit) const { + + float onlCalib(1.); + //=== CIS calibration + if (onlUnit > TileRawChannelUnit::OnlineADCcounts) { + onlCalib = m_calibOnlCis->getCalibDrawer(drawerIdx)->getCalib(channel, adc, onlCalib); + + //=== LAS+CES calibration + if (onlUnit > TileRawChannelUnit::OnlinePicoCoulombs) { + onlCalib = m_calibOnlLas->getCalibDrawer(drawerIdx)->getCalib(channel, adc, onlCalib); + onlCalib = m_calibOnlCes->getCalibDrawer(drawerIdx)->getCalib(channel, adc, onlCalib); + } + //=== EMSCALE calibration + if (onlUnit > TileRawChannelUnit::OnlineCesiumPicoCoulombs) { + onlCalib = m_calibOnlEms->getCalibDrawer(drawerIdx)->getCalib(channel, adc, onlCalib); + } + } + //=== Convert float to 16 bit fixed point DSP precision + onlCalib = TileCalibUtils::fixedPointPrecision(onlCalib); + + return onlCalib; +} + +// +//____________________________________________________________________ +float TileEMScale::undoOnlineChannelCalibration(unsigned int drawerIdx, unsigned int channel, unsigned int adc, + float amplitude, TileRawChannelUnit::UNIT onlUnit) const { + + //=== Check if online folders are available + if (m_onlCacheUnit == TileRawChannelUnit::Invalid) { + throw TileCalib::InvalidRawChanUnit("TileCalibEms::channelCalib(onl)", onlUnit); + } + + //=== Check for valid unit request + if (onlUnit < TileRawChannelUnit::OnlineADCcounts + || onlUnit > TileRawChannelUnit::OnlineMegaElectronVolts) { + throw TileCalib::InvalidRawChanUnit("TileCalibEms::channelCalib(onl)", onlUnit); + } + + float onlCalib(0.); + //=== Look up total calib constant in cache if possible ... + if (onlUnit == m_onlCacheUnit) { + unsigned int idx = getCacheIndex(drawerIdx, channel, adc); + if (idx >= m_onlCache.size()) { + throw TileCalib::IndexOutOfRange("TileCalibEms::undoOnlineCalib", idx, m_onlCache.size()); + } + + onlCalib = m_onlCache[idx]; + } else { //=== ... otherwise compute on the fly + + onlCalib = getOnlineCalibration(drawerIdx, channel, adc, onlUnit); + + } + + //=== Sanity check + if (onlCalib == 0.) { + throw TileCalib::InvalidValue("TileCalibEms::undoOnlCalib", onlCalib); + } + + return amplitude / onlCalib; +} + +// +//____________________________________________________________________ +float TileEMScale::calibrateChannel(unsigned int drawerIdx, unsigned int channel, unsigned int adc, + float amplitude, TileRawChannelUnit::UNIT rawDataUnitIn, + TileRawChannelUnit::UNIT rawDataUnitOut) const { + + //=== Undo online calibration, result is offline ADC counts + if (rawDataUnitIn >= TileRawChannelUnit::OnlineADCcounts) { + if (rawDataUnitIn > TileRawChannelUnit::OnlineMegaElectronVolts) { + throw TileCalib::InvalidRawChanUnit("TileCalibEms::channelCalib(onl)", rawDataUnitIn); + } else if (rawDataUnitIn > TileRawChannelUnit::OnlineADCcounts) { + amplitude = undoOnlineChannelCalibration(drawerIdx, channel, adc, amplitude, rawDataUnitIn); + } + rawDataUnitIn = TileRawChannelUnit::ADCcounts; + } + + //=== Allow only "forward" calibration from here on + if (rawDataUnitOut < rawDataUnitIn || rawDataUnitOut > TileRawChannelUnit::MegaElectronVolts) { + throw TileCalib::InvalidRawChanUnit("TileCalibEms::channelCalib(out)", rawDataUnitOut); + } + + //=== decide which calibrations to apply + switch (rawDataUnitIn) { + + case TileRawChannelUnit::ADCcounts: + case TileRawChannelUnit::OnlineADCcounts: + if (rawDataUnitOut > TileRawChannelUnit::ADCcounts) { + amplitude = applyChargeCalibration(drawerIdx, channel, adc, amplitude); + if (rawDataUnitOut > TileRawChannelUnit::PicoCoulombs) { + amplitude = applyLaserCalibration(drawerIdx, channel, amplitude); + amplitude = applyCesiumCalibration(drawerIdx, channel, amplitude); + if (rawDataUnitOut > TileRawChannelUnit::CesiumPicoCoulombs) { + amplitude = applyEMScaleCalibration(drawerIdx, channel, amplitude); + } + } + } + break; + + case TileRawChannelUnit::PicoCoulombs: + if (rawDataUnitOut > TileRawChannelUnit::PicoCoulombs) { + amplitude = applyLaserCalibration(drawerIdx, channel, amplitude); + amplitude = applyCesiumCalibration(drawerIdx, channel, amplitude); + if (rawDataUnitOut > TileRawChannelUnit::CesiumPicoCoulombs) { + amplitude = applyEMScaleCalibration(drawerIdx, channel, amplitude); + } + } + break; + + case TileRawChannelUnit::CesiumPicoCoulombs: + if (rawDataUnitOut > TileRawChannelUnit::CesiumPicoCoulombs) { + amplitude = applyEMScaleCalibration(drawerIdx, channel, amplitude); + } + break; + + case TileRawChannelUnit::MegaElectronVolts: + break; + + default: + throw TileCalib::InvalidRawChanUnit("TileCalibEms::channelCalib", rawDataUnitIn); + + } + + return amplitude; +} + +// +//____________________________________________________________________ +float TileEMScale::applyEMScaleCalibration(unsigned int drawerIdx, unsigned int channel, float amplitude) const { + + return m_calibOflEms->getCalibDrawer(drawerIdx)->getCalib(channel, 0, amplitude); +} + +// +//____________________________________________________________________ +float TileEMScale::applyCesiumCalibration(unsigned int drawerIdx, unsigned int channel, float amplitude, bool applyLasCorr) const { + + amplitude = m_calibOflCes->getCalibDrawer(drawerIdx)->getCalib(channel, 0, amplitude); + + if (applyLasCorr) { + //=== At some point a correction relative to the mono-energy laser reference + //=== taken with each Cesium calibration run needs to be implemented here. + } + + return amplitude; +} + +// +//____________________________________________________________________ +float TileEMScale::applyLaserCalibration(unsigned int drawerIdx, unsigned int channel, float amplitude) const { + + //=== Linear correction + if (m_isOflLasLinUsed) { + amplitude = m_calibOflLasLin->getCalibDrawer(drawerIdx)->getCalib(channel, 0, amplitude); + } + + //=== Non-linear correction + if (m_isOflLasNlnUsed) { + amplitude = m_calibOflLasNln->getCalibDrawer(drawerIdx)->getCalib(channel, 0, amplitude); + } + + return amplitude; +} + +// +//____________________________________________________________________ +float TileEMScale::applyLaserLinearCalibration(unsigned int drawerIdx, unsigned int channel, float amplitude) const { + + //=== Linear correction + if (m_isOflLasLinUsed) { + amplitude = m_calibOflLasLin->getCalibDrawer(drawerIdx)->getCalib(channel, 0, amplitude); + } + + return amplitude; +} + +// +//____________________________________________________________________ +float TileEMScale::applyLaserNonLinearCalibration(unsigned int drawerIdx, unsigned int channel, float amplitude) const { + + //=== Non-linear correction + if (m_isOflLasNlnUsed) { + amplitude = m_calibOflLasNln->getCalibDrawer(drawerIdx)->getCalib(channel, 0, amplitude); + } + + return amplitude; +} + + +// +//____________________________________________________________________ +float TileEMScale::applyChargeCalibration(unsigned int drawerIdx, unsigned int channel, unsigned int adc, float amplitude) const { + + //=== Linear correction + amplitude = m_calibOflCisLin->getCalibDrawer(drawerIdx)->getCalib(channel, adc, amplitude); + + //=== Non-linear correction + return m_calibOflCisNln->getCalibDrawer(drawerIdx)->getCalib(channel, adc, amplitude); +} + +// +//____________________________________________________________________ +float TileEMScale::applyChargLinearCalibration(unsigned int drawerIdx, unsigned int channel, unsigned int adc, float amplitude) const { + + //=== Linear correction + return m_calibOflCisLin->getCalibDrawer(drawerIdx)->getCalib(channel, adc, amplitude); + +} + +// +//____________________________________________________________________ +float TileEMScale::applyChargeNonLinearCalibration(unsigned int drawerIdx, unsigned int channel, unsigned int adc, float amplitude) const { + + //=== Non-linear correction + return m_calibOflCisNln->getCalibDrawer(drawerIdx)->getCalib(channel, adc, amplitude); +} + +// +//____________________________________________________________________ +float TileEMScale::calibrateOnlineChannel(unsigned int drawerIdx, unsigned int channel, unsigned int adc, + float amplitude, TileRawChannelUnit::UNIT onlUnit) const { + + //=== CIS calibration + if (onlUnit > TileRawChannelUnit::OnlineADCcounts) { + amplitude = m_calibOnlCis->getCalibDrawer(drawerIdx)->getCalib(channel, adc, amplitude); + + //=== LAS+CES calibration + if (onlUnit > TileRawChannelUnit::OnlinePicoCoulombs) { + amplitude = m_calibOnlLas->getCalibDrawer(drawerIdx)->getCalib(channel, adc, amplitude); + amplitude = m_calibOnlCes->getCalibDrawer(drawerIdx)->getCalib(channel, adc, amplitude); + } + + //=== EMSCALE calibration + if (onlUnit > TileRawChannelUnit::OnlineCesiumPicoCoulombs) { + amplitude = m_calibOnlEms->getCalibDrawer(drawerIdx)->getCalib(channel, adc, amplitude); + } + } + + //=== convert float to 16 bit fixed point DSP precision + amplitude = TileCalibUtils::fixedPointPrecision(amplitude); + + return amplitude; + +} + +// +//____________________________________________________________________ +float TileEMScale::applyOnlineEMScaleCalibration(unsigned int drawerIdx, unsigned int channel, float amplitude) const { + + return m_calibOnlEms->getCalibDrawer(drawerIdx)->getCalib(channel, 0, amplitude); +} + +// +//____________________________________________________________________ +float TileEMScale::applyOnlineCesiumCalibration(unsigned int drawerIdx, unsigned int channel, + float amplitude, bool applyLasCorr) const { + + amplitude = m_calibOnlCes->getCalibDrawer(drawerIdx)->getCalib(channel, 0, amplitude); + if (applyLasCorr) { + //=== At some point a correction relative to the mono-energy laser reference + //=== taken with each Cesium calibration run needs to be implemented here. + } + + return amplitude; +} + +// +//____________________________________________________________________ +float TileEMScale::applyOnlineLaserCalibration(unsigned int drawerIdx, unsigned int channel, float amplitude) const { + + //=== Linear correction only + return m_calibOnlLas->getCalibDrawer(drawerIdx)->getCalib(channel, 0, amplitude); +} + +// +//____________________________________________________________________ +float TileEMScale::applyOnlineChargeCalibration(unsigned int drawerIdx, unsigned int channel, unsigned int adc, float amplitude) const { + + + //=== Linear correction only + return m_calibOnlCis->getCalibDrawer(drawerIdx)->getCalib(channel, adc, amplitude); +} + +// +//____________________________________________________________________ +float TileEMScale::getCesiumReferenceLaserGain(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const { + + return m_calibOflCes->getCalibDrawer(drawerIdx)->getData(channel, adc, 1); +} + +// +//____________________________________________________________________ +float TileEMScale::getCesiumReferenceHV(unsigned int drawerIdx, unsigned int channel) const { + + return m_calibOflCes->getCalibDrawer(drawerIdx)->getData(channel, 0, 2); +} + +// +//____________________________________________________________________ +float TileEMScale::getCesiumReferenceTemperature(unsigned int drawerIdx, unsigned int channel) const { + + return m_calibOflCes->getCalibDrawer(drawerIdx)->getData(channel, 0, 3); +} + +// +//____________________________________________________________________ +float TileEMScale::getLaserFiberVariation(unsigned int drawerIdx, unsigned int channel) const { + + return m_calibOflLasFib->getCalibDrawer(drawerIdx)->getData(channel, 0, 0); +} + +// +//____________________________________________________________________ +float TileEMScale::getLaserPartitionVariation(unsigned int drawerIdx) const { + + unsigned int firstDrawerIdx = TileCalibUtils::getFirstDrawerInPartitionIdx(drawerIdx); + return m_calibOflLasFib->getCalibDrawer(firstDrawerIdx)->getData( TileCalibUtils::LAS_PART_CHAN, 0, 0); +} + +// +//____________________________________________________________________ +float TileEMScale::getLaserReferenceHV(unsigned int drawerIdx, unsigned int channel) const { + + float val = -4.; + + const TileCalibDrawerFlt* calibDrawer = m_calibOflLasLin->getCalibDrawer(drawerIdx); + int size = calibDrawer->getObjSizeUint32(); + if (size > 1) { + val = m_calibOflLasLin->getCalibDrawer(drawerIdx)->getData(channel, 0, 1); + } + + return val; +} +// + +void TileEMScale::setCalibOflCisLin(std::unique_ptr<TileCalibDataFlt> calibData) { + m_calibOflCisLin = std::move(calibData); +} + +void TileEMScale::setCalibOflCisNln(std::unique_ptr<TileCalibDataFlt> calibData) { + m_calibOflCisNln = std::move(calibData); +} + +void TileEMScale::setCalibOflLasLin(std::unique_ptr<TileCalibDataFlt> calibData) { + m_calibOflLasLin = std::move(calibData); +} + +void TileEMScale::setCalibOflLasNln(std::unique_ptr<TileCalibDataFlt> calibData) { + m_calibOflLasNln = std::move(calibData); +} + +void TileEMScale::setCalibOflLasFib(std::unique_ptr<TileCalibDataFlt> calibData) { + m_calibOflLasFib = std::move(calibData); +} + +void TileEMScale::setCalibOflCes(std::unique_ptr<TileCalibDataFlt> calibData) { + m_calibOflCes = std::move(calibData); +} + +void TileEMScale::setCalibOflEms(std::unique_ptr<TileCalibDataFlt> calibData) { + m_calibOflEms = std::move(calibData); +} + + +void TileEMScale::setCalibOnlCis(std::unique_ptr<TileCalibDataFlt> calibData) { + m_calibOnlCis = std::move(calibData); +} + +void TileEMScale::setCalibOnlLas(std::unique_ptr<TileCalibDataFlt> calibData) { + m_calibOnlLas = std::move(calibData); +} + +void TileEMScale::setCalibOnlCes(std::unique_ptr<TileCalibDataFlt> calibData) { + m_calibOnlCes = std::move(calibData); +} + +void TileEMScale::setCalibOnlEms(std::unique_ptr<TileCalibDataFlt> calibData) { + m_calibOnlEms = std::move(calibData); +} + + +bool TileEMScale::checkIfOflLaserLinearCalibrationUsed() const { + + const float defval = 1.0; + const float epsilon = defval * m_epsilon; + float val(defval); + for (unsigned int drawerIdx = 0; drawerIdx < TileCalibUtils::MAX_DRAWERIDX; ++drawerIdx) { + for (unsigned int chn = 0; chn < TileCalibUtils::MAX_CHAN; ++chn) { + val = m_calibOflLasLin->getCalibDrawer(drawerIdx)->getCalib(chn, 0, defval); + if (fabs(val - defval) > epsilon) { + return true; + } + } + } + + return false; +} + +bool TileEMScale::checkIfOflLaserNonLinearCalibrationUsed() const { + + const float defval = 100.0; + const float epsilon = defval * m_epsilon; + float val(defval); + + for (unsigned int drawerIdx = 0; drawerIdx < TileCalibUtils::MAX_DRAWERIDX; ++drawerIdx) { + for (unsigned int chn = 0; chn < TileCalibUtils::MAX_CHAN; ++chn) { + val = m_calibOflLasNln->getCalibDrawer(drawerIdx)->getCalib(chn, 0, defval); + if (fabs(val - defval) > epsilon) { + return true; + } + } + } + + return false; +} diff --git a/TileCalorimeter/TileConditions/src/TileEMScaleCondAlg.cxx b/TileCalorimeter/TileConditions/src/TileEMScaleCondAlg.cxx new file mode 100644 index 0000000000000000000000000000000000000000..2c840da33d6ea72aa8c1434b95f1b73838281651 --- /dev/null +++ b/TileCalorimeter/TileConditions/src/TileEMScaleCondAlg.cxx @@ -0,0 +1,282 @@ +//Dear emacs, this is -*- c++ -*- +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "TileEMScaleCondAlg.h" +#include "TileCalibBlobObjs/TileCalibUtils.h" +#include "TileIdentifier/TileRawChannelUnit.h" +#include "TileConditions/TileCablingService.h" +#include "TileConditions/TileCablingSvc.h" + + +#include "StoreGate/ReadCondHandle.h" +#include "StoreGate/WriteCondHandle.h" + +TileEMScaleCondAlg::TileEMScaleCondAlg(const std::string& name, ISvcLocator* pSvcLocator) : + AthAlgorithm(name, pSvcLocator), + m_condSvc("CondSvc", name), + m_useOflLasFib(false), + m_maxChannels(0), + m_maxGains(0), + m_onlCacheUnit(TileRawChannelUnit::Invalid) +{ +} + + +TileEMScaleCondAlg::~TileEMScaleCondAlg() { +} + + +StatusCode TileEMScaleCondAlg::initialize() { + + ATH_MSG_DEBUG( "In initialize()" ); + + //=== Configure online cache unit + if (m_onlCacheUnitString == "Invalid") { + m_onlCacheUnit = TileRawChannelUnit::Invalid; + } else if (m_onlCacheUnitString == "OnlineADCcounts") { + m_onlCacheUnit = TileRawChannelUnit::OnlineADCcounts; + } else if (m_onlCacheUnitString == "OnlinePicoCoulombs") { + m_onlCacheUnit = TileRawChannelUnit::OnlinePicoCoulombs; + } else if (m_onlCacheUnitString == "OnlineCesiumPicoCoulombs") { + m_onlCacheUnit = TileRawChannelUnit::OnlineCesiumPicoCoulombs; + } else if (m_onlCacheUnitString == "OnlineMegaElectronVolts") { + m_onlCacheUnit = TileRawChannelUnit::OnlineMegaElectronVolts; + } else { + ATH_MSG_WARNING( "Unrecoginzed jobOption OnlCacheUnit=" << m_onlCacheUnitString << ". " + << "Setting it to \"Invalid\"!" ); + m_onlCacheUnit = TileRawChannelUnit::Invalid; + } + + + // CondSvc + ATH_CHECK( m_condSvc.retrieve() ); + + ATH_CHECK( m_oflCisLinProxy.retrieve() ); + ATH_CHECK( m_oflCisNlnProxy.retrieve() ); + + ATH_CHECK( m_oflLasLinProxy.retrieve() ); + ATH_CHECK( m_oflLasNlnProxy.retrieve() ); + + m_useOflLasFib = !(m_oflLasFibProxy.empty()); + + if (m_useOflLasFib) { + //=== retrieve offline proxy + CHECK( m_oflLasFibProxy.retrieve() ); + ATH_MSG_INFO("ProxyOflLasFib is set up and can be used"); + } else { + ATH_MSG_INFO("ProxyOflLasFib is not set up and cannot be used"); + m_oflLasFibProxy.disable(); + } + + ATH_CHECK( m_oflCesProxy.retrieve() ); + ATH_CHECK( m_oflEmsProxy.retrieve() ); + + if (m_onlCacheUnit != TileRawChannelUnit::Invalid) { + + if (m_onlCisProxy.empty() || m_onlLasProxy.empty() + || m_onlCesProxy.empty() || m_onlEmsProxy.empty()) { + + ATH_MSG_ERROR( "Requested valid OnlCacheUnit (" << m_onlCacheUnitString << ") " + << "but at least one Onl{Cis|Las|Ces|Ems}Proxy is not set up!" ); + return StatusCode::FAILURE; + } + + ATH_CHECK( m_onlCisProxy.retrieve() ); + ATH_CHECK( m_onlLasProxy.retrieve() ); + ATH_CHECK( m_onlCesProxy.retrieve() ); + ATH_CHECK( m_onlEmsProxy.retrieve() ); + + + //=== Resize onlCache to desired size + ServiceHandle<TileCablingSvc> cablingSvc("TileCablingSvc", name()); + ATH_CHECK( cablingSvc.retrieve()); + + const TileCablingService* cabling = cablingSvc->cablingService(); + if (!cabling) { + ATH_MSG_ERROR( "Unable to retrieve TileCablingService" ); + return StatusCode::FAILURE; + } + + + m_maxChannels = cabling->getMaxChannels(); + m_maxGains = cabling->getMaxGains(); + + } else { + + ATH_MSG_INFO( "Loading of online calibration constants is not requested, " + << "since OnlCacheUnit=" << m_onlCacheUnitString ); + + m_onlCisProxy.disable(); + m_onlLasProxy.disable(); + m_onlCesProxy.disable(); + m_onlEmsProxy.disable(); + } + + + ATH_CHECK( m_calibEmsKey.initialize() ); + + // Register write handle + if (m_condSvc->regHandle(this, m_calibEmsKey).isFailure()) { + ATH_MSG_ERROR("unable to register WriteCondHandle " << m_calibEmsKey.fullKey() << " with CondSvc"); + return StatusCode::FAILURE; + } + + + + return StatusCode::SUCCESS; +} + + +StatusCode TileEMScaleCondAlg::execute() { + + SG::WriteCondHandle<TileEMScale> calibEms{m_calibEmsKey}; + + if (calibEms.isValid()) { + ATH_MSG_DEBUG("Found valid TileCalibEms: " << calibEms.key()); + return StatusCode::SUCCESS; + } + + + std::unique_ptr<TileEMScale> emsData = std::make_unique<TileEMScale>(); + + emsData->setMaxChannels(m_maxChannels); + emsData->setMaxGains(m_maxGains); + emsData->setOnlineCacheUnit(m_onlCacheUnit); + + + // Get offline CIS linear calibration constants + EventIDRange oflCisLinRange; + std::unique_ptr<TileCalibDataFlt> calibOflCisLin = std::make_unique<TileCalibDataFlt>(); + + ATH_CHECK( m_oflCisLinProxy->fillCalibData(*calibOflCisLin, oflCisLinRange) ); + emsData->setCalibOflCisLin(std::move(calibOflCisLin)); + + // Get offline CIS non-linear calibration constants + EventIDRange oflCisNlnRange; + std::unique_ptr<TileCalibDataFlt> calibOflCisNln = std::make_unique<TileCalibDataFlt>(); + + ATH_CHECK( m_oflCisNlnProxy->fillCalibData(*calibOflCisNln, oflCisNlnRange) ); + emsData->setCalibOflCisNln(std::move(calibOflCisNln)); + + + // Get offline Laser linear calibration constants + EventIDRange oflLasLinRange; + std::unique_ptr<TileCalibDataFlt> calibOflLasLin = std::make_unique<TileCalibDataFlt>(); + + ATH_CHECK( m_oflLasLinProxy->fillCalibData(*calibOflLasLin, oflLasLinRange) ); + emsData->setCalibOflLasLin(std::move(calibOflLasLin)); + + + // Get offline Laser non-linear calibration constants + EventIDRange oflLasNlnRange; + std::unique_ptr<TileCalibDataFlt> calibOflLasNln = std::make_unique<TileCalibDataFlt>(); + + ATH_CHECK( m_oflLasNlnProxy->fillCalibData(*calibOflLasNln, oflLasNlnRange) ); + emsData->setCalibOflLasNln(std::move(calibOflLasNln)); + + + // Get offline Ces calibration constants + EventIDRange oflCesRange; + std::unique_ptr<TileCalibDataFlt> calibOflCes = std::make_unique<TileCalibDataFlt>(); + + ATH_CHECK( m_oflCesProxy->fillCalibData(*calibOflCes, oflCesRange) ); + emsData->setCalibOflCes(std::move(calibOflCes)); + + + // Get offline Ems calibration constants + EventIDRange oflEmsRange; + std::unique_ptr<TileCalibDataFlt> calibOflEms = std::make_unique<TileCalibDataFlt>(); + + ATH_CHECK( m_oflEmsProxy->fillCalibData(*calibOflEms, oflEmsRange) ); + emsData->setCalibOflEms(std::move(calibOflEms)); + + + EventIDRange eventRange = EventIDRange::intersect(oflCisLinRange, oflCisNlnRange, + oflLasLinRange, oflLasNlnRange, + oflCesRange, oflEmsRange); + + + if (m_useOflLasFib) { + // Get offline Laser fiber calibration constants + EventIDRange oflLasFibRange; + std::unique_ptr<TileCalibDataFlt> calibOflLasFib = std::make_unique<TileCalibDataFlt>(); + + ATH_CHECK( m_oflLasFibProxy->fillCalibData(*calibOflLasFib, oflLasFibRange) ); + emsData->setCalibOflLasFib(std::move(calibOflLasFib)); + + eventRange = EventIDRange::intersect(eventRange, oflLasFibRange); + } + + + if (m_onlCacheUnit != TileRawChannelUnit::Invalid) { + // Get online CIS calibration constants + EventIDRange onlCisRange; + std::unique_ptr<TileCalibDataFlt> calibOnlCis = std::make_unique<TileCalibDataFlt>(); + + ATH_CHECK( m_onlCisProxy->fillCalibData(*calibOnlCis, onlCisRange) ); + emsData->setCalibOnlCis(std::move(calibOnlCis)); + + // Get online Laser calibration constants + EventIDRange onlLasRange; + std::unique_ptr<TileCalibDataFlt> calibOnlLas = std::make_unique<TileCalibDataFlt>(); + + ATH_CHECK( m_onlLasProxy->fillCalibData(*calibOnlLas, onlLasRange) ); + emsData->setCalibOnlLas(std::move(calibOnlLas)); + + + // Get online Ces calibration constants + EventIDRange onlCesRange; + std::unique_ptr<TileCalibDataFlt> calibOnlCes = std::make_unique<TileCalibDataFlt>(); + + ATH_CHECK( m_onlCesProxy->fillCalibData(*calibOnlCes, onlCesRange) ); + emsData->setCalibOnlCes(std::move(calibOnlCes)); + + + // Get online Ems calibration constants + EventIDRange onlEmsRange; + std::unique_ptr<TileCalibDataFlt> calibOnlEms = std::make_unique<TileCalibDataFlt>(); + + ATH_CHECK( m_onlEmsProxy->fillCalibData(*calibOnlEms, onlEmsRange) ); + emsData->setCalibOnlEms(std::move(calibOnlEms)); + + eventRange = EventIDRange::intersect(eventRange, onlCisRange, onlLasRange, + onlCesRange, onlEmsRange); + } + + + if(eventRange.start() > eventRange.stop()) { + ATH_MSG_ERROR("Invalid intersection range: " << eventRange); + return StatusCode::FAILURE; + } + + if (emsData->initialize()) { + ATH_MSG_DEBUG("TileCalibEms object is initialized successfully."); + } else { + ATH_MSG_ERROR("Impossible to inizialize TileCalibEms object!"); + return StatusCode::FAILURE; + } + + if(calibEms.record(eventRange, emsData.release()).isFailure()) { + ATH_MSG_ERROR("Could not record TileCalibEms object with " + << calibEms.key() + << " with EventRange " << eventRange + << " into Conditions Store"); + return StatusCode::FAILURE; + } else { + + ATH_MSG_VERBOSE("Recorded TileCalibEms object with " + << calibEms.key() + << " with EventRange " << eventRange + << " into Conditions Store"); + } + + return StatusCode::SUCCESS; + +} + + +StatusCode TileEMScaleCondAlg::finalize() { + return StatusCode::SUCCESS; +} diff --git a/TileCalorimeter/TileConditions/src/TileEMScaleCondAlg.h b/TileCalorimeter/TileConditions/src/TileEMScaleCondAlg.h new file mode 100644 index 0000000000000000000000000000000000000000..fb80016dce23580f5ca0ab59aa0a18fdb47c4687 --- /dev/null +++ b/TileCalorimeter/TileConditions/src/TileEMScaleCondAlg.h @@ -0,0 +1,127 @@ +//Dear emacs, this is -*- c++ -*- + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef TILECONDITIONS_TILECALIBEMSCALECONDALG_H +#define TILECONDITIONS_TILECALIBEMSCALECONDALG_H + +#include "TileConditions/TileEMScale.h" +#include "TileConditions/ITileCondProxy.h" + +#include "AthenaBaseComps/AthAlgorithm.h" +#include "StoreGate/ReadCondHandleKey.h" +#include "StoreGate/WriteCondHandleKey.h" +#include "AthenaPoolUtilities/CondAttrListCollection.h" + +#include "GaudiKernel/ICondSvc.h" +#include "GaudiKernel/Property.h" + +/** + * @brief Condition algorithm to produce TileEMScale and put it into condition store + */ + +class TileEMScaleCondAlg: public AthAlgorithm { + public: + + TileEMScaleCondAlg(const std::string& name, ISvcLocator* pSvcLocator); + ~TileEMScaleCondAlg(); + + virtual StatusCode initialize() override; + virtual StatusCode execute() override; + virtual StatusCode finalize() override; + + private: + + /** + * @brief Online cache units as string, see TileIdentifier/TileRawChannelUnit.h + */ + Gaudi::Property<std::string> m_onlCacheUnitString{this, + "OnlCacheUnit", "Invalid", "Online cache unit string"}; + + /** + * @brief Tool to get offline CIS calibration constants + */ + ToolHandle<ITileCondProxy<TileCalibDrawerFlt> > m_oflCisLinProxy{this, + "OflCisLinProxy", "", "Tile offline liner CIS conditions proxy tool"}; + + /** + * @brief Tool to get offline non-linear CIS calibration constants + */ + ToolHandle<ITileCondProxy<TileCalibDrawerFlt> > m_oflCisNlnProxy{this, + "OflCisNlnProxy", "", "Tile offline non-linerar CIS conditions proxy tool"}; + + /** + * @brief Tool to get offline linear Laser correction factors + */ + ToolHandle<ITileCondProxy<TileCalibDrawerFlt> > m_oflLasLinProxy{this, + "OflLasLinProxy", "", "Tile offline linear Laser conditions proxy tool"}; + + /** + * @brief Tool to get non-linear Laser corection factors + */ + ToolHandle<ITileCondProxy<TileCalibDrawerFlt> > m_oflLasNlnProxy{this, + "OflLasNlnProxy", "", "Tile offline non-linear Laser conditions proxy tool"}; + + /** + * @brief Tool to get offline Laser fiber correction factors + */ + ToolHandle<ITileCondProxy<TileCalibDrawerFlt> > m_oflLasFibProxy{this, + "OflLasFibProxy", "", "Tile offline Laser fiber conditions proxy tool"}; + + /** + * @brief Tool to get offline Cesium calibration constants + */ + ToolHandle<ITileCondProxy<TileCalibDrawerFlt> > m_oflCesProxy{this, + "OflCesProxy", "", "Tile offline CES conditions proxy tool"}; + + /** + * @brief Tool to get offline EMS factors + */ + ToolHandle<ITileCondProxy<TileCalibDrawerFlt> > m_oflEmsProxy{this, + "OflEmsProxy", "", "Tile offline EMS conditions proxy tool"}; + + + + /** + * @brief Tool to get online CIS calibration constants + */ + ToolHandle<ITileCondProxy<TileCalibDrawerFlt> > m_onlCisProxy{this, + "OnlCisProxy", "", "Tile online CIS conditions proxy tool"}; + + /** + * @brief Tool to get Tile online Laser correction factors + */ + ToolHandle<ITileCondProxy<TileCalibDrawerFlt> > m_onlLasProxy{this, + "OnlLasProxy", "", "Tile online Laser conditions proxy tool"}; + + /** + * @brief Tool to get Tile online Cesium calibration constants + */ + ToolHandle<ITileCondProxy<TileCalibDrawerFlt> > m_onlCesProxy{this, + "OnlCesProxy", "", "Tile online CES conditions proxy tool"}; + + /** + * @brief Tool to get Tile online EMS factors + */ + ToolHandle<ITileCondProxy<TileCalibDrawerFlt> > m_onlEmsProxy{this, + "OnlEmsProxy", "", "Tile online EMS conditions proxy tool"}; + + + /** + * @brief Name of output TileEMScale + */ + SG::WriteCondHandleKey<TileEMScale> m_calibEmsKey{this, + "TileEMScale", "TileEMScale", "Output Tile EMS calibration constants"}; + + ServiceHandle<ICondSvc> m_condSvc; + + bool m_useOflLasFib; + unsigned int m_maxChannels; + unsigned int m_maxGains; + TileRawChannelUnit::UNIT m_onlCacheUnit; +}; + + +#endif // TILECONDITIONS_TILECALIBEMSCALECONDALG_H diff --git a/TileCalorimeter/TileConditions/src/TileExpertToolEmscale.cxx b/TileCalorimeter/TileConditions/src/TileExpertToolEmscale.cxx index 9ea9045fd8eb0debfc054137e2db61b643109a59..0438199b3ba0e41589c926f224e66630a7bb82d2 100644 --- a/TileCalorimeter/TileConditions/src/TileExpertToolEmscale.cxx +++ b/TileCalorimeter/TileConditions/src/TileExpertToolEmscale.cxx @@ -4,9 +4,8 @@ // Tile includes #include "TileConditions/TileExpertToolEmscale.h" +#include "TileConditions/Exception.h" #include "TileCalibBlobObjs/TileCalibUtils.h" -#include "TileCalibBlobObjs/Exception.h" -#include "TileConditions/TileCondProxyWrapper.h" // //____________________________________________________________________ @@ -32,6 +31,8 @@ TileExpertToolEmscale::TileExpertToolEmscale(const std::string& type, const std: float TileExpertToolEmscale::channelCalib(unsigned int drawerIdx, unsigned int channel, unsigned int adc, float amplitude , TileRawChannelUnit::UNIT rawDataUnitIn, TileRawChannelUnit::UNIT rawDataUnitOut) const { + SG::ReadCondHandle<TileEMScale> emScale(m_emScaleKey); + //=== Undo online calibration, result is offline ADC counts if (rawDataUnitIn >= TileRawChannelUnit::OnlineADCcounts) { if (rawDataUnitIn > TileRawChannelUnit::OnlineMegaElectronVolts) { @@ -103,39 +104,40 @@ float TileExpertToolEmscale::channelCalib(unsigned int drawerIdx, unsigned int c //____________________________________________________________________ float TileExpertToolEmscale::doCalibEms(unsigned int drawerIdx, unsigned int channel, float amplitude) const { - if (m_emOptions.getEmscaleCalibBit(TileEmscaleCalibOptions::OflEms)) + if (m_emOptions.getEmscaleCalibBit(TileEmscaleCalibOptions::OflEms)) { return TileCondToolEmscale::doCalibEms(drawerIdx, channel, amplitude); - else + } else { return amplitude; + } } // //____________________________________________________________________ float TileExpertToolEmscale::doCalibCes(unsigned int drawerIdx, unsigned int channel, float amplitude, bool applyLasCorr) const { - if (m_emOptions.getEmscaleCalibBit(TileEmscaleCalibOptions::OflCes)) + if (m_emOptions.getEmscaleCalibBit(TileEmscaleCalibOptions::OflCes)) { return TileCondToolEmscale::doCalibCes(drawerIdx, channel, amplitude, applyLasCorr); - else + } else { return amplitude; + } + } // //____________________________________________________________________ float TileExpertToolEmscale::doCalibLas(unsigned int drawerIdx, unsigned int channel, float amplitude) const { - if (drawerIdx >= TileCalibUtils::MAX_DRAWERIDX) { - throw TileCalib::IndexOutOfRange("TileExpertToolEmscale::doCalibLas", drawerIdx,TileCalibUtils::MAX_DRAWERIDX); - } + SG::ReadCondHandle<TileEMScale> emScale(m_emScaleKey); //=== Linear correction if (m_emOptions.getEmscaleCalibBit(TileEmscaleCalibOptions::OflLasLin)) { - amplitude = m_pryOflLasLin->getCalibDrawer(drawerIdx)->getCalib(channel, 0, amplitude); + amplitude = emScale->applyLaserLinearCalibration(drawerIdx, channel, amplitude); } // OflLasLin //=== Non-linear correction if (m_emOptions.getEmscaleCalibBit(TileEmscaleCalibOptions::OflLasNln)) { - amplitude = m_pryOflLasNln->getCalibDrawer(drawerIdx)->getCalib(channel, 0, amplitude); - } // OflLasNln + amplitude = emScale->applyLaserNonLinearCalibration(drawerIdx, channel, amplitude); + } // OflLasNln return amplitude; } @@ -144,19 +146,17 @@ float TileExpertToolEmscale::doCalibLas(unsigned int drawerIdx, unsigned int cha //____________________________________________________________________ float TileExpertToolEmscale::doCalibCis(unsigned int drawerIdx, unsigned int channel, unsigned int adc, float amplitude) const { - if (drawerIdx >= TileCalibUtils::MAX_DRAWERIDX) { - throw TileCalib::IndexOutOfRange("TileExpertToolEmscale::doCalibCis", drawerIdx, TileCalibUtils::MAX_DRAWERIDX); - } + SG::ReadCondHandle<TileEMScale> emScale(m_emScaleKey); //=== Linear correction if (m_emOptions.getEmscaleCalibBit(TileEmscaleCalibOptions::OflCisFitLin)) { - amplitude = m_pryOflCisLin->getCalibDrawer(drawerIdx)->getCalib(channel, adc, amplitude); + amplitude = emScale->applyChargLinearCalibration(drawerIdx, channel, adc, amplitude); } // OflCisFitLin //=== non-linear correction if (m_emOptions.getEmscaleCalibBit(TileEmscaleCalibOptions::OflCisFitNln)) { - amplitude = m_pryOflCisNln->getCalibDrawer(drawerIdx)->getCalib(channel, adc, amplitude); - } // OflCisFitNln + amplitude = emScale->applyChargeNonLinearCalibration(drawerIdx, channel, adc, amplitude); + } // OflCisFitNln return amplitude; } @@ -165,14 +165,11 @@ float TileExpertToolEmscale::doCalibCis(unsigned int drawerIdx, unsigned int cha //____________________________________________________________________ float TileExpertToolEmscale::channelCalibOnl(unsigned int drawerIdx, unsigned int channel, unsigned int adc , float amplitude, TileRawChannelUnit::UNIT onlUnit) const { - if (drawerIdx >= TileCalibUtils::MAX_DRAWERIDX) { - throw TileCalib::IndexOutOfRange("TileExpertToolEmscale::channelCalibOnl", drawerIdx, - TileCalibUtils::MAX_DRAWERIDX); - } ATH_MSG_VERBOSE( "Recalculating total online constant for " << drawerIdx << "/" << channel << "/" << adc << " , " << onlUnit ); + SG::ReadCondHandle<TileEMScale> emScale(m_emScaleKey); //=== CIS calibration if (onlUnit > TileRawChannelUnit::OnlineADCcounts) { @@ -207,40 +204,48 @@ float TileExpertToolEmscale::channelCalibOnl(unsigned int drawerIdx, unsigned in //____________________________________________________________________ float TileExpertToolEmscale::doCalibEmsOnl(unsigned int drawerIdx, unsigned int channel, float amplitude) const { - if (m_emOptions.getEmscaleCalibBit(TileEmscaleCalibOptions::OnlEms)) + if (m_emOptions.getEmscaleCalibBit(TileEmscaleCalibOptions::OnlEms)) { return TileCondToolEmscale::doCalibEmsOnl(drawerIdx, channel, amplitude); - else + } else { return amplitude; + } + } // //____________________________________________________________________ float TileExpertToolEmscale::doCalibCesOnl(unsigned int drawerIdx, unsigned int channel, float amplitude, bool applyLasCorr) const { - if (m_emOptions.getEmscaleCalibBit(TileEmscaleCalibOptions::OnlCes)) + if (m_emOptions.getEmscaleCalibBit(TileEmscaleCalibOptions::OnlCes)) { return TileCondToolEmscale::doCalibCesOnl(drawerIdx, channel, amplitude, applyLasCorr); - else + } else { return amplitude; + } + } // //____________________________________________________________________ float TileExpertToolEmscale::doCalibLasOnl(unsigned int drawerIdx, unsigned int channel, float amplitude) const { - if (m_emOptions.getEmscaleCalibBit(TileEmscaleCalibOptions::OnlLasLin)) + if (m_emOptions.getEmscaleCalibBit(TileEmscaleCalibOptions::OnlLasLin)) { return TileCondToolEmscale::doCalibLasOnl(drawerIdx, channel, amplitude); - else + } else { return amplitude; + } + } // //____________________________________________________________________ float TileExpertToolEmscale::doCalibCisOnl(unsigned int drawerIdx, unsigned int channel, unsigned int adc, float amplitude) const { - if (m_emOptions.getEmscaleCalibBit(TileEmscaleCalibOptions::OnlCisLin)) + if (m_emOptions.getEmscaleCalibBit(TileEmscaleCalibOptions::OnlCisLin)) { return TileCondToolEmscale::doCalibCisOnl(drawerIdx, channel, adc, amplitude); - else + } else { return amplitude; + } + } // @@ -248,8 +253,10 @@ float TileExpertToolEmscale::doCalibCisOnl(unsigned int drawerIdx, unsigned int float TileExpertToolEmscale::undoOnlCalib(unsigned int drawerIdx, unsigned int channel, unsigned int adc , float amplitude, TileRawChannelUnit::UNIT onlUnit) const { + SG::ReadCondHandle<TileEMScale> emScale(m_emScaleKey); + //=== Check if online folders are available - if (m_onlCacheUnit == TileRawChannelUnit::Invalid) { + if (emScale->getOnlineCacheUnit() == TileRawChannelUnit::Invalid) { ATH_MSG_FATAL( "Trying to undo online calibration, but COOL folders were not loaded" ); std::abort(); } @@ -276,10 +283,12 @@ float TileExpertToolEmscale::undoOnlCalib(unsigned int drawerIdx, unsigned int c //____________________________________________________________________ float TileExpertToolEmscale::getLasPartition(unsigned int drawerIdx) const { - if (m_emOptions.getEmscaleCalibBit(TileEmscaleCalibOptions::OflLasPart)) + if (m_emOptions.getEmscaleCalibBit(TileEmscaleCalibOptions::OflLasPart)) { return TileCondToolEmscale::getLasPartition(drawerIdx); - else + } else { return 1.0; + } + } // diff --git a/TileCalorimeter/TileConditions/src/TileInfoLoader.cxx b/TileCalorimeter/TileConditions/src/TileInfoLoader.cxx index 601e24a710593eb6487abbf0c127dae6bcdfa79f..d645b7bc453957b2809a1d4f2d8aeea511cb049c 100644 --- a/TileCalorimeter/TileConditions/src/TileInfoLoader.cxx +++ b/TileCalorimeter/TileConditions/src/TileInfoLoader.cxx @@ -41,7 +41,7 @@ #include "TileConditions/TileCablingService.h" #include "TileConditions/TilePulseShapes.h" #include "TileConditions/TileOptFilterWeights.h" -#include "TileConditions/TileBadChanTool.h" +#include "TileConditions/TileBadChanLegacyTool.h" #include "TMatrixD.h" #include "cstdio" @@ -256,7 +256,7 @@ StatusCode TileInfoLoader::initialize() { bool nothing_found = (geo*run1*ibl*run2*comm*slhc*upg != 0); GeoModel::GeoConfig geoConfig = geoModel->geoConfig(); - bool RUN2 = (nothing_found && (geoConfig==GeoModel::GEO_RUN2 + bool RUN2 = (nothing_found && (geoConfig==GeoModel::GEO_RUN2 || geoConfig==GeoModel::GEO_RUN3 || geoConfig==GeoModel::GEO_RUN4 || geoConfig==GeoModel::GEO_ITk @@ -378,9 +378,9 @@ StatusCode TileInfoLoader::initialize() { m_eorCalled = false; - // This retrieval of TileBadChanTool is needed to avoid crash in trigger-related jobs, + // This retrieval of TileBadChanLegacyTool is needed to avoid crash in trigger-related jobs, // when TileByteStream wants to use bad channel tool at start of run - ToolHandle<ITileBadChanTool> tileBadChanTool("TileBadChanTool"); + ToolHandle<ITileBadChanTool> tileBadChanTool("TileBadChanLegacyTool"); CHECK( tileBadChanTool.retrieve() ); // Listen for end of run @@ -862,4 +862,3 @@ void TileInfoLoader::buildCovMatrix() { } } } - diff --git a/TileCalorimeter/TileConditions/src/components/TileConditions_entries.cxx b/TileCalorimeter/TileConditions/src/components/TileConditions_entries.cxx index fd506b58522128e869c62457db04ef4e9a09102b..d01cd28ba62d6c786bf39787a76c0fcb6eecdabb 100644 --- a/TileCalorimeter/TileConditions/src/components/TileConditions_entries.cxx +++ b/TileCalorimeter/TileConditions/src/components/TileConditions_entries.cxx @@ -1,7 +1,12 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + #include "TileConditions/TileInfoLoader.h" #include "TileConditions/TileCablingSvc.h" #include "TileConditions/TileCondIdTransforms.h" #include "TileConditions/TileBadChanTool.h" +#include "TileConditions/TileBadChanLegacyTool.h" #include "TileConditions/TileCondToolOfc.h" #include "TileConditions/TileCondToolOfcCool.h" #include "TileConditions/TileCellNoiseTool.h" @@ -19,13 +24,18 @@ #include "TileConditions/TileCondToolAutoCr.h" #include "TileConditions/TileCondToolTMDB.h" #include "TileConditions/TileCondToolDspThreshold.h" - +#include "../TileDCSTool.h" +#include "../TileCalibCondAlg.h" +#include "../TileBadChannelsCondAlg.h" +#include "../TileEMScaleCondAlg.h" +#include "../TileDCSCondAlg.h" DECLARE_COMPONENT( TileInfoLoader ) DECLARE_COMPONENT( TileCablingSvc ) DECLARE_COMPONENT( TileDCSSvc ) DECLARE_COMPONENT( TileCondIdTransforms ) DECLARE_COMPONENT( TileBadChanTool ) +DECLARE_COMPONENT( TileBadChanLegacyTool ) DECLARE_COMPONENT( TileCondToolOfc ) DECLARE_COMPONENT( TileCondToolOfcCool ) DECLARE_COMPONENT( TileCellNoiseTool ) @@ -45,4 +55,9 @@ DECLARE_COMPONENT( TileCondProxyCoolBch ) DECLARE_COMPONENT( TileCondProxyCoolOfc ) DECLARE_COMPONENT( TileCondProxyFileFlt ) DECLARE_COMPONENT( TileCondProxyFileBch ) - +DECLARE_COMPONENT( TileCalibFltCondAlg ) +DECLARE_COMPONENT( TileCalibOfcCondAlg ) +DECLARE_COMPONENT( TileBadChannelsCondAlg ) +DECLARE_COMPONENT( TileEMScaleCondAlg ) +DECLARE_COMPONENT( TileDCSCondAlg ) +DECLARE_COMPONENT( TileDCSTool ) diff --git a/TileCalorimeter/TileConditions/test/TileCablingService_common_test.cxx b/TileCalorimeter/TileConditions/test/TileCablingService_common_test.cxx index 31dce7430a1069241b922b2571dee0bec0a26192..ca662d55fe7d177eaee3c08b716917a86f6e6b4f 100644 --- a/TileCalorimeter/TileConditions/test/TileCablingService_common_test.cxx +++ b/TileCalorimeter/TileConditions/test/TileCablingService_common_test.cxx @@ -34,7 +34,7 @@ class TileCablingSvc { public: static void init_idhelpers (IdDictParser& parser, - std::string idDictFile = "IdDictTileCalorimeter.xml", + std::string idDictFile = "IdDictTileCalorimeter.xml", TileCablingService::TileCablingType cablingType = TileCablingService::RUN2aCabling) { @@ -63,6 +63,10 @@ class TileCablingSvc { svc->setCablingType(cablingType); } + static void set_cabling_type(TileCablingService::TileCablingType cablingType) { + TileCablingService* svc = TileCablingService::getInstance(); + svc->setCablingType(cablingType); + } }; diff --git a/TileCalorimeter/TileConditions/test/TileCondToolDspThreshold_test.cxx b/TileCalorimeter/TileConditions/test/TileCondToolDspThreshold_test.cxx deleted file mode 100644 index 6614897453db40ba9633ef4b1e9912792374680f..0000000000000000000000000000000000000000 --- a/TileCalorimeter/TileConditions/test/TileCondToolDspThreshold_test.cxx +++ /dev/null @@ -1,224 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#undef NDEBUG - -//=== AttributeList -//#include "CoralBase/Attribute.h" -#include "TileConditions/TileCondToolDspThreshold.h" -#include "TileCalibBlobObjs/TileCalibDrawerFlt.h" -#include "TileConditions/ITileCondProxy.h" - -#include "CoralBase/Blob.h" -#include "CoralBase/Attribute.h" -#include "CoralBase/AttributeList.h" -#include "CoralBase/AttributeListSpecification.h" - -#include "TestTools/FLOATassert.h" -#include "TestTools/initGaudi.h" -#include "GaudiKernel/ISvcLocator.h" -#include "GaudiKernel/ToolHandle.h" -#include "AthenaBaseComps/AthAlgorithm.h" -#include "AthenaBaseComps/AthAlgTool.h" - -//#include "GaudiKernel/DeclareFactoryEntries.h" - -#include <algorithm> -#include <cassert> -#include <iostream> -#include <fstream> -#include <string> -#include <vector> - - -static const unsigned int OBJVERSION(0); -static const int NCHANNELS(48); - - - -/** Class provides dummy algorithm - * to help construct Tool to be tested. - */ -class DummyAlgorithm: public AthAlgorithm { - public: - DummyAlgorithm(const std::string& name, ISvcLocator* svcloc) - : AthAlgorithm(name, svcloc) { - - } - - virtual StatusCode execute() { - return StatusCode::SUCCESS; - } -}; - - -static const std::vector<std::vector<float> > THRESHOLDS = { - {-1, 2, 3}, // Low gain (min, max, dsp) - {-10, 20, 30} // High gain (min, max, dsp) -}; - - -static const std::vector<std::vector<float> > CHANNEL2_THRESHOLDS = { - {-100, 200, 300}, // Low gain (min, max, dsp) - {-1000, 2000, 3000} // High gain (min, max, dsp) -}; - - -template<typename T = TileCalibDrawerFlt> -class TileCondProxyMock: public AthAlgTool, virtual public ITileCondProxy<T> { - public: - - TileCondProxyMock(const std::string& type, const std::string& name, const IInterface* parent) - :AthAlgTool(type, name, parent) - , m_list(nullptr) - , m_drawer(nullptr) - { - declareInterface<ITileCondProxy<T> >(this); - }; - - virtual ~TileCondProxyMock() {}; - - StatusCode initialize() { - - - coral::AttributeListSpecification* spec = new coral::AttributeListSpecification(); - spec->extend("TileCalibBlob", "blob"); - m_list = new coral::AttributeList(*spec); - coral::Blob& blob = (*m_list)["TileCalibBlob"].data<coral::Blob>(); - m_drawer = TileCalibDrawerFlt::getInstance(blob, THRESHOLDS, NCHANNELS, OBJVERSION); - - unsigned int channel(2); - unsigned int adc(0); - m_drawer->setData(channel, adc, CHANNEL2_THRESHOLDS[adc]); - adc = 1; - m_drawer->setData(channel, adc, CHANNEL2_THRESHOLDS[adc]); - - return StatusCode::SUCCESS; - }; - - StatusCode finalize() { - delete m_drawer; - delete m_list; - - return StatusCode::SUCCESS; - }; - - const T* getCalibDrawer(unsigned int /* drawerIdx */ ) const { return m_drawer;}; - - private: - coral::AttributeList* m_list; - T* m_drawer; -}; - - - -typedef TileCondProxyMock< TileCalibDrawerFlt > TileCondProxyMockFlt; -DECLARE_COMPONENT( TileCondProxyMockFlt ) - - - -void test1() { - - std::cout << "test1\n"; - - - ISvcLocator* svcLoc; - if (!Athena_test::initGaudi(svcLoc)) { - std::cerr << "ERROR This test can not be run, can not get ServiceLocator" << std::endl; - } - - - DummyAlgorithm* alg = new DummyAlgorithm("DummyAlgorithm", svcLoc); - alg->addRef(); - - TileCondToolDspThreshold* tool = new TileCondToolDspThreshold("TileCondToolDspThreshold", "TileCondToolDspThresholdTest", alg); - tool->addRef(); - assert(tool->setProperty("ProxyDspThreshold", "TileCondProxyMock<TileCalibDrawerFlt>/TileCondProxyMockFlt")); - assert(tool->initialize()); - - - unsigned int drawerIdx(0); - unsigned int channel(0); - unsigned int adc(0); - - float minThreshold = tool->getMinimumAmplitudeThreshold(drawerIdx, channel, adc); - assert(Athena_test::isEqual(minThreshold, THRESHOLDS[adc][0])); - - float maxThreshold = tool->getMaximumAmplitudeThreshold(drawerIdx, channel, adc); - assert(Athena_test::isEqual(maxThreshold, THRESHOLDS[adc][1])); - - - - minThreshold = 0.0; - maxThreshold = 0.0; - - - tool->getAmplitudeThresholds(drawerIdx, channel, adc, minThreshold, maxThreshold); - assert(Athena_test::isEqual(minThreshold, THRESHOLDS[adc][0])); - assert(Athena_test::isEqual(maxThreshold, THRESHOLDS[adc][1])); - - - float dspThreshold = tool->getDspThreshold(drawerIdx, channel, adc); - assert(Athena_test::isEqual(dspThreshold, THRESHOLDS[adc][2])); - - - adc = 1; - minThreshold = 0.0; - maxThreshold = 0.0; - - minThreshold = tool->getMinimumAmplitudeThreshold(drawerIdx, channel, adc); - assert(Athena_test::isEqual(minThreshold, THRESHOLDS[adc][0])); - - maxThreshold = tool->getMaximumAmplitudeThreshold(drawerIdx, channel, adc); - assert(Athena_test::isEqual(maxThreshold, THRESHOLDS[adc][1])); - - minThreshold = 0.0; - maxThreshold = 0.0; - - - tool->getAmplitudeThresholds(drawerIdx, channel, adc, minThreshold, maxThreshold); - assert(Athena_test::isEqual(minThreshold, THRESHOLDS[adc][0])); - assert(Athena_test::isEqual(maxThreshold, THRESHOLDS[adc][1])); - - dspThreshold = tool->getDspThreshold(drawerIdx, channel, adc); - assert(Athena_test::isEqual(dspThreshold, THRESHOLDS[adc][2])); - - - channel = 2; - adc = 0; - minThreshold = 0.0; - maxThreshold = 0.0; - dspThreshold = 0.0; - - tool->getAmplitudeThresholds(drawerIdx, channel, adc, minThreshold, maxThreshold); - assert(Athena_test::isEqual(minThreshold, CHANNEL2_THRESHOLDS[adc][0])); - assert(Athena_test::isEqual(maxThreshold, CHANNEL2_THRESHOLDS[adc][1])); - - adc = 1; - minThreshold = 0.0; - maxThreshold = 0.0; - - - tool->getAmplitudeThresholds(drawerIdx, channel, adc, minThreshold, maxThreshold); - assert(Athena_test::isEqual(minThreshold, CHANNEL2_THRESHOLDS[adc][0])); - assert(Athena_test::isEqual(maxThreshold, CHANNEL2_THRESHOLDS[adc][1])); - - dspThreshold = tool->getDspThreshold(drawerIdx, channel, adc); - assert(Athena_test::isEqual(dspThreshold, CHANNEL2_THRESHOLDS[adc][2])); - - - - delete tool; - delete alg; - -} - - -int main() { - - - test1(); - - return 0; -} diff --git a/TileCalorimeter/TileConditions/test/TileCondToolOfcCool_test.cxx b/TileCalorimeter/TileConditions/test/TileCondToolOfcCool_test.cxx deleted file mode 100644 index 7581ff274006015c3c757de6056c8f57fe5e8f62..0000000000000000000000000000000000000000 --- a/TileCalorimeter/TileConditions/test/TileCondToolOfcCool_test.cxx +++ /dev/null @@ -1,216 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#undef NDEBUG - -//=== AttributeList -//#include "CoralBase/Attribute.h" -#include "TileConditions/TileCondToolOfcCool.h" -#include "TileCalibBlobObjs/TileCalibDrawerOfc.h" -#include "TileConditions/ITileCondProxy.h" - -#include "CoralBase/Blob.h" -#include "CoralBase/Attribute.h" -#include "CoralBase/AttributeList.h" -#include "CoralBase/AttributeListSpecification.h" - -#include "TestTools/FLOATassert.h" -#include "TestTools/initGaudi.h" -#include "GaudiKernel/ISvcLocator.h" -#include "GaudiKernel/ToolHandle.h" -#include "AthenaBaseComps/AthAlgorithm.h" -#include "AthenaBaseComps/AthAlgTool.h" - -//#include "GaudiKernel/DeclareFactoryEntries.h" - -#include <algorithm> -#include <cassert> -#include <iostream> -#include <fstream> -#include <string> -#include <vector> - -const std::vector<float> phases = {-2.0, 0.0, 0.1, 0.2, 0.5, 1.0}; -const int nPhases = phases.size(); - -static const unsigned int OBJVERSION(3); -static const int NCHANNELS(1); -static const int NGAINS(1); -static const unsigned int NSAMPLES(1); - - -/** Class provides dummy algorithm - * to help construct CaloCellFastCopyTool to be tested. - */ -class DummyAlgorithm: public AthAlgorithm { - public: - DummyAlgorithm(const std::string& name, ISvcLocator* svcloc) - : AthAlgorithm(name, svcloc) { - - } - - virtual StatusCode execute() { - return StatusCode::SUCCESS; - } -}; - - - -template<typename T = TileCalibDrawerOfc> -class TileCondProxyMock: public AthAlgTool, virtual public ITileCondProxy<T> { - public: - - TileCondProxyMock(const std::string& type, const std::string& name, const IInterface* parent) - :AthAlgTool(type, name, parent), - m_ofcList(nullptr), - m_drawerOfc(nullptr) - { - declareInterface<ITileCondProxy<T> >(this); - }; - - virtual ~TileCondProxyMock() {}; - - StatusCode initialize() { - coral::AttributeListSpecification* spec = new coral::AttributeListSpecification(); - spec->extend("TileCalibBlobOfc", "blob"); - m_ofcList = new coral::AttributeList(*spec); - coral::Blob& blob = (*m_ofcList)["TileCalibBlobOfc"].data<coral::Blob>(); - - m_drawerOfc = TileCalibDrawerOfc::getInstance(blob, OBJVERSION, NSAMPLES, -nPhases, NCHANNELS, NGAINS); - m_drawerOfc->setPhases(0, 0, phases); - - for (unsigned int channel = 0; channel < NCHANNELS; ++channel) { - for (unsigned int gain = 0; gain < NGAINS; ++gain) { - for (float phase : phases) { - for (unsigned int isam = 0; isam < NSAMPLES; ++isam) { - m_drawerOfc->setOfc(TileCalibDrawerOfc::FieldA, channel, gain, phase, isam, phase + 10.0F); - m_drawerOfc->setOfc(TileCalibDrawerOfc::FieldB, channel, gain, phase, isam, phase + 20.0F); - m_drawerOfc->setOfc(TileCalibDrawerOfc::FieldG, channel, gain, phase, isam, phase + 30.0F); - if (OBJVERSION == 3) { - m_drawerOfc->setOfc(TileCalibDrawerOfc::FieldC, channel, gain, phase, isam, phase + 40.0F); - m_drawerOfc->setOfc(TileCalibDrawerOfc::FieldDG, channel, gain, phase, isam, phase + 50.0F); - } - } - } - } - } - - return StatusCode::SUCCESS; - }; - - StatusCode finalize() { - delete m_drawerOfc; - delete m_ofcList; - return StatusCode::SUCCESS; - }; - - const T* getCalibDrawer(unsigned int /* drawerIdx */) const {return m_drawerOfc; }; - - private: - coral::AttributeList* m_ofcList; - T* m_drawerOfc; -}; - - - -typedef TileCondProxyMock< TileCalibDrawerOfc > TileCondProxyMockOfc; -DECLARE_COMPONENT( TileCondProxyMockOfc ) - - - -void test1() { - - std::cout << "test1\n"; - - - ISvcLocator* svcLoc; - if (!Athena_test::initGaudi(svcLoc)) { - std::cerr << "ERROR This test can not be run, can not get ServiceLocator" << std::endl; - } - - - DummyAlgorithm* alg = new DummyAlgorithm("DummyAlgorithm", svcLoc); - alg->addRef(); - - TileCondToolOfcCool* tool = new TileCondToolOfcCool("TileCondToolOfcCool", "TileCondToolOfcCoolTest", alg); - tool->addRef(); - assert(tool->setProperty("ProxyOfcCool", "TileCondProxyMock<TileCalibDrawerOfc>/TileCondProxyMockOfc")); - assert(tool->initialize()); - - - int drawerIdx(0); - int channel(0); - int gain(0); - - float phase(0.0); - - const TileOfcWeightsStruct* weights; - weights = tool->getOfcWeights(drawerIdx, channel, gain, phase, true); - - assert(Athena_test::isEqual(weights->w_a[0], 10.0)); - assert(Athena_test::isEqual(weights->w_b[0], 20.0)); - assert(Athena_test::isEqual(weights->g[0], 30.0)); - assert(Athena_test::isEqual(weights->w_c[0], 40.0)); - assert(Athena_test::isEqual(weights->dg[0], 50.0)); - assert(Athena_test::isEqual(phase, 0.0)); - - phase = 0.1; - weights = tool->getOfcWeights(drawerIdx, channel, gain, phase, true); - assert(Athena_test::isEqual(weights->w_a[0], 10.1)); - assert(Athena_test::isEqual(phase, 0.1)); - - phase = 0.2; - weights = tool->getOfcWeights(drawerIdx, channel, gain, phase, true); - assert(Athena_test::isEqual(weights->w_a[0], 10.2)); - assert(Athena_test::isEqual(phase, 0.2)); - - phase = 0.3; - weights = tool->getOfcWeights(drawerIdx, channel, gain, phase, true); - assert(Athena_test::isEqual(weights->w_a[0], 10.2)); - assert(Athena_test::isEqual(phase, 0.2)); - - phase = 0.6; - weights = tool->getOfcWeights(drawerIdx, channel, gain, phase, true); - assert(Athena_test::isEqual(weights->w_a[0], 10.5)); - assert(Athena_test::isEqual(phase, 0.5)); - - phase = 0.8; - weights = tool->getOfcWeights(drawerIdx, channel, gain, phase, true); - assert(Athena_test::isEqual(weights->w_a[0], 11)); - assert(Athena_test::isEqual(phase, 1.0)); - - phase = 2.0; - weights = tool->getOfcWeights(drawerIdx, channel, gain, phase, true); - assert(Athena_test::isEqual(weights->w_a[0], 11)); - assert(Athena_test::isEqual(phase, 1.0)); - - phase = -1.0; - weights = tool->getOfcWeights(drawerIdx, channel, gain, phase, true); - assert(Athena_test::isEqual(weights->w_a[0], 10.0)); - assert(Athena_test::isEqual(phase, 0.0)); - - phase = -1.1; - weights = tool->getOfcWeights(drawerIdx, channel, gain, phase, true); - assert(Athena_test::isEqual(weights->w_a[0], 8.0)); - assert(Athena_test::isEqual(phase, -2.0)); - - - phase = -20.0; - weights = tool->getOfcWeights(drawerIdx, channel, gain, phase, true); - assert(Athena_test::isEqual(weights->w_a[0], 8.0)); - assert(Athena_test::isEqual(phase, -2.0)); - - delete tool; - delete alg; - -} - - -int main() { - - - test1(); - - return 0; -} diff --git a/TileCalorimeter/TileConditions/test/TileCondToolTMDB_test.cxx b/TileCalorimeter/TileConditions/test/TileCondToolTMDB_test.cxx index d0f4cd615672242bd126e2d0cc74c76c78997b05..43c3c8e1d753741b1aad1381035da3c305b1a2c4 100644 --- a/TileCalorimeter/TileConditions/test/TileCondToolTMDB_test.cxx +++ b/TileCalorimeter/TileConditions/test/TileCondToolTMDB_test.cxx @@ -4,16 +4,10 @@ #undef NDEBUG -//=== AttributeList -//#include "CoralBase/Attribute.h" #include "TileConditions/TileCondToolTMDB.h" #include "TileCalibBlobObjs/TileCalibDrawerFlt.h" -#include "TileConditions/ITileCondProxy.h" #include "CoralBase/Blob.h" -#include "CoralBase/Attribute.h" -#include "CoralBase/AttributeList.h" -#include "CoralBase/AttributeListSpecification.h" #include "TestTools/FLOATassert.h" #include "TestTools/initGaudi.h" @@ -22,7 +16,6 @@ #include "AthenaBaseComps/AthAlgorithm.h" #include "AthenaBaseComps/AthAlgTool.h" -//#include "GaudiKernel/DeclareFactoryEntries.h" #include <algorithm> #include <cassert> @@ -32,9 +25,27 @@ #include <vector> -static const unsigned int OBJVERSION(0); -static const int NCHANNELS(4); -//static const int NGAINS(1); +static const std::string TILE_JO_NAME("jobOptions_TileCondToolTMDBTest.py"); +static const std::string TILE_TMDB("TileTMDB"); +static const unsigned int OBJ_VERSION(0); +static const int N_CHANNELS(4); +static const unsigned int DEF_DRAWER_IDX(0); + +static const EventIDRange EVENT_RANGE { + EventIDBase{ + EventIDBase::UNDEFNUM / 8, // Run number + EventIDBase::UNDEFEVT, + EventIDBase::UNDEFNUM, + EventIDBase::UNDEFNUM, + EventIDBase::UNDEFNUM / 8}, // Lumi block + + EventIDBase{ + EventIDBase::UNDEFNUM / 2, // Run number + EventIDBase::UNDEFEVT, + EventIDBase::UNDEFNUM, + EventIDBase::UNDEFNUM, + EventIDBase::UNDEFNUM / 2} // Lumi block +}; /** Class provides dummy algorithm @@ -44,9 +55,9 @@ class DummyAlgorithm: public AthAlgorithm { public: DummyAlgorithm(const std::string& name, ISvcLocator* svcloc) : AthAlgorithm(name, svcloc) { - - } - + + } + virtual StatusCode execute() { return StatusCode::SUCCESS; } @@ -54,7 +65,7 @@ class DummyAlgorithm: public AthAlgorithm { enum DRAWER {DELAY_DRAWER_IDX = 0, CALIB_DRAWER_IDX = 1, THRESHOLD_DRAWER_IDX = 2, TMF_DRAWER_IDX = 3}; -static const std::vector<std::vector<float> > defaults = { +static const std::vector<std::vector<float> > DEFAULTS = { {10}, // DELAY {1, 2}, // CALIB {100}, // THRESHOLD @@ -62,83 +73,86 @@ static const std::vector<std::vector<float> > defaults = { }; -template<typename T = TileCalibDrawerFlt> -class TileCondProxyMock: public AthAlgTool, virtual public ITileCondProxy<T> { - public: - - TileCondProxyMock(const std::string& type, const std::string& name, const IInterface* parent) - :AthAlgTool(type, name, parent) - { - declareInterface<ITileCondProxy<T> >(this); - }; - - virtual ~TileCondProxyMock() {}; - - StatusCode initialize() { - - for ( const std::vector<float>& def : defaults) { - coral::AttributeListSpecification* spec = new coral::AttributeListSpecification(); - spec->extend("TileCalibBlob", "blob"); - m_lists.push_back( new coral::AttributeList(*spec) ); - coral::Blob& blob = (*m_lists.back())["TileCalibBlob"].template data<coral::Blob>(); - std::vector<std::vector<float> > defs(1, def); - m_drawers.push_back(TileCalibDrawerFlt::getInstance(blob, defs, NCHANNELS, OBJVERSION)); - } - - m_drawers.at(DELAY_DRAWER_IDX)->setData(TMDB::D5L, 0, 0, 10); - m_drawers.at(DELAY_DRAWER_IDX)->setData(TMDB::D5R, 0, 0, 20); - m_drawers.at(DELAY_DRAWER_IDX)->setData(TMDB::D6L, 0, 0, 30); - m_drawers.at(DELAY_DRAWER_IDX)->setData(TMDB::D6R, 0, 0, 40); - - m_drawers.at(THRESHOLD_DRAWER_IDX)->setData(TMDB::D6LOW, 0, 0, 100); - m_drawers.at(THRESHOLD_DRAWER_IDX)->setData(TMDB::D6HIGH, 0, 0, 200); - m_drawers.at(THRESHOLD_DRAWER_IDX)->setData(TMDB::D5D6LOW, 0, 0, 1000); - m_drawers.at(THRESHOLD_DRAWER_IDX)->setData(TMDB::D5D6HIGH, 0, 0, 2000); - - return StatusCode::SUCCESS; - }; - - StatusCode finalize() { - for (T* drawer : m_drawers) delete drawer; - for (coral::AttributeList* list : m_lists) delete list; - - return StatusCode::SUCCESS; - }; - - const T* getCalibDrawer(unsigned int drawerIdx ) const { return m_drawers.at(drawerIdx);}; - - private: - std::vector<coral::AttributeList*> m_lists; - std::vector<T*> m_drawers; -}; +void test1() { + std::cout << "test1 TileCondToolTMDB\n"; -typedef TileCondProxyMock< TileCalibDrawerFlt > TileCondProxyMockFlt; -DECLARE_COMPONENT( TileCondProxyMockFlt ) + std::ofstream jo(TILE_JO_NAME); + jo << "ApplicationMgr.ExtSvc += { \"StoreGateSvc/ConditionStore\" };" << std::endl; + jo.close(); + ISvcLocator* svcLoc; + if (!Athena_test::initGaudi(TILE_JO_NAME, svcLoc)) { + std::cerr << "ERROR This test can not be run, can not get ServiceLocator" << std::endl; + } + ServiceHandle<StoreGateSvc> conditionStore("ConditionStore", ""); + assert(conditionStore.retrieve().isSuccess()); -void test1() { + SG::WriteCondHandleKey<TileCalibDataFlt> calibDataKey{TILE_TMDB}; + assert(calibDataKey.initialize().isSuccess()); - std::cout << "test1\n"; + SG::WriteCondHandle<TileCalibDataFlt> calibData{calibDataKey}; + std::unique_ptr<TileCalibDataFlt> data = std::make_unique<TileCalibDataFlt>(); - ISvcLocator* svcLoc; - if (!Athena_test::initGaudi(svcLoc)) { - std::cerr << "ERROR This test can not be run, can not get ServiceLocator" << std::endl; + unsigned int drawerIdx(DEF_DRAWER_IDX); + for(const std::vector<float>& def : DEFAULTS) { + + std::vector<std::vector<float> > defs(1, def); + std::unique_ptr<coral::Blob> blob = std::make_unique<coral::Blob>(0); + std::unique_ptr<TileCalibDrawerFlt> calibDrawer(TileCalibDrawerFlt::getInstance(*blob, defs, N_CHANNELS, OBJ_VERSION)); + // Trick to make calib drawer to own blob + std::unique_ptr<TileCalibDrawerFlt> tmdbDrawer = std::make_unique<TileCalibDrawerFlt>(*calibDrawer); + + if (drawerIdx == DELAY_DRAWER_IDX) { + tmdbDrawer->setData(TMDB::D5L, 0, 0, 10); + tmdbDrawer->setData(TMDB::D5R, 0, 0, 20); + tmdbDrawer->setData(TMDB::D6L, 0, 0, 30); + tmdbDrawer->setData(TMDB::D6R, 0, 0, 40); + } else if (drawerIdx == THRESHOLD_DRAWER_IDX) { + tmdbDrawer->setData(TMDB::D6LOW, 0, 0, 100); + tmdbDrawer->setData(TMDB::D6HIGH, 0, 0, 200); + tmdbDrawer->setData(TMDB::D5D6LOW, 0, 0, 1000); + tmdbDrawer->setData(TMDB::D5D6HIGH, 0, 0, 2000); + } + + data->setCalibDrawer(drawerIdx, tmdbDrawer.release()); + ++drawerIdx; + } + + for (unsigned int drawerIdx = 0; drawerIdx < TileCalibUtils::MAX_DRAWERIDX; ++drawerIdx) { + if (!data->getCalibDrawer(drawerIdx)) { + unsigned int defaultDrawerIdx = TileCalibUtils::getDefaultDrawerIdx(drawerIdx); + data->setCalibDrawer(drawerIdx, data->getCalibDrawer(defaultDrawerIdx)); + } } + assert(calibData.record(EVENT_RANGE, data.release()).isSuccess()); - DummyAlgorithm* alg = new DummyAlgorithm("DummyAlgorithm", svcLoc); + EventIDBase eventId; + eventId.set_run_number(EventIDBase::UNDEFNUM / 4); + eventId.set_lumi_block(EventIDBase::UNDEFNUM / 4); + + EventContext ctx; + ctx.setEventID(eventId); + ctx.setExtension( Atlas::ExtendedEventContext(&*conditionStore) ); + Gaudi::Hive::setCurrentContext(ctx); + + + std::unique_ptr<DummyAlgorithm> alg = std::make_unique<DummyAlgorithm>("DummyAlgorithm", svcLoc); alg->addRef(); - TileCondToolTMDB* tool = new TileCondToolTMDB("TileCondToolTMDB", "TileCondToolTMDBTest", alg); + std::unique_ptr<TileCondToolTMDB> tool = std::make_unique<TileCondToolTMDB>("TileCondToolTMDB", + "TileCondToolTMDBTest", + alg.get()); tool->addRef(); - assert(tool->setProperty("ProxyThreshold", "TileCondProxyMock<TileCalibDrawerFlt>/TileCondProxyMockFlt")); - assert(tool->setProperty("ProxyDelay", "TileCondProxyMock<TileCalibDrawerFlt>/TileCondProxyMockFlt")); - assert(tool->setProperty("ProxyCalib", "TileCondProxyMock<TileCalibDrawerFlt>/TileCondProxyMockFlt")); - assert(tool->setProperty("ProxyTMF", "TileCondProxyMock<TileCalibDrawerFlt>/TileCondProxyMockFlt")); + + assert(tool->setProperty("TileTMDBThreshold", TILE_TMDB)); + assert(tool->setProperty("TileTMDBDelay", TILE_TMDB)); + assert(tool->setProperty("TileTMDBTMF", TILE_TMDB)); + assert(tool->setProperty("TileTMDBCalib", TILE_TMDB)); assert(tool->initialize()); @@ -194,15 +208,11 @@ void test1() { amplitude = tool->channelCalib(TMF_DRAWER_IDX, TMDB::D5L, samples); assert(Athena_test::isEqual(amplitude, 2121.0)); - delete tool; - delete alg; - } int main() { - test1(); return 0; diff --git a/TileCalorimeter/TileConditions/test/TileConditionTools_test.cxx b/TileCalorimeter/TileConditions/test/TileConditionTools_test.cxx new file mode 100644 index 0000000000000000000000000000000000000000..5b2bf8149ed8d1fa9fc25c73325e4949a9fffcd6 --- /dev/null +++ b/TileCalorimeter/TileConditions/test/TileConditionTools_test.cxx @@ -0,0 +1,405 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#undef NDEBUG + +// Tile includes +#include "TileConditions/TileCondToolTiming.h" +#include "TileConditions/TileCondToolAutoCr.h" +#include "TileConditions/TileCondToolPulseShape.h" +#include "TileConditions/TileCondToolDspThreshold.h" +#include "TileConditions/TileCondToolIntegrator.h" +#include "TileCalibBlobObjs/TileCalibDrawerFlt.h" +#include "TileConditions/TileCalibData.h" + +#include "TestTools/FLOATassert.h" +#include "TestTools/initGaudi.h" + +#include "AthenaBaseComps/AthAlgorithm.h" +#include "AthenaBaseComps/AthAlgTool.h" + +#include "StoreGate/StoreGateSvc.h" +#include "StoreGate/SGtests.h" +#include "StoreGate/ReadCondHandleKey.h" +#include "StoreGate/ReadCondHandle.h" + +#include "GaudiKernel/ISvcLocator.h" +#include "GaudiKernel/EventIDRange.h" + +#include "CoralBase/Blob.h" + +#include <algorithm> +#include <cassert> +#include <iostream> +#include <fstream> +#include <string> +#include <vector> +#include <memory> + +static const std::string TILE_JO_NAME("jobOptions_TileCondToolsTest.py"); +static const std::string TILE_TEST_CONDITION("TileTest"); +static const std::string TILE_PULSE_TEST_CONDITION("TilePulseTest"); +static const unsigned int OBJ_VERSION(0); +static const unsigned int PULSE_OBJ_VERSION(200); +static const unsigned int DEF_DRAWER_IDX(0); +static const unsigned int DRAWER_IDX(100); +static const unsigned int MAX_CHANNEL(64); +static const unsigned int MAX_GAIN(3); + +static const std::vector<float> DEF_CONDITIONS{1.0F, 2.0F, 3.0F, 4.0F, 5.0F, 6.0F, 7.0F, 8.0F, 9.0F, 10.0F}; +static const std::vector<std::vector<float> > DEF_CONDDATA = { + DEF_CONDITIONS +}; + +static const unsigned int MAX_INDEX(DEF_CONDITIONS.size()); + +static const EventIDRange EVENT_RANGE { + EventIDBase{ + EventIDBase::UNDEFNUM / 8, // Run number + EventIDBase::UNDEFEVT, + EventIDBase::UNDEFNUM, + EventIDBase::UNDEFNUM, + EventIDBase::UNDEFNUM / 8}, // Lumi block + + EventIDBase{ + EventIDBase::UNDEFNUM / 2, // Run number + EventIDBase::UNDEFEVT, + EventIDBase::UNDEFNUM, + EventIDBase::UNDEFNUM, + EventIDBase::UNDEFNUM / 2} // Lumi block +}; + + + +/** Class provides dummy algorithm + * to help construct Tool to be tested. + */ +class DummyAlgorithm: public AthAlgorithm { + public: + DummyAlgorithm(const std::string& name, ISvcLocator* svcloc) + : AthAlgorithm(name, svcloc) { + + } + + virtual StatusCode execute() override { + return StatusCode::SUCCESS; + } +}; + + +float getCondtionsData(unsigned channel, unsigned int gain, unsigned int index) { + return gain + channel / 100.0F + (100.0F * index); +} + + +void initTileTestCondtions(std::string conditionName, unsigned int version) { + + + SG::WriteCondHandleKey<TileCalibDataFlt> calibDataKey{conditionName}; + assert(calibDataKey.initialize().isSuccess()); + + SG::WriteCondHandle<TileCalibDataFlt> calibData{calibDataKey}; + + std::unique_ptr<TileCalibDataFlt> data = std::make_unique<TileCalibDataFlt>(); + + std::unique_ptr<coral::Blob> defaultBlob = std::make_unique<coral::Blob>(0); + std::unique_ptr<TileCalibDrawerFlt> tmpDefaultCalibDrawer(TileCalibDrawerFlt::getInstance(*defaultBlob, DEF_CONDDATA, 1, version)); + // Trick to make calib drawer to copy and own blob + std::unique_ptr<TileCalibDrawerFlt> defaultCalibDrawer = std::make_unique<TileCalibDrawerFlt>(*tmpDefaultCalibDrawer); + data->setCalibDrawer(DEF_DRAWER_IDX, defaultCalibDrawer.release()); + + + std::vector<std::vector<float>> channelData{MAX_GAIN, std::vector<float>(MAX_INDEX, 0.0F)}; + + std::unique_ptr<coral::Blob> drawerBlob = std::make_unique<coral::Blob>(0); + std::unique_ptr<TileCalibDrawerFlt> tmpCalibDrawer(TileCalibDrawerFlt::getInstance(*drawerBlob, channelData, MAX_CHANNEL, version)); + // Trick to make calib drawer to own blob + std::unique_ptr<TileCalibDrawerFlt> calibDrawer = std::make_unique<TileCalibDrawerFlt>(*tmpCalibDrawer); + + + std::vector<float> gainData(MAX_INDEX, 0.0F); + for (unsigned int channel = 0; channel < MAX_CHANNEL; ++channel) { + for (unsigned int gain = 0; gain < MAX_GAIN; ++gain) { + for (unsigned int index = 0; index < MAX_INDEX; ++index) { + gainData[index] = getCondtionsData(channel, gain, index); + } + calibDrawer->setData(channel, gain, gainData); + } + } + + data->setCalibDrawer(DRAWER_IDX, calibDrawer.release()); + + for (unsigned int drawerIdx = 1; drawerIdx < TileCalibUtils::MAX_DRAWERIDX; ++drawerIdx) { + if (drawerIdx == DRAWER_IDX) continue; + unsigned int defaultDrawerIdx = TileCalibUtils::getDefaultDrawerIdx(drawerIdx); + data->setCalibDrawer(drawerIdx, data->getCalibDrawer(defaultDrawerIdx)); + } + + + assert(calibData.record(EVENT_RANGE, data.release()).isSuccess()); + +} + + +void testTileCondToolTiming(ISvcLocator* svcLoc) { + + std::cout << "\nTest TileCondToolTiming\n"; + + std::unique_ptr<DummyAlgorithm> alg = std::make_unique<DummyAlgorithm>("DummyAlgorithm", svcLoc); + alg->addRef(); + + std::unique_ptr<TileCondToolTiming> tool = std::make_unique<TileCondToolTiming>("TileCondToolTiming", + "TileCondToolTimingTest", + alg.get()); + tool->addRef(); + + assert(tool->setProperty("TileTiming", TILE_TEST_CONDITION)); + assert(tool->initialize().isSuccess()); + + unsigned int defaultDrawerIdx(200); + unsigned int defaultChannel(0); + unsigned int defaultAdc(0); + assert(Athena_test::isEqual(tool->getChannelOffset(defaultDrawerIdx, defaultChannel, defaultAdc), DEF_CONDITIONS[0])); + + + for (unsigned int channel = 0; channel < MAX_CHANNEL; ++channel) { + for (unsigned int gain = 0; gain < MAX_GAIN; ++gain) { + float channelOffset = getCondtionsData(channel, gain, 0); + assert(Athena_test::isEqual(tool->getChannelOffset(DRAWER_IDX, channel, gain), channelOffset)); + } + } + +} + +void testTileCondToolAutoCr(ISvcLocator* svcLoc) { + + std::cout << "\nTest TileCondToolAutoCr\n"; + + std::unique_ptr<DummyAlgorithm> alg = std::make_unique<DummyAlgorithm>("DummyAlgorithm", svcLoc); + alg->addRef(); + + std::unique_ptr<TileCondToolAutoCr> tool = std::make_unique<TileCondToolAutoCr>("TileCondToolAutoCr", + "TileCondToolAutoCrTest", + alg.get()); + tool->addRef(); + + assert(tool->setProperty("TileAutoCorrelation", TILE_TEST_CONDITION)); + assert(tool->initialize().isSuccess()); + + unsigned int defaultDrawerIdx(200); + unsigned int defaultChannel(0); + unsigned int defaultAdc(0); + + std::vector<float> referenceAutoCorr(DEF_CONDITIONS); + std::vector<float> testedAutoCorr(MAX_INDEX); + + tool->getAutoCorr(defaultDrawerIdx, defaultChannel, defaultAdc, testedAutoCorr); + assert(testedAutoCorr == referenceAutoCorr); + + for (unsigned int channel = 0; channel < MAX_CHANNEL; ++channel) { + for (unsigned int gain = 0; gain < MAX_GAIN; ++gain) { + + for (unsigned int index = 0; index < MAX_INDEX; ++index) { + referenceAutoCorr[index] = getCondtionsData(channel, gain, index); + } + + tool->getAutoCorr(DRAWER_IDX, channel, gain, testedAutoCorr); + assert(testedAutoCorr == referenceAutoCorr); + + } + } + +} + + + +void testTileCondToolPulseShape(ISvcLocator* svcLoc) { + + std::cout << "\nTest TileCondToolPulseShape\n"; + + std::unique_ptr<DummyAlgorithm> alg = std::make_unique<DummyAlgorithm>("DummyAlgorithm", svcLoc); + alg->addRef(); + + std::unique_ptr<TileCondToolPulseShape> tool = std::make_unique<TileCondToolPulseShape>("TileCondToolPulseShape", + "TileCondToolPulseShapeTest", + alg.get()); + tool->addRef(); + + assert(tool->setProperty("TilePulseShape", TILE_PULSE_TEST_CONDITION)); + assert(tool->initialize().isSuccess()); + + unsigned int defaultDrawerIdx(200); + unsigned int defaultChannel(0); + unsigned int defaultAdc(0); + + unsigned int nTimes(MAX_INDEX / 2); + for(unsigned int timeIndex = 0; timeIndex < nTimes; ++timeIndex) { + float time = DEF_CONDITIONS[timeIndex]; + float y(0.0F); + float dy(0.0F); + tool->getPulseShapeYDY(defaultDrawerIdx, defaultChannel, defaultAdc, time, y, dy); + assert(Athena_test::isEqual(y, DEF_CONDITIONS[timeIndex + nTimes])); + } + + for (unsigned int channel = 0; channel < MAX_CHANNEL; ++channel) { + for (unsigned int gain = 0; gain < MAX_GAIN; ++gain) { + for(unsigned int timeIndex = 0; timeIndex < nTimes; ++timeIndex) { + float time = getCondtionsData(channel, gain, timeIndex); + float refY = getCondtionsData(channel, gain, timeIndex + nTimes); + float y(0.0F); + float dy(0.0F); + tool->getPulseShapeYDY(DRAWER_IDX, channel, gain, time, y, dy); + assert(Athena_test::isEqual(y, refY)); + } + } + } + +} + + +void testTileCondToolDspThreshold(ISvcLocator* svcLoc) { + + std::cout << "\nTest TileCondToolDspThreshold\n"; + + std::unique_ptr<DummyAlgorithm> alg = std::make_unique<DummyAlgorithm>("DummyAlgorithm", svcLoc); + alg->addRef(); + + std::unique_ptr<TileCondToolDspThreshold> tool = std::make_unique<TileCondToolDspThreshold>("TileCondToolDspThreshold", + "TileCondToolDspThresholdTest", + alg.get()); + tool->addRef(); + + assert(tool->setProperty("TileDSP_Threshold", TILE_TEST_CONDITION)); + assert(tool->initialize().isSuccess()); + + unsigned int defaultDrawerIdx(200); + unsigned int defaultChannel(0); + unsigned int defaultAdc(0); + + float minThreshold = tool->getMinimumAmplitudeThreshold(defaultDrawerIdx, defaultChannel, defaultAdc); + assert(Athena_test::isEqual(minThreshold, DEF_CONDITIONS[0])); + + float maxThreshold = tool->getMaximumAmplitudeThreshold(defaultDrawerIdx, defaultChannel, defaultAdc); + assert(Athena_test::isEqual(maxThreshold, DEF_CONDITIONS[1])); + + minThreshold = 0.0; + maxThreshold = 0.0; + + tool->getAmplitudeThresholds(defaultDrawerIdx, defaultChannel, defaultAdc, minThreshold, maxThreshold); + assert(Athena_test::isEqual(minThreshold, DEF_CONDITIONS[0])); + assert(Athena_test::isEqual(maxThreshold, DEF_CONDITIONS[1])); + + float dspThreshold = tool->getDspThreshold(defaultDrawerIdx, defaultChannel, defaultAdc); + assert(Athena_test::isEqual(dspThreshold, DEF_CONDITIONS[2])); + + + for (unsigned int channel = 0; channel < MAX_CHANNEL; ++channel) { + for (unsigned int gain = 0; gain < MAX_GAIN; ++gain) { + + minThreshold = tool->getMinimumAmplitudeThreshold(DRAWER_IDX, channel, gain); + assert(Athena_test::isEqual(minThreshold, getCondtionsData(channel, gain, 0))); + + maxThreshold = tool->getMaximumAmplitudeThreshold(DRAWER_IDX, channel, gain); + assert(Athena_test::isEqual(maxThreshold, getCondtionsData(channel, gain, 1))); + + minThreshold = 0.0; + maxThreshold = 0.0; + + tool->getAmplitudeThresholds(DRAWER_IDX, channel, gain, minThreshold, maxThreshold); + assert(Athena_test::isEqual(minThreshold, getCondtionsData(channel, gain, 0))); + assert(Athena_test::isEqual(maxThreshold, getCondtionsData(channel, gain, 1))); + + dspThreshold = tool->getDspThreshold(DRAWER_IDX, channel, gain); + assert(Athena_test::isEqual(dspThreshold, getCondtionsData(channel, gain, 2))); + + } + } + +} + + +void testTileCondToolIntegrator(ISvcLocator* svcLoc) { + + std::cout << "\nTest TileCondToolIntegrator\n"; + + std::unique_ptr<DummyAlgorithm> alg = std::make_unique<DummyAlgorithm>("DummyAlgorithm", svcLoc); + alg->addRef(); + + std::unique_ptr<TileCondToolIntegrator> tool = std::make_unique<TileCondToolIntegrator>("TileCondToolIntegrator", + "TileCondToolIntegratorTest", + alg.get()); + tool->addRef(); + + assert(tool->setProperty("TileIntegrator", TILE_TEST_CONDITION)); + assert(tool->initialize().isSuccess()); + + unsigned int defaultDrawerIdx(200); + unsigned int defaultChannel(0); + unsigned int defaultAdc(0); + + + assert(Athena_test::isEqual(tool->getGain(defaultDrawerIdx, defaultChannel, defaultAdc), DEF_CONDITIONS[0])); + assert(Athena_test::isEqual(tool->getGainError(defaultDrawerIdx, defaultChannel, defaultAdc), DEF_CONDITIONS[1])); + assert(Athena_test::isEqual(tool->getChi2(defaultDrawerIdx, defaultChannel, defaultAdc), DEF_CONDITIONS[2])); + assert(Athena_test::isEqual(tool->getPedestal(defaultDrawerIdx, defaultChannel, defaultAdc), DEF_CONDITIONS[3])); + assert(Athena_test::isEqual(tool->getDACForPed(defaultDrawerIdx, defaultChannel, defaultAdc), DEF_CONDITIONS[4])); + assert(Athena_test::isEqual(tool->getSigmaOfPed(defaultDrawerIdx, defaultChannel, defaultAdc), DEF_CONDITIONS[5])); + assert(Athena_test::isEqual(tool->getRMSOfPed(defaultDrawerIdx, defaultChannel, defaultAdc), DEF_CONDITIONS[6])); + assert(Athena_test::isEqual(tool->getSigmaOfRMS(defaultDrawerIdx, defaultChannel, defaultAdc), DEF_CONDITIONS[7])); + + + for (unsigned int channel = 0; channel < MAX_CHANNEL; ++channel) { + for (unsigned int gain = 0; gain < MAX_GAIN; ++gain) { + + assert(Athena_test::isEqual(tool->getGain(DRAWER_IDX, channel, gain), getCondtionsData(channel, gain, 0))); + assert(Athena_test::isEqual(tool->getGainError(DRAWER_IDX, channel, gain), getCondtionsData(channel, gain, 1))); + + assert(Athena_test::isEqual(tool->getChi2(DRAWER_IDX, channel, gain), getCondtionsData(channel, gain, 2))); + assert(Athena_test::isEqual(tool->getPedestal(DRAWER_IDX, channel, gain), getCondtionsData(channel, gain, 3))); + assert(Athena_test::isEqual(tool->getDACForPed(DRAWER_IDX, channel, gain), getCondtionsData(channel, gain, 4))); + assert(Athena_test::isEqual(tool->getSigmaOfPed(DRAWER_IDX, channel, gain), getCondtionsData(channel, gain, 5))); + assert(Athena_test::isEqual(tool->getRMSOfPed(DRAWER_IDX, channel, gain), getCondtionsData(channel, gain, 6))); + assert(Athena_test::isEqual(tool->getSigmaOfRMS(DRAWER_IDX, channel, gain), getCondtionsData(channel, gain, 7))); + + } + } + +} + + +int main() { + + + std::ofstream jo(TILE_JO_NAME); + jo << "ApplicationMgr.ExtSvc += { \"StoreGateSvc/ConditionStore\" };" << std::endl; + jo.close(); + + ISvcLocator* svcLoc; + if (!Athena_test::initGaudi(TILE_JO_NAME, svcLoc)) { + std::cerr << "ERROR This test can not be run, can not get ServiceLocator" << std::endl; + } + + ServiceHandle<StoreGateSvc> conditionStore("ConditionStore", ""); + assert(conditionStore.retrieve().isSuccess()); + + initTileTestCondtions(TILE_TEST_CONDITION, OBJ_VERSION); + initTileTestCondtions(TILE_PULSE_TEST_CONDITION, PULSE_OBJ_VERSION); + + EventIDBase eventId; + eventId.set_run_number(EventIDBase::UNDEFNUM / 4); + eventId.set_lumi_block(EventIDBase::UNDEFNUM / 4); + + EventContext ctx; + ctx.setEventID(eventId); + ctx.setExtension( Atlas::ExtendedEventContext(&*conditionStore) ); + Gaudi::Hive::setCurrentContext(ctx); + + testTileCondToolTiming(svcLoc); + testTileCondToolAutoCr(svcLoc); + testTileCondToolPulseShape(svcLoc); + testTileCondToolDspThreshold(svcLoc); + testTileCondToolIntegrator(svcLoc); + + return 0; +} diff --git a/TileCalorimeter/TileConditions/test/TileDCSComponents_test.cxx b/TileCalorimeter/TileConditions/test/TileDCSComponents_test.cxx new file mode 100644 index 0000000000000000000000000000000000000000..b36b85c1b67fac9ce5527348b7fcbef58deba738 --- /dev/null +++ b/TileCalorimeter/TileConditions/test/TileDCSComponents_test.cxx @@ -0,0 +1,896 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#undef NDEBUG + +#include "TileConditions/TileDCSState.h" +#include "TileConditions/TileCalibData.h" +#include "../src/TileDCSCondAlg.h" +#include "../src/TileDCSTool.h" +//#include "TileIdentifier/TileHWID.h" +#include "TileCablingService_common_test.cxx" + +#include "CaloIdentifier/CaloLVL1_ID.h" + +#include "TestTools/FLOATassert.h" +#include "TestTools/initGaudi.h" +#include "AthenaBaseComps/AthAlgorithm.h" +#include "AthenaBaseComps/AthAlgTool.h" +#include "CLIDSvc/CLASS_DEF.h" + +#include "GaudiKernel/ISvcLocator.h" +#include "GaudiKernel/ServiceHandle.h" + +#include "CoralBase/Blob.h" +#include "CoralBase/Attribute.h" +#include "CoralBase/AttributeList.h" +#include "CoralBase/AttributeListSpecification.h" + + +#include <algorithm> +#include <cassert> +#include <iostream> +#include <fstream> +#include <string> +#include <vector> + + +static const std::string TILE_JO_NAME("jobOptions_TileDCSTest.py"); +static const std::string TILE_DCS_CH_HV_IN_COOL("TileDCSChHvInCool.dat"); +static const std::string TILE_DCS_CH_STATES_IN_COOL("TileDCSChStatesInCool.dat"); + +static const std::string TILE_DCS_HV("/TILE/TEST/DCS/HV"); +static const std::string TILE_DCS_HVSET("/TILE/TEST/DCS/HVSET"); +static const std::string TILE_DCS_STATES("/TILE/TEST/DCS/STATES"); + +static const std::string TILE_TEST_EMS("TileTestEms"); +static const std::string TILE_TEST_DCS("TileTestDCS"); +static const std::string TILE_TEST_TOOL_DCS("TileTestToolDCS"); + +static const unsigned int ROS(2); +static const unsigned int DRAWER(3); +static const unsigned int MAX_CHANNEL(48); +static const unsigned int DEF_DRAWER_IDX(0); + +static const unsigned int GOOD_DRAWER(5); +static const unsigned int WARNING_DRAWER(6); +static const unsigned int BAD_DRAWER(7); + +static const std::vector<unsigned int> DRAWERS{ + GOOD_DRAWER, WARNING_DRAWER, BAD_DRAWER +}; + +static const unsigned int DRAWER_SHIFT_IN_COOL(10); + +static const int GOOD_DCS_STATE(111); +static const int WARNING1_DCS_STATE(150); +static const int WARNING2_DCS_STATE(250); +static const int BAD_DCS_STATE(50); + +static const std::vector<int> WARNING_DCS_STATE{ + WARNING1_DCS_STATE, WARNING2_DCS_STATE +}; + + +static const unsigned int LASER_REF_CHANNEL(10); +static const unsigned int WARNING_CHANNEL(11); +static const unsigned int BAD_CHANNEL(12); + +static const float CES_HV_SHIFT(50.0F); +static const float WARNING_HV_SHIFT(5.0F); +static const float BAD_HV_SHIFT(15.0F); + +static const std::vector<TileDCSState::TileDCSStatus> DCS_STATUS{ + TileDCSState::NON_EXISTING, + TileDCSState::UNKNOWN, + TileDCSState::OK_DRAWER, + TileDCSState::OK_KNOWNBADPMT, + TileDCSState::OK, + TileDCSState::WARNING_DRAWER, + TileDCSState::WARNING_KNOWNBADPMT, + TileDCSState::WARNING, + TileDCSState::ALERT_DRAWER, + TileDCSState::ALERT_KNOWNBADPMT, + TileDCSState::ALERT +}; + + +static const EventIDRange EVENT_RANGE { + EventIDBase{ + EventIDBase::UNDEFNUM / 8, // Run number + EventIDBase::UNDEFEVT, + EventIDBase::UNDEFNUM, + EventIDBase::UNDEFNUM, + EventIDBase::UNDEFNUM / 8}, // Lumi block + + EventIDBase{ + EventIDBase::UNDEFNUM / 2, // Run number + EventIDBase::UNDEFEVT, + EventIDBase::UNDEFNUM, + EventIDBase::UNDEFNUM, + EventIDBase::UNDEFNUM / 2} // Lumi block +}; + +/* +static const EventIDRange ALL_EVENT_RANGE { + EventIDBase{ + 0, // Run number + EventIDBase::UNDEFEVT, + EventIDBase::UNDEFNUM, + EventIDBase::UNDEFNUM, + 0}, // Lumi block + + EventIDBase{ + EventIDBase::UNDEFNUM - 1, // Run number + EventIDBase::UNDEFEVT, + EventIDBase::UNDEFNUM, + EventIDBase::UNDEFNUM, + EventIDBase::UNDEFNUM - 1} // Lumi block +}; + +*/ + +/** Class provides dummy algorithm + * to help construct Tool to be tested. + */ +class DummyAlgorithm: public AthAlgorithm { + public: + DummyAlgorithm(const std::string& name, ISvcLocator* svcloc) + : AthAlgorithm(name, svcloc) { + + } + + virtual StatusCode execute() override { + return StatusCode::SUCCESS; + } +}; + + +/* +// Dummy Tile detector descrition manager +class TileDetDescrManager { + +}; + + +CLASS_DEF(TileDetDescrManager, 2941, 1) +*/ + +unsigned int channelKey(unsigned int ros, unsigned int drawer, unsigned int channel) { + return ( ((((ros - 1) << 6) | drawer) << 6) | channel ); +} + + +float getChannelHV(unsigned int ros, unsigned int drawer, unsigned int channel) { + return ros * 100.0F + drawer + (channel / 100.0F); +} + +float getChannelHVSet(unsigned int ros, unsigned int drawer, unsigned int channel) { + return ros * 100.0F + drawer + (channel / 100.0F) + 0.005F; +} + +int getDrawerStates(unsigned int ros, unsigned int drawer) { + return ((ros << 6) | drawer); +} + +TileDCSState::TileDCSStatus getDCSHVStatus(unsigned int ros, + unsigned int drawer, + unsigned int channel) { + + return DCS_STATUS[channelKey(ros, drawer, channel) % DCS_STATUS.size()]; + +} + + +TileDCSState::TileDCSStatus getDCSStatus(unsigned int ros, + unsigned int drawer, + unsigned int channel) { + + return DCS_STATUS[channelKey(ros, drawer, channel + 1) % DCS_STATUS.size()]; + +} + + +template<typename T> +using FolderData = std::map<unsigned int, std::vector<std::pair<std::string, T>>>; + +template<typename T> +void prepareDCSFolder(const std::string& key, const FolderData<T>& folderData) { + + IOVRange range(EVENT_RANGE); + + SG::WriteCondHandleKey<CondAttrListCollection> folderKey(key); + assert(folderKey.initialize().isSuccess()); + + SG::WriteCondHandle<CondAttrListCollection> folder(folderKey); + + std::unique_ptr<CondAttrListCollection> data = std::make_unique<CondAttrListCollection>(true); + + for (const auto coolChannelData : folderData) { + + unsigned int coolChannel = coolChannelData.first; + const auto nameValuePairs = coolChannelData.second; + + coral::AttributeList attributeList; + + for (const std::pair<std::string, T> nameValuePair : nameValuePairs) { + std::string name = nameValuePair.first; + T value = nameValuePair.second; + attributeList.extend<T>(name); + attributeList[name].data<T>() = value; + } + + data->add(coolChannel, attributeList); + } + + + std::cout << "FOLDER [" << EVENT_RANGE << "]: " << std::endl; + data->dump(); + + assert(folder.record(EVENT_RANGE, data.release()).isSuccess()); +} + + + +void prepareDCSHVFolder(void) { + + TileCablingService* cabling = TileCablingService::getInstance(); + + FolderData<float> hvFolder; + + for (unsigned int drawer : DRAWERS) { + + std::vector<std::pair<std::string, float>> drawerHV; + drawerHV.resize(55); + + unsigned int channel = 0; + for (; channel < TileCalibUtils::MAX_CHAN; ++channel) { + int pmt = std::abs(cabling->channel2hole(ROS, channel)); + std::string name = (pmt < 10) ? "HVOUT0" : "HVOUT"; + name += std::to_string(pmt); + drawerHV[pmt - 1].first = name; + drawerHV[pmt - 1].second = getChannelHV(ROS, drawer, channel); + } + + for (; channel < drawerHV.size(); ++channel) { + std::string name = "TEMP"; + name += std::to_string(channel - TileCalibUtils::MAX_CHAN + 1); + drawerHV[channel].first = name; + drawerHV[channel].second = channel; + } + + hvFolder[drawer + DRAWER_SHIFT_IN_COOL] = drawerHV; + + } + + prepareDCSFolder(TILE_DCS_HV, hvFolder); + +} + + +void prepareDCSHVSetFolder(void) { + + TileCablingService* cabling = TileCablingService::getInstance(); + + FolderData<float> hvSetFolder; + + for (unsigned int drawer : DRAWERS) { + + std::vector<std::pair<std::string, float>> drawerHV; + drawerHV.resize(68); + + unsigned int channel = 0; + for (; channel < TileCalibUtils::MAX_CHAN; ++channel) { + int pmt = std::abs(cabling->channel2hole(ROS, channel)); + std::string name = "hvOut"; + name += std::to_string(pmt); + drawerHV[pmt - 1].first = name; + drawerHV[pmt - 1].second = getChannelHVSet(ROS, drawer, channel); + } + + for (int i = 1; i < 5; ++i) { + std::string name = "hvIn"; + name += std::to_string(i); + drawerHV[channel].first = name; + drawerHV[channel].second = 0.0F; + ++channel; + } + + for (int i = 1; i < 8; ++i) { + std::string name = "temp"; + name += std::to_string(i); + drawerHV[channel].first = name; + drawerHV[channel].second = i * 5.0F; + ++channel; + } + + for (int i = 1; i < 8; ++i) { + std::string name = "volt"; + name += std::to_string(i); + drawerHV[channel].first = name; + drawerHV[channel].second = i * 2.0F; + ++channel; + } + + for (int i = 1; i < 3; ++i) { + std::string name = "vFix"; + name += std::to_string(i); + drawerHV[channel].first = name; + drawerHV[channel].second = 1230.0F; + ++channel; + } + + + hvSetFolder[drawer + DRAWER_SHIFT_IN_COOL] = drawerHV; + + } + + prepareDCSFolder(TILE_DCS_HVSET, hvSetFolder); + +} + + +void prepareDCSStatesFolder(void) { + + FolderData<int32_t> statesFolder; + + std::map<unsigned int, unsigned int> drawerState{ + {GOOD_DRAWER, GOOD_DCS_STATE}, + {WARNING_DRAWER, WARNING1_DCS_STATE}, + {BAD_DRAWER, BAD_DCS_STATE}, + }; + + for (unsigned int drawer : DRAWERS) { + std::vector<std::pair<std::string, int32_t>> drawerStates{ + {"FORDAQ_MBHV", drawerState[drawer]} + }; + statesFolder[drawer + DRAWER_SHIFT_IN_COOL] = drawerStates; + } + + prepareDCSFolder(TILE_DCS_STATES, statesFolder); +} + + +void prepareDrawerInCoolMapping(void) { + + std::map<unsigned int, std::string> computer{ + {1, "ATLTILLV01"}, + {2, "ATLTILLV02"}, + {3, "ATLTILLV00"}, + {4, "ATLTILLV03"}, + }; + + std::ofstream dcsChHVInCool(TILE_DCS_CH_HV_IN_COOL); + for (unsigned int drawer : DRAWERS) { + unsigned int coolChannel(drawer + DRAWER_SHIFT_IN_COOL); + std::string drawerInCool = std::to_string(coolChannel - 1) + ": " + + std::to_string(coolChannel) + " " + + computer[ROS] + "_Drawer" + std::to_string(drawer + 1); + + dcsChHVInCool << drawerInCool << std::endl; + } + dcsChHVInCool.close(); + + + std::ofstream dcsChStatesInCool(TILE_DCS_CH_STATES_IN_COOL); + for (unsigned int drawer : DRAWERS) { + unsigned int coolChannel(drawer + DRAWER_SHIFT_IN_COOL); + std::string drawerInCool = std::to_string(coolChannel - 1) + ": " + + std::to_string(coolChannel) + " " + + computer[ROS] + "_ELMB_LVCAN1_LVPS_" + std::to_string(drawer + 1) + "_states"; + + dcsChStatesInCool << drawerInCool << std::endl; + } + + dcsChStatesInCool.close(); + +} + + +std::unique_ptr<TileCalibDataFlt> getCalibOflCes() { + + const unsigned int version(1); + const unsigned int adc(0); + + std::unique_ptr<TileCalibDataFlt> calibData = std::make_unique<TileCalibDataFlt>(); + + std::vector<std::vector<float>> defaultData{{0.0F, 0.0F, 0.0F, 0.0F}}; + std::unique_ptr<coral::Blob> blob = std::make_unique<coral::Blob>(0); + std::unique_ptr<TileCalibDrawerFlt> tmpCalibDrawer(TileCalibDrawerFlt::getInstance(*blob, + defaultData, + MAX_CHANNEL, + version)); + // Trick to make calib drawer to copy and own blob + std::unique_ptr<TileCalibDrawerFlt> defaultCalibDrawer = std::make_unique<TileCalibDrawerFlt>(*tmpCalibDrawer); + calibData->setCalibDrawer(DEF_DRAWER_IDX, defaultCalibDrawer.release()); + + std::unique_ptr<TileCalibDrawerFlt> goodCalibDrawer = std::make_unique<TileCalibDrawerFlt>(*tmpCalibDrawer); + std::unique_ptr<TileCalibDrawerFlt> warningCalibDrawer = std::make_unique<TileCalibDrawerFlt>(*tmpCalibDrawer); + std::unique_ptr<TileCalibDrawerFlt> badCalibDrawer = std::make_unique<TileCalibDrawerFlt>(*tmpCalibDrawer); + + for (unsigned int channel = 0; channel < TileCalibUtils::MAX_CHAN; ++channel) { + float hvShift(0.0F); + if (channel == WARNING_CHANNEL) hvShift = WARNING_HV_SHIFT; + if (channel == BAD_CHANNEL) hvShift = BAD_HV_SHIFT; + + goodCalibDrawer->setData(channel, adc, 2, getChannelHVSet(ROS, GOOD_DRAWER, channel) - hvShift); + warningCalibDrawer->setData(channel, adc, 2, getChannelHVSet(ROS, WARNING_DRAWER, channel) - hvShift); + badCalibDrawer->setData(channel, adc, 2, getChannelHVSet(ROS, BAD_DRAWER, channel) - hvShift); + } + + // Put 'bad' value, should be recovered by laser refference + goodCalibDrawer->setData(LASER_REF_CHANNEL, adc, 2, + getChannelHVSet(ROS, GOOD_DRAWER, LASER_REF_CHANNEL) - CES_HV_SHIFT); + + /* + goodCalibDrawer->setData(WARNING_CHANNEL, adc, 2, + getChannelHVSet(ROS, GOOD_DRAWER, WARNING_CHANNEL) - WARNING_HV_SHIFT); + + goodCalibDrawer->setData(BAD_CHANNEL, adc, 2, + getChannelHVSet(ROS, GOOD_DRAWER, BAD_CHANNEL) - BAD_HV_SHIFT); + + */ + + unsigned int goodDrawerIdx = TileCalibUtils::getDrawerIdx(ROS, GOOD_DRAWER); + calibData->setCalibDrawer(goodDrawerIdx, goodCalibDrawer.release()); + + unsigned int warningDrawerIdx = TileCalibUtils::getDrawerIdx(ROS, WARNING_DRAWER); + calibData->setCalibDrawer(warningDrawerIdx, warningCalibDrawer.release()); + + unsigned int badDrawerIdx = TileCalibUtils::getDrawerIdx(ROS, BAD_DRAWER); + calibData->setCalibDrawer(badDrawerIdx, badCalibDrawer.release()); + + for (unsigned int drawerIdx = 1; drawerIdx < TileCalibUtils::MAX_DRAWERIDX; ++drawerIdx) { + if(!calibData->getCalibDrawer(drawerIdx)) { + unsigned int defaultDrawerIdx = TileCalibUtils::getDefaultDrawerIdx(drawerIdx); + calibData->setCalibDrawer(drawerIdx, calibData->getCalibDrawer(defaultDrawerIdx)); + } + } + + return calibData; + +} + + +std::unique_ptr<TileCalibDataFlt> getCalibOflLasLin() { + + const unsigned int version(1); + const unsigned int adc(0); + + std::unique_ptr<TileCalibDataFlt> calibData = std::make_unique<TileCalibDataFlt>(); + + std::vector<std::vector<float>> defaultData{{0.0F, -1.0F}}; + std::unique_ptr<coral::Blob> blob = std::make_unique<coral::Blob>(0); + std::unique_ptr<TileCalibDrawerFlt> tmpCalibDrawer(TileCalibDrawerFlt::getInstance(*blob, + defaultData, + MAX_CHANNEL, + version)); + // Trick to make calib drawer to copy and own blob + std::unique_ptr<TileCalibDrawerFlt> defaultCalibDrawer = std::make_unique<TileCalibDrawerFlt>(*tmpCalibDrawer); + calibData->setCalibDrawer(DEF_DRAWER_IDX, defaultCalibDrawer.release()); + + std::unique_ptr<TileCalibDrawerFlt> goodCalibDrawer = std::make_unique<TileCalibDrawerFlt>(*tmpCalibDrawer); + std::unique_ptr<TileCalibDrawerFlt> warningCalibDrawer = std::make_unique<TileCalibDrawerFlt>(*tmpCalibDrawer); + std::unique_ptr<TileCalibDrawerFlt> badCalibDrawer = std::make_unique<TileCalibDrawerFlt>(*tmpCalibDrawer); + + goodCalibDrawer->setData(LASER_REF_CHANNEL, adc, 1, getChannelHVSet(ROS, GOOD_DRAWER, LASER_REF_CHANNEL)); + + unsigned int goodDrawerIdx = TileCalibUtils::getDrawerIdx(ROS, GOOD_DRAWER); + calibData->setCalibDrawer(goodDrawerIdx, goodCalibDrawer.release()); + + unsigned int warningDrawerIdx = TileCalibUtils::getDrawerIdx(ROS, WARNING_DRAWER); + calibData->setCalibDrawer(warningDrawerIdx, warningCalibDrawer.release()); + + unsigned int badDrawerIdx = TileCalibUtils::getDrawerIdx(ROS, BAD_DRAWER); + calibData->setCalibDrawer(badDrawerIdx, badCalibDrawer.release()); + + for (unsigned int drawerIdx = 1; drawerIdx < TileCalibUtils::MAX_DRAWERIDX; ++drawerIdx) { + if(!calibData->getCalibDrawer(drawerIdx)) { + unsigned int defaultDrawerIdx = TileCalibUtils::getDefaultDrawerIdx(drawerIdx); + calibData->setCalibDrawer(drawerIdx, calibData->getCalibDrawer(defaultDrawerIdx)); + } + } + + return calibData; + +} + + +void prepareEms(void) { + + // Initialize TileCalibEms + std::unique_ptr<TileEMScale> emScale = std::make_unique<TileEMScale>(); + + emScale->setCalibOflLasLin(getCalibOflLasLin()); + emScale->setCalibOflCes(getCalibOflCes()); + + SG::WriteCondHandleKey<TileEMScale> folderEmsKey{TILE_TEST_EMS}; + assert(folderEmsKey.initialize().isSuccess()); + + SG::WriteCondHandle<TileEMScale> folderEms{folderEmsKey}; + + assert(folderEms.record(EVENT_RANGE, emScale.release()).isSuccess()); + +} + +std::unique_ptr<TileDCSState> getDCSState() { + + // Initialize TileDscState + std::unique_ptr<TileDCSState> dcsState = std::make_unique<TileDCSState>(); + + dcsState->setGoodDrawer(GOOD_DCS_STATE); + dcsState->setWarningDrawer(WARNING_DCS_STATE); + + // Initialize TileDCSState + for (unsigned int ros = 1; ros < TileCalibUtils::MAX_ROS; ++ros) { + for (unsigned int drawer = 0; drawer < TileCalibUtils::MAX_DRAWER; ++drawer) { + + dcsState->setDrawerStates(ros, drawer, getDrawerStates(ros, drawer)); + + for (unsigned int channel = 0; channel < TileCalibUtils::MAX_CHAN; ++channel) { + dcsState->setChannelHV(ros, drawer, channel, getChannelHV(ros, drawer, channel)); + dcsState->setChannelHVSet(ros, drawer, channel, getChannelHVSet(ros, drawer, channel)); + + dcsState->setDCSStatus(ros, drawer, channel, getDCSStatus(ros, drawer, channel)); + dcsState->setDCSHVStatus(ros, drawer, channel, getDCSHVStatus(ros, drawer, channel)); + + } + + } + } + + + return dcsState; +} + + +template<class T> +void checkDCSState(const T* dcsState) { + + for (unsigned int ros = 1; ros < TileCalibUtils::MAX_ROS; ++ros) { + for (unsigned int drawer = 0; drawer < TileCalibUtils::MAX_DRAWER; ++drawer) { + + const int referenceDrawerStates(getDrawerStates(ros, drawer)); + assert(dcsState->getDrawerStates(ros, drawer) == referenceDrawerStates); + + TileDCSState::TileDCSStatus referenceDrawerDCSStatus(TileDCSState::ALERT_DRAWER); + if (referenceDrawerStates == GOOD_DCS_STATE) { + referenceDrawerDCSStatus = TileDCSState::OK_DRAWER; + } else if (referenceDrawerStates == WARNING1_DCS_STATE + || referenceDrawerStates == WARNING2_DCS_STATE) { + referenceDrawerDCSStatus = TileDCSState::WARNING_DRAWER; + } + + assert(dcsState->getDCSStatus(ros, drawer) == referenceDrawerDCSStatus); + + for (unsigned int channel = 0; channel < TileCalibUtils::MAX_CHAN; ++channel) { + + const float channelHV(getChannelHV(ros, drawer, channel)); + assert(Athena_test::isEqual(dcsState->getChannelHV(ros, drawer, channel), channelHV)); + + const float channelHVSet(getChannelHVSet(ros, drawer, channel)); + assert(Athena_test::isEqual(dcsState->getChannelHVSet(ros, drawer, channel), channelHVSet)); + + + assert(dcsState->getDCSStatus(ros, drawer, channel) == getDCSStatus(ros, drawer, channel)); + assert(dcsState->getDCSHVStatus(ros, drawer, channel) == getDCSHVStatus(ros, drawer, channel)); + + const bool referenceDCSStatus(getDCSStatus(ros, drawer, channel) > TileDCSState::WARNING); + assert(dcsState->isStatusBad(ros, drawer, channel) == referenceDCSStatus); + + const bool referenceDCSHVStatus(getDCSHVStatus(ros, drawer, channel) > TileDCSState::WARNING); + assert(dcsState->isStatusHVBad(ros, drawer, channel) == referenceDCSHVStatus); + + + } + } + } + +} + + + +void testTileDCSState(void) { + + std::cout << "\nTest TileDCSState\n"; + + + TileDCSState initialDCSState; + + // Test initial values + for (unsigned int ros = 1; ros < TileCalibUtils::MAX_ROS; ++ros) { + for (unsigned int drawer = 0; drawer < TileCalibUtils::MAX_DRAWER; ++drawer) { + + assert(initialDCSState.getDrawerStates(ros, drawer) < 0); + assert(initialDCSState.getDCSStatus(ros, drawer) == TileDCSState::UNKNOWN); + assert(!initialDCSState.isStatusBad(ros, drawer)); + + for (unsigned int channel = 0; channel < TileCalibUtils::MAX_CHAN; ++channel) { + + assert(initialDCSState.getChannelHV(ros, drawer, channel) < 0); + assert(initialDCSState.getChannelHVSet(ros, drawer, channel) < 0); + assert(initialDCSState.getDCSStatus(ros, drawer, channel) == TileDCSState::UNKNOWN); + + assert(!initialDCSState.isStatusBad(ros, drawer, channel)); + assert(!initialDCSState.isStatusHVBad(ros, drawer, channel)); + } + } + } + + + std::unique_ptr<TileDCSState> dcsState = getDCSState(); + checkDCSState(dcsState.get()); + +} + + + +void testTileDCSCondAlg(ISvcLocator* svcLoc) { + + std::cout << "\nTest TileDCSCondAlg\n"; + + prepareDrawerInCoolMapping(); + + ServiceHandle<StoreGateSvc> detStore("DetectorStore", ""); + assert(detStore.retrieve().isSuccess()); + + std::unique_ptr<CaloLVL1_ID> caloLVL1_ID = std::make_unique<CaloLVL1_ID>(); + assert(detStore->record(caloLVL1_ID.release(), "CaloLVL1_ID").isSuccess()); + + + //TileDCSCondAlg + std::unique_ptr<TileDCSCondAlg> alg = std::make_unique<TileDCSCondAlg>("TileDCSCondAlgTest", svcLoc); + alg->addRef(); + + assert( (alg->setProperty("HV", TILE_DCS_HV)).isSuccess() ); + assert( (alg->setProperty("HVSET", TILE_DCS_HVSET)).isSuccess() ); + assert( (alg->setProperty("STATES", TILE_DCS_STATES)).isSuccess() ); + assert( (alg->setProperty("TileEMScale", TILE_TEST_EMS)).isSuccess() ); + assert( (alg->setProperty("TileDCS", TILE_TEST_DCS)).isSuccess() ); + + assert( (alg->setProperty("GoodDrawer", GOOD_DCS_STATE)).isSuccess() ); + assert( (alg->setProperty("WarningDrawer", WARNING_DCS_STATE)).isSuccess() ); + + assert( (alg->setProperty("DCSChHVInCOOL", TILE_DCS_CH_HV_IN_COOL)).isSuccess() ); + assert( (alg->setProperty("DCSChHVSETInCOOL", TILE_DCS_CH_HV_IN_COOL)).isSuccess() ); + assert( (alg->setProperty("DCSChStatesInCOOL", TILE_DCS_CH_STATES_IN_COOL)).isSuccess() ); + + assert( (alg->initialize()).isSuccess() ); + TileCablingSvc::set_cabling_type(TileCablingService::RUN2aCabling); + + //assert(alg->setProperty("OutputLevel", 1)); // 1 == VERBOSE + + assert( (alg->initialize()).isSuccess() ); + + TileCablingService* cabling = TileCablingService::getInstance(); + std::cout << "Tile cabling type: " << cabling->getCablingType() << std::endl; + + prepareDCSHVFolder(); + prepareDCSHVSetFolder(); + prepareDCSStatesFolder(); + prepareEms(); + + assert( (alg->execute()).isSuccess() ); + + + SG::ReadCondHandleKey<TileDCSState> dcsStateKey{TILE_TEST_DCS}; + assert( dcsStateKey.initialize().isSuccess() ); + + SG::ReadCondHandle<TileDCSState> dcsState{dcsStateKey}; + assert( dcsState.isValid() ); + + assert(dcsState->getDrawerStates(ROS, GOOD_DRAWER) == GOOD_DCS_STATE); + assert(dcsState->getDCSStatus(ROS, GOOD_DRAWER) == TileDCSState::OK_DRAWER); + + assert(dcsState->getDrawerStates(ROS, WARNING_DRAWER) == WARNING1_DCS_STATE); + assert(dcsState->getDCSStatus(ROS, WARNING_DRAWER) == TileDCSState::WARNING_DRAWER); + + assert(dcsState->getDrawerStates(ROS, BAD_DRAWER) == BAD_DCS_STATE); + assert(dcsState->getDCSStatus(ROS, BAD_DRAWER) == TileDCSState::ALERT_DRAWER); + + + for (unsigned int channel = 0; channel < TileCalibUtils::MAX_CHAN; ++channel) { + + float channelHV(getChannelHV(ROS, WARNING_DRAWER, channel)); + assert(Athena_test::isEqual(dcsState->getChannelHV(ROS, WARNING_DRAWER, channel), channelHV)); + + channelHV = getChannelHV(ROS, BAD_DRAWER, channel); + assert(Athena_test::isEqual(dcsState->getChannelHV(ROS, BAD_DRAWER, channel), channelHV)); + + channelHV = getChannelHV(ROS, GOOD_DRAWER, channel); + assert(Athena_test::isEqual(dcsState->getChannelHV(ROS, GOOD_DRAWER, channel), channelHV)); + + + float hvShift(0.0F); + if (channel == WARNING_CHANNEL) { + hvShift = WARNING_HV_SHIFT; + } else if (channel == BAD_CHANNEL) { + hvShift = BAD_HV_SHIFT; + } + + float channelHVSet(getChannelHVSet(ROS, GOOD_DRAWER, channel) - hvShift); + assert(Athena_test::isEqual(dcsState->getChannelHVSet(ROS, GOOD_DRAWER, channel), channelHVSet)); + + channelHVSet = getChannelHVSet(ROS, WARNING_DRAWER, channel) - hvShift; + assert(Athena_test::isEqual(dcsState->getChannelHVSet(ROS, WARNING_DRAWER, channel), channelHVSet)); + + channelHVSet = getChannelHVSet(ROS, BAD_DRAWER, channel) - hvShift; + assert(Athena_test::isEqual(dcsState->getChannelHVSet(ROS, BAD_DRAWER, channel), channelHVSet)); + + + if (cabling->channel2hole(ROS, channel) > 0) { + assert(dcsState->getDCSStatus(ROS, WARNING_DRAWER, channel) == TileDCSState::WARNING_DRAWER); + assert(dcsState->getDCSStatus(ROS, BAD_DRAWER, channel) == TileDCSState::ALERT_DRAWER); + + if (channel == WARNING_CHANNEL) { + assert(dcsState->getDCSHVStatus(ROS, GOOD_DRAWER, channel) == TileDCSState::WARNING); + assert(dcsState->getDCSStatus(ROS, GOOD_DRAWER, channel) == TileDCSState::WARNING); + assert(!dcsState->isStatusBad(ROS, GOOD_DRAWER, channel)); + + assert(dcsState->getDCSHVStatus(ROS, WARNING_DRAWER, channel) == TileDCSState::WARNING); + assert(dcsState->getDCSHVStatus(ROS, BAD_DRAWER, channel) == TileDCSState::WARNING); + + } else if(channel == BAD_CHANNEL) { + assert(dcsState->getDCSHVStatus(ROS, GOOD_DRAWER, channel) == TileDCSState::ALERT); + assert(dcsState->getDCSStatus(ROS, GOOD_DRAWER, channel) == TileDCSState::ALERT); + assert(dcsState->isStatusBad(ROS, GOOD_DRAWER, channel)); + + assert(dcsState->getDCSHVStatus(ROS, WARNING_DRAWER, channel) == TileDCSState::ALERT); + assert(dcsState->getDCSHVStatus(ROS, BAD_DRAWER, channel) == TileDCSState::ALERT); + + } else { + assert(dcsState->getDCSHVStatus(ROS, GOOD_DRAWER, channel) == TileDCSState::OK); + assert(dcsState->getDCSStatus(ROS, GOOD_DRAWER, channel) == TileDCSState::OK); + + assert(dcsState->getDCSHVStatus(ROS, WARNING_DRAWER, channel) == TileDCSState::OK); + assert(dcsState->getDCSHVStatus(ROS, BAD_DRAWER, channel) == TileDCSState::OK); + + assert(!dcsState->isStatusBad(ROS, GOOD_DRAWER, channel)); + } + + assert(!dcsState->isStatusBad(ROS, WARNING_DRAWER, channel)); + assert(dcsState->isStatusBad(ROS, BAD_DRAWER, channel)); + + } else { + assert(dcsState->getDCSStatus(ROS, WARNING_DRAWER, channel) == TileDCSState::NON_EXISTING); + assert(dcsState->getDCSStatus(ROS, BAD_DRAWER, channel) == TileDCSState::NON_EXISTING); + assert(dcsState->getDCSStatus(ROS, GOOD_DRAWER, channel) == TileDCSState::NON_EXISTING); + + assert(!dcsState->isStatusBad(ROS, WARNING_DRAWER, channel)); + assert(!dcsState->isStatusBad(ROS, BAD_DRAWER, channel)); + assert(!dcsState->isStatusBad(ROS, GOOD_DRAWER, channel)); + + assert(dcsState->getDCSHVStatus(ROS, WARNING_DRAWER, channel) == TileDCSState::NON_EXISTING); + assert(dcsState->getDCSHVStatus(ROS, BAD_DRAWER, channel) == TileDCSState::NON_EXISTING); + assert(dcsState->getDCSHVStatus(ROS, GOOD_DRAWER, channel) == TileDCSState::NON_EXISTING); + + } + + if (channel == BAD_CHANNEL) { + assert(dcsState->isStatusHVBad(ROS, GOOD_DRAWER, channel)); + assert(dcsState->isStatusHVBad(ROS, WARNING_DRAWER, channel)); + assert(dcsState->isStatusHVBad(ROS, BAD_DRAWER, channel)); + } else { + assert(!dcsState->isStatusHVBad(ROS, GOOD_DRAWER, channel)); + assert(!dcsState->isStatusHVBad(ROS, WARNING_DRAWER, channel)); + assert(!dcsState->isStatusHVBad(ROS, BAD_DRAWER, channel)); + } + + } + + for (unsigned int ros = 1; ros < TileCalibUtils::MAX_ROS; ++ros) { + for (unsigned int drawer = 0; drawer < TileCalibUtils::MAX_DRAWER; ++drawer) { + + if (ros == ROS && (drawer == GOOD_DRAWER || drawer == WARNING_DRAWER || drawer == BAD_DRAWER)) { + continue; + } + + assert(dcsState->getDrawerStates(ros, drawer) < 0); + assert(dcsState->getDCSStatus(ros, drawer) == TileDCSState::UNKNOWN); + assert(!dcsState->isStatusBad(ros, drawer)); + + for (unsigned int channel = 0; channel < TileCalibUtils::MAX_CHAN; ++channel) { + + assert(dcsState->getChannelHV(ros, drawer, channel) < 0); + assert(dcsState->getChannelHVSet(ros, drawer, channel) == 0); + + bool isChannelUsed(cabling->channel2hole(ros, channel) > 0); + + if ((ros == 3 && drawer == 14) || (ros == 4 && drawer == 17)) { + if (channel < 4) isChannelUsed = false; + else if (channel == 18 || channel == 19) isChannelUsed = true; + } + + if (ros > 2 && !cabling->C10_connected(drawer) && channel == 4) { + isChannelUsed = false; + } + + if (isChannelUsed) { + assert(dcsState->getDCSStatus(ros, drawer, channel) == TileDCSState::UNKNOWN); + } else { + assert(dcsState->getDCSStatus(ros, drawer, channel) == TileDCSState::NON_EXISTING); + } + + assert(!dcsState->isStatusBad(ros, drawer, channel)); + assert(!dcsState->isStatusHVBad(ros, drawer, channel)); + } + } + } + + + + +} + + + +void testTileDCSTool(ISvcLocator* svcLoc) { + + std::cout << "\nTest TileDCSTool\n"; + + + std::unique_ptr<DummyAlgorithm> alg = std::make_unique<DummyAlgorithm>("DummyAlgorithm", svcLoc); + alg->addRef(); + + std::unique_ptr<TileDCSTool> tool = std::make_unique<TileDCSTool>("TileDCSTool", + "TileDCSToolTest", + alg.get()); + tool->addRef(); + + + { + + SG::WriteCondHandleKey<TileDCSState> dcsStateKey{TILE_TEST_TOOL_DCS}; + assert(dcsStateKey.initialize().isSuccess()); + + SG::WriteCondHandle<TileDCSState> dcsState{dcsStateKey}; + std::unique_ptr<TileDCSState> dcsData = getDCSState(); + assert(dcsState.record(EVENT_RANGE, dcsData.release()).isSuccess()); + + } + + assert(tool->setProperty("TileDCS", TILE_TEST_TOOL_DCS)); + assert(tool->initialize().isSuccess()); + + checkDCSState(tool.get()); + +} + + + +int main() { + + std::ofstream jo(TILE_JO_NAME); + jo << "ApplicationMgr.ExtSvc += { \"StoreGateSvc/DetectorStore\", \"StoreGateSvc/ConditionStore\" };" << std::endl; + jo.close(); + + + ISvcLocator* svcLoc; + if (!Athena_test::initGaudi(TILE_JO_NAME, svcLoc)) { + std::cerr << "ERROR This test can not be run, can not get ServiceLocator" << std::endl; + } + + + IdDictParser parser; + TileCablingSvc::init_idhelpers (parser); + + ServiceHandle<StoreGateSvc> conditionStore("ConditionStore", ""); + assert(conditionStore.retrieve().isSuccess()); + + EventIDBase eventId; + eventId.set_run_number(EventIDBase::UNDEFNUM / 4); + eventId.set_lumi_block(EventIDBase::UNDEFNUM / 4); + + EventContext ctx; + ctx.setEventID(eventId); + ctx.setExtension( Atlas::ExtendedEventContext(&*conditionStore) ); + Gaudi::Hive::setCurrentContext(ctx); + + + testTileDCSState(); + testTileDCSCondAlg(svcLoc); + testTileDCSTool(svcLoc); + + return 0; +} diff --git a/TileCalorimeter/TileConditions/test/TileEMScaleComponents_test.cxx b/TileCalorimeter/TileConditions/test/TileEMScaleComponents_test.cxx new file mode 100644 index 0000000000000000000000000000000000000000..b72e34ce3f0dd5bab0ede035ebd791e6cfb4f980 --- /dev/null +++ b/TileCalorimeter/TileConditions/test/TileEMScaleComponents_test.cxx @@ -0,0 +1,559 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#undef NDEBUG + +// Tile includes +#include "TileCalibBlobObjs/TileCalibDrawerFlt.h" +#include "TileConditions/TileCalibData.h" +#include "TileConditions/TileEMScale.h" +#include "src/TileEMScaleCondAlg.h" +#include "TileConditions/TileCondToolEmscale.h" +#include "TileCablingService_common_test.cxx" + +#include "CaloIdentifier/CaloLVL1_ID.h" + +#include "TestTools/FLOATassert.h" +#include "TestTools/initGaudi.h" + +#include "AthenaBaseComps/AthAlgorithm.h" +#include "AthenaBaseComps/AthAlgTool.h" + +#include "StoreGate/StoreGateSvc.h" +#include "StoreGate/SGtests.h" +#include "StoreGate/ReadCondHandleKey.h" +#include "StoreGate/ReadCondHandle.h" +#include "StoreGate/WriteCondHandleKey.h" +#include "StoreGate/WriteCondHandle.h" + +#include "GaudiKernel/ISvcLocator.h" +#include "GaudiKernel/EventIDRange.h" + +#include "CoralBase/Blob.h" + +#include <algorithm> +#include <cassert> +#include <iostream> +#include <fstream> +#include <string> +#include <vector> +#include <memory> + +static const std::string TILE_JO_NAME("jobOptions_TileCalibEmsTest.py"); +static const std::string TILE_TEST_EMS("TileEMS_Test"); +static const std::string TILE_TEST_ALG_EMS("TileEMS_AlgTest"); +static const unsigned int OBJ_VERSION(1); +static const unsigned int DEF_DRAWER_IDX(0); +static const unsigned int MAX_CHANNEL(1); + +static const unsigned int DRAWER_IDX(20); +static const unsigned int CHANNEL(0); +static const unsigned int ADC(0); + + +static const float AMPLITUDE(5.0F); + +static const float ONL_CIS(1.05F); +static const float ONL_LAS(1.005F); +static const float ONL_CES(1.0005F); +static const float ONL_EMS(1.00005F); + +static const float OFL_CIS(1.1F); +static const float OFL_LAS(1.01F); +static const float OFL_CES(1.001F); +static const float OFL_EMS(1.0001F); + +static const float CES_REF_LAS(1.5F); +static const float CES_REF_HV(650.0F); +static const float CES_REF_TEMP(20.5F); + + +static const std::vector<std::vector<float>> ONL_CIS_DEF{{ONL_CIS}}; +static const std::vector<std::vector<float>> ONL_LAS_DEF{{ONL_LAS}}; +static const std::vector<std::vector<float>> ONL_CES_DEF{{ONL_CES}}; +static const std::vector<std::vector<float>> ONL_EMS_DEF{{ONL_EMS}}; + +static const std::vector<std::vector<float>> OFL_CIS_LIN{{OFL_CIS}}; +static const std::vector<std::vector<float>> OFL_CIS_NLN{{0.0F, 1000.0F, 0.0F, 1100.0F}}; +static const std::vector<std::vector<float>> OFL_LAS_LIN{{OFL_LAS}}; +static const std::vector<std::vector<float>> OFL_LAS_NLN{{0.0F, 1000.0F, 0.0F, 1200.0F}}; +static const std::vector<std::vector<float>> OFL_CES_FULL{ + {OFL_CES, CES_REF_LAS, CES_REF_HV, CES_REF_TEMP} +}; +static const std::vector<std::vector<float>> OFL_EMS_DEF{{OFL_EMS}}; + + + +static const EventIDRange EVENT_RANGE { + EventIDBase{ + EventIDBase::UNDEFNUM / 8, // Run number + EventIDBase::UNDEFEVT, + EventIDBase::UNDEFNUM, + EventIDBase::UNDEFNUM, + EventIDBase::UNDEFNUM / 8}, // Lumi block + + EventIDBase{ + EventIDBase::UNDEFNUM / 2, // Run number + EventIDBase::UNDEFEVT, + EventIDBase::UNDEFNUM, + EventIDBase::UNDEFNUM, + EventIDBase::UNDEFNUM / 2} // Lumi block +}; + + + +/** Class provides dummy algorithm + * to help construct Tool to be tested. + */ +class DummyAlgorithm: public AthAlgorithm { + public: + DummyAlgorithm(const std::string& name, ISvcLocator* svcloc) + : AthAlgorithm(name, svcloc) { + + } + + virtual StatusCode execute() override { + return StatusCode::SUCCESS; + } +}; + + +void prepareCalibData(TileCalibDataFlt& calibData, + const std::vector<std::vector<float>>& defaultData, + unsigned int version = 100) { + + std::unique_ptr<coral::Blob> defaultBlob = std::make_unique<coral::Blob>(0); + std::unique_ptr<TileCalibDrawerFlt> tmpCalibDrawer(TileCalibDrawerFlt::getInstance(*defaultBlob, defaultData, MAX_CHANNEL, version)); + // Trick to make calib drawer to copy and own blob + std::unique_ptr<TileCalibDrawerFlt> defaultCalibDrawer = std::make_unique<TileCalibDrawerFlt>(*tmpCalibDrawer); + + calibData.setCalibDrawer(DEF_DRAWER_IDX, defaultCalibDrawer.release()); + + for (unsigned int drawerIdx = 1; drawerIdx < TileCalibUtils::MAX_DRAWERIDX; ++drawerIdx) { + unsigned int defaultDrawerIdx = TileCalibUtils::getDefaultDrawerIdx(drawerIdx); + calibData.setCalibDrawer(drawerIdx, calibData.getCalibDrawer(defaultDrawerIdx)); + } + +} + +std::unique_ptr<TileCalibDataFlt> getCalibData(const std::vector<std::vector<float>>& defaultData, unsigned int version = 100) { + + std::unique_ptr<TileCalibDataFlt> calibData = std::make_unique<TileCalibDataFlt>(); + prepareCalibData(*calibData, defaultData, version); + + return calibData; + +} + + +std::unique_ptr<TileCalibDataFlt> getCalibData(float value) { + std::vector<std::vector<float>> defaultData{{value}}; + return getCalibData(defaultData, 1); +} + + +std::unique_ptr<TileEMScale> getCalibEms() { + + // Initialize TileCalibEms + std::unique_ptr<TileEMScale> emScale = std::make_unique<TileEMScale>(); + unsigned int cesVersion(1); + + emScale->setCalibOnlCis(getCalibData(ONL_CIS)); + emScale->setCalibOnlLas(getCalibData(ONL_LAS)); + emScale->setCalibOnlCes(getCalibData(ONL_CES)); + emScale->setCalibOnlEms(getCalibData(ONL_EMS)); + + emScale->setCalibOflCisLin(getCalibData(OFL_CIS)); + emScale->setCalibOflLasLin(getCalibData(OFL_LAS)); + emScale->setCalibOflCes(getCalibData(OFL_CES_FULL, cesVersion)); + emScale->setCalibOflEms(getCalibData(OFL_EMS)); + + emScale->setCalibOflCisNln(getCalibData(OFL_CIS_NLN)); + emScale->setCalibOflLasNln(getCalibData(OFL_LAS_NLN)); + + emScale->setOnlineCacheUnit(TileRawChannelUnit::OnlineMegaElectronVolts); + emScale->setMaxChannels(48); + emScale->setMaxGains(2); + assert(emScale->initialize()); + + return emScale; +} + + + +template<class T = TileCalibDrawerFlt, + const std::vector<std::vector<float>>* CALIBRATIONS_DEF = &ONL_CIS_DEF, + unsigned int VERSION = 1 > +class TileCondProxyMock: public AthAlgTool, virtual public ITileCondProxy<T> { + public: + + TileCondProxyMock(const std::string& type, const std::string& name, const IInterface* parent) + :AthAlgTool(type, name, parent) + { + declareInterface<ITileCondProxy<T> >(this); + }; + + virtual ~TileCondProxyMock() {}; + + virtual StatusCode fillCalibData(TileCalibData<T>& calibData, EventIDRange& eventRange) const override { + + prepareCalibData(calibData, *CALIBRATIONS_DEF, VERSION); + eventRange = EVENT_RANGE; + + return StatusCode::SUCCESS; + }; + + StatusCode initialize() { + return StatusCode::SUCCESS; + }; + + StatusCode finalize() { + return StatusCode::SUCCESS; + }; + + const T* getCalibDrawer(unsigned int /*drawerIdx*/ ) const { return nullptr;}; + +}; + + +// Online proxies +typedef TileCondProxyMock<TileCalibDrawerFlt, &ONL_CIS_DEF> TileCondProxyOnlCisMock; +DECLARE_COMPONENT_WITH_ID( TileCondProxyOnlCisMock, "TileCondProxyOnlCisMock" ) + +typedef TileCondProxyMock<TileCalibDrawerFlt, &ONL_LAS_DEF> TileCondProxyOnlLasMock; +DECLARE_COMPONENT_WITH_ID( TileCondProxyOnlLasMock, "TileCondProxyOnlLasMock" ) + +typedef TileCondProxyMock<TileCalibDrawerFlt, &ONL_CES_DEF> TileCondProxyOnlCesMock; +DECLARE_COMPONENT_WITH_ID( TileCondProxyOnlCesMock, "TileCondProxyOnlCesMock" ) + +typedef TileCondProxyMock<TileCalibDrawerFlt, &ONL_EMS_DEF> TileCondProxyOnlEmsMock; +DECLARE_COMPONENT_WITH_ID( TileCondProxyOnlEmsMock, "TileCondProxyOnlEmsMock" ) + +// Offline proxies +typedef TileCondProxyMock<TileCalibDrawerFlt, &OFL_CIS_LIN> TileCondProxyOflCisLinMock; +DECLARE_COMPONENT_WITH_ID( TileCondProxyOflCisLinMock, "TileCondProxyOflCisLinMock" ) + +typedef TileCondProxyMock<TileCalibDrawerFlt, &OFL_CIS_NLN, 100U> TileCondProxyOflCisNlnMock; +DECLARE_COMPONENT_WITH_ID( TileCondProxyOflCisNlnMock, "TileCondProxyOflCisNlnMock" ) + +typedef TileCondProxyMock<TileCalibDrawerFlt, &OFL_LAS_LIN> TileCondProxyOflLasLinMock; +DECLARE_COMPONENT_WITH_ID( TileCondProxyOflLasLinMock, "TileCondProxyOflLasLinMock" ) + +typedef TileCondProxyMock<TileCalibDrawerFlt, &OFL_LAS_NLN, 100U> TileCondProxyOflLasNlnMock; +DECLARE_COMPONENT_WITH_ID( TileCondProxyOflLasNlnMock, "TileCondProxyOflLasNlnMock" ) + +typedef TileCondProxyMock<TileCalibDrawerFlt, &OFL_CES_FULL> TileCondProxyOflCesMock; +DECLARE_COMPONENT_WITH_ID( TileCondProxyOflCesMock, "TileCondProxyOflCesMock" ) + +typedef TileCondProxyMock<TileCalibDrawerFlt, &OFL_EMS_DEF> TileCondProxyOflEmsMock; +DECLARE_COMPONENT_WITH_ID( TileCondProxyOflEmsMock, "TileCondProxyOflEmsMock" ) + + + +void checkEMScale(const TileEMScale* emScale) { + + // Test online calibration + assert(Athena_test::isEqual(emScale->applyOnlineChargeCalibration(DRAWER_IDX, CHANNEL, ADC, AMPLITUDE), (AMPLITUDE / ONL_CIS), 1E-5)); + assert(Athena_test::isEqual(emScale->applyOnlineLaserCalibration(DRAWER_IDX, CHANNEL, AMPLITUDE), (AMPLITUDE / ONL_LAS), 1E-5)); + assert(Athena_test::isEqual(emScale->applyOnlineCesiumCalibration(DRAWER_IDX, CHANNEL, AMPLITUDE), (AMPLITUDE / ONL_CES), 1E-5)); + assert(Athena_test::isEqual(emScale->applyOnlineEMScaleCalibration(DRAWER_IDX, CHANNEL, AMPLITUDE), (AMPLITUDE / ONL_EMS), 1E-5)); + + const float onlAdcAmplitude(emScale->calibrateOnlineChannel(DRAWER_IDX, CHANNEL, ADC, AMPLITUDE, + TileRawChannelUnit::OnlineADCcounts)); + assert(Athena_test::isEqual(onlAdcAmplitude, AMPLITUDE)); + + const float onlPicoCoulombsAmplitude(emScale->calibrateOnlineChannel(DRAWER_IDX, CHANNEL, ADC, AMPLITUDE, + TileRawChannelUnit::OnlinePicoCoulombs)); + assert(Athena_test::isEqual(onlPicoCoulombsAmplitude, AMPLITUDE / ONL_CIS, 1E-5)); + + const float onlCesPicoCoulombsAmplitude(emScale->calibrateOnlineChannel(DRAWER_IDX, CHANNEL, ADC, AMPLITUDE, + TileRawChannelUnit::OnlineCesiumPicoCoulombs)); + assert(Athena_test::isEqual(onlCesPicoCoulombsAmplitude, AMPLITUDE / (ONL_CIS * ONL_LAS * ONL_CES), 1E-5)); + + + const float onlMevAmplitude(emScale->calibrateOnlineChannel(DRAWER_IDX, CHANNEL, ADC, AMPLITUDE, + TileRawChannelUnit::OnlineMegaElectronVolts)); + assert(Athena_test::isEqual(onlMevAmplitude, AMPLITUDE / (ONL_CIS * ONL_LAS * ONL_CES * ONL_EMS), 1E-5)); + + + // Test offline calibration + assert(Athena_test::isEqual(emScale->applyCesiumCalibration(DRAWER_IDX, CHANNEL, AMPLITUDE), (AMPLITUDE / OFL_CES), 1E-5)); + assert(Athena_test::isEqual(emScale->applyEMScaleCalibration(DRAWER_IDX, CHANNEL, AMPLITUDE), (AMPLITUDE / OFL_EMS), 1E-5)); + + assert(Athena_test::isEqual(emScale->undoOnlineChannelCalibration(DRAWER_IDX, CHANNEL, ADC, onlAdcAmplitude, + TileRawChannelUnit::OnlineADCcounts), AMPLITUDE, 1E-5)); + + assert(Athena_test::isEqual(emScale->undoOnlineChannelCalibration(DRAWER_IDX, CHANNEL, ADC, onlPicoCoulombsAmplitude, + TileRawChannelUnit::OnlinePicoCoulombs), AMPLITUDE, 1E-5)); + + assert(Athena_test::isEqual(emScale->undoOnlineChannelCalibration(DRAWER_IDX, CHANNEL, ADC, onlCesPicoCoulombsAmplitude, + TileRawChannelUnit::OnlineCesiumPicoCoulombs), AMPLITUDE, 1E-5)); + + assert(Athena_test::isEqual(emScale->undoOnlineChannelCalibration(DRAWER_IDX, CHANNEL, ADC, onlMevAmplitude, + TileRawChannelUnit::OnlineMegaElectronVolts), AMPLITUDE, 1E-5)); + + + const float adcAmplitude(emScale->calibrateChannel(DRAWER_IDX, CHANNEL, ADC, AMPLITUDE, + TileRawChannelUnit::OnlineADCcounts, + TileRawChannelUnit::ADCcounts)); + assert(Athena_test::isEqual(adcAmplitude, AMPLITUDE)); + + + const float nlnCis((OFL_CIS_NLN[0][3] - OFL_CIS_NLN[0][2]) / (OFL_CIS_NLN[0][1] - OFL_CIS_NLN[0][0])); + const float nlnLas((OFL_LAS_NLN[0][3] - OFL_LAS_NLN[0][2]) / (OFL_LAS_NLN[0][1] - OFL_LAS_NLN[0][0])); + + const float picoCoulombsAmplitude(emScale->calibrateChannel(DRAWER_IDX, CHANNEL, ADC, onlPicoCoulombsAmplitude, + TileRawChannelUnit::OnlinePicoCoulombs, + TileRawChannelUnit::PicoCoulombs)); + assert(Athena_test::isEqual(picoCoulombsAmplitude, (AMPLITUDE / OFL_CIS) * nlnCis, 1E-5)); + + const float cesPicoCoulombsAmplitude(emScale->calibrateChannel(DRAWER_IDX, CHANNEL, ADC, onlCesPicoCoulombsAmplitude, + TileRawChannelUnit::OnlineCesiumPicoCoulombs, + TileRawChannelUnit::CesiumPicoCoulombs)); + assert(Athena_test::isEqual(cesPicoCoulombsAmplitude, + (AMPLITUDE / OFL_CIS / OFL_LAS / OFL_CES) * nlnCis * nlnLas, 1E-5)); + + const float mevAmplitude(emScale->calibrateChannel(DRAWER_IDX, CHANNEL, ADC, onlMevAmplitude, + TileRawChannelUnit::OnlineMegaElectronVolts, + TileRawChannelUnit::MegaElectronVolts)); + assert(Athena_test::isEqual(mevAmplitude, + (AMPLITUDE / OFL_CIS / OFL_LAS / OFL_CES / OFL_EMS) * nlnCis * nlnLas, 1E-5)); + + assert(Athena_test::isEqual(emScale->getCesiumReferenceLaserGain(DRAWER_IDX, CHANNEL, ADC), CES_REF_LAS)); + assert(Athena_test::isEqual(emScale->getCesiumReferenceHV(DRAWER_IDX, CHANNEL), CES_REF_HV)); + assert(Athena_test::isEqual(emScale->getCesiumReferenceTemperature(DRAWER_IDX, CHANNEL), CES_REF_TEMP)); + +} + + +void checkEMScaleTool(const TileCondToolEmscale* emScaleTool) { + + // Test online calibration + assert(Athena_test::isEqual(emScaleTool->doCalibCisOnl(DRAWER_IDX, CHANNEL, ADC, AMPLITUDE), (AMPLITUDE / ONL_CIS), 1E-5)); + assert(Athena_test::isEqual(emScaleTool->doCalibLasOnl(DRAWER_IDX, CHANNEL, AMPLITUDE), (AMPLITUDE / ONL_LAS), 1E-5)); + assert(Athena_test::isEqual(emScaleTool->doCalibCesOnl(DRAWER_IDX, CHANNEL, AMPLITUDE), (AMPLITUDE / ONL_CES), 1E-5)); + assert(Athena_test::isEqual(emScaleTool->doCalibEmsOnl(DRAWER_IDX, CHANNEL, AMPLITUDE), (AMPLITUDE / ONL_EMS), 1E-5)); + + const float onlAdcAmplitude(emScaleTool->channelCalibOnl(DRAWER_IDX, CHANNEL, ADC, AMPLITUDE, + TileRawChannelUnit::OnlineADCcounts)); + assert(Athena_test::isEqual(onlAdcAmplitude, AMPLITUDE)); + + const float onlPicoCoulombsAmplitude(emScaleTool->channelCalibOnl(DRAWER_IDX, CHANNEL, ADC, AMPLITUDE, + TileRawChannelUnit::OnlinePicoCoulombs)); + assert(Athena_test::isEqual(onlPicoCoulombsAmplitude, AMPLITUDE / ONL_CIS, 1E-5)); + + const float onlCesPicoCoulombsAmplitude(emScaleTool->channelCalibOnl(DRAWER_IDX, CHANNEL, ADC, AMPLITUDE, + TileRawChannelUnit::OnlineCesiumPicoCoulombs)); + assert(Athena_test::isEqual(onlCesPicoCoulombsAmplitude, AMPLITUDE / (ONL_CIS * ONL_LAS * ONL_CES), 1E-5)); + + + const float onlMevAmplitude(emScaleTool->channelCalibOnl(DRAWER_IDX, CHANNEL, ADC, AMPLITUDE, + TileRawChannelUnit::OnlineMegaElectronVolts)); + assert(Athena_test::isEqual(onlMevAmplitude, AMPLITUDE / (ONL_CIS * ONL_LAS * ONL_CES * ONL_EMS), 1E-5)); + + + // Test offline calibration + assert(Athena_test::isEqual(emScaleTool->doCalibCes(DRAWER_IDX, CHANNEL, AMPLITUDE), (AMPLITUDE / OFL_CES), 1E-5)); + assert(Athena_test::isEqual(emScaleTool->doCalibEms(DRAWER_IDX, CHANNEL, AMPLITUDE), (AMPLITUDE / OFL_EMS), 1E-5)); + + assert(Athena_test::isEqual(emScaleTool->undoOnlCalib(DRAWER_IDX, CHANNEL, ADC, onlAdcAmplitude, + TileRawChannelUnit::OnlineADCcounts), AMPLITUDE, 1E-5)); + + assert(Athena_test::isEqual(emScaleTool->undoOnlCalib(DRAWER_IDX, CHANNEL, ADC, onlPicoCoulombsAmplitude, + TileRawChannelUnit::OnlinePicoCoulombs), AMPLITUDE, 1E-5)); + + assert(Athena_test::isEqual(emScaleTool->undoOnlCalib(DRAWER_IDX, CHANNEL, ADC, onlCesPicoCoulombsAmplitude, + TileRawChannelUnit::OnlineCesiumPicoCoulombs), AMPLITUDE, 1E-5)); + + assert(Athena_test::isEqual(emScaleTool->undoOnlCalib(DRAWER_IDX, CHANNEL, ADC, onlMevAmplitude, + TileRawChannelUnit::OnlineMegaElectronVolts), AMPLITUDE, 1E-5)); + + + const float adcAmplitude(emScaleTool->channelCalib(DRAWER_IDX, CHANNEL, ADC, AMPLITUDE, + TileRawChannelUnit::OnlineADCcounts, + TileRawChannelUnit::ADCcounts)); + assert(Athena_test::isEqual(adcAmplitude, AMPLITUDE)); + + + const float nlnCis((OFL_CIS_NLN[0][3] - OFL_CIS_NLN[0][2]) / (OFL_CIS_NLN[0][1] - OFL_CIS_NLN[0][0])); + const float nlnLas((OFL_LAS_NLN[0][3] - OFL_LAS_NLN[0][2]) / (OFL_LAS_NLN[0][1] - OFL_LAS_NLN[0][0])); + + const float picoCoulombsAmplitude(emScaleTool->channelCalib(DRAWER_IDX, CHANNEL, ADC, onlPicoCoulombsAmplitude, + TileRawChannelUnit::OnlinePicoCoulombs, + TileRawChannelUnit::PicoCoulombs)); + assert(Athena_test::isEqual(picoCoulombsAmplitude, (AMPLITUDE / OFL_CIS) * nlnCis, 1E-5)); + + const float cesPicoCoulombsAmplitude(emScaleTool->channelCalib(DRAWER_IDX, CHANNEL, ADC, onlCesPicoCoulombsAmplitude, + TileRawChannelUnit::OnlineCesiumPicoCoulombs, + TileRawChannelUnit::CesiumPicoCoulombs)); + assert(Athena_test::isEqual(cesPicoCoulombsAmplitude, + (AMPLITUDE / OFL_CIS / OFL_LAS / OFL_CES) * nlnCis * nlnLas, 1E-5)); + + const float mevAmplitude(emScaleTool->channelCalib(DRAWER_IDX, CHANNEL, ADC, onlMevAmplitude, + TileRawChannelUnit::OnlineMegaElectronVolts, + TileRawChannelUnit::MegaElectronVolts)); + assert(Athena_test::isEqual(mevAmplitude, + (AMPLITUDE / OFL_CIS / OFL_LAS / OFL_CES / OFL_EMS) * nlnCis * nlnLas, 1E-5)); + + assert(Athena_test::isEqual(emScaleTool->getCesRefLas(DRAWER_IDX, CHANNEL, ADC), CES_REF_LAS)); + assert(Athena_test::isEqual(emScaleTool->getCesRefHv(DRAWER_IDX, CHANNEL), CES_REF_HV)); + assert(Athena_test::isEqual(emScaleTool->getCesRefTemp(DRAWER_IDX, CHANNEL), CES_REF_TEMP)); + +} + + + +void testTileCalibEms(void) { + + std::cout << "\nTest TileCalibEms\n"; + + std::unique_ptr<TileEMScale> emScale = getCalibEms(); + + std::cout << "" << std::endl; + std::cout << "ONL CIS: " << (1.0F / emScale->applyOnlineChargeCalibration(DRAWER_IDX, CHANNEL, ADC, 1.0F)) << std::endl; + std::cout << "ONL LAS: " << (1.0F / emScale->applyOnlineLaserCalibration(DRAWER_IDX, CHANNEL, 1.0F)) << std::endl; + std::cout << "ONL CES: " << (1.0F / emScale->applyOnlineCesiumCalibration(DRAWER_IDX, CHANNEL, 1.0F)) << std::endl; + std::cout << "ONL EMS: " << (1.0F / emScale->applyOnlineEMScaleCalibration(DRAWER_IDX, CHANNEL, 1.0F)) << std::endl; + + std::cout << std::endl; + + std::cout << "OFL CIS: " << (1.0F / emScale->applyChargLinearCalibration(DRAWER_IDX, CHANNEL, ADC, 1.0F)) << std::endl; + std::cout << "OFL CIS NLN [" << AMPLITUDE << "]: " + << (emScale->applyChargeNonLinearCalibration(DRAWER_IDX, CHANNEL, ADC, AMPLITUDE)) << std::endl; + + std::cout << "OFL LAS: " << (1.0F / emScale->applyLaserLinearCalibration(DRAWER_IDX, CHANNEL, 1.0F)) << std::endl; + std::cout << "OFL LAS NLN [" << AMPLITUDE << "]: " + << (emScale->applyLaserNonLinearCalibration(DRAWER_IDX, CHANNEL, AMPLITUDE)) << std::endl; + + std::cout << "OFL CES: " << (1.0F / emScale->applyCesiumCalibration(DRAWER_IDX, CHANNEL, 1.0F)) << std::endl; + std::cout << "OFL EMS: " << (1.0F / emScale->applyEMScaleCalibration(DRAWER_IDX, CHANNEL, 1.0F)) << std::endl; + std::cout << std::endl; + + checkEMScale(emScale.get()); + + assert(Athena_test::isEqual(emScale->applyChargLinearCalibration(DRAWER_IDX, CHANNEL, ADC, AMPLITUDE), (AMPLITUDE / OFL_CIS), 1E-5)); + assert(Athena_test::isEqual(emScale->applyLaserLinearCalibration(DRAWER_IDX, CHANNEL, AMPLITUDE), (AMPLITUDE / OFL_LAS), 1E-5)); + +} + + + +void testTileCalibEmsCondAlg(ISvcLocator* svcLoc) { + + std::cout << "\nTest TileCalibEmsCondAlg\n"; + + ServiceHandle<StoreGateSvc> detStore("DetectorStore", ""); + assert(detStore.retrieve().isSuccess()); + + std::unique_ptr<CaloLVL1_ID> caloLVL1_ID = std::make_unique<CaloLVL1_ID>(); + assert(detStore->record(caloLVL1_ID.release(), "CaloLVL1_ID").isSuccess()); + + + std::unique_ptr<TileEMScaleCondAlg> alg = std::make_unique<TileEMScaleCondAlg>("TileCalibEmsCondAlg", svcLoc); + alg->addRef(); + + assert( (alg->setProperty("OnlCisProxy", "TileCondProxyOnlCisMock")).isSuccess() ); + assert( (alg->setProperty("OnlLasProxy", "TileCondProxyOnlLasMock")).isSuccess() ); + assert( (alg->setProperty("OnlCesProxy", "TileCondProxyOnlCesMock")).isSuccess() ); + assert( (alg->setProperty("OnlEmsProxy", "TileCondProxyOnlEmsMock")).isSuccess() ); + + assert( (alg->setProperty("OflCisLinProxy", "TileCondProxyOflCisLinMock")).isSuccess() ); + assert( (alg->setProperty("OflCisNlnProxy", "TileCondProxyOflCisNlnMock")).isSuccess() ); + assert( (alg->setProperty("OflLasLinProxy", "TileCondProxyOflLasLinMock")).isSuccess() ); + assert( (alg->setProperty("OflLasNlnProxy", "TileCondProxyOflLasNlnMock")).isSuccess() ); + assert( (alg->setProperty("OflCesProxy", "TileCondProxyOflCesMock")).isSuccess() ); + assert( (alg->setProperty("OflEmsProxy", "TileCondProxyOflEmsMock")).isSuccess() ); + + assert( (alg->setProperty("OnlCacheUnit", "OnlineMegaElectronVolts")).isSuccess() ); + assert( (alg->setProperty("TileEMScale", TILE_TEST_ALG_EMS)).isSuccess() ); + assert( (alg->initialize()).isSuccess() ); + + assert( (alg->execute()).isSuccess() ); + + SG::ReadCondHandleKey<TileEMScale> emScaleKey{TILE_TEST_ALG_EMS}; + assert(emScaleKey.initialize().isSuccess()); + + SG::ReadCondHandle<TileEMScale> emScale{emScaleKey}; + assert(emScale.isValid()); + + EventIDRange eventRange; + emScale.range(eventRange); + + assert( eventRange == EVENT_RANGE); + + checkEMScale(emScale.retrieve()); + + assert(Athena_test::isEqual(emScale->applyChargLinearCalibration(DRAWER_IDX, CHANNEL, ADC, AMPLITUDE), (AMPLITUDE / OFL_CIS), 1E-5)); + assert(Athena_test::isEqual(emScale->applyLaserLinearCalibration(DRAWER_IDX, CHANNEL, AMPLITUDE), (AMPLITUDE / OFL_LAS), 1E-5)); + +} + + + +void testTileCondToolEmscale(ISvcLocator* svcLoc) { + + std::cout << "\nTest TileCondToolEmscale\n"; + + { + SG::WriteCondHandleKey<TileEMScale> emScaleKey{TILE_TEST_EMS}; + assert(emScaleKey.initialize().isSuccess()); + + SG::WriteCondHandle<TileEMScale> emScale{emScaleKey}; + std::unique_ptr<TileEMScale> calibData = getCalibEms(); + assert(emScale.record(EVENT_RANGE, calibData.release()).isSuccess()); + } + + std::unique_ptr<DummyAlgorithm> alg = std::make_unique<DummyAlgorithm>("DummyAlgorithm", svcLoc); + alg->addRef(); + + std::unique_ptr<TileCondToolEmscale> toolEmscale + = std::make_unique<TileCondToolEmscale>("TileCondToolEmscale", + "TileCondToolEmscaleTest", + alg.get()); + toolEmscale->addRef(); + + assert(toolEmscale->setProperty("TileEMScale", TILE_TEST_EMS)); + assert(toolEmscale->initialize().isSuccess()); + + + checkEMScaleTool(toolEmscale.get()); + + +} + + +int main() { + + + std::ofstream jo(TILE_JO_NAME); + jo << "ApplicationMgr.ExtSvc += {\"StoreGateSvc/DetectorStore\", \"StoreGateSvc/ConditionStore\" };" << std::endl; + jo.close(); + + ISvcLocator* svcLoc; + if (!Athena_test::initGaudi(TILE_JO_NAME, svcLoc)) { + std::cerr << "ERROR This test can not be run, can not get ServiceLocator" << std::endl; + } + + IdDictParser parser; + TileCablingSvc::init_idhelpers (parser); + + ServiceHandle<StoreGateSvc> conditionStore("ConditionStore", ""); + assert(conditionStore.retrieve().isSuccess()); + + EventIDBase eventId; + eventId.set_run_number(EventIDBase::UNDEFNUM / 4); + eventId.set_lumi_block(EventIDBase::UNDEFNUM / 4); + + EventContext ctx; + ctx.setEventID(eventId); + ctx.setExtension( Atlas::ExtendedEventContext(&*conditionStore) ); + Gaudi::Hive::setCurrentContext(ctx); + + + testTileCalibEms(); + testTileCalibEmsCondAlg(svcLoc); + testTileCondToolEmscale(svcLoc); + + return 0; +} diff --git a/TileCalorimeter/TileConditions/test/TileNoiseTools_test.cxx b/TileCalorimeter/TileConditions/test/TileNoiseTools_test.cxx new file mode 100644 index 0000000000000000000000000000000000000000..a732e190149233d8e07628b561af89e098708100 --- /dev/null +++ b/TileCalorimeter/TileConditions/test/TileNoiseTools_test.cxx @@ -0,0 +1,397 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#undef NDEBUG + +// Tile includes +#include "TileCalibBlobObjs/TileCalibDrawerFlt.h" +#include "TileConditions/TileCalibData.h" +#include "TileConditions/TileEMScale.h" +#include "TileConditions/TileCondToolNoiseSample.h" +#include "TileConditions/TileCondToolNoiseRawChn.h" + +#include "TestTools/FLOATassert.h" +#include "TestTools/initGaudi.h" + +#include "AthenaBaseComps/AthAlgorithm.h" +#include "AthenaBaseComps/AthAlgTool.h" + +#include "StoreGate/StoreGateSvc.h" +#include "StoreGate/SGtests.h" +#include "StoreGate/ReadCondHandleKey.h" +#include "StoreGate/ReadCondHandle.h" +#include "StoreGate/WriteCondHandleKey.h" +#include "StoreGate/WriteCondHandle.h" + + +#include "GaudiKernel/ISvcLocator.h" +#include "GaudiKernel/EventIDRange.h" + + +#include <algorithm> +#include <cassert> +#include <iostream> +#include <fstream> +#include <string> +#include <vector> +#include <memory> + +static const std::string TILE_JO_NAME("jobOptions_TileNoiseToolsTest.py"); +static const std::string TILE_SAMPLE_EMS("TileSampleEms"); +static const std::string TILE_RAW_CHANNEL_EMS("TileRawChannelEms"); +static const std::string TILE_SAMPLE_NOISE("TileSampleNoiseTest"); +static const std::string TILE_ONLINE_SAMPLE_NOISE("TileOnlineSampleNoiseTest"); +static const std::string TILE_RAW_CHANNEL_NOISE("TileRawChannelNoiseTest"); + +static const unsigned int OBJ_VERSION(0); +static const unsigned int DEF_DRAWER_IDX(0); +static const unsigned int MAX_CHANNEL(1); + +static const unsigned int DRAWER_IDX(20); +static const unsigned int CHANNEL(0); +static const unsigned int ADC(0); + +static const float LIN_FACTOR(2.0F); +static const float NLN_FACTOR(2.0F); +static const float RANGE(1000.0F); +static const std::vector<std::vector<float>> NLN_CORRECTIONS{ + {0.0F, RANGE, 0.0F, RANGE * NLN_FACTOR} +}; + +static const float PEDESTAL(50.0F); +static const float HFN(10.0F); +static const float LFN(5.0F); +static const float HFN1(8.0F); +static const float HFN2(12.0F); +static const float HFN_NORM(15.0F); + +static const std::vector<std::vector<float>> SAMPLE_NOISE{ + {PEDESTAL, HFN, LFN, HFN1, HFN2, HFN_NORM} +}; + +static const float PEDESTAL_DIF(10.0F); +static const float ONLINE_PEDESTAL(PEDESTAL + PEDESTAL_DIF); + +static const float ELECTRONIC_NOISE(20.0F); +static const float PILEUP_NOISE(100.0F); + +static const std::vector<std::vector<float>> RAW_CHANNEL_NOISE{ + {ELECTRONIC_NOISE, PILEUP_NOISE} +}; + + +static const EventIDRange EVENT_RANGE { + EventIDBase{ + EventIDBase::UNDEFNUM / 8, // Run number + EventIDBase::UNDEFEVT, + EventIDBase::UNDEFNUM, + EventIDBase::UNDEFNUM, + EventIDBase::UNDEFNUM / 8}, // Lumi block + + EventIDBase{ + EventIDBase::UNDEFNUM / 2, // Run number + EventIDBase::UNDEFEVT, + EventIDBase::UNDEFNUM, + EventIDBase::UNDEFNUM, + EventIDBase::UNDEFNUM / 2} // Lumi block +}; + + + +/** Class provides dummy algorithm + * to help construct Tool to be tested. + */ +class DummyAlgorithm: public AthAlgorithm { + public: + DummyAlgorithm(const std::string& name, ISvcLocator* svcloc) + : AthAlgorithm(name, svcloc) { + + } + + virtual StatusCode execute() override { + return StatusCode::SUCCESS; + } +}; + + +std::unique_ptr<TileCalibDataFlt> getCalibData(const std::vector<std::vector<float>>& defaultData, unsigned int version = 100) { + + // std::vector<std::vector<float> defaultData{{data}}; + std::unique_ptr<coral::Blob> defaultBlob = std::make_unique<coral::Blob>(0); + std::unique_ptr<TileCalibDrawerFlt> tmpCalibDrawer(TileCalibDrawerFlt::getInstance(*defaultBlob, defaultData, MAX_CHANNEL, version)); + // Trick to make calib drawer to copy and own blob + std::unique_ptr<TileCalibDrawerFlt> defaultCalibDrawer = std::make_unique<TileCalibDrawerFlt>(*tmpCalibDrawer); + + std::unique_ptr<TileCalibDataFlt> calibData = std::make_unique<TileCalibDataFlt>(); + calibData->setCalibDrawer(DEF_DRAWER_IDX, defaultCalibDrawer.release()); + + for (unsigned int drawerIdx = 1; drawerIdx < TileCalibUtils::MAX_DRAWERIDX; ++drawerIdx) { + unsigned int defaultDrawerIdx = TileCalibUtils::getDefaultDrawerIdx(drawerIdx); + calibData->setCalibDrawer(drawerIdx, calibData->getCalibDrawer(defaultDrawerIdx)); + } + + return calibData; + +} + +std::unique_ptr<TileCalibDataFlt> getCalibData(float value) { + std::vector<std::vector<float>> defaultData{{value}}; + return getCalibData(defaultData, 1); +} + + +std::unique_ptr<TileEMScale> getCalibEms() { + + // Initialize TileCalibEms + std::unique_ptr<TileEMScale> emScale = std::make_unique<TileEMScale>(); + + emScale->setCalibOnlCis(getCalibData(LIN_FACTOR)); + emScale->setCalibOnlLas(getCalibData(LIN_FACTOR)); + emScale->setCalibOnlCes(getCalibData(LIN_FACTOR)); + emScale->setCalibOnlEms(getCalibData(LIN_FACTOR)); + + emScale->setCalibOflCisLin(getCalibData(LIN_FACTOR)); + emScale->setCalibOflLasLin(getCalibData(LIN_FACTOR)); + emScale->setCalibOflCes(getCalibData(LIN_FACTOR)); + emScale->setCalibOflEms(getCalibData(LIN_FACTOR)); + + emScale->setCalibOflCisNln(getCalibData(NLN_CORRECTIONS)); + emScale->setCalibOflLasNln(getCalibData(NLN_CORRECTIONS)); + + emScale->setOnlineCacheUnit(TileRawChannelUnit::OnlineMegaElectronVolts); + emScale->setMaxChannels(48); + emScale->setMaxGains(2); + assert(emScale->initialize()); + + return emScale; +} + + +void testTileCondToolNoiseSample(ISvcLocator* svcLoc) { + + std::cout << "\nTest TileCondToolNoiseSample\n"; + + { + SG::WriteCondHandleKey<TileEMScale> emScaleKey{TILE_SAMPLE_EMS}; + assert(emScaleKey.initialize().isSuccess()); + + SG::WriteCondHandle<TileEMScale> emScale{emScaleKey}; + std::unique_ptr<TileEMScale> emScaleData = getCalibEms(); + assert(emScale.record(EVENT_RANGE, emScaleData.release()).isSuccess()); + + + SG::WriteCondHandleKey<TileCalibDataFlt> calibSampleNoiseKey{TILE_SAMPLE_NOISE}; + assert(calibSampleNoiseKey.initialize().isSuccess()); + + SG::WriteCondHandle<TileCalibDataFlt> calibSampleNoise{calibSampleNoiseKey}; + std::unique_ptr<TileCalibDataFlt> calibSampleNoiseData = getCalibData(SAMPLE_NOISE); + assert(calibSampleNoise.record(EVENT_RANGE, calibSampleNoiseData.release()).isSuccess()); + + + SG::WriteCondHandleKey<TileCalibDataFlt> calibOnlineSampleNoiseKey{TILE_ONLINE_SAMPLE_NOISE}; + assert(calibOnlineSampleNoiseKey.initialize().isSuccess()); + + SG::WriteCondHandle<TileCalibDataFlt> calibOnlineSampleNoise{calibOnlineSampleNoiseKey}; + std::unique_ptr<TileCalibDataFlt> calibOnlineSampleNoiseData = getCalibData(ONLINE_PEDESTAL); + assert(calibOnlineSampleNoise.record(EVENT_RANGE, calibOnlineSampleNoiseData.release()).isSuccess()); + + } + + std::unique_ptr<DummyAlgorithm> alg = std::make_unique<DummyAlgorithm>("DummyAlgorithm", svcLoc); + alg->addRef(); + + std::unique_ptr<TileCondToolNoiseSample> sampleNoise + = std::make_unique<TileCondToolNoiseSample>("TileCondToolNoiseSample", + "TileCondToolNoiseSampleTest", + alg.get()); + sampleNoise->addRef(); + + assert(sampleNoise->setProperty("TileEMScale", TILE_SAMPLE_EMS)); + assert(sampleNoise->setProperty("TileSampleNoise", TILE_SAMPLE_NOISE)); + assert(sampleNoise->setProperty("TileOnlineSampleNoise", TILE_ONLINE_SAMPLE_NOISE)); + assert(sampleNoise->initialize().isSuccess()); + + const float adcPedestal(sampleNoise->getPed(DRAWER_IDX, CHANNEL, ADC, TileRawChannelUnit::ADCcounts)); + assert(Athena_test::isEqual(adcPedestal, PEDESTAL)); + + const float picoCoulombsPedestal(sampleNoise->getPed(DRAWER_IDX, CHANNEL, ADC, TileRawChannelUnit::PicoCoulombs)); + assert(Athena_test::isEqual(picoCoulombsPedestal, (adcPedestal / LIN_FACTOR) * NLN_FACTOR)); + + const float cesPicoCoulombsPedestal(sampleNoise->getPed(DRAWER_IDX, CHANNEL, ADC, TileRawChannelUnit::CesiumPicoCoulombs)); + assert(Athena_test::isEqual(cesPicoCoulombsPedestal, picoCoulombsPedestal / LIN_FACTOR / LIN_FACTOR * NLN_FACTOR)); + + const float mevPedestal(sampleNoise->getPed(DRAWER_IDX, CHANNEL, ADC, TileRawChannelUnit::MegaElectronVolts)); + assert(Athena_test::isEqual(mevPedestal, cesPicoCoulombsPedestal / LIN_FACTOR)); + + + + const float adcHfn(sampleNoise->getHfn(DRAWER_IDX, CHANNEL, ADC, TileRawChannelUnit::ADCcounts)); + assert(Athena_test::isEqual(adcHfn, HFN)); + + const float picoCoulombsHfn(sampleNoise->getHfn(DRAWER_IDX, CHANNEL, ADC, TileRawChannelUnit::PicoCoulombs)); + assert(Athena_test::isEqual(picoCoulombsHfn, (adcHfn / LIN_FACTOR) * NLN_FACTOR)); + + const float cesPicoCoulombsHfn(sampleNoise->getHfn(DRAWER_IDX, CHANNEL, ADC, TileRawChannelUnit::CesiumPicoCoulombs)); + assert(Athena_test::isEqual(cesPicoCoulombsHfn, picoCoulombsHfn / LIN_FACTOR / LIN_FACTOR * NLN_FACTOR)); + + const float mevHfn(sampleNoise->getHfn(DRAWER_IDX, CHANNEL, ADC, TileRawChannelUnit::MegaElectronVolts)); + assert(Athena_test::isEqual(mevHfn, cesPicoCoulombsHfn / LIN_FACTOR)); + + + + const float adcNoise(sampleNoise->getNoise(DRAWER_IDX, CHANNEL, ADC, TileRawChannelUnit::ADCcounts)); + assert(Athena_test::isEqual(adcNoise, HFN)); + + const float picoCoulombsNoise(sampleNoise->getNoise(DRAWER_IDX, CHANNEL, ADC, TileRawChannelUnit::PicoCoulombs)); + assert(Athena_test::isEqual(picoCoulombsNoise, (adcNoise / LIN_FACTOR) * NLN_FACTOR)); + + const float cesPicoCoulombsNoise(sampleNoise->getNoise(DRAWER_IDX, CHANNEL, ADC, TileRawChannelUnit::CesiumPicoCoulombs)); + assert(Athena_test::isEqual(cesPicoCoulombsNoise, picoCoulombsNoise / LIN_FACTOR / LIN_FACTOR * NLN_FACTOR)); + + const float mevNoise(sampleNoise->getNoise(DRAWER_IDX, CHANNEL, ADC, TileRawChannelUnit::MegaElectronVolts)); + assert(Athena_test::isEqual(mevNoise, cesPicoCoulombsNoise / LIN_FACTOR)); + + + + const float adcLfn(sampleNoise->getLfn(DRAWER_IDX, CHANNEL, ADC, TileRawChannelUnit::ADCcounts)); + assert(Athena_test::isEqual(adcLfn, LFN)); + + const float picoCoulombsLfn(sampleNoise->getLfn(DRAWER_IDX, CHANNEL, ADC, TileRawChannelUnit::PicoCoulombs)); + assert(Athena_test::isEqual(picoCoulombsLfn, (adcLfn / LIN_FACTOR) * NLN_FACTOR)); + + const float cesPicoCoulombsLfn(sampleNoise->getLfn(DRAWER_IDX, CHANNEL, ADC, TileRawChannelUnit::CesiumPicoCoulombs)); + assert(Athena_test::isEqual(cesPicoCoulombsLfn, picoCoulombsLfn / LIN_FACTOR / LIN_FACTOR * NLN_FACTOR)); + + const float mevLfn(sampleNoise->getLfn(DRAWER_IDX, CHANNEL, ADC, TileRawChannelUnit::MegaElectronVolts)); + assert(Athena_test::isEqual(mevLfn, cesPicoCoulombsLfn / LIN_FACTOR)); + + + + const float hfn1(sampleNoise->getHfn1(DRAWER_IDX, CHANNEL, ADC)); + assert(Athena_test::isEqual(hfn1, HFN1)); + + const float hfn2(sampleNoise->getHfn2(DRAWER_IDX, CHANNEL, ADC)); + assert(Athena_test::isEqual(hfn2, HFN2)); + + const float hfnNorm(sampleNoise->getHfnNorm(DRAWER_IDX, CHANNEL, ADC)); + assert(Athena_test::isEqual(hfnNorm, HFN_NORM)); + + + + const float adcPedestalDifferene(sampleNoise->getOnlinePedestalDifference(DRAWER_IDX, CHANNEL, ADC, + TileRawChannelUnit::OnlineADCcounts)); + assert(Athena_test::isEqual(adcPedestalDifferene, PEDESTAL_DIF)); + + const float picoCoulombsPedestalDifference = + sampleNoise->getOnlinePedestalDifference(DRAWER_IDX, CHANNEL, ADC, TileRawChannelUnit::OnlinePicoCoulombs); + + assert(Athena_test::isEqual(picoCoulombsPedestalDifference, (adcPedestalDifferene / LIN_FACTOR))); + + + const float cesPicoCoulombsPedestalDifference = + sampleNoise->getOnlinePedestalDifference(DRAWER_IDX, CHANNEL, ADC, TileRawChannelUnit::OnlineCesiumPicoCoulombs); + + assert(Athena_test::isEqual(cesPicoCoulombsPedestalDifference, + picoCoulombsPedestalDifference / LIN_FACTOR / LIN_FACTOR)); + + const float mevPedestalDifference = + sampleNoise->getOnlinePedestalDifference(DRAWER_IDX, CHANNEL, ADC, TileRawChannelUnit::OnlineMegaElectronVolts); + + assert(Athena_test::isEqual(mevPedestalDifference, cesPicoCoulombsPedestalDifference / LIN_FACTOR)); + +} + + + +void testTileCondToolNoiseRawChn(ISvcLocator* svcLoc) { + + std::cout << "\nTest TileCondToolNoiseRawChn\n"; + + { + SG::WriteCondHandleKey<TileEMScale> emScaleKey{TILE_RAW_CHANNEL_EMS}; + assert(emScaleKey.initialize().isSuccess()); + + SG::WriteCondHandle<TileEMScale> emScale{emScaleKey}; + std::unique_ptr<TileEMScale> emScaleData = getCalibEms(); + assert(emScale.record(EVENT_RANGE, emScaleData.release()).isSuccess()); + + + SG::WriteCondHandleKey<TileCalibDataFlt> calibSampleNoiseKey{TILE_RAW_CHANNEL_NOISE}; + assert(calibSampleNoiseKey.initialize().isSuccess()); + + SG::WriteCondHandle<TileCalibDataFlt> calibSampleNoise{calibSampleNoiseKey}; + std::unique_ptr<TileCalibDataFlt> calibSampleNoiseData = getCalibData(RAW_CHANNEL_NOISE); + assert(calibSampleNoise.record(EVENT_RANGE, calibSampleNoiseData.release()).isSuccess()); + + } + + std::unique_ptr<DummyAlgorithm> alg = std::make_unique<DummyAlgorithm>("DummyAlgorithm", svcLoc); + alg->addRef(); + + std::unique_ptr<TileCondToolNoiseRawChn> rawChannelNoise + = std::make_unique<TileCondToolNoiseRawChn>("TileCondToolNoiseRawChn", + "TileCondToolNoiseRawChnTest", + alg.get()); + rawChannelNoise->addRef(); + + assert(rawChannelNoise->setProperty("TileEMScale", TILE_RAW_CHANNEL_EMS)); + assert(rawChannelNoise->setProperty("TileRawChannelNoise", TILE_RAW_CHANNEL_NOISE)); + assert(rawChannelNoise->initialize().isSuccess()); + + + const float adcElectronicNoise(rawChannelNoise->getElectronicNoise(DRAWER_IDX, CHANNEL, ADC, + TileRawChannelUnit::ADCcounts)); + assert(Athena_test::isEqual(adcElectronicNoise, ELECTRONIC_NOISE)); + + const float picoCoulombsElectronicNoise(rawChannelNoise->getElectronicNoise(DRAWER_IDX, CHANNEL, ADC, + TileRawChannelUnit::PicoCoulombs)); + assert(Athena_test::isEqual(picoCoulombsElectronicNoise, ELECTRONIC_NOISE / LIN_FACTOR * NLN_FACTOR)); + + const float cesPicoCoulombsElectronicNoise(rawChannelNoise->getElectronicNoise(DRAWER_IDX, CHANNEL, ADC, + TileRawChannelUnit::CesiumPicoCoulombs)); + assert(Athena_test::isEqual(cesPicoCoulombsElectronicNoise, + picoCoulombsElectronicNoise / LIN_FACTOR / LIN_FACTOR * NLN_FACTOR)); + + + const float mevElectronicNoise(rawChannelNoise->getElectronicNoise(DRAWER_IDX, CHANNEL, ADC, + TileRawChannelUnit::MegaElectronVolts)); + assert(Athena_test::isEqual(mevElectronicNoise, cesPicoCoulombsElectronicNoise / LIN_FACTOR)); + + + const float pileUpNoise(rawChannelNoise->getPileUpNoise(DRAWER_IDX, CHANNEL, ADC)); + assert(Athena_test::isEqual(pileUpNoise, PILEUP_NOISE)); + +} + + +int main() { + + + std::ofstream jo(TILE_JO_NAME); + jo << "ApplicationMgr.ExtSvc += { \"StoreGateSvc/ConditionStore\" };" << std::endl; + jo.close(); + + ISvcLocator* svcLoc; + if (!Athena_test::initGaudi(TILE_JO_NAME, svcLoc)) { + std::cerr << "ERROR This test can not be run, can not get ServiceLocator" << std::endl; + } + + ServiceHandle<StoreGateSvc> conditionStore("ConditionStore", ""); + assert(conditionStore.retrieve().isSuccess()); + + EventIDBase eventId; + eventId.set_run_number(EventIDBase::UNDEFNUM / 4); + eventId.set_lumi_block(EventIDBase::UNDEFNUM / 4); + + EventContext ctx; + ctx.setEventID(eventId); + ctx.setExtension( Atlas::ExtendedEventContext(&*conditionStore) ); + Gaudi::Hive::setCurrentContext(ctx); + + + testTileCondToolNoiseSample(svcLoc); + testTileCondToolNoiseRawChn(svcLoc); + + return 0; +} diff --git a/TileCalorimeter/TileEvent/TileEvent/TileBeamElem.h b/TileCalorimeter/TileEvent/TileEvent/TileBeamElem.h index 49342f1ea3664d4e64f5d9888f20961d73f359db..ce8fdbb1c47123589971753701833c9928349de3 100755 --- a/TileCalorimeter/TileEvent/TileEvent/TileBeamElem.h +++ b/TileCalorimeter/TileEvent/TileEvent/TileBeamElem.h @@ -31,12 +31,14 @@ public: TileBeamElem() { } - TileBeamElem(const Identifier& id, const std::vector<uint32_t>& digits ); - TileBeamElem(const HWIdentifier& HWid, const std::vector<uint32_t>& digits ); TileBeamElem(const HWIdentifier& HWid, std::vector<uint32_t>&& digits ); - - TileBeamElem(const HWIdentifier& HWid, uint32_t digit ); + + // Needs to come after HWIdentifier for proper overload resolution + // with pyroot. + TileBeamElem(const Identifier& id, const std::vector<uint32_t>& digits ); + + TileBeamElem(const HWIdentifier& HWid, uint32_t digit ); /* Destructor */ diff --git a/TileCalorimeter/TileEvent/TileEvent/TileDigits.h b/TileCalorimeter/TileEvent/TileEvent/TileDigits.h index 880daa36a599ba50403605c6f46eddc902cd256b..34fd7acdad6e9d7eaf617612b1baa8f0cef774d2 100755 --- a/TileCalorimeter/TileEvent/TileEvent/TileDigits.h +++ b/TileCalorimeter/TileEvent/TileEvent/TileDigits.h @@ -34,18 +34,22 @@ public: TileDigits() { } - TileDigits(const Identifier& id, const std::vector<double>& digits ); - TileDigits(const HWIdentifier& HWid, const std::vector<double>& digits ); - TileDigits(const HWIdentifier& HWid, const std::vector<short>& digits ); + // Needs to come after HWIdentifier for proper overload resolution + // with pyroot. + TileDigits(const Identifier& id, const std::vector<double>& digits ); - TileDigits(const Identifier& id, const std::vector<float>& digits ); + TileDigits(const HWIdentifier& HWid, const std::vector<short>& digits ); TileDigits(const HWIdentifier& HWid, const std::vector<float>& digits ); TileDigits(const HWIdentifier& HWid, std::vector<float>&& digits ); + // Needs to come after HWIdentifier for proper overload resolution + // with pyroot. + TileDigits(const Identifier& id, const std::vector<float>& digits ); + /** @return number of samples */ int nsamples() const { return m_digits.size(); } diff --git a/TileCalorimeter/TileGeoModel/CMakeLists.txt b/TileCalorimeter/TileGeoModel/CMakeLists.txt index b65e008ec0ee4621b2a092b419e7d9447e62c63d..79a974a973a43092d1dfcf719ce58c572db3ab15 100644 --- a/TileCalorimeter/TileGeoModel/CMakeLists.txt +++ b/TileCalorimeter/TileGeoModel/CMakeLists.txt @@ -15,7 +15,7 @@ atlas_depends_on_subdirs( PUBLIC PRIVATE Calorimeter/CaloDetDescr Calorimeter/CaloIdentifier - Control/CLIDSvc + Control/AthenaKernel Control/SGTools Database/RDBAccessSvc GaudiKernel diff --git a/TileCalorimeter/TileGeoModel/src/TileDetectorTool.cxx b/TileCalorimeter/TileGeoModel/src/TileDetectorTool.cxx index 5ec00014e5e9ddf36fd1404dbb298d9961386fdb..f6efcc608ae8643d1a9b20a2a54d9738c524b4c5 100755 --- a/TileCalorimeter/TileGeoModel/src/TileDetectorTool.cxx +++ b/TileCalorimeter/TileGeoModel/src/TileDetectorTool.cxx @@ -24,7 +24,7 @@ #include "RDBAccessSvc/IRDBRecordset.h" #include "RDBAccessSvc/IRDBRecord.h" -#include "CLIDSvc/tools/ClassID_traits.h" +#include "AthenaKernel/ClassID_traits.h" #include "SGTools/DataProxy.h" TileDetectorTool::TileDetectorTool(const std::string& type, diff --git a/TileCalorimeter/TileMonitoring/src/TileCellMonTool.cxx b/TileCalorimeter/TileMonitoring/src/TileCellMonTool.cxx index ad02ad22e3bf269e9f44764250912199efe44ad5..b7df4f6a596deadd811d3059355c56faae70cd02 100644 --- a/TileCalorimeter/TileMonitoring/src/TileCellMonTool.cxx +++ b/TileCalorimeter/TileMonitoring/src/TileCellMonTool.cxx @@ -5,10 +5,10 @@ /// ******************************************************************** // // NAME: TileCellMonTool.cxx -// PACKAGE: TileMonitoring +// PACKAGE: TileMonitoring // // AUTHORS: Alexander Solodkov -// Luca Fiorini (Luca.Fiorini@cern.ch) +// Luca Fiorini (Luca.Fiorini@cern.ch) // // ******************************************************************** @@ -99,8 +99,7 @@ TileCellMonTool::TileCellMonTool(const std::string & type, const std::string & n for (int part = 0; part < NumPart; ++part) { for (unsigned int drawer = 0; drawer < TileCalibUtils::MAX_DRAWER; ++drawer) { - if (drawer % 2 == 1) m_moduleLabel[part].push_back(" "); - else m_moduleLabel[part].push_back(TileCalibUtils::getDrawerString(roses[part], drawer)); + m_moduleLabel[part].push_back(TileCalibUtils::getDrawerString(roses[part], drawer)); } for (unsigned int channel = 0; channel < TileCalibUtils::MAX_CHAN; ++channel) { @@ -113,8 +112,8 @@ TileCellMonTool::TileCellMonTool(const std::string & type, const std::string & n } for (unsigned int drawer = 0; drawer < TileCalibUtils::MAX_DRAWER; ++drawer) { - if (drawer % 2 == 1) m_moduleLabel[NumPart].push_back(" "); - else m_moduleLabel[NumPart].push_back((drawer < 10) ? std::string("0") + std::to_string(drawer + 1) : std::to_string(drawer + 1)); + m_moduleLabel[NumPart].push_back((drawer < 10) ? std::string("0") + std::to_string(drawer + 1) + : std::to_string(drawer + 1)); } m_old_lumiblock= -1; @@ -160,16 +159,16 @@ void TileCellMonTool::ShiftLumiHist(TProfile2D* Histo, int32_t delta_LB) { double xCenter = Histo->GetXaxis()->GetBinCenter(binx); double yCenter = Histo->GetYaxis()->GetBinCenter(biny); int32_t globalBin = Histo->FindBin(xCenter,yCenter); - + // Getting values from old bin double oldContent=Histo->GetBinContent(globalBin); double oldEntries=Histo->GetBinEffectiveEntries(globalBin); - + // Looking at new bin to get filled xCenter = Histo->GetXaxis()->GetBinCenter(binx + delta_LB); yCenter = Histo->GetYaxis()->GetBinCenter(biny); globalBin = Histo->FindBin(xCenter,yCenter); - + // Filling in new bin with old values Histo->SetBinEntries(globalBin,oldEntries); Histo->SetBinContent(globalBin,oldContent*oldEntries); @@ -194,7 +193,7 @@ void TileCellMonTool::ShiftLumiHist(TProfile2D* Histo, int32_t delta_LB) { } } } - + /*---------------------------------------------------------*/ StatusCode TileCellMonTool::bookHistTrigPart( int trig , int part ) { @@ -209,7 +208,7 @@ StatusCode TileCellMonTool::bookHistTrigPart( int trig , int part ) { std::string runNumStr = getRunNumStr(); /// Book Sampling Histos /// there are 1d histograms showing the energy and time balance for all cells together - /// the 2d plots count the number of times the balance is outside the allowed range. + /// the 2d plots count the number of times the balance is outside the allowed range. /// these are shown for as partition vs module number and for each partition module number vs cell number for (int sample = 0; sample < TotalSamp; sample++) { @@ -221,11 +220,11 @@ StatusCode TileCellMonTool::bookHistTrigPart( int trig , int part ) { "", "mergeRebinned") ); m_TileCellEvEneSamp[part][ sample ][ element ]->GetXaxis()->SetTitle("Event Energy (MeV)"); - } else if (m_fillTimeAndEnergyDiffHistograms){ //Don't make Samp E + } else if (m_fillTimeAndEnergyDiffHistograms){ //Don't make Samp E m_TileCellEneDiffSamp[part][ sample ].push_back( book1F(m_TrigNames[trig] + "/" + m_PartNames[part], "tileCellEneDiff" + m_SampStrNames[sample] + m_PartNames[part] + m_TrigNames[trig], - "Run " + runNumStr + " Trigger " + m_TrigNames[trig] + ": TileCell " + + "Run " + runNumStr + " Trigger " + m_TrigNames[trig] + ": TileCell " + m_SampStrNames[sample]+" Energy difference (MeV) between PMTs", 50,-1000., 1000.) ); m_TileCellEneDiffSamp[part][ sample ][ element ]->GetXaxis()->SetTitle("Energy diff (MeV)"); @@ -233,7 +232,7 @@ StatusCode TileCellMonTool::bookHistTrigPart( int trig , int part ) { m_TileCellTimeDiffSamp[part][ sample ].push_back( book1F(m_TrigNames[trig] + "/" + m_PartNames[part], "tileCellTimeDiff" + m_SampStrNames[sample] + m_PartNames[part] + m_TrigNames[trig], "Run " + runNumStr +" Trigger " + m_TrigNames[trig] + ": TileCell " + m_SampStrNames[sample] + - " Time difference (ns) between PMTs. Collision Events, either E_{ch} > " + + " Time difference (ns) between PMTs. Collision Events, either E_{ch} > " + std::to_string(m_ThresholdForTime) + " MeV", 50, -10., 10.) ); m_TileCellTimeDiffSamp[part][ sample ][ element ]->GetXaxis()->SetTitle("time (ns)"); } @@ -241,7 +240,7 @@ StatusCode TileCellMonTool::bookHistTrigPart( int trig , int part ) { //END of the booking per sample if (m_doOnline) { - + m_TilenCellsLB[ part ].push_back( bookProfile(m_TrigNames[trig]+"/"+m_PartNames[part],"tilenCellsLB" + m_PartNames[part] + m_TrigNames[trig], "Trigger "+m_TrigNames[trig]+": TileCal Cell number per LumiBlock",100, -99.5, 0.5) ); m_TilenCellsLB[ part ][ element ]->GetXaxis()->SetTitle("Last LumiBlocks"); @@ -268,21 +267,23 @@ StatusCode TileCellMonTool::bookHistTrigPart( int trig , int part ) { // m_TileCellModuleCorr[ part ][ element ]->GetYaxis()->SetTitle("cell Module"); SetBinLabel(m_TileCellModuleCorr[ part ][ element ]->GetXaxis(), m_moduleLabel[part]); + m_TileCellModuleCorr[part][element]->GetXaxis()->LabelsOption("v"); + m_TileCellModuleCorr[ part ][ element ]->GetXaxis()->SetTitleOffset(1.55); SetBinLabel(m_TileCellModuleCorr[ part ][ element ]->GetYaxis(), m_moduleLabel[part]); - - + + if ( part != NumPart ){ //Don't make AllPart if (m_fillChannelTimeSampHistograms) { for (int sample = 0; sample < TotalSamp; sample++) { if (sample == SampE && (part == PartLBA || part == PartLBC)) continue; - + m_TileChannelTimeSamp[part][ sample ].push_back( book1F(m_TrigNames[trig] + "/" + m_PartNames[part], "tileChannelTime" + m_SampStrNames[sample] + m_PartNames[part] + m_TrigNames[trig], - "Run "+ runNumStr + " Trigger " + m_TrigNames[trig] + ": Partition " + m_PartNames[part] + - ": TileCell " + m_SampStrNames[sample] + " Channel time (ns) Collision Events, E_{ch} > " + + "Run "+ runNumStr + " Trigger " + m_TrigNames[trig] + ": Partition " + m_PartNames[part] + + ": TileCell " + m_SampStrNames[sample] + " Channel time (ns) Collision Events, E_{ch} > " + std::to_string(m_ThresholdForTime) + " MeV", 121, -60.5, 60.5) ); m_TileChannelTimeSamp[part][ sample ][ element ]->GetXaxis()->SetTitle("time (ns)"); } @@ -290,8 +291,8 @@ StatusCode TileCellMonTool::bookHistTrigPart( int trig , int part ) { m_TileCellEvEneTim[ part ].push_back( bookProfile(m_TrigNames[trig] + "/" + m_PartNames[part], "tileCellEvEneTim" + m_PartNames[part] + m_TrigNames[trig], - "Run " + runNumStr + " Trigger " + m_TrigNames[trig] + ": Partition " + m_PartNames[part] + - ": Event Energy as a function of the event number", 25, 0., 100.,-2000.,200000., + "Run " + runNumStr + " Trigger " + m_TrigNames[trig] + ": Partition " + m_PartNames[part] + + ": Event Energy as a function of the event number", 25, 0., 100.,-2000.,200000., run, ATTRIB_MANAGED, "", "mergeRebinned") ); m_TileCellEvEneTim[ part ][ element ]->SetYTitle("Average Event Energy (MeV)"); m_TileCellEvEneTim[ part ][ element ]->SetXTitle("Event Number"); @@ -300,7 +301,7 @@ StatusCode TileCellMonTool::bookHistTrigPart( int trig , int part ) { if ( part != NumPart ){ //Don't Make allpart m_TileCellEvEneLumi[ part ].push_back( bookProfile(m_TrigNames[trig] + "/" + m_PartNames[part], "tileCellEvEneLumi" + m_PartNames[part] + m_TrigNames[trig], "Run " + runNumStr + " Trigger " + m_TrigNames[trig] + ": Partition " + m_PartNames[part] + - ": Event Energy as a function of the LumiBlock", 10, 0., 20., -5.e6, 5.e6, + ": Event Energy as a function of the LumiBlock", 10, 0., 20., -5.e6, 5.e6, run, ATTRIB_MANAGED, "", "mergeRebinned") ); m_TileCellEvEneLumi[ part ][ element ]->SetYTitle("Average Event Energy (MeV)"); m_TileCellEvEneLumi[ part ][ element ]->SetXTitle("LumiBlock"); @@ -318,7 +319,7 @@ StatusCode TileCellMonTool::bookHistTrigPart( int trig , int part ) { // last element of array exists, but it is not used. We don't book it, in order to avoid wasting memory and time - + m_TileCellDetailOccMapOvThr[ part ].push_back( book2F(m_TrigNames[trig]+"/"+m_PartNames[part], "tileCellDetailOccMapOvThr_"+m_PartNames[part] + m_TrigNames[trig], "Run "+runNumStr+" Trigger "+m_TrigNames[trig]+" Partition "+m_PartNames[part]+ @@ -327,6 +328,7 @@ StatusCode TileCellMonTool::bookHistTrigPart( int trig , int part ) { SetBinLabel(m_TileCellDetailOccMapOvThr[ part ][ element ]->GetYaxis(),m_cellchLabel[part]); SetBinLabel(m_TileCellDetailOccMapOvThr[ part ][ element ]->GetXaxis(),m_moduleLabel[part]); + m_TileCellDetailOccMapOvThr[part][element]->GetXaxis()->LabelsOption("v"); m_TileCellDetailOccMapHiGainOvThr[ part ].push_back( book2F(m_TrigNames[trig]+"/"+m_PartNames[part], "tileCellDetailOccMapHiGainOvThr_"+m_PartNames[part] + m_TrigNames[trig], @@ -336,6 +338,7 @@ StatusCode TileCellMonTool::bookHistTrigPart( int trig , int part ) { SetBinLabel(m_TileCellDetailOccMapHiGainOvThr[ part ][ element ]->GetYaxis(),m_cellchLabel[part]); SetBinLabel(m_TileCellDetailOccMapHiGainOvThr[ part ][ element ]->GetXaxis(),m_moduleLabel[part]); + m_TileCellDetailOccMapHiGainOvThr[part][element]->GetXaxis()->LabelsOption("v"); m_TileCellDetailOccMapLowGainOvThr[ part ].push_back( book2F(m_TrigNames[trig]+"/"+m_PartNames[part], @@ -346,8 +349,8 @@ StatusCode TileCellMonTool::bookHistTrigPart( int trig , int part ) { SetBinLabel(m_TileCellDetailOccMapLowGainOvThr[ part ][ element ]->GetYaxis(),m_cellchLabel[part]); SetBinLabel(m_TileCellDetailOccMapLowGainOvThr[ part ][ element ]->GetXaxis(),m_moduleLabel[part]); + m_TileCellDetailOccMapLowGainOvThr[part][element]->GetXaxis()->LabelsOption("v"); - m_TileCellDetailOccMapOvThr30GeV[ part ].push_back( book2F(m_TrigNames[trig]+"/"+m_PartNames[part], "tileCellDetailOccMapOvThr30GeV_"+m_PartNames[part] + m_TrigNames[trig], "Run "+runNumStr+" Trigger "+m_TrigNames[trig]+" Partition "+m_PartNames[part]+ @@ -356,7 +359,8 @@ StatusCode TileCellMonTool::bookHistTrigPart( int trig , int part ) { SetBinLabel(m_TileCellDetailOccMapOvThr30GeV[ part ][ element ]->GetYaxis(),m_cellchLabel[part]); SetBinLabel(m_TileCellDetailOccMapOvThr30GeV[ part ][ element ]->GetXaxis(),m_moduleLabel[part]); - + m_TileCellDetailOccMapOvThr30GeV[part][element]->GetXaxis()->LabelsOption("v"); + m_TileCellDetailOccMapOvThr300GeV[ part ].push_back( book2F(m_TrigNames[trig]+"/"+m_PartNames[part], "tileCellDetailOccMapOvThr300GeV_"+m_PartNames[part] + m_TrigNames[trig], "Run "+runNumStr+" Trigger "+m_TrigNames[trig]+" Partition "+m_PartNames[part]+ @@ -365,6 +369,7 @@ StatusCode TileCellMonTool::bookHistTrigPart( int trig , int part ) { SetBinLabel(m_TileCellDetailOccMapOvThr300GeV[ part ][ element ]->GetYaxis(),m_cellchLabel[part]); SetBinLabel(m_TileCellDetailOccMapOvThr300GeV[ part ][ element ]->GetXaxis(),m_moduleLabel[part]); + m_TileCellDetailOccMapOvThr300GeV[part][element]->GetXaxis()->LabelsOption("v"); @@ -373,19 +378,21 @@ StatusCode TileCellMonTool::bookHistTrigPart( int trig , int part ) { "Run "+runNumStr+" Trigger "+m_TrigNames[trig]+" Partition "+m_PartNames[part]+ ": Occupancy Map (MeV) (entries = events)", 64,0.5, 64.5,48,-0.5,47.5,-2.e6,2.e6) ) ; - + SetBinLabel(m_TileCellDetailOccMap[ part ][ element ]->GetYaxis(),m_cellchLabel[part]); SetBinLabel(m_TileCellDetailOccMap[ part ][ element ]->GetXaxis(),m_moduleLabel[part]); m_TileCellDetailOccMap[ part ][ element ]->SetOption("COLZ"); + m_TileCellDetailOccMap[part][element]->GetXaxis()->LabelsOption("v"); m_TileCellEneDiffChanMod[ part ].push_back( bookProfile2D(m_TrigNames[trig]+"/"+m_PartNames[part], "tileCellEneDiffChanMod_"+m_PartNames[part] + m_TrigNames[trig], "Run "+runNumStr+" Trigger "+m_TrigNames[trig]+" Partition "+m_PartNames[part]+ ": Energy difference betwean pmts (MeV)", 64,0.5, 64.5,48,-0.5,47.5,-2.e6,2.e6) ) ; - + SetBinLabel(m_TileCellEneDiffChanMod[ part ][ element ]->GetYaxis(),m_cellchLabel[part]); SetBinLabel(m_TileCellEneDiffChanMod[ part ][ element ]->GetXaxis(),m_moduleLabel[part]); + m_TileCellEneDiffChanMod[part][element]->GetXaxis()->LabelsOption("v"); // Channel timing plots below. @@ -404,6 +411,7 @@ StatusCode TileCellMonTool::bookHistTrigPart( int trig , int part ) { SetBinLabel(m_TileChanPartTime[part][element]->GetYaxis(), m_cellchLabel[part]); m_TileChanPartTime[part][element]->SetZTitle("Average Channel Time (ns)"); m_TileChanPartTime[part][element]->SetOption("COLZ"); + m_TileChanPartTime[part][element]->GetXaxis()->LabelsOption("v"); // Tile Cell average digi time temperature plot for each partition. histName = "tileDigiPartTime_"+m_PartNames[part] + m_TrigNames[trig]; @@ -414,12 +422,13 @@ StatusCode TileCellMonTool::bookHistTrigPart( int trig , int part ) { obj = bookProfile2D(histDir,histName,histTitle, 64,0.5,64.5,8,0.5,8.5,-80,80); m_TileDigiPartTime[part].push_back(static_cast<TProfile2D*>(obj)); SetBinLabel(m_TileDigiPartTime[part][element]->GetXaxis(), m_moduleLabel[part]); + m_TileDigiPartTime[part][element]->GetXaxis()->LabelsOption("v"); m_TileDigiPartTime[part][element]->SetYTitle("Digitizer"); m_TileDigiPartTime[part][element]->SetZTitle("Average Digitizer Time (ns)"); // per module plots for (int mod = 0; mod < 64; ++mod) { - + if (m_fillDigitizerTimeLBHistograms) { //Tile Cell average digitizer time per lumiblock for each module histName = "tileDigiTimeLB_" + m_PartNames[part] + "_" + std::to_string(mod + 1) + m_TrigNames[trig]; @@ -427,7 +436,7 @@ StatusCode TileCellMonTool::bookHistTrigPart( int trig , int part ) { " Partition " + m_PartNames[part] + " Module " + std::to_string(mod + 1) + ": TileCal Average Digitizer Time (ns) vs. Lumiblock " + "Collision Events, E_{ch} > " + std::to_string(m_ThresholdForTime) + " MeV"; - + if (m_doOnline) { obj = bookProfile2D(histDir,histName,histTitle,20,-0.5,19.5,8,0.5,8.5,-100,100); m_TileDigiTimeLB[part][mod].push_back(static_cast<TProfile2D*>(obj)); @@ -442,7 +451,7 @@ StatusCode TileCellMonTool::bookHistTrigPart( int trig , int part ) { m_TileDigiTimeLB[part][mod][element]->SetZTitle("Average Digitizer Time (ns)"); } } - + if (m_fillDigitizerEnergyLBHistograms) { //Tile Cell average digitizer energy per lumiblock for each module @@ -476,8 +485,8 @@ StatusCode TileCellMonTool::bookHistTrigPart( int trig , int part ) { StatusCode TileCellMonTool::bookHistTrig( int trig ) { /*---------------------------------------------------------*/ - - m_activeTrigs[ trig ] = m_TileCellTrig; + + m_activeTrigs[ trig ] = m_TileCellTrig; int element = m_activeTrigs[ trig ]; std::ostringstream ss; ss.str(""); @@ -503,7 +512,7 @@ StatusCode TileCellMonTool::bookHistTrig( int trig ) { std::ostringstream sene; sene.str(""); sene << m_Threshold; - + std::string histDir, histName, histTitle, xTitle; /// Book Sampling Histos @@ -519,8 +528,8 @@ StatusCode TileCellMonTool::bookHistTrig( int trig ) { m_TileCellEneEtaPhiSamp[sample].push_back( bookProfile2D(m_TrigNames[trig] , "tileCellEneEtaPhi" + m_SampStrNames[sample] + m_TrigNames[trig] - , "Run " + runNumStr + " Trigger " + m_TrigNames[trig] - + ": Tile 2D Cell " + m_SampStrNames[sample] + , "Run " + runNumStr + " Trigger " + m_TrigNames[trig] + + ": Tile 2D Cell " + m_SampStrNames[sample] + " Energy Average depostion (MeV) (entries = events)" , 21, -2.025, 2.025,64, -3.15, 3.15, -2.e6, 2.e6) ); @@ -532,7 +541,7 @@ StatusCode TileCellMonTool::bookHistTrig( int trig ) { m_TileCellSynch.push_back( book1F(m_TrigNames[trig],"tileCellSynch" + m_TrigNames[trig],"Run "+runNumStr+" Trigger "+m_TrigNames[trig]+": Tile Time of Flight - Time measured ",50,-100., 100.) ); - m_TileCellSynch[ element ]->GetXaxis()->SetTitle("Time of Flight - Time Measured (ns)"); + m_TileCellSynch[ element ]->GetXaxis()->SetTitle("Time of Flight - Time Measured (ns)"); for (int p = 0; p < NPartHisto; p++) { if ( bookHistTrigPart( trig, p ).isFailure() ) { @@ -575,7 +584,7 @@ void TileCellMonTool::cleanHistVec() { m_TileCellEneBalModPart.clear() ; m_TileCellTimBalModPart.clear() ; - m_TileCellTrig = 0; + m_TileCellTrig = 0; m_TileCellSynch.clear() ; @@ -642,7 +651,7 @@ void TileCellMonTool::cleanHistVec() { StatusCode TileCellMonTool::fillHistograms() { /*---------------------------------------------------------*/ - + // conversion from channel number to digitizer number static const int ch2digi[48] = { 8, 8, 8, 8, 8, 8, @@ -681,16 +690,16 @@ StatusCode TileCellMonTool::fillHistograms() { << " Evt = " << m_evtNum << " BCID = " << m_evtBCID << " lvl1 = 0x" << std::hex << m_lvl1info << std::dec; - + if (!evtStreamTags.empty()) { msg(MSG::INFO) << " stream name/type:"; for (const auto& evtStreamTag : evtStreamTags) { msg(MSG::INFO) << " " << evtStreamTag.name() << "/" << evtStreamTag.type(); } } - + msg(MSG::INFO) << endmsg; - + return StatusCode::SUCCESS; } } @@ -723,7 +732,7 @@ StatusCode TileCellMonTool::fillHistograms() { uint32_t lumi = getLumiBlock(); unsigned int bcid = TileFatherMonTool::getEvtBCID(); get_eventTrigs(lvl1info); //fill m_eventTrigs; it always contains at least one element: AnyPhysTrig or Calib. - + if (m_isFirstEv) { FirstEvInit(); } @@ -752,7 +761,7 @@ StatusCode TileCellMonTool::fillHistograms() { } } } - + if (m_fillMaskedOnFly4LastLumiblocks && m_old_lumiblock < current_lumiblock) { for (unsigned int partition = 0; partition < NumPart; ++partition) { @@ -820,7 +829,7 @@ StatusCode TileCellMonTool::fillHistograms() { ros1 = m_tileHWID->ros(hw1); partition = m_ros2partition[ros1]; } - + IdentifierHash hash2 = caloDDE->onl2(); if (hash2 != TileHWID::NOT_VALID_HASH) { HWIdentifier hw2 = m_tileHWID->channel_id(hash2); @@ -833,7 +842,7 @@ StatusCode TileCellMonTool::fillHistograms() { // just to avoid potential problems with disconnected cells if (partition >= NumPart) partition = getPartition(cell); if (partition2 >= NumPart) partition2 = partition; - + // something is wrong - go to next cell if (partition >= NumPart) continue; @@ -842,7 +851,7 @@ StatusCode TileCellMonTool::fillHistograms() { double drawer = (double)drw + 1.0; // range from 1-64 double module = (double)m_tileID->module(id) + 1.0; // range from 1-64 double occ_module = (m_cabling->isRun2Cabling()) ? module : drawer; // used for occupancy maps - + int samp = std::min(m_tileID->sample(id),(int)AllSamp); bool single_PMT_scin = (samp == TileID::SAMP_E); @@ -895,7 +904,7 @@ StatusCode TileCellMonTool::fillHistograms() { if (msgLvl(MSG::VERBOSE)) { //tile_cell->print(); //log << MSG::VERBOSE << "HWIdentifier: " << tile_cell->adc_HWID() << endreq; - + msg(MSG::VERBOSE) << "Identifier: " << id << " " << m_tileID->to_string(id,-2) << endmsg; msg(MSG::VERBOSE) << " region: " << m_tileID->region(id) << " system: " << m_tileID->system(id) @@ -944,7 +953,7 @@ StatusCode TileCellMonTool::fillHistograms() { if (real_cell) { - + // masking on the fly: check if channel is bad in event, while it is good in DB // when only one channel is bad, it might be that gain of masked channel is not correct @@ -975,7 +984,7 @@ StatusCode TileCellMonTool::fillHistograms() { } } - + bool channel2MaskedDueToDQ(false); if (badch2 && ch2Ok && !(single_PMT_C10 && ch2 == 4)) { @@ -995,28 +1004,28 @@ StatusCode TileCellMonTool::fillHistograms() { } } - + if ((energy > 300.) && (energy < 2000.) && (time > -60.) && (time < 60.) && (time != 0) && (cell_isbad < 2)) { m_muonCells.push_back(cell); } - + // check if at least 1 cell's pmt is good if (cell_isbad < 2) { for (unsigned int i = 0; i < m_eventTrigs.size(); i++) { int vecInd = vecIndx(i); - + m_TileCellEneEtaPhiSamp[ AllSamp ][ vecInd ]->Fill(eta, phi, energy); m_TileCellEneEtaPhiSamp[ samp ][ vecInd ]->Fill(eta, phi, energy); - + // Fill occupancy histograms - + if (ch1Ok) { m_TileCellDetailOccMap[ partition ][ vecInd ]->Fill(occ_module, ch1, ene1 * weight); - } + } if (ch2Ok) { m_TileCellDetailOccMap[ partition2 ][ vecInd ]->Fill(occ_module, ch2, ene2); } @@ -1029,7 +1038,7 @@ StatusCode TileCellMonTool::fillHistograms() { } } - + // check if energy is below negative threshold if (ch1Ok && ene1 < m_NegThreshold && (!badch1) ) { m_TileCellDetailNegOccMap[ partition ]->Fill(occ_module, ch1, 1.0); @@ -1040,18 +1049,18 @@ StatusCode TileCellMonTool::fillHistograms() { // check if energy is over threshold if (energy>m_Threshold) { - + for (unsigned int i=0; i<m_eventTrigs.size(); i++) { int vecInd = vecIndx(i); - + m_TileCellEtaPhiOvThrSamp[AllSamp][ vecInd ]->Fill(eta, phi, 1.); m_TileCellEtaPhiOvThrSamp[ samp ][ vecInd ]->Fill(eta, phi, 1.); - + // Fill channel timing histograms. if (m_is_collision || m_eventTrigs[i]==Trig_b7 || m_fillTimeHistograms) { - + if (ch1Ok && ene1 > m_ThresholdForTime) { - + if (m_fillChannelTimeSampHistograms) { m_TileChannelTimeSamp[partition][samp][vecInd]->Fill(t1, 1.); m_TileChannelTimeSamp[partition][AllSamp][vecInd]->Fill(t1, 1.); @@ -1062,7 +1071,7 @@ StatusCode TileCellMonTool::fillHistograms() { if(m_doOnline) { m_delta_lumiblock = current_lumiblock - m_OldLumiArray2[partition][drw][vecInd]; - + if (m_fillDigitizerEnergyLBHistograms) { if(m_delta_lumiblock != 0) {//move bins ShiftLumiHist(m_TileDigiEnergyLB[partition][drw][vecInd], m_delta_lumiblock); @@ -1070,9 +1079,9 @@ StatusCode TileCellMonTool::fillHistograms() { } m_TileDigiEnergyLB[partition][drw][vecInd]->Fill(0,ch2digi[ch1],ene1,1.); } - + m_delta_lumiblock = current_lumiblock - m_OldLumiArray1[partition][drw][vecInd]; - + if (m_fillDigitizerTimeLBHistograms) { if(m_delta_lumiblock != 0) {//move bins ShiftLumiHist(m_TileDigiTimeLB[partition][drw][vecInd], m_delta_lumiblock); @@ -1080,19 +1089,19 @@ StatusCode TileCellMonTool::fillHistograms() { } m_TileDigiTimeLB[partition][drw][vecInd]->Fill(0,ch2digi[ch1],t1,1.); } - + } else {// End of Online if (m_fillDigitizerEnergyLBHistograms) { - m_TileDigiEnergyLB[partition][drw][vecInd]->Fill(current_lumiblock,ch2digi[ch1],ene1,1.); + m_TileDigiEnergyLB[partition][drw][vecInd]->Fill(current_lumiblock,ch2digi[ch1],ene1,1.); } if (m_fillDigitizerTimeLBHistograms) { - m_TileDigiTimeLB[partition][drw][vecInd]->Fill(current_lumiblock,ch2digi[ch1],t1,1.); + m_TileDigiTimeLB[partition][drw][vecInd]->Fill(current_lumiblock,ch2digi[ch1],t1,1.); } } - + } - + if (ch2Ok && ene2 > m_ThresholdForTime) { if (m_fillChannelTimeSampHistograms) { @@ -1126,7 +1135,7 @@ StatusCode TileCellMonTool::fillHistograms() { } else {// End of Online if (m_fillDigitizerEnergyLBHistograms) { - m_TileDigiEnergyLB[partition2][drw][vecInd]->Fill(current_lumiblock,ch2digi[ch1],ene2,1.); + m_TileDigiEnergyLB[partition2][drw][vecInd]->Fill(current_lumiblock,ch2digi[ch1],ene2,1.); } if (m_fillDigitizerTimeLBHistograms) { @@ -1135,42 +1144,42 @@ StatusCode TileCellMonTool::fillHistograms() { } } } - + // store the occupancy for number hits over threshold if (ch1Ok && ene1 > m_Threshold && (!badch1)) { - + m_TileCellDetailOccMapOvThr[partition][vecInd]->Fill(occ_module, ch1, weight); if (gn1 == 1) m_TileCellDetailOccMapHiGainOvThr[partition][vecInd]->Fill(occ_module, ch1, weight); else m_TileCellDetailOccMapLowGainOvThr[partition][vecInd]->Fill(occ_module, ch1, weight); if (ene1 > 30000.) m_TileCellDetailOccMapOvThr30GeV[partition][vecInd]->Fill(occ_module, ch1); if (ene1 > 300000.) m_TileCellDetailOccMapOvThr300GeV[partition][vecInd]->Fill(occ_module, ch1); } - + if (ch2Ok && ene2 > m_Threshold && (!badch2)) { - + m_TileCellDetailOccMapOvThr[partition2][vecInd]->Fill(occ_module, ch2, 1.0); if (gn2 == 1) m_TileCellDetailOccMapHiGainOvThr[partition2][vecInd]->Fill(occ_module, ch2, 1.0); else m_TileCellDetailOccMapLowGainOvThr[partition2][vecInd]->Fill(occ_module, ch2, 1.0); if (ene2 > 30000.) m_TileCellDetailOccMapOvThr30GeV[partition2][vecInd]->Fill(occ_module, ch2); if (ene2 > 300000.) m_TileCellDetailOccMapOvThr300GeV[partition2][vecInd]->Fill(occ_module, ch2); } - + } // end loop over TriggerType - + bool fillEneAndTimeDiff(m_fillTimeAndEnergyDiffHistograms); - + // avoid double peak structure in energy and time balance histograms if ((gn1 == 0 && gn2 == 1 && (ene1 < 2000 || std::abs(ene1 / ene2) > 5)) || (gn1 == 1 && gn2 == 0 && (ene2 < 2000 || std::abs(ene2 / ene1) > 5))) { - + fillEneAndTimeDiff = false; } - - + + // check if cell is not completely bad if (cell_isbad < 2) { - + for (unsigned int i = 0; i < m_eventTrigs.size(); i++) { int vecInd = vecIndx(i); if (samp != 3 && fillEneAndTimeDiff){ //Don't make samp E @@ -1178,74 +1187,74 @@ StatusCode TileCellMonTool::fillHistograms() { m_TileCellEneDiffSamp[ partition ][ samp ][ vecInd ]->Fill(ediff, 1.); m_TileCellEneDiffSamp[ NumPart ][ samp ][ vecInd ]->Fill(ediff, 1.); - + if ((ene1 > m_ThresholdForTime || ene2 > m_ThresholdForTime) - && (m_is_collision || m_eventTrigs[i]==Trig_b7 || m_fillTimeHistograms)) { - + && (m_is_collision || m_eventTrigs[i]==Trig_b7 || m_fillTimeHistograms)) { + m_TileCellTimeDiffSamp[ partition ][ samp ][ vecInd ]->Fill(tdiff, 1.); m_TileCellTimeDiffSamp[ NumPart ][ samp ][ vecInd ]->Fill(tdiff, 1.); } - + } } - + if (cell_isbad<1 && (! single_PMT) ) { // we fill these histograms only if the both PMTs are good - + m_TileCellEneBal[ partition ]->Fill(module, eratio); if ((ene1 > m_ThresholdForTime || ene2 > m_ThresholdForTime) && (m_is_collision || m_fillTimeHistograms)) { - + m_TileCellTimBal[ partition ]->Fill(module, tdiff); } - + for (unsigned int i = 0; i < m_eventTrigs.size(); i++) { int vecInd = vecIndx(i); - + if (fillEneAndTimeDiff) { m_TileCellEneDiffSamp[ partition ][ AllSamp ][ vecInd ]->Fill(ediff, 1.); // also store the energy ratio diff/energy - + m_TileCellEneDiffSamp[ NumPart ][ AllSamp ][ vecInd ]->Fill(ediff, 1.); // also store the energy ratio diff/energy if ((ene1 > m_ThresholdForTime || ene2 > m_ThresholdForTime) - && (m_is_collision || m_eventTrigs[i]==Trig_b7 || m_fillTimeHistograms)) { - + && (m_is_collision || m_eventTrigs[i]==Trig_b7 || m_fillTimeHistograms)) { + m_TileCellTimeDiffSamp[ NumPart ][ AllSamp ][ vecInd ]->Fill(tdiff, 1.); m_TileCellTimeDiffSamp[ partition][ AllSamp ][ vecInd ]->Fill(tdiff, 1.); - } - } - + } + } + // check if the energy or timing balance is out of range - if (TMath::Abs(eratio) > m_EneBalThreshold) + if (TMath::Abs(eratio) > m_EneBalThreshold) m_TileCellEneBalModPart[ vecInd ]->Fill(module, fpartition, 1.0); - if (TMath::Abs(tdiff) > m_TimBalThreshold + if (TMath::Abs(tdiff) > m_TimBalThreshold && (ene1 > m_ThresholdForTime || ene2 > m_ThresholdForTime) - && (m_is_collision || m_eventTrigs[i]==Trig_b7 || m_fillTimeHistograms)) { - + && (m_is_collision || m_eventTrigs[i]==Trig_b7 || m_fillTimeHistograms)) { + m_TileCellTimBalModPart[ vecInd ]->Fill(module, fpartition, 1.0); } - + m_TileCellEneDiffChanMod[partition][vecInd]->Fill(drawer, ch1, ediff); m_TileCellEneDiffChanMod[partition2][vecInd]->Fill(drawer, ch2, -1 * ediff); - + } - + modulecorr[partition].inputxy(module); modulecorr[NumPart].inputxy(module); } // end if cell has two pmts and both pmts are good - + } // end if cell is good - + //store info for BCID plots. We count the number of cells over threshold per partition ++cellcnt[partition]; - + } //end if energy > threshold } //end if real cell @@ -1257,7 +1266,7 @@ StatusCode TileCellMonTool::fillHistograms() { eTileSamp[partition][samp] += energy; } // end if tile_cell - } // end of loop over the Cells + } // end of loop over the Cells // Calculate totals for all samples and all partitions for (int partition = 0; partition < NumPart; ++partition) { @@ -1271,7 +1280,7 @@ StatusCode TileCellMonTool::fillHistograms() { nMaskedCellsDueToDQ[NumPart] += nMaskedCellsDueToDQ[partition]; m_TileBadCell->Fill(partition,nBadCells[partition]); - + for (int samp=0; samp<AllSamp; samp++) { eTileSamp[partition][AllSamp] += eTileSamp[partition][samp]; eTileSamp[ NumPart ][ samp ] += eTileSamp[partition][samp]; @@ -1292,7 +1301,7 @@ StatusCode TileCellMonTool::fillHistograms() { msg(MSG::DEBUG) << "EneTotal: " << eTileSamp[0][AllSamp] << " " << eTileSamp[1][AllSamp] << " " << eTileSamp[2][AllSamp] << " " << eTileSamp[3][AllSamp] << " " << eTileSamp[4][AllSamp] << endmsg; } } - + // Start filling summary histograms // Fill BCID plots @@ -1304,7 +1313,7 @@ StatusCode TileCellMonTool::fillHistograms() { float ene = eTileSamp[partition][AllSamp] - eTileSamp[partition][SampE]; //Total Energy in partition without E sample m_TileCellOccOvThrBCID[ partition ][ vecInd ]->Fill(bcid, cellcnt[partition]); - if (partition != NumPart) {m_TileCellEvEneTim [ partition ][ vecInd ]->Fill(evtNum, ene);} //don't make AllPart + if (partition != NumPart) {m_TileCellEvEneTim [ partition ][ vecInd ]->Fill(evtNum, ene);} //don't make AllPart if (partition != NumPart) {m_TileCellEvEneLumi [ partition ][ vecInd ]->Fill(lumi, ene);} //don't make AllPart m_TileCellEvEneSamp [ partition ][ 3 ][ vecInd ]->Fill(eTileSamp[partition][3], 1.0); //Changed samp to 3, only make Samp E @@ -1324,7 +1333,7 @@ StatusCode TileCellMonTool::fillHistograms() { for (unsigned int i = 0; i < m_eventTrigs.size(); i++) { int vecInd = vecIndx(i); - m_TileCellModuleCorr[ partition ][ vecInd ]->Fill(modulecorr[partition].xOfPairAt(j), + m_TileCellModuleCorr[ partition ][ vecInd ]->Fill(modulecorr[partition].xOfPairAt(j), modulecorr[partition].yOfPairAt(j), modulecorr[partition].weight() ); } @@ -1430,8 +1439,8 @@ StatusCode TileCellMonTool::fillHistograms() { int vecInd = vecIndx(i); for (int sample = 0; sample < TotalSamp; ++sample) { - m_TileCellEneEtaPhiSamp[sample][vecInd]->SetEntries(nEventsPerTrig); - m_TileCellEtaPhiOvThrSamp[sample][vecInd]->SetEntries(nEventsPerTrig); + m_TileCellEneEtaPhiSamp[sample][vecInd]->SetEntries(nEventsPerTrig); + m_TileCellEtaPhiOvThrSamp[sample][vecInd]->SetEntries(nEventsPerTrig); } for (int partition = 0; partition < NumPart; ++partition) { @@ -1470,7 +1479,7 @@ StatusCode TileCellMonTool::procHistograms() { /*---------------------------------------------------------*/ StatusCode TileCellMonTool::checkHists(bool /* fromFinalize */) { /*---------------------------------------------------------*/ - + ATH_MSG_INFO( "in checkHists()" ); @@ -1582,7 +1591,7 @@ void TileCellMonTool::FirstEvInit() { if ( bookHistTrig( AnyTrig ).isFailure() ) { ATH_MSG_WARNING( "Error booking Cell histograms for Trigger " << m_TrigNames[ AnyTrig ] ); - } + } std::ostringstream sene; sene.str(""); sene << m_NegThreshold / GeV; @@ -1605,7 +1614,7 @@ void TileCellMonTool::FirstEvInit() { m_TileCellTimBal[p]->SetYTitle("Time balance between cells PMTs (ns)"); m_TileCellTimBal[p]->SetXTitle("Module"); } - + ////////////////////////// Book Histograms with the chanel status from the DB and masking on the fly for (int p = 0; p < NumPart; p++) { @@ -1615,39 +1624,44 @@ void TileCellMonTool::FirstEvInit() { , 64, 0.5, 64.5, 48, -0.5, 47.5); SetBinLabel(m_TileCellStatFromDB[p][g]->GetYaxis(), m_cellchLabel[p]); SetBinLabel(m_TileCellStatFromDB[p][g]->GetXaxis(), m_moduleLabel[p]); + m_TileCellStatFromDB[p][g]->GetXaxis()->LabelsOption("v"); + // setting average bit for histogram, but apparently it doesn't work ... need to investigate m_TileCellStatFromDB[p][g]->SetBit(TH1::kIsAverage); - } + } m_TileCellStatOnFly[p] = book2F("", "tileCellStatOnFly_" + m_PartNames[p] , "Run " + runNumStr + " Partition " + m_PartNames[p] + ": Channels masked on the fly (entries = events)" , 64, 0.5, 64.5, 48, -0.5, 47.5); SetBinLabel(m_TileCellStatOnFly[p]->GetYaxis(), m_cellchLabel[p]); SetBinLabel(m_TileCellStatOnFly[p]->GetXaxis(), m_moduleLabel[p]); + m_TileCellStatOnFly[p]->GetXaxis()->LabelsOption("v"); if (m_fillMaskedOnFly4LastLumiblocks) { m_TileCellStatOnFlyLastLumiblocks[p] = book2F("", "tileCellStatOnFlyLastLumiblocks_" + m_PartNames[p] - , "Run " + runNumStr + " Partition " + m_PartNames[p] - + ": Channels masked on the fly last " + std::to_string(m_nLastLumiblocks) + , "Run " + runNumStr + " Partition " + m_PartNames[p] + + ": Channels masked on the fly last " + std::to_string(m_nLastLumiblocks) + " lumiblocks (entries = events)" , 64, 0.5, 64.5, 48, -0.5, 47.5); SetBinLabel(m_TileCellStatOnFlyLastLumiblocks[p]->GetYaxis(), m_cellchLabel[p]); SetBinLabel(m_TileCellStatOnFlyLastLumiblocks[p]->GetXaxis(), m_moduleLabel[p]); + m_TileCellStatOnFlyLastLumiblocks[p]->GetXaxis()->LabelsOption("v"); for (int i = 0; i < m_nLastLumiblocks; ++i) { - m_TileCellStatOnFlyLastLumiblocksShadow[p].push_back(new TH2F(*m_TileCellStatOnFlyLastLumiblocks[p])); + m_TileCellStatOnFlyLastLumiblocksShadow[p].push_back(new TH2F(*m_TileCellStatOnFlyLastLumiblocks[p])); } } m_TileCellDetailNegOccMap[p] = book2F("", "tileCellDetailNegOccMap_" + m_PartNames[p] - , "Run " + runNumStr + " Partition " + m_PartNames[p] + , "Run " + runNumStr + " Partition " + m_PartNames[p] + ": Occupancy Map Below Negative Threshold " + sene.str() + " GeV (entries = events)" , 64, 0.5, 64.5, 48, -0.5, 47.5); SetBinLabel(m_TileCellDetailNegOccMap[p]->GetYaxis(), m_cellchLabel[p]); SetBinLabel(m_TileCellDetailNegOccMap[p]->GetXaxis(), m_moduleLabel[p]); + m_TileCellDetailNegOccMap[p]->GetXaxis()->LabelsOption("v"); } - + ////////////////////////// Book Histograms with the chanel status as a function of lumi block for (int p = 0; p < NPartHisto; p++) { @@ -1674,15 +1688,15 @@ void TileCellMonTool::FirstEvInit() { , m_nLumiblocks, -0.5, m_nLumiblocks - 0.5); m_TileMaskChannonFlyLumi[p]->SetYTitle("Number of masked channels"); m_TileMaskChannonFlyLumi[p]->SetXTitle("LumiBlock"); - - + + ////////////////////////// Book Histograms with the cell status as a function of lumi block m_TileMaskCellonFlyLumi[p] = bookProfile("", "tileMaskCellOnFlyLumi_" + m_PartNames[p] , "Run " + runNumStr + " Partition " + m_PartNames[p] + ": Number of masked cells on the fly" , m_nLumiblocks, -0.5, m_nLumiblocks - 0.5); m_TileMaskCellonFlyLumi[p]->SetYTitle("Number of masked cells"); m_TileMaskCellonFlyLumi[p]->SetXTitle("LumiBlock"); - + } m_TileMaskChannfromDBLumi[p] = bookProfile("", "tileMaskChannfromDBLumi_" + m_PartNames[p] @@ -1734,4 +1748,3 @@ void TileCellMonTool::FirstEvInit() { } //close if } - diff --git a/TileCalorimeter/TileMonitoring/src/TileFatherMonTool.cxx b/TileCalorimeter/TileMonitoring/src/TileFatherMonTool.cxx index e1748a859327137c2b257382582ec07feef2cc7a..54cd9955d766eb4fe03c9dd276af10cae403578e 100644 --- a/TileCalorimeter/TileMonitoring/src/TileFatherMonTool.cxx +++ b/TileCalorimeter/TileMonitoring/src/TileFatherMonTool.cxx @@ -8,8 +8,8 @@ // PACKAGE: TileMonitoring // // AUTHOR: Luca Fiorini (Luca.Fiorini@cern.ch) -// -// July 2006 +// +// July 2006 // ********************************************************************// #include "TileMonitoring/TileFatherMonTool.h" @@ -152,7 +152,7 @@ StatusCode TileFatherMonTool::initialize() { /// Method to navigate from a cell to its Tile partition -/// EBA, LBA, LBC, EBC. Other kind of cell or non Tile cells +/// EBA, LBA, LBC, EBC. Other kind of cell or non Tile cells /// will return a conventional number NumPart /// Argument cell is a pointer to a CaloCell /*---------------------------------------------------------*/ @@ -186,8 +186,8 @@ int TileFatherMonTool::getPartition(const CaloCell* cell) { -/// Method to get the Level1 Trigger word: -/// 32bit long, but only 8 bit are used +/// Method to get the Level1 Trigger word: +/// 32bit long, but only 8 bit are used /// If no trigger word or empty it will return 0 /*---------------------------------------------------------*/ void TileFatherMonTool::fillEvtInfo() @@ -235,7 +235,7 @@ void TileFatherMonTool::fillEvtInfo() } -/// Method to get the run Number in words: +/// Method to get the run Number in words: /*---------------------------------------------------------*/ std::string TileFatherMonTool::getRunNumStr() { /*---------------------------------------------------------*/ @@ -248,9 +248,9 @@ void TileFatherMonTool::fillEvtInfo() -/// Method to get the list of all Level1 trigger passed +/// Method to get the list of all Level1 trigger passed /// by the event. -/// Results are stored in m_eventTrigs +/// Results are stored in m_eventTrigs /// Beware: vector contains always at least 1 element: AnyPhystrig or calib /// Argument lvl1info is the 32 bit Level 1 trigger word /*---------------------------------------------------------*/ @@ -307,7 +307,7 @@ void TileFatherMonTool::checkIsCollision() { for (const TileCell* mbts_cell : *mbts_container) { if (mbts_cell->energy() < 0.27 || TMath::Abs(mbts_cell->time()) < 1.e-5) continue; //threshold approx 60./222. - + if (m_tileTBID->side(mbts_cell->ID()) > 0) { ++nHitsA; timeA += mbts_cell->time(); @@ -315,9 +315,9 @@ void TileFatherMonTool::checkIsCollision() { ++nHitsC; timeC += mbts_cell->time(); } - + } // end Cell loop - + if (nHitsA > 1 && nHitsC > 1) { TileFatherMonTool::m_time_difference = timeA / nHitsA - timeC / nHitsC; if (TMath::Abs(TileFatherMonTool::m_time_difference) < 7.5) { @@ -357,7 +357,7 @@ void TileFatherMonTool::checkIsCollision() { double time = tile_cell->time(); double energy = tile_cell->energy(); - if (energy < 500.0 || TMath::Abs(time) < 1.e-5) continue; + if (energy < 500.0 || TMath::Abs(time) < 1.e-5) continue; if (m_tileID->sample(id) == TileID::SAMP_E) { if (m_tileID->side(id) == TileID::POSITIVE) { @@ -398,7 +398,7 @@ template<class T> void TileFatherMonTool::SetBinLabel(T* axis, const std::string* labels, int nLabels) { if (nLabels < 0) return; for (unsigned int bin = 1; bin <= (unsigned int) nLabels; ++bin) { - axis->SetBinLabel(bin, (labels[bin]).c_str()); + axis->SetBinLabel(bin, (labels[bin - 1]).c_str()); } } @@ -420,7 +420,7 @@ void TileFatherMonTool::ShiftTprofile(TProfile* histo, int delta_lb) { } for (; i <= 100; i++) { // set rest to zero - + histo->SetBinEntries(i, 0.); histo->SetBinContent(i, 0.); histo->SetBinError(i, 0.); diff --git a/TileCalorimeter/TileRecUtils/CMakeLists.txt b/TileCalorimeter/TileRecUtils/CMakeLists.txt index 9fecd97f772c27151baa5bc87cea77f85c60e75b..0c174d677899b386d10fbd6470113ba951849805 100644 --- a/TileCalorimeter/TileRecUtils/CMakeLists.txt +++ b/TileCalorimeter/TileRecUtils/CMakeLists.txt @@ -32,6 +32,7 @@ atlas_depends_on_subdirs( PUBLIC # External dependencies: find_package( Boost COMPONENTS filesystem thread system ) +find_package( ROOT COMPONENTS Core ) find_package( CLHEP ) # Component(s) in the package: @@ -53,3 +54,15 @@ atlas_add_component( TileRecUtils atlas_install_python_modules( python/*.py ) atlas_install_joboptions( share/*.py ) +atlas_add_dictionary( TileRecUtilsDict + TileRecUtils/TileRecUtilsDict.h + TileRecUtils/selection.xml + INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} + LINK_LIBRARIES ${ROOT_LIBRARIES} TileRecUtilsLib ) + + +atlas_add_test( TileCellBuilder_test + SCRIPT test/TileCellBuilder_test.sh + PROPERTIES TIMEOUT 600 + EXTRA_PATTERNS "LArDetectorToolNV|is still valid|no data retrieved|Database being retired|Reading file|Unable to locate catalog|Resolved path|DigitizationFlags|^Domain|created CondCont|no dictionary for class|^ +[+]|Reading LArPedestalMC|IOV callback|^DetectorStore|TileDetectorTool|Creating TileCondProxyFile|Cache alignment" ) + diff --git a/TileCalorimeter/TileRecUtils/TileRecUtils/TileBeamInfoProvider.h b/TileCalorimeter/TileRecUtils/TileRecUtils/TileBeamInfoProvider.h index 5c0ce4f479ee6c4c9161cd4beb617a218fb31307..c519d9685d48cfd595679070b28728ecea3a4add 100644 --- a/TileCalorimeter/TileRecUtils/TileRecUtils/TileBeamInfoProvider.h +++ b/TileCalorimeter/TileRecUtils/TileRecUtils/TileBeamInfoProvider.h @@ -19,7 +19,7 @@ * Output: contents of cispar fragment, header, status and trigType * Parameters: * TileBeamElemContainer - Name of input container - * + * ********************************************************************/ // Tile includes @@ -28,6 +28,7 @@ #include "TileEvent/TileRawChannelContainer.h" #include "TileEvent/TileTriggerContainer.h" #include "TileEvent/TileLaserObject.h" +#include "TileConditions/ITileDCSTool.h" #include "TileEvent/TileDQstatus.h" // Atlas includes @@ -50,7 +51,6 @@ class TileHWID; class TileRawChannelCollection; class StoreGateSvc; class TileBeamInfoProvider; -class TileDCSSvc; class ITileBadChanTool; class IAtRndmGenSvc; namespace CLHEP { @@ -61,7 +61,7 @@ namespace CLHEP { /** @class coincBoard -@brief Small class holding the information for a cosmic trigger coincidence board +@brief Small class holding the information for a cosmic trigger coincidence board */ class coincBoard { public: @@ -83,16 +83,16 @@ class TileBeamInfoProvider: public AthAlgTool virtual StatusCode initialize(); //!< intialize method virtual StatusCode finalize(); //!< finalize method - - virtual void handle(const Incident&) ; //!< Callback for Incident service + + virtual void handle(const Incident&) ; //!< Callback for Incident service static const InterfaceID& interfaceID( ) ; //!< AlgTool InterfaceID - + const TileDQstatus* getDQstatus(); //<! Creates TileDQstatus object and fills arrays from DQ fragment - bool isChanDCSgood (int partition, int drawer, int channel) const; + bool isChanDCSgood (int partition, int drawer, int channel) const; - inline uint32_t eventCounter(void) const { return m_evt; } + inline uint32_t eventCounter(void) const { return m_evt; } inline uint32_t calibMode(void) const { return m_calibMode; } inline int trigType(void) const { return m_trigType; } inline uint32_t laserFlag(void) const { return m_laserFlag; } @@ -117,29 +117,29 @@ class TileBeamInfoProvider: public AthAlgTool bool m_checkDQ; //!< if false, skip DQ checks (set to false if container is not found in first event) bool m_checkDigi; //!< if false, skip reading of TileDigitsContainer ( /-/-/-/ ) bool m_checkBeam; //!< if false, skip reading of TileBeamContainer ( /-/-/-/ ) - bool m_checkDCS; //!< if false, do not use TileDCSSvc at all + bool m_checkDCS; //!< if false, do not use Tile DCS at all bool m_simulateTrips; //! if true simulate drawer trips - SG::ReadHandleKey<xAOD::EventInfo> m_eventInfoKey{this, "EventInfo", + SG::ReadHandleKey<xAOD::EventInfo> m_eventInfoKey{this, "EventInfo", "EventInfo", "Input Event info key"}; - SG::ReadHandleKey<TileBeamElemContainer> m_beamElemContainerKey{this, "TileBeamElemContainer", + SG::ReadHandleKey<TileBeamElemContainer> m_beamElemContainerKey{this, "TileBeamElemContainer", "", "Input Tile beam elements container key"}; - SG::ReadHandleKey<TileDigitsContainer> m_digitsContainerKey{this, "TileDigitsContainer", + SG::ReadHandleKey<TileDigitsContainer> m_digitsContainerKey{this, "TileDigitsContainer", "", "Input Tile digits container key"}; - SG::ReadHandleKey<TileRawChannelContainer> m_rawChannelContainerKey{this, "TileRawChannelContainer", + SG::ReadHandleKey<TileRawChannelContainer> m_rawChannelContainerKey{this, "TileRawChannelContainer", "", "Input Tile raw channel container key"}; - SG::WriteHandleKey<TileTriggerContainer> m_triggerContainerKey{this, "TileTriggerContainer", + SG::WriteHandleKey<TileTriggerContainer> m_triggerContainerKey{this, "TileTriggerContainer", "", "Output Tile trigger container key"}; - SG::WriteHandleKey<TileLaserObject> m_laserObjectKey{this, "TileLaserObject", + SG::WriteHandleKey<TileLaserObject> m_laserObjectKey{this, "TileLaserObject", "", "Output Tile laser object key"}; - - ServiceHandle<TileDCSSvc> m_tileDCSSvc; //!< Pointer to TileDCSSvc + + ToolHandle<ITileDCSTool> m_tileDCS{this, "TileDCSTool", "TileDCSTool", "Tile DCS tool"}; ServiceHandle<IAtRndmGenSvc> m_rndmSvc; //!< Random number service to use ToolHandle<ITileBadChanTool> m_tileBadChanTool; //!< Tool which provides trips probabilities also @@ -165,7 +165,7 @@ class TileBeamInfoProvider: public AthAlgTool const TileDigitsContainer * m_digitsCnt; const TileRawChannelContainer * m_rcCnt; const TileBeamElemContainer * m_beamElemCnt; - + CLHEP::HepRandomEngine* m_pHRengine; //!< Random number generator engine to use double* m_rndmVec; diff --git a/TileCalorimeter/TileRecUtils/TileRecUtils/TileRecUtilsDict.h b/TileCalorimeter/TileRecUtils/TileRecUtils/TileRecUtilsDict.h new file mode 100644 index 0000000000000000000000000000000000000000..f2cca8820b2639d1f1ae7661663ea4cd0eed993d --- /dev/null +++ b/TileCalorimeter/TileRecUtils/TileRecUtils/TileRecUtilsDict.h @@ -0,0 +1,21 @@ +// This file's extension implies that it's C, but it's really -*- C++ -*-. +/* + * Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration. + */ +/** + * @file TileRecUtils/TileRecUtilsDict.h + * @author scott snyder <snyder@bnl.gov> + * @date Sep, 2018 + * @brief Generate dictionary for TileRecUtils. + */ + + +#ifndef TILERECUTILS_TILERECUTILSDICT_H +#define TILERECUTILS_TILERECUTILSDICT_H + + +// Needed for tests. +#include "TileRecUtils/TileBeamInfoProvider.h" + + +#endif // not TILERECUTILS_TILERECUTILSDICT_H diff --git a/TileCalorimeter/TileRecUtils/TileRecUtils/selection.xml b/TileCalorimeter/TileRecUtils/TileRecUtils/selection.xml new file mode 100644 index 0000000000000000000000000000000000000000..680265273c37e0e34b83bab69ddfa91a31b65cf2 --- /dev/null +++ b/TileCalorimeter/TileRecUtils/TileRecUtils/selection.xml @@ -0,0 +1,3 @@ +<lcgdict> + <class name="TileBeamInfoProvider"/> +</lcgdict> diff --git a/TileCalorimeter/TileRecUtils/share/TileCellBuilder_test.py b/TileCalorimeter/TileRecUtils/share/TileCellBuilder_test.py new file mode 100644 index 0000000000000000000000000000000000000000..ff87f189f380e573d03f9766a7fbbc5787d6d018 --- /dev/null +++ b/TileCalorimeter/TileRecUtils/share/TileCellBuilder_test.py @@ -0,0 +1,710 @@ +# +# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration. +# +# File: TileRecUtils/share/TileCellBuilder_test.py +# Author: sss +# Date: Aug, 2018 +# Brief: Test for TileCellBuilder. +# + +from __future__ import print_function + + +import ROOT +ROOT.TH1F + +from AthenaCommon.DetFlags import DetFlags +DetFlags.detdescr.Tile_setOn() +DetFlags.detdescr.LAr_setOn() + +RunNumber = 284500 + +import sys +import string +import ROOT +import math +from AtlasGeoModel import SetGeometryVersion +from AtlasGeoModel import GeoModelInit +from AtlasGeoModel import SetupRecoGeometry +include('TileConditions/TileConditions_jobOptions.py') + +from GeoModelSvc.GeoModelSvcConf import GeoModelSvc +ServiceMgr += GeoModelSvc() +theApp.CreateSvc += [ "GeoModelSvc"] +from AtlasGeoModel import TileGM +from AtlasGeoModel import LArGM #LAr needed to get MBTS DD. + +from IOVDbSvc.IOVDbSvcConf import IOVDbSvc +IOVDbSvc().GlobalTag = 'OFLCOND-RUN12-SDR-35' + +from AthenaCommon.AlgSequence import AlgSequence +topSequence = AlgSequence() + +theApp.EvtMax=12 + + + +hits_0 = [ + # (sec, side, mod, tow, samp, pmt, adc), [adc, time, qual, ped] + [0, [ + [(1, 1, 0, 1, 1, 0, 1), [ 0.2, 22.1, 2.4, 42.9]], + [(1, 1, 0, 1, 1, 1, 1), [-0.4, 75.0, 2.7, 31.4]], + [(1, 1, 0, 1, 0, 0, 1), [-0.9, -13.3, 1.5, 37.4]], + [(1, 1, 0, 2, 0, 1, 1), [41.8, 0.1, 2.5, 45.7]], + [(1, 1, 0, 2, 0, 0, 1), [30.6, -0.4, 2.0, 33.1]], + [(1, 1, 0, 2, 1, 1, 1), [ 1.4, 12.9, 4.7, 43.1]], + [(1, 1, 0, 2, 1, 0, 1), [ 3.4, 3.5, 1.9, 54.2]], + ]], + + [136, [ + [(3, 1, 8, 13, 3, 0, 1), [26.9, 4.8, 5.2, 45.4]], + ]], + + [146, [ + [(3, 1, 18, 13, 3, 0, 1), [ 4.4, -26.5, 23.9, 51.2]], + [(3, 1, 18, 15, 3, 0, 1), [-0.1, -75.0, 3.7, 51.0]], + [(3, 1, 18, 8, 2, 0, 1), [-0.1, 75.0, 4.2, 41.7]], + [(3, 1, 18, 8, 2, 1, 1), [ 3.5, -11.9, 2.6, 44.7]], + [(3, 1, 18, 9, 1, 0, 1), [ 0.8, -17.6, 1.8, 49.2]], + [(3, 1, 18, 9, 1, 1, 1), [ 0.1, -75.0, 3.4, 48.4]], + [(2, 1, 18, 11, 0, 0, 1), [ 8.7, 0.4, 2.7, 50.2]], + [(2, 1, 18, 11, 0, 1, 1), [ 6.3, 1.9, 1.6, 48.6]], + [(2, 1, 18, 10, 1, 0, 1), [53.3, 1.3, 3.8, 38.4]], + [(2, 1, 18, 10, 1, 1, 1), [64.1, 1.0, 3.5, 36.9]], + [(2, 1, 18, 12, 0, 0, 1), [-0.2, -75.0, 2.8, 38.1]], + [(2, 1, 18, 12, 0, 1, 1), [ 0.5, -32.7, 1.9, 40.3]], + [(3, 1, 18, 10, 3, 0, 1), [ 5.4, 7.7, 8.2, 57.0]], + [(3, 1, 18, 11, 3, 0, 1), [48.9, 0.4, 4.0, 32.3]], + [(2, 1, 18, 11, 1, 0, 1), [38.5, 0.5, 1.7, 46.8]], + [(2, 1, 18, 11, 1, 1, 1), [48.1, 0.3, 1.6, 46.3]], + [(2, 1, 18, 10, 2, 0, 1), [ 0.3, 75.0, 2.0, 34.9]], + [(2, 1, 18, 10, 2, 1, 1), [0.1, -75.0, 3.7, 54.7]], + ]], + + # Some MBTS cells. + [135, [ [(4, 1, 0, 1, 0, 0, 0), [ 59.1, 2.8, 6.9, 56.2]] ]], + [181, [ [(4, 1, 6, 1, 0, 0, 0), [ 56.4, 1.2, 2.9, 39.9]] ]], + [182, [ [(4, 1, 6, 0, 0, 0, 0), [ 44.9, 0.5, 1.4, 42.1]] ]], + [231, [ [(4, -1, 3, 0, 0, 0, 0), [107.9, 1.7, 7.8, 47.8]] ]], + + # Some E4 cells. + [220, [ [(4, -1, 0, 2, 0, 0, 0), [ 2.3, 3.2, 2.5, 44.4]] ]], + [223, [ [(4, -1, 1, 2, 0, 0, 0), [ 3.1, -5.3, 2.4, 44.4]] ]], + [225, [ [(4, -1, 2, 2, 0, 0, 0), [ -0.4, 27.6, 1.3, 32.5]] ]], + [228, [ [(4, -1, 3, 2, 0, 0, 0), [ 0.2, -75.0, 2.4, 35.4]] ]], + + # Some disconnected cells. + [253, [ + [4706026383833300992, [ 0, 0, 0, 50000]], + [4706027483344928768, [ 0, 0, 0, 50000]] ], ], + [255, [ + [4706157225717006336, [ 0, 0, 0, 80000]], + [4706158325228634112, [ 0, 0, 0, 80000]] ], ], +] + + +# Add an offset to one pedestal value. +def add_pedestal (offs_addr, offs): + out = [] + for icoll, colldata in hits_0: + colldata_out = [] + for addr, data in colldata: + if addr == offs_addr: + data = data[:] + data[3] += offs + colldata_out.append ([addr, data]) + out.append ([icoll, colldata_out]) + return out + + +exp_cells_0 = { + (1, 1, 0, 1, 0) : [-10.4734, -10.4734, -13.3, -13.3, 1, 1, 130, 138, 1, 1], + (1, 1, 0, 1, 1) : [ 2.3274, -4.6548, 22.1, 75.0, 2, 2, 130, 130, 1, 1], + (1, 1, 0, 2, 0) : [356.0956, 486.4312, -0.4, 0.1, 2, 2, 162, 162, 1, 1], + (1, 1, 0, 2, 1) : [ 39.5662, 16.2920, 3.5, 12.9, 1, 4, 162, 130, 1, 1], + + (2, 1, 18, 10, 1):[620.25793, 745.93872, 1.3, 1.0, 3, 3, 162, 162, 1, 1], + (2, 1, 18, 10, 2):[ 3.49113, 1.16371, 75.0, -75.0, 2, 3, 130, 130, 1, 1], + (2, 1, 18, 11, 0):[101.24284, 73.31380, 0.4, 1.9, 2, 1, 162, 162, 1, 1], + (2, 1, 18, 11, 1):[448.02869, 559.74500, 0.5, 0.3, 1, 1, 162, 162, 1, 1], + (2, 1, 18, 12, 0):[ -2.32742, 5.81855,-75.0, -32.7, 2, 1, 130, 130, 1, 1], + (3, 1, 18, 8, 2):[ -0.96976, 33.94157, 75.0, -11.9, 4, 2, 130, 130, 1, 1], + (3, 1, 18, 9, 1):[ 7.75807, 0.96976,-17.6, -75.0, 1, 3, 130, 130, 1, 1], + (3, 1, 18, 10, 3):[ 41.89359, 0.0, 7.7, 7.7, 8, 0, 162, 0, 1,-1], + (3, 1, 18, 11, 3):[379.36975, 0.0, 0.4, 0.4, 4, 0, 162, 0, 1,-1], + (3, 1, 18, 13, 3):[ 34.13552, 0.0, -26.5, -26.5,23, 0, 130, 0, 1,-1], + (3, 1, 18, 15, 3):[ -0.77581, 0.0, -75.0, -75.0, 3, 0, 130, 0, 1, -1], + + # coll 136 + (3, 1, 8, 13, 3) : [208.6922, 0.0, 4.8, 4.8, 5, 0, 162, 0, 1, -1], +} + + +exp_mbts_0 = { + (4, 1, 0, 1, 0) : [0.7221, 0.0, 2.8, 2.8, 6, 0, 162, 0, 1, -1], + (4, 1, 6, 1, 0) : [0.6891, 0.0, 1.2, 1.2, 2, 0, 162, 0, 1, -1], + (4, 1, 6, 0, 0) : [0.5486, 0.0, 0.5, 0.5, 1, 0, 162, 0, 1, -1], + (4, -1, 3, 0, 0) : [1.318, 0.0, 1.7, 1.7, 7, 0, 162, 0, 1, -1], +} + + +exp_e4_0 = { + (4, -1, 0, 2, 0) : [17.84357, 0.0, 3.2, 3.2, 2, 0, 130, 0, 1, -1], + (4, -1, 1, 2, 0) : [24.05003, 0.0, -5.3, -5.3, 2, 0, 130, 0, 1, -1], + (4, -1, 2, 2, 0) : [-3.10323, 0.0, 27.6, 27.6, 1, 0, 130, 0, 1, -1], + (4, -1, 3, 2, 0) : [1.551615, 0.0, -75.0, -75.0, 2, 0, 130, 0, 1, -1], +} + + +def exp_merge (base, d): + new = base.copy() + new.update (d) + return new + + +# Underflow. +hits_1 = add_pedestal ((3, 1, 18, 15, 3, 0, 1), 10000) +exp_cells_1 = exp_merge (exp_cells_0, { + (3, 1, 18, 15, 3) : [-0.7758, 0.0, -75.0, -75.0, 3, 0, 146, 0, 1, -1], +}) + +# Overflow. +hits_2 = add_pedestal ((3, 1, 18, 15, 3, 0, 1), 20000) +exp_cells_2 = exp_merge (exp_cells_0, { + (3, 1, 18, 15, 3) : [-0.7758, 0.0, -75.0, -75.0, 3, 0, 146, 0, 1, -1], +}) + +# TileBadChan errors. +exp_cells_3 = exp_merge (exp_cells_0, { + (3, 1, 18, 8, 2) : [ 33.9416, 33.9416, -11.9, -11.9, 2, 2, 138, 130, 1, 1], + (2, 1, 18, 11, 0) : [101.2428, 73.3138, 1.9, 1.9, 2, 1, 34, 162, 1, 1], + (2, 1, 18, 12, 0) : [ -2.3274, -2.3274, -75.0, -75.0, 2, 2, 130, 138, 1, 1], +}) +exp_mbts_3 = exp_merge (exp_mbts_0, { + (4, 1, 0, 1, 0) : [ 0.0, 0.0, -100.0,-100.0,255,0, 10, 8, 1,-1], + (4, 1, 6, 1, 0) : [ 0.6891, 0.0, 0.0, 0.0, 2, 0, 34, 0, 1,-1], +}) + +# TileBeamInfoProvider errors +exp_cells_4 = exp_merge (exp_cells_0, { + (2, 1, 18, 10, 1):[620.2579,620.2579, 1.3, 1.3, 3, 3, 161, 169, 1, 1], + (2, 1, 18, 12, 0):[ 0.5, 0.5, 0.0, 0.0, 255, 255, 9, 9, 1, 1], + (3, 1, 18, 8, 2):[ 33.9416, 33.9416,-11.9,-11.9, 2, 2, 137, 129, 1, 1], + (3, 1, 18, 13, 3):[ 0.5, 0.0, 0.0, 0.0, 255, 0, 9, 8, 1,-1], + (3, 1, 18, 15, 3):[ 0.5, 0.0, 0.0, 0.0, 255, 0, 9, 8, 1,-1], +}) + + +# fakeCrackCells +exp_cells_5 = exp_merge (exp_cells_0, { + (3, 1, 8, 8, 2) : [0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0], + (3, 1, 8, 9, 1) : [0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0], + (3, 1, 8, 10, 3) : [0.0, 0.0, 0.0, 0.0, 0, 0, 8, 8, 0, -1], + (3, 1, 8, 11, 3) : [0.0, 0.0, 0.0, 0.0, 0, 0, 8, 8, 0, -1], + (3, 1, 8, 15, 3) : [0.0, 0.0, 0.0, 0.0, 0, 0, 8, 8, 0, -1], +}) + + +def filter_e (base, thresh): + out = {} + for addr, l in base.items(): + if l[0] >= thresh or l[1] >= thresh: + out[addr] = l + return out + +# EThreshold +exp_cells_6 = filter_e (exp_cells_0, 300) + + + +# corrections +exp_cells_7 = exp_merge (exp_cells_0, { + (1, 1, 0, 2, 0) : [356.1491, 486.4361, -0.4, 0.1, 2, 2, 162, 162, 1, 1], + (2, 1, 18, 10, 1) : [621.3283, 746.7004, 1.3, 1.0, 3, 3, 162, 162, 1, 1], + (2, 1, 18, 11, 1) : [448.1431, 559.7963, 0.5, 0.3, 1, 1, 162, 162, 1, 1], + (3, 1, 8, 13, 3) : [213.6019, 0.0, 4.8, 4.8, 5, 0, 162, 0, 1,-1], + (3, 1, 18, 11, 3) : [379.4317, 0.0, 0.4, 0.4, 4, 0, 162, 0, 1,-1], +}) +exp_mbts_7 = exp_merge (exp_mbts_0, { + (4, 1, 0, 1, 0) : [0.7279, 0.0, 2.8, 2.8, 6, 0, 162, 0, 1, -1], + (4, 1, 6, 1, 0) : [0.6902, 0.0, 1.2, 1.2, 2, 0, 162, 0, 1, -1], + (4, -1, 3, 0, 0) : [1.3223, 0.0, 1.7, 1.7, 7, 0, 162, 0, 1, -1], +}) + + +# noisefilter +exp_cells_8 = exp_merge (exp_cells_0, { + (1, 1, 0, 1, 0) : [-11.3462, -11.3462, -13.3, -13.3, 1, 1, 130, 138, 1, 1], + (1, 1, 0, 1, 1) : [ 1.4546, -5.5276, 22.1, 75.0, 2, 2, 130, 130, 1, 1], + (1, 1, 0, 2, 0) : [355.2228, 485.5583, -0.4, 0.1, 2, 2, 162, 162, 1, 1], + (1, 1, 0, 2, 1) : [ 39.5662, 15.4192, 3.5, 12.9, 1, 4, 162, 130, 1, 1], +}) + + +# DSP w/corrrections +exp_cells_10 = exp_merge (exp_cells_7, { + (1, 1, 0, 2, 0) : [356.1227, 486.4159, -0.4, 0.1, 2, 2, 162, 162, 1, 1], +}) + + + +# TileFragHash::TYPE +class TileFragHash: + Beam = 255 + Default = 0 + Digitizer = 0 + OptFilterDsp = 1 + OptFilterOffline = 2 + OptFilterDspCompressed = 3 + ManyAmps = 4 + MF = 5 + FitFilter = 6 + FitFilterCool = 7 + FlatFilter = 8 + + +from AthenaPython.PyAthenaComps import Alg, StatusCode +class TestAlg (Alg): + def __init__ (self, name): + Alg.__init__ (self, name) + return + + def initialize (self): + ROOT.ICaloCellMakerTool + + def gettool (name): + tool = ROOT.ToolHandle(ROOT.ICaloCellMakerTool)('TileCellBuilder/' + name) + if not tool.retrieve(): + assert 0 + return tool + + self.tool1 = gettool ('tool1') + self.tool2 = gettool ('tool2') + self.tool4 = gettool ('tool4') + self.tool5 = gettool ('tool5') + self.tool6 = gettool ('tool6') + self.tool7 = gettool ('tool7') + self.tool8 = gettool ('tool8') + self.tool9 = gettool ('tool9') + self.tool10 = gettool ('tool10') + self.tool11 = gettool ('tool11') + + self.beaminfo4 = ROOT.ToolHandle(ROOT.TileBeamInfoProvider)('TileBeamInfoProvider/beaminfo4') + if not self.beaminfo4.retrieve(): + return StatusCode.Failure + return StatusCode.Success + + + def finalize (self): + self.check_bad_chan_lines() + return StatusCode.Success + + + def execute (self): + iev = self.getContext().evt() + + hits = hits_0 + exp_cells = exp_cells_0 + exp_mbts = exp_mbts_0 + extra_ei_flags = 0 + tool = self.tool1 + baddq = {} + bsflags = 0x32002000 + dspbsflags = 0x32002000 + rctype = TileFragHash.OptFilterOffline + dspcolls = set() + if iev == 0: + # Event 0: nominal + pass + + elif iev == 1: + # Event 1: Add an underflow. + hits = hits_1 + extra_ei_flags = 0x40 + exp_cells = exp_cells_1 + + elif iev == 2: + # Event 2: Add an overflow. + hits = hits_2 + extra_ei_flags = 0x400 + exp_cells = exp_cells_2 + + elif iev == 3: + # Event 3: Bad channels + tool = self.tool2 + exp_cells = exp_cells_3 + exp_mbts = exp_mbts_3 + + elif iev == 4: + # Event 4: Bad channels from BeamInfoProvider. + tool = self.tool4 + rctype = TileFragHash.OptFilterDsp + baddq = {146 : [2, 10]} + exp_cells = exp_cells_4 + + elif iev == 5: + # Event 5: fakeCrackCells + tool = self.tool5 + exp_cells = exp_cells_5 + + elif iev == 6: + # Event 6: Threshold. + tool = self.tool6 + exp_cells = exp_cells_6 + + elif iev == 7: + # Event 7: Corrections + tool = self.tool7 + bsflags = 0x32000000 + exp_cells = exp_cells_7 + exp_mbts = exp_mbts_7 + + elif iev == 8: + # Event 8: noise filter + tool = self.tool8 + exp_cells = exp_cells_8 + + elif iev == 9: + # Event 9: dsp container + tool = self.tool9 + dspcolls.add (0) + + elif iev == 10: + # Event 10: dsp container + corrections + tool = self.tool10 + dspcolls.add (0) + bsflags = 0x32000000 + dspbsflags = 0x20000000 + exp_cells = exp_cells_10 + exp_mbts = exp_mbts_7 + + else: + # Event 11: dsp container + noise filter + tool = self.tool11 + dspcolls.add (0) + exp_cells = exp_cells_8 + + + self.record_raw_data (hits, rctype, baddq, bsflags, dspbsflags, dspcolls) + if iev == 4: + self.beaminfo4.setContainers (None, + self.evtStore['TileRawChannelCnt'], + None) + + ccc = ROOT.CaloCellContainer() + if not tool.process (ccc): + return StatusCode.Failure + + self.compare_cells (ccc, exp_cells, rctype) + self.compare_cells (self.evtStore['MBTSContainer'], exp_mbts, rctype) + self.compare_cells (self.evtStore['E4prContainer'], exp_e4_0, rctype) + + self.check_ei (extra_ei_flags) + return StatusCode.Success + + + @staticmethod + def update_qbit (qb, rctype): + if qb == 0: return 0 + return qb&(~7) | rctype + + + def record_raw_data (self, hits, typ, baddq, bsflags, dspbsflags, dspcolls): + idHelper = self.detStore['CaloCell_ID'].tile_idHelper() + + unit = 0 # TileRawChannelUnit::ADCcounts + cont = ROOT.TileRawChannelContainer (False, typ, unit) + cont.set_bsflags (bsflags) + hashFunc = cont.hashFunc() + + dspcont = None + if dspcolls: + dspcont = ROOT.TileRawChannelContainer (False, typ, unit) + dspcont.set_bsflags (dspbsflags) + + for icoll, colldata in hits: + coll = ROOT.TileRawChannelCollection (hashFunc.identifier(icoll)) + + mask = 0 + for chan in baddq.get (icoll, []): + mask |= (1<<(chan/3)) + coll.setFragMemoryPar(mask) + + for addr, data in colldata: + if type(addr) == type(()): + adc_id = idHelper.adc_id (*addr) + chan = ROOT.TileRawChannel (adc_id, *data) + else: + hwid = ROOT.HWIdentifier (addr) + chan = ROOT.TileRawChannel (hwid, *data) + coll.push_back (chan) + + if icoll in dspcolls: + thiscont = dspcont + else: + thiscont = cont + thiscont.addCollection (coll, ROOT.IdentifierHash(icoll)) + ROOT.SetOwnership (coll, False) + + self.evtStore.record (cont, 'TileRawChannelCnt', False) + if dspcont: + self.evtStore.record (dspcont, 'TileRawChannelCntDsp', False) + return + + + def compare_cells (self, ccc, exp_cells, rctype): + exp_cells = exp_cells.copy() + idHelper = self.detStore['CaloCell_ID'].tile_idHelper() + + for c in ccc: + lcell = [c.ene1(), c.ene2(), c.time1(), c.time2(), + ord(c.qual1()), ord(c.qual2()), + ord(c.qbit1()), ord(c.qbit2()), + c.gain1(), c.gain2()] + + cid = c.ID() + addr = (idHelper.section(cid), + idHelper.side(cid), + idHelper.module(cid), + idHelper.tower(cid), + idHelper.sampling(cid)) + l = exp_cells.get (addr) + if not l: + print ('xxx unexpected cell', addr, lcell) + assert 0 + continue + + l = l[:] + + # Low 3 bits of qbit correspond to rctype, unless cell was masked. + if l[0] != 0: l[6] = TestAlg.update_qbit (l[6], rctype) + if l[1] != 0: l[7] = TestAlg.update_qbit (l[7], rctype) + + if (abs (lcell[0] - l[0]) > 1e-3 or + abs (lcell[1] - l[1]) > 1e-3 or + abs (lcell[2] - l[2]) > 1e-3 or + abs (lcell[3] - l[3]) > 1e-3 or + abs (lcell[4] != l[4]) or + abs (lcell[5] != l[5]) or + abs (lcell[6] != l[6]) or + abs (lcell[7] != l[7]) or + abs (lcell[8] != l[8]) or + abs (lcell[9] != l[9])): + print ('xxx cell mismatch: ', addr, lcell, l) + assert 0 + del exp_cells[addr] + + for extra in exp_cells: + print ('xxx unfound cell', extra) + assert 0 + return + + + def check_ei (self, extra_flags): + ei = self.evtStore['EventInfo'] + print ('zzz', hex(ei.eventFlags (ROOT.xAOD.EventInfo.Tile)), ei.errorState (ROOT.xAOD.EventInfo.Tile), hex(0xf0f0005 | extra_flags)) + assert ei.eventFlags (ROOT.xAOD.EventInfo.Tile) == (0xf0f0005 | extra_flags) + assert ei.errorState (ROOT.xAOD.EventInfo.Tile) == ROOT.xAOD.EventInfo.Error + return + + + def make_bad_chan_lines (self, chans): + idHelper = self.detStore['CaloCell_ID'].tile_idHelper() + hwidHelper = self.detStore['TileHWID'] + cabling = ROOT.TileCablingService.getInstance() + + lines = [] + for addr, data in chans: + pmt_id = idHelper.pmt_id (*addr) + channel_id = cabling.s2h_channel_id (pmt_id) + frag = hwidHelper.frag (channel_id) + channel = hwidHelper.channel (channel_id) + line = '0x%03x %d 0 %d %d %d' % (frag, channel, data[0], data[1], data[2]) + lines.append (line) + + return '\n'.join (lines) + + + def check_bad_chan_lines (self): + for name, (chans, lines) in baddefs.items(): + xlines = self.make_bad_chan_lines (chans) + if xlines.strip() != lines.strip(): + print ('xxx Bad chan lines need updating: ', name) + print (xlines) + return + + +######################################################################### + + +baddefs = {} +BAD_LOW = [1<<1, 0, 0] # AdcDead +BAD_HIGH = [ 0, 1<<1, 0] # AdcDead +BAD_BOTH = [ 0, 0, 1<<1] # NoHV +BADTIMING = [ 0, 0, 1<<9] # BadTiming + +# chans: [(sec, side, mod, tow, samp, pmt), [DATA0, DATA1, DATA2]] +# We'd like to specify cells using offline addressing, but the bad cell +# file uses online addressing. We can convert, but that requires +# idhelpers, etc, that aren't available until after initialization. +# So we pass in both representations; in finalize(), we'll check +# that they match and print out the correct bad cell lines +# if they do not. +def make_tileBadChanTool (name, chans = [], lines = ''): + global ToolSvc + from TileConditions.TileCondProxyConf import getTileCondProxy + from TileConditions.TileConditionsConf import TileBadChanTool + from TileConditions.TileConditionsConf import TileBadChannelsCondAlg + + # File data line format: + # frag channel dummy adcStatus0 adcStatus1 chnStatus + # chnStatus + adcStatusN are given to TileBchDecoder. + # Offline problem masks: + # chn adc + # 0 GeneralMaskChannel GeneralMaskAdc + # 1 NoPmt AdcDead + # 2 NoHV StuckBit + # 3 WrongHV DataCorruption + # 4 NoLaser VeryLargeHfNoise + # 5 BadLaser NoData + # 6 NoCesium WrongDspConfig + # 7 BadCesium LargeHfNoise + # 8 NoTiming CorrelatedNoise + # 9 BadTiming LargeLfNoise + # 10 TrigGeneralMask NoCis + # 11 TrigNoGain BadCis + # 12 TrigHalfGain SevereStuckBit + # 13 TrigNoisy SevereDataCorruption + # 14 Emergency IgnoredByDQV + # 15 HVReadoutPb + # 16 BrokenClearFibre + # 17 IgnoreCs + # 18 UnstableCs + # + # + # Online problem masks: + # chn adc + # 0 IgnoredInDsp OnlineGeneralMaskAdc + # 1 IgnoredInHlt + # 2 DisableForL1 + # 3 TrigGeneralMask + # 4 TrigNoGain + # 5 TrigHalfGain + # 6 TrigNoisy + # 7 OnlineBadTiming + + if not chans: + TileBchList = 'TileNoBad.oflBch' + else: + TileBchList = name + '.bch' + f = open (TileBchList, 'w') + print ('OBJVERSION 0', file=f) + print ('0x000 0 0 0 0 0', file=f) + f.write (lines) + f.close() + baddefs[name] = (chans, lines) + + from AthenaCommon.AlgSequence import AthSequencer + condSeq = AthSequencer("AthCondSeq") + + condAlg = TileBadChannelsCondAlg (name + 'Cond', + TileBadChannels = name + 'CondData', + OflBchProxy = getTileCondProxy ('FILE', 'Bch', TileBchList, name + '_ofl'), + OnlBchProxy = getTileCondProxy ('FILE', 'Bch', 'TileNoBad.oflBch', name + '_onl'), + ) + condSeq += condAlg + + bct = TileBadChanTool (name, + TileBadChannels = name + 'CondData') + ToolSvc += bct + return bct + + +bct1 = make_tileBadChanTool ('tilecellbuilder_bct1') + +bct2 = make_tileBadChanTool ('tilecellbuilder_bct2', + [[(3, 1, 18, 8, 2, 0), BAD_HIGH], + [(2, 1, 18, 9, 1, 0), BAD_LOW], + [(2, 1, 18, 12, 0, 1), BAD_BOTH], + [(2, 1, 18, 11, 0, 0), BADTIMING], + [(4, 1, 0, 1, 0, 0), BAD_BOTH], + [(4, 1, 6, 1, 0, 0), BADTIMING], + ], + """ +0x312 2 0 0 2 0 +0x312 4 0 2 0 0 +0x312 11 0 0 0 2 +0x312 6 0 0 0 512 +0x307 12 0 0 0 2 +0x335 12 0 0 0 512 +""") + + + +from TileRecUtils.TileRecUtilsConf import TileCellBuilder, TileBeamInfoProvider, TileRawChannelNoiseFilter +beaminfo4 = TileBeamInfoProvider ('beaminfo4') +ToolSvc += beaminfo4 +noisefilter = TileRawChannelNoiseFilter ('noisefilter') +ToolSvc += noisefilter + +def maketool (name, bct, **kw): + return TileCellBuilder (name, TileBadChanTool = bct, **kw) +ToolSvc += maketool ('tool1', bct1) +ToolSvc += maketool ('tool2', bct2) +ToolSvc += maketool ('tool4', bct1, BeamInfo = beaminfo4) +ToolSvc += maketool ('tool5', bct1, fakeCrackCells = True) +ToolSvc += maketool ('tool6', bct1, EThreshold = 300) +ToolSvc += maketool ('tool7', bct1, correctAmplitude = True, correctTime = True) +ToolSvc += maketool ('tool8', bct1, NoiseFilterTools = [noisefilter]) +ToolSvc += maketool ('tool9', bct1, TileDSPRawChannelContainer = 'TileRawChannelCntDsp') +ToolSvc += maketool ('tool10', bct1, TileDSPRawChannelContainer = 'TileRawChannelCntDsp', + correctTime = True, correctAmplitude = True) +ToolSvc += maketool ('tool11', bct1, TileDSPRawChannelContainer = 'TileRawChannelCntDsp', + NoiseFilterTools = [noisefilter]) + +from xAODEventInfoCnv.xAODEventInfoCnvConf import xAODMaker__EventInfoCnvAlg +topSequence += xAODMaker__EventInfoCnvAlg (DoBeginRun = False) + +testalg1 = TestAlg ('testalg1') +topSequence += testalg1 + + + +def addr(x): + cabling=ROOT.TileCablingService.getInstance() + hwid = ROOT.HWIdentifier(x) + adcid=cabling.h2s_adc_id(hwid) + idHelper = testalg1.detStore['CaloCell_ID'].tile_idHelper() + return (idHelper.section(adcid), + idHelper.side(adcid), + idHelper.module(adcid), + idHelper.tower(adcid), + idHelper.sampling(adcid), + idHelper.pmt(adcid), + idHelper.adc(adcid)) + +def selindex (fname): + from array import array + cabling=ROOT.TileCablingService.getInstance() + lcoll = '' + for l in open(fname).readlines(): + l = l.strip() + if l.find('Coll') == 0: + lcoll = l + continue + if l.find('[') < 0: continue + iid = int(l.split()[0]) + hwid = ROOT.HWIdentifier(iid) + index=array('i',[0]) + pmt=array('i',[0]) + cabling.h2s_cell_id_index (hwid, index, pmt) + #if index[0] == -3: + # print (iid, addr(iid), lcoll, l) + hwidHelper = testalg1.detStore['TileHWID'] + ros = hwidHelper.ros (hwid) + chan = hwidHelper.channel (hwid) + if chan == 0 and ros > 2: + drawer = hwidHelper.drawer (hwid) + idx = (ros - 3) * 64 + drawer + print (iid, idx, addr(iid), lcoll, l) + return diff --git a/TileCalorimeter/TileRecUtils/share/TileCellBuilder_test.ref b/TileCalorimeter/TileRecUtils/share/TileCellBuilder_test.ref new file mode 100644 index 0000000000000000000000000000000000000000..23fa680eb4eb20ce68f17fd12341e908dfcee98e --- /dev/null +++ b/TileCalorimeter/TileRecUtils/share/TileCellBuilder_test.ref @@ -0,0 +1,611 @@ +Tue Sep 25 19:06:24 CEST 2018 +Preloading tcmalloc_minimal.so +Py:Athena INFO including file "AthenaCommon/Preparation.py" +Py:Athena INFO using release [AthenaWorkDir-22.0.1] [x86_64-slc6-gcc62-opt] [atlas-work3/8583d770640] -- built on [2018-09-25T1457] +Py:Athena INFO including file "AthenaCommon/Atlas.UnixStandardJob.py" +Py:Athena INFO executing ROOT6Setup +Py:Athena INFO including file "AthenaCommon/Execution.py" +Py:Athena INFO including file "TileRecUtils/TileCellBuilder_test.py" +[?1034hSetGeometryVersion.py obtained major release version 22 +Py:Athena INFO including file "IdDictDetDescrCnv/IdDictDetDescrCnv_joboptions.py" +Py:ConfigurableDb INFO Read module info for 5501 configurables from 54 genConfDb files +Py:ConfigurableDb INFO No duplicates have been found: that's good ! +EventInfoMgtInit: Got release version Athena-22.0.1 +Py:IOVDbSvc.CondDB INFO Setting up conditions DB access to instance OFLP200 +Py:Athena INFO including file "TileConditions/TileConditions_jobOptions.py" +Py:TileInfoConf. INFO Adding TileCablingSvc to ServiceMgr +Py:TileConditions_jobOptions.py INFO Forcing RUN2 (2014-2017) cabling for run 284500 with geometry ATLAS-R2-2016-01-00-01 +Py:TileConditions_jobOptions.py INFO Adjusting TileInfo for 7 samples +Py:TileConditions_jobOptions.py INFO setting up COOL for TileCal conditions data +Py:TileInfoConf. INFO Changing default TileBadChanTool configuration to COOL source +Py:TileInfoConf. INFO Changing default TileBadChanLegacyTool configuration to COOL source +Py:TileInfoConf. INFO Changing default TileCondToolEmscale configuration to COOL source +Py:TileInfoConf. INFO Changing default TileCondToolNoiseSample configuration to COOL source +Py:TileInfoConf. INFO Changing default TileCondToolTiming configuration to COOL source +Py:TileConditions_jobOptions.py INFO Adjusting TileInfo to return cell noise for Opt.Filter without iterations +Py:Athena INFO including file "AthenaCommon/runbatch.py" +ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 +ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 +ApplicationMgr SUCCESS +==================================================================================================================================== + Welcome to ApplicationMgr (GaudiCoreSvc v30r3) + running on lxplus034.cern.ch on Tue Sep 25 19:06:33 2018 +==================================================================================================================================== +ApplicationMgr INFO Successfully loaded modules : AthenaServices +ApplicationMgr INFO Application Manager Configured successfully +ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 +StatusCodeSvc INFO initialize +AthDictLoaderSvc INFO in initialize... +AthDictLoaderSvc INFO acquired Dso-registry +ClassIDSvc INFO getRegistryEntries: read 6946 CLIDRegistry entries for module ALL +CoreDumpSvc INFO install f-a-t-a-l handler... (flag = -1) +CoreDumpSvc INFO Handling signals: 11(Segmentation fault) 7(Bus error) 4(Illegal instruction) 8(Floating point exception) +MetaDataSvc INFO Initializing MetaDataSvc - package version AthenaServices-00-00-00 +AthenaPoolCnvSvc INFO Initializing AthenaPoolCnvSvc - package version AthenaPoolCnvSvc-00-00-00 +PoolSvc INFO io_register[PoolSvc](xmlcatalog_file:PoolFileCatalog.xml) [ok] +PoolSvc INFO Set connectionsvc retry/timeout/IDLE timeout to 'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled +PoolSvc INFO Frontier compression level set to 5 +DBReplicaSvc INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy-wigner.cern.ch:3128) will be considered for COOL data +DBReplicaSvc INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-09-24T2056/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/dbreplica.config +DBReplicaSvc INFO Total of 10 servers found for host lxplus034.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] +PoolSvc INFO Successfully setup replica sorting algorithm +PoolSvc INFO Setting up APR FileCatalog and Streams +PoolSvc WARNING Unable to locate catalog for prfile:poolcond/PoolCat_oflcond.xml check your ATLAS_POOLCOND_PATH and DATAPATH variables +PoolSvc WARNING Unable to locate catalog for apcfile:poolcond/PoolCat_oflcond.xml check your ATLAS_POOLCOND_PATH and DATAPATH variables +PoolSvc INFO Resolved path (via ATLAS_POOLCOND_PATH) is /cvmfs/atlas-condb.cern.ch/repo/conditions/poolcond/PoolFileCatalog.xml +PoolSvc INFO POOL WriteCatalog is xmlcatalog_file:PoolFileCatalog.xml +DbSession INFO Open DbSession +Domain[ROOT_All] INFO > Access DbDomain READ [ROOT_All] +IOVDbSvc INFO Opened read transaction for POOL PersistencySvc +IOVDbSvc INFO Only 5 POOL conditions files will be open at once +IOVDbSvc INFO Cache alignment will be done in 3 slices +IOVDbSvc INFO Global tag: OFLCOND-RUN12-SDR-35 set from joboptions +IOVDbSvc INFO Read from meta data only for folder /TagInfo +IOVDbSvc INFO Initialised with 3 connections and 14 folders +IOVDbSvc INFO Service IOVDbSvc initialised successfully +IOVDbSvc INFO preLoadAddresses: Removing folder /TagInfo. It should only be in the file meta data and was not found. +IOVDbSvc INFO Opening COOL connection for COOLOFL_LAR/OFLP200 +IOVSvc INFO No IOVSvcTool associated with store "StoreGateSvc" +IOVSvcTool INFO IOVRanges will be checked at every Event +IOVDbSvc INFO Opening COOL connection for COOLOFL_TILE/OFLP200 +IOVDbSvc INFO Disconnecting from COOLOFL_LAR/OFLP200 +IOVDbSvc INFO Disconnecting from COOLOFL_TILE/OFLP200 +IOVDbSvc INFO Added taginfo remove for /LAR/Align +IOVDbSvc INFO Added taginfo remove for /TILE/OFL02/CALIB/CES +IOVDbSvc INFO Added taginfo remove for /TILE/OFL02/CALIB/CIS/FIT/LIN +IOVDbSvc INFO Added taginfo remove for /TILE/OFL02/CALIB/CIS/FIT/NLN +IOVDbSvc INFO Added taginfo remove for /TILE/OFL02/CALIB/EMS +IOVDbSvc INFO Added taginfo remove for /TILE/OFL02/CALIB/LAS/FIBER +IOVDbSvc INFO Added taginfo remove for /TILE/OFL02/CALIB/LAS/LIN +IOVDbSvc INFO Added taginfo remove for /TILE/OFL02/CALIB/LAS/NLN +IOVDbSvc INFO Added taginfo remove for /TILE/OFL02/NOISE/SAMPLE +IOVDbSvc INFO Added taginfo remove for /TILE/OFL02/STATUS/ADC +IOVDbSvc INFO Added taginfo remove for /TILE/OFL02/TIME/CHANNELOFFSET/PHY +IOVDbSvc INFO Added taginfo remove for /TILE/ONL01/STATUS/ADC +IOVDbSvc INFO Added taginfo remove for /LAR/LArCellPositionShift +ClassIDSvc INFO getRegistryEntries: read 1856 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 22 CLIDRegistry entries for module ALL +DetDescrCnvSvc INFO initializing +DetDescrCnvSvc INFO Found DetectorStore service +DetDescrCnvSvc INFO filling proxies for detector managers +DetDescrCnvSvc INFO filling address for CaloTTMgr with CLID 117659265 and storage type 68 to detector store +DetDescrCnvSvc INFO filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store +DetDescrCnvSvc INFO filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store +DetDescrCnvSvc INFO filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store +DetDescrCnvSvc INFO filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store +DetDescrCnvSvc INFO filling address for IdDict with CLID 2411 and storage type 68 to detector store +DetDescrCnvSvc INFO filling address for AtlasID with CLID 164875623 and storage type 68 to detector store +DetDescrCnvSvc INFO filling address for PixelID with CLID 2516 and storage type 68 to detector store +DetDescrCnvSvc INFO filling address for SCT_ID with CLID 2517 and storage type 68 to detector store +DetDescrCnvSvc INFO filling address for TRT_ID with CLID 2518 and storage type 68 to detector store +DetDescrCnvSvc INFO filling address for SiliconID with CLID 129452393 and storage type 68 to detector store +DetDescrCnvSvc INFO filling address for LArEM_ID with CLID 163583365 and storage type 68 to detector store +DetDescrCnvSvc INFO filling address for LArEM_SuperCell_ID with CLID 99488227 and storage type 68 to detector store +DetDescrCnvSvc INFO filling address for LArHEC_ID with CLID 3870484 and storage type 68 to detector store +DetDescrCnvSvc INFO filling address for LArHEC_SuperCell_ID with CLID 254277678 and storage type 68 to detector store +DetDescrCnvSvc INFO filling address for LArFCAL_ID with CLID 45738051 and storage type 68 to detector store +DetDescrCnvSvc INFO filling address for LArFCAL_SuperCell_ID with CLID 12829437 and storage type 68 to detector store +DetDescrCnvSvc INFO filling address for LArMiniFCAL_ID with CLID 79264204 and storage type 68 to detector store +DetDescrCnvSvc INFO filling address for LArOnlineID with CLID 158698068 and storage type 68 to detector store +DetDescrCnvSvc INFO filling address for TTOnlineID with CLID 38321944 and storage type 68 to detector store +DetDescrCnvSvc INFO filling address for LArOnline_SuperCellID with CLID 115600394 and storage type 68 to detector store +DetDescrCnvSvc INFO filling address for LArHVLineID with CLID 27863673 and storage type 68 to detector store +DetDescrCnvSvc INFO filling address for LArElectrodeID with CLID 80757351 and storage type 68 to detector store +DetDescrCnvSvc INFO filling address for TileID with CLID 2901 and storage type 68 to detector store +DetDescrCnvSvc INFO filling address for Tile_SuperCell_ID with CLID 49557789 and storage type 68 to detector store +DetDescrCnvSvc INFO filling address for TileHWID with CLID 2902 and storage type 68 to detector store +DetDescrCnvSvc INFO filling address for TileTBID with CLID 2903 and storage type 68 to detector store +DetDescrCnvSvc INFO filling address for MDTIDHELPER with CLID 4170 and storage type 68 to detector store +DetDescrCnvSvc INFO filling address for CSCIDHELPER with CLID 4171 and storage type 68 to detector store +DetDescrCnvSvc INFO filling address for RPCIDHELPER with CLID 4172 and storage type 68 to detector store +DetDescrCnvSvc INFO filling address for TGCIDHELPER with CLID 4173 and storage type 68 to detector store +DetDescrCnvSvc INFO filling address for STGCIDHELPER with CLID 4174 and storage type 68 to detector store +DetDescrCnvSvc INFO filling address for MMIDHELPER with CLID 4175 and storage type 68 to detector store +DetDescrCnvSvc INFO filling address for CaloLVL1_ID with CLID 108133391 and storage type 68 to detector store +DetDescrCnvSvc INFO filling address for CaloCell_ID with CLID 123500438 and storage type 68 to detector store +DetDescrCnvSvc INFO filling address for CaloCell_SuperCell_ID with CLID 128365736 and storage type 68 to detector store +DetDescrCnvSvc INFO filling address for CaloDM_ID with CLID 167756483 and storage type 68 to detector store +DetDescrCnvSvc INFO filling address for ZdcID with CLID 190591643 and storage type 68 to detector store +GeoModelSvc::RD...WARNING Getting PixTBMatComponents with default tag +GeoModelSvc::RD...WARNING Getting PixTBMaterials with default tag +GeoModelSvc::RD...WARNING Getting InDetMatComponents with default tag +GeoModelSvc::RD...WARNING Getting InDetMaterials with default tag +GeoModelSvc.LAr... INFO Keys for LAr are ATLAS-R2-2016-01-00-01 ATLAS +GeoModelSvc.LAr... INFO Building LAr version LAr-Revised-17-01 while ATLAS version is ATLAS-R2-2016-01-00-01 +GeoModelSvc.LAr... INFO LAr Geometry Options: +GeoModelSvc.LAr... INFO Sagging = false +GeoModelSvc.LAr... INFO Barrel = ON +GeoModelSvc.LAr... INFO Endcap = ON +BarrelConstruction INFO Getting primary numbers for ATLAS, ATLAS-R2-2016-01-00-01 +BarrelConstruction INFO Makes detailed absorber sandwich ? 1 1 +BarrelConstruction INFO Use sagging in geometry ? 0 +============== EMEC Construction =============== + multi-layered version of absorbers activated, mlabs == 1 +================================================ +EventPersistenc... INFO Added successfully Conversion service:DetDescrCnvSvc +ClassIDSvc INFO getRegistryEntries: read 2398 CLIDRegistry entries for module ALL +CaloIDHelper_ID... INFO in createObj: creating a TileTBID helper object in the detector store +IdDictDetDescrCnv INFO in initialize +IdDictDetDescrCnv INFO in createObj: creating a IdDictManager object in the detector store +IdDictDetDescrCnv INFO IdDictName: IdDictParser/ATLAS_IDS.xml +IdDictDetDescrCnv INFO Reading InnerDetector IdDict file InDetIdDictFiles/IdDictInnerDetector_IBL3D25-03.xml +IdDictDetDescrCnv INFO Reading LArCalorimeter IdDict file IdDictParser/IdDictLArCalorimeter_DC3-05-Comm-01.xml +IdDictDetDescrCnv INFO Reading TileCalorimeter IdDict file IdDictParser/IdDictTileCalorimeter.xml +IdDictDetDescrCnv INFO Reading Calorimeter IdDict file IdDictParser/IdDictCalorimeter_L1Onl.xml +IdDictDetDescrCnv INFO Reading MuonSpectrometer IdDict file IdDictParser/IdDictMuonSpectrometer_R.03.xml +IdDictDetDescrCnv INFO Reading ForwardDetectors IdDict file IdDictParser/IdDictForwardDetectors_2010.xml +IdDictDetDescrCnv INFO Found id dicts: +IdDictDetDescrCnv INFO Using dictionary tag: null +IdDictDetDescrCnv INFO Dictionary ATLAS version default DetDescr tag (using default) file +IdDictDetDescrCnv INFO Dictionary Calorimeter version default DetDescr tag CaloIdentifier-LVL1-02 file IdDictParser/IdDictCalorimeter_L1Onl.xml +IdDictDetDescrCnv INFO Dictionary ForwardDetectors version default DetDescr tag ForDetIdentifier-01 file IdDictParser/IdDictForwardDetectors_2010.xml +IdDictDetDescrCnv INFO Dictionary InnerDetector version IBL-DBM DetDescr tag InDetIdentifier-IBL3D25-02 file InDetIdDictFiles/IdDictInnerDetector_IBL3D25-03.xml +IdDictDetDescrCnv INFO Dictionary LArCalorimeter version fullAtlas DetDescr tag LArIdentifier-DC3-05-Comm file IdDictParser/IdDictLArCalorimeter_DC3-05-Comm-01.xml +IdDictDetDescrCnv INFO Dictionary LArElectrode version fullAtlas DetDescr tag (using default) file +IdDictDetDescrCnv INFO Dictionary LArHighVoltage version fullAtlas DetDescr tag (using default) file +IdDictDetDescrCnv INFO Dictionary MuonSpectrometer version R.03 DetDescr tag MuonIdentifier-08 file IdDictParser/IdDictMuonSpectrometer_R.03.xml +IdDictDetDescrCnv INFO Dictionary TileCalorimeter version fullAtlasAndTestBeam DetDescr tag TileIdentifier-00 file IdDictParser/IdDictTileCalorimeter.xml +TileTBID INFO initialize_from_dictionary +AtlasDetectorID INFO initialize_from_dictionary - OK +EndcapDMConstru... INFO Start building EC electronics geometry +============== EMEC Construction =============== + multi-layered version of absorbers activated, mlabs == 1 +================================================ +EndcapDMConstru... INFO Start building EC electronics geometry +GeoModelSvc INFO GeoModelSvc.LArDetectorToolNV SZ= 22964Kb Time = 0.51S +GeoModelSvc.Til... INFO Entering TileDetectorTool::create() +TileDddbManager INFO m_tag = ATLAS-R2-2016-01-00-01 +TileDddbManager INFO n_tiglob = 5 +TileDddbManager INFO n_timod = 320 +TileDddbManager INFO n_cuts = 9 +TileDddbManager INFO n_saddle = 1 +TileDddbManager INFO n_tilb = 21 +TileDddbManager INFO n_tileSwitches = 1 +ClassIDSvc INFO getRegistryEntries: read 213 CLIDRegistry entries for module ALL +CaloIDHelper_ID... INFO in createObj: creating a TileID helper object in the detector store +AtlasDetectorID INFO initialize_from_dictionary - OK +TileNeighbour INFO Reading file /afs/cern.ch/user/s/ssnyder/atlas-work3/build-x86_64-slc6-gcc62-opt/x86_64-slc6-gcc62-opt/share/TileNeighbour_reduced.txt +TileHWIDDetDesc... INFO in createObj: creating a TileHWID helper object in the detector store +TileHWID INFO initialize_from_dictionary +AtlasDetectorID INFO initialize_from_dictionary - OK +ClassIDSvc INFO getRegistryEntries: read 55 CLIDRegistry entries for module ALL +CaloIDHelper_ID... INFO in createObj: creating a CaloCell_ID helper object in the detector store +CaloIDHelper_ID... INFO in createObj: creating a LArEM_ID helper object in the detector store +AtlasDetectorID INFO initialize_from_dictionary - OK +CaloIDHelper_ID... INFO in createObj: creating a LArHEC_ID helper object in the detector store +AtlasDetectorID INFO initialize_from_dictionary - OK +CaloIDHelper_ID... INFO in createObj: creating a LArFCAL_ID helper object in the detector store +AtlasDetectorID INFO initialize_from_dictionary - OK +LArFCAL_Base_ID INFO Reading file /afs/cern.ch/user/s/ssnyder/atlas-work3/build-x86_64-slc6-gcc62-opt/x86_64-slc6-gcc62-opt/share/FCal2DNeighbors-April2011.txt +LArFCAL_Base_ID INFO Reading file /afs/cern.ch/user/s/ssnyder/atlas-work3/build-x86_64-slc6-gcc62-opt/x86_64-slc6-gcc62-opt/share/FCal3DNeighborsNext-April2011.txt +LArFCAL_Base_ID INFO Reading file /afs/cern.ch/user/s/ssnyder/atlas-work3/build-x86_64-slc6-gcc62-opt/x86_64-slc6-gcc62-opt/share/FCal3DNeighborsPrev-April2011.txt +CaloIDHelper_ID... INFO in createObj: creating a LArMiniFCAL_ID helper object in the detector store +AtlasDetectorID INFO initialize_from_dictionary - OK +LArMiniFCAL_ID INFO initialize_from_dict - LArCalorimeter dictionary does NOT contain miniFCAL description. Unable to initialize LArMiniFCAL_ID. +AtlasDetectorID INFO initialize_from_dictionary - OK +GeoModelSvc.Til... INFO U-shape parameter from database is: 1 +GeoModelSvc.Til... INFO Glue parameter from database is: 1 +GeoModelSvc.Til... INFO Entering TileAtlasFactory::create() +GeoModelSvc.Til... INFO Tile Geometry with Saddle supports, starting from TileCal-CSC-02 xxx +GeoModelSvc.Til... INFO => New BFingerLengthPos 430.5 +GeoModelSvc.Til... INFO => New BFingerLengthNeg 420.5 +GeoModelSvc.Til... INFO Positioning barrel with translation 0 +GeoModelSvc.Til... INFO Positioning positive barrel finger with translation 3035.25 +GeoModelSvc.Til... INFO Positioning negative barrel finger with translation -3030.25 +GeoModelSvc.Til... INFO Positioning positive ext.barrel with translation 4854.75 +GeoModelSvc.Til... INFO Positioning positive ext.barrel finger with translation ztrans= 6338.5 +GeoModelSvc.Til... INFO Positioning positive ext.barrel saddle with translation ztrans= 6192.5 +GeoModelSvc.Til... INFO Positive ITC envelope parameters: PLUG1 Rmin= 3438.85 Rmax= 4250 dzITC1= 154.5 +GeoModelSvc.Til... INFO PLUG2 Rmin= 2981 Rmax= 3440 dzITC2= 47.425 +GeoModelSvc.Til... INFO Positioning positive ITC with translation 3405 +GeoModelSvc.Til... INFO Positioning positive Gap with translation 3552 +GeoModelSvc.Til... INFO Positioning positive Crack with translation 3536 +GeoModelSvc.Til... INFO Positioning negative ext.barrel with translation ztrans -4854.75 +GeoModelSvc.Til... INFO Positioning negative ext.barrel finger with translation ztrans= -6338.5 +GeoModelSvc.Til... INFO Positioning negative ext.barrel saddle with translation ztrans= -6192.5 +GeoModelSvc.Til... INFO Negative ITC envelope parameters: PLUG1 Rmin= 3438.85 Rmax= 4250 dzITC1= 154.5 +GeoModelSvc.Til... INFO PLUG2 Rmin= 2981 Rmax= 3440 dzITC2= 47.425 +GeoModelSvc.Til... INFO Positioning negative ITC with translation -3405 +GeoModelSvc.Til... INFO Positioning negative Gap with translation -3552 +GeoModelSvc.Til... INFO Positioning negative Crack with translation -3536 +GeoModelSvc.Til... INFO Global positioning of barrel with rotation (0,0,0)) and translation (0,0,0) CLHEP::cm +GeoModelSvc.Til... INFO Global positioning of positive ext.barrel with rotation (0,0,0)) and translation (0,0,0) CLHEP::cm +GeoModelSvc.Til... INFO Global positioning of negative ext.barrel with rotation (0,0,0)) and translation (0,0,1) CLHEP::cm +TileDetDescrMan... INFO Entering create_elements() +GeoModelSvc INFO GeoModelSvc.TileDetectorTool SZ= 4596Kb Time = 0.2S +ClassIDSvc INFO getRegistryEntries: read 65 CLIDRegistry entries for module ALL +TileInfoLoader INFO Initializing....TileInfoLoader +TileInfoLoader INFO New ATLAS geometry detected: ATLAS-R2-2016-01-00-01 (010001) version 10001 +TileInfoLoader INFO Changing TTL1 calib from 4.1 to 6.9 +TileInfoLoader INFO Changing TTL1 noise sigma from 2.5 to 2.8 +TileInfoLoader INFO ATLAS IBL geometry - special sampling fractions for gap/crack scin are allowed +TileInfoLoader INFO Special C10 in EB module 39 +TileInfoLoader INFO Special C10 in EB module 40 +TileInfoLoader INFO Special C10 in EB module 41 +TileInfoLoader INFO Special C10 in EB module 42 +TileInfoLoader INFO Special C10 in EB module 55 +TileInfoLoader INFO Special C10 in EB module 56 +TileInfoLoader INFO Special C10 in EB module 57 +TileInfoLoader INFO Special C10 in EB module 58 +TileInfoLoader INFO Sampling fraction for normal cells 1/34 +TileInfoLoader INFO Sampling fraction for special C10 cells 1/45 +TileInfoLoader INFO Sampling fraction for E1 cells 1/125 +TileInfoLoader INFO Sampling fraction for E2 cells 1/107 +TileInfoLoader INFO Sampling fraction for E3 cells 1/97 +TileInfoLoader INFO Sampling fraction for E4 cells 1/75 +TileInfoLoader INFO Sampling fraction for E4' cells 1/75 +TileInfoLoader INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-09-24T2056/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/pulsehi_physics.dat +TileInfoLoader INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-09-24T2056/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/pulselo_physics.dat +TileInfoLoader INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-09-24T2056/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/pulse_adder_tower_physics.dat +TileInfoLoader INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-09-24T2056/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/pulse_adder_muonRcv_physics.dat +TileInfoLoader INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-09-24T2056/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/pulse_adder_muon_physics.dat +CaloIDHelper_ID... INFO in createObj: creating a CaloLVL1_ID helper object in the detector store +CaloLVL1_ID INFO initialize_from_dictionary +AtlasDetectorID INFO initialize_from_dictionary - OK +TileCablingSvc INFO RUN2 ATLAS geometry flag detected for geometry: ATLAS-R2-2016-01-00-01 +TileCablingSvc INFO Cabling for RUN2 (2014-2017) ATLAS geometry is set via jobOptions +TileCablingSvc INFO Setting Cabling type to 4 +TileInfoLoader INFO Placed TileInfo object in the detector store. +ToolSvc.TileBad... INFO Creating TileCondProxyCool(ToolSvc.TileBadChanLegacyTool.TileCondProxyCool_OnlBch) for folder: "/TILE/ONL01/STATUS/ADC" +IOVSvcTool INFO Still in initialize phase, not tiggering callback for TileCondProxyCool<TileCalibDrawerBch>[0x1c8f7700]+7f3afb649a70 bound to CondAttrListCollection[/TILE/ONL01/STATUS/ADC] +ToolSvc.TileBad... INFO Creating TileCondProxyCool(ToolSvc.TileBadChanLegacyTool.TileCondProxyCool_OflBch) for folder: "/TILE/OFL02/STATUS/ADC" +IOVSvcTool INFO Still in initialize phase, not tiggering callback for TileCondProxyCool<TileCalibDrawerBch>[0x1c8f6c00]+7f3afb649a70 bound to CondAttrListCollection[/TILE/OFL02/STATUS/ADC] +ToolSvc.TileBad... INFO ProxyOnlBch and ProxyOflBch will be used for bad channel status +IOVSvcTool INFO Still in initialize phase, not tiggering callback for TileBadChanLegacyTool[0x18f02000]+7f3afb5d83c0 bound to /TILE/ONL01/STATUS/ADC +IOVSvcTool INFO Still in initialize phase, not tiggering callback for TileBadChanLegacyTool[0x18f02000]+7f3afb5d83c0 bound to /TILE/OFL02/STATUS/ADC +AthenaEventLoopMgr INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00 +ClassIDSvc INFO getRegistryEntries: read 318 CLIDRegistry entries for module ALL +CondInputLoader INFO Initializing CondInputLoader... +CondInputLoader INFO Adding base classes: + + ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/CALIB/CES' ) -> + + ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/CALIB/CIS/FIT/LIN' ) -> + + ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/CALIB/CIS/FIT/NLN' ) -> + + ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/CALIB/EMS' ) -> + + ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/CALIB/LAS/FIBER' ) -> + + ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/CALIB/LAS/LIN' ) -> + + ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/CALIB/LAS/NLN' ) -> + + ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/NOISE/SAMPLE' ) -> + + ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/STATUS/ADC' ) -> + + ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/TIME/CHANNELOFFSET/PHY' ) -> + + ( 'CondAttrListCollection' , 'ConditionStore+/TILE/ONL01/STATUS/ADC' ) -> +CondInputLoader INFO Will create WriteCondHandle dependencies for the following DataObjects: + + ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/CALIB/CES' ) + + ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/CALIB/CIS/FIT/LIN' ) + + ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/CALIB/CIS/FIT/NLN' ) + + ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/CALIB/EMS' ) + + ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/CALIB/LAS/FIBER' ) + + ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/CALIB/LAS/LIN' ) + + ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/CALIB/LAS/NLN' ) + + ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/NOISE/SAMPLE' ) + + ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/STATUS/ADC' ) + + ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/TIME/CHANNELOFFSET/PHY' ) + + ( 'CondAttrListCollection' , 'ConditionStore+/TILE/ONL01/STATUS/ADC' ) +TileBadChannels... INFO Creating TileCondProxyCool(TileBadChannelsCondAlg.TileCondProxyCool_OnlBch) for folder: "/TILE/ONL01/STATUS/ADC" +TileBadChannels... INFO Creating TileCondProxyCool(TileBadChannelsCondAlg.TileCondProxyCool_OflBch) for folder: "/TILE/OFL02/STATUS/ADC" +TileBadChannels... INFO ProxyOnlBch and ProxyOflBch will be used for bad channel status +TileEMScaleCond... INFO Creating TileCondProxyCool(TileEMScaleCondAlg.TileCondProxyCool_OflCisLin) for folder: "/TILE/OFL02/CALIB/CIS/FIT/LIN" +TileEMScaleCond... INFO Creating TileCondProxyCool(TileEMScaleCondAlg.TileCondProxyCool_OflCisNln) for folder: "/TILE/OFL02/CALIB/CIS/FIT/NLN" +TileEMScaleCond... INFO Creating TileCondProxyCool(TileEMScaleCondAlg.TileCondProxyCool_OflLasLin) for folder: "/TILE/OFL02/CALIB/LAS/LIN" +TileEMScaleCond... INFO Creating TileCondProxyCool(TileEMScaleCondAlg.TileCondProxyCool_OflLasNln) for folder: "/TILE/OFL02/CALIB/LAS/NLN" +TileEMScaleCond... INFO Creating TileCondProxyCool(TileEMScaleCondAlg.TileCondProxyCool_OflLasFib) for folder: "/TILE/OFL02/CALIB/LAS/FIBER" +TileEMScaleCondAlg INFO ProxyOflLasFib is set up and can be used +TileEMScaleCond... INFO Creating TileCondProxyCool(TileEMScaleCondAlg.TileCondProxyCool_OflCes) for folder: "/TILE/OFL02/CALIB/CES" +TileEMScaleCond... INFO Creating TileCondProxyCool(TileEMScaleCondAlg.TileCondProxyCool_OflEms) for folder: "/TILE/OFL02/CALIB/EMS" +TileEMScaleCondAlg INFO Loading of online calibration constants is not requested, since OnlCacheUnit= 'OnlCacheUnit':Invalid +TileSampleNoise... INFO Creating TileCondProxyCool(TileSampleNoiseCondAlg.TileCondProxyCool_NoiseSample) for folder: "/TILE/OFL02/NOISE/SAMPLE" +TileTimingCondA... INFO Creating TileCondProxyCool(TileTimingCondAlg.TileCondProxyCool_AdcOffset) for folder: "/TILE/OFL02/TIME/CHANNELOFFSET/PHY" +tilecellbuilder... INFO Creating TileCondProxyFile(tilecellbuilder_bct1Cond.tilecellbuilder_bct1_onl) for ASCII file name: "/cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-09-24T2056/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/TileNoBad.oflBch" +tilecellbuilder... INFO Creating TileCondProxyFile(tilecellbuilder_bct1Cond.tilecellbuilder_bct1_ofl) for ASCII file name: "/cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-09-24T2056/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/TileNoBad.oflBch" +tilecellbuilder... INFO ProxyOnlBch and ProxyOflBch will be used for bad channel status +tilecellbuilder... INFO Creating TileCondProxyFile(tilecellbuilder_bct2Cond.tilecellbuilder_bct2_onl) for ASCII file name: "/cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-09-24T2056/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/TileNoBad.oflBch" +tilecellbuilder... INFO Creating TileCondProxyFile(tilecellbuilder_bct2Cond.tilecellbuilder_bct2_ofl) for ASCII file name: "/afs/cern.ch/work/s/ssnyder/builds/atlas-work3/build-x86_64-slc6-gcc62-opt/TileCalorimeter/TileRecUtils/unitTestRun/tilecellbuilder_bct2.bch" +tilecellbuilder... INFO ProxyOnlBch and ProxyOflBch will be used for bad channel status +ClassIDSvc INFO getRegistryEntries: read 504 CLIDRegistry entries for module ALL +xAODMaker::Even... INFO Initializing - Package version: xAODEventInfoCnv-00-00-00 +xAODMaker::Even... INFO Initializing - Package version: xAODEventInfoCnv-00-00-00 +xAODMaker::Even...WARNING Beam conditions service not available +xAODMaker::Even...WARNING Will not fill beam spot information into xAOD::EventInfo +xAODMaker::Even... INFO Luminosity information not available +xAODMaker::Even... INFO Will take information from the EventInfo object +ClassIDSvc INFO getRegistryEntries: read 319 CLIDRegistry entries for module ALL +PyComponentMgr INFO Initializing PyComponentMgr... +testalg1 INFO Initializing testalg1... +ClassIDSvc INFO getRegistryEntries: read 4339 CLIDRegistry entries for module ALL +ToolSvc.tool1 INFO Storing MBTS cells in MBTSContainer +ToolSvc.TileBea... INFO in initialize() +ToolSvc.tool1 INFO none of thresholds set, all RawChannels will be converted to Cells +ToolSvc.tool1 INFO size of temp vector set to 5184 +ToolSvc.tool1 INFO taking RawChannels from 'TileRawChannelCnt' +ToolSvc.tool1 INFO Storing E4' cells in E4prContainer +ToolSvc.tool1 INFO TileCellBuilder initialization completed +ToolSvc.tool2 INFO Storing MBTS cells in MBTSContainer +ToolSvc.tool2 INFO none of thresholds set, all RawChannels will be converted to Cells +ToolSvc.tool2 INFO size of temp vector set to 5184 +ToolSvc.tool2 INFO taking RawChannels from 'TileRawChannelCnt' +ToolSvc.tool2 INFO Storing E4' cells in E4prContainer +ToolSvc.tool2 INFO TileCellBuilder initialization completed +ToolSvc.tool4 INFO Storing MBTS cells in MBTSContainer +ToolSvc.beaminfo4 INFO in initialize() +ToolSvc.tool4 INFO none of thresholds set, all RawChannels will be converted to Cells +ToolSvc.tool4 INFO size of temp vector set to 5184 +ToolSvc.tool4 INFO taking RawChannels from 'TileRawChannelCnt' +ToolSvc.tool4 INFO Storing E4' cells in E4prContainer +ToolSvc.tool4 INFO TileCellBuilder initialization completed +ToolSvc.tool5 INFO Storing MBTS cells in MBTSContainer +ToolSvc.tool5 INFO none of thresholds set, all RawChannels will be converted to Cells +ToolSvc.tool5 INFO size of temp vector set to 5184 +ToolSvc.tool5 INFO taking RawChannels from 'TileRawChannelCnt' +ToolSvc.tool5 INFO Storing E4' cells in E4prContainer +ToolSvc.tool5 INFO TileCellBuilder initialization completed +ToolSvc.tool6 INFO Storing MBTS cells in MBTSContainer +ToolSvc.tool6 INFO Ene threshold 300 MeV +ToolSvc.tool6 INFO max time diff 100000 ns +ToolSvc.tool6 INFO max time thr 100000 ns +ToolSvc.tool6 INFO min time thr -100000 ns +ToolSvc.tool6 INFO max qual thr 100000 +ToolSvc.tool6 INFO min qual thr -100000 +ToolSvc.tool6 INFO size of temp vector set to 5184 +ToolSvc.tool6 INFO taking RawChannels from 'TileRawChannelCnt' +ToolSvc.tool6 INFO Storing E4' cells in E4prContainer +ToolSvc.tool6 INFO TileCellBuilder initialization completed +ToolSvc.tool7 INFO Storing MBTS cells in MBTSContainer +ToolSvc.tool7 INFO none of thresholds set, all RawChannels will be converted to Cells +ToolSvc.tool7 INFO size of temp vector set to 5184 +ToolSvc.tool7 INFO taking RawChannels from 'TileRawChannelCnt' +ToolSvc.tool7 INFO Storing E4' cells in E4prContainer +ToolSvc.tool7 INFO TileCellBuilder initialization completed +ToolSvc.tool8 INFO Storing MBTS cells in MBTSContainer +ToolSvc.noisefi... INFO Initializing... +ToolSvc.tool8 INFO none of thresholds set, all RawChannels will be converted to Cells +ToolSvc.tool8 INFO size of temp vector set to 5184 +ToolSvc.tool8 INFO taking RawChannels from 'TileRawChannelCnt' +ToolSvc.tool8 INFO Storing E4' cells in E4prContainer +ToolSvc.tool8 INFO TileCellBuilder initialization completed +ToolSvc.tool9 INFO Storing MBTS cells in MBTSContainer +ToolSvc.tool9 INFO none of thresholds set, all RawChannels will be converted to Cells +ToolSvc.tool9 INFO size of temp vector set to 5184 +ToolSvc.tool9 INFO taking RawChannels from 'TileRawChannelCnt' +ToolSvc.tool9 INFO Storing E4' cells in E4prContainer +ToolSvc.tool9 INFO TileCellBuilder initialization completed +ToolSvc.tool10 INFO Storing MBTS cells in MBTSContainer +ToolSvc.tool10 INFO none of thresholds set, all RawChannels will be converted to Cells +ToolSvc.tool10 INFO size of temp vector set to 5184 +ToolSvc.tool10 INFO taking RawChannels from 'TileRawChannelCnt' +ToolSvc.tool10 INFO Storing E4' cells in E4prContainer +ToolSvc.tool10 INFO TileCellBuilder initialization completed +ToolSvc.tool11 INFO Storing MBTS cells in MBTSContainer +ToolSvc.tool11 INFO none of thresholds set, all RawChannels will be converted to Cells +ToolSvc.tool11 INFO size of temp vector set to 5184 +ToolSvc.tool11 INFO taking RawChannels from 'TileRawChannelCnt' +ToolSvc.tool11 INFO Storing E4' cells in E4prContainer +ToolSvc.tool11 INFO TileCellBuilder initialization completed +HistogramPersis...WARNING Histograms saving not required. +ApplicationMgr INFO Application Manager Initialized successfully +ClassIDSvc INFO getRegistryEntries: read 281 CLIDRegistry entries for module ALL +CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/TILE/OFL02/CALIB/CES' +CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/TILE/OFL02/CALIB/CIS/FIT/LIN' +CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/TILE/OFL02/CALIB/CIS/FIT/NLN' +CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/TILE/OFL02/CALIB/EMS' +CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/TILE/OFL02/CALIB/LAS/FIBER' +CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/TILE/OFL02/CALIB/LAS/LIN' +CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/TILE/OFL02/CALIB/LAS/NLN' +CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/TILE/OFL02/NOISE/SAMPLE' +CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/TILE/OFL02/STATUS/ADC' +CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/TILE/OFL02/TIME/CHANNELOFFSET/PHY' +CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/TILE/ONL01/STATUS/ADC' +ApplicationMgr INFO Application Manager Started successfully +AthenaEventLoopMgr INFO ===>>> start of run 1 <<<=== +EventPersistenc... INFO Added successfully Conversion service:AthenaPoolCnvSvc +EventPersistenc... INFO Added successfully Conversion service:TagInfoMgr +ClassIDSvc INFO getRegistryEntries: read 109 CLIDRegistry entries for module ALL +IOVDbSvc INFO Opening COOL connection for COOLOFL_LAR/OFLP200 +IOVDbSvc INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to LARAlign-IOVDEP-00 for folder /LAR/Align +IOVDbSvc INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to LArCellPositionShift-ideal for folder /LAR/LArCellPositionShift +IOVDbSvc INFO Disconnecting from COOLOFL_LAR/OFLP200 +IOVDbSvc INFO Opening COOL connection for COOLOFL_TILE/OFLP200 +IOVDbSvc INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to TileOfl02CalibCes-SIM-06 for folder /TILE/OFL02/CALIB/CES +IOVDbSvc INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to TileOfl02CalibCisFitLin-COM-00 for folder /TILE/OFL02/CALIB/CIS/FIT/LIN +IOVDbSvc INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to TileOfl02CalibCisFitNln-COM-00 for folder /TILE/OFL02/CALIB/CIS/FIT/NLN +IOVDbSvc INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to TileOfl02CalibEms-COM-00 for folder /TILE/OFL02/CALIB/EMS +IOVDbSvc INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to TileOfl02CalibLasFiber-000-00 for folder /TILE/OFL02/CALIB/LAS/FIBER +IOVDbSvc INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to TileOfl02CalibLasLin-COM-00 for folder /TILE/OFL02/CALIB/LAS/LIN +IOVDbSvc INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to TileOfl02CalibLasNln-COM-00 for folder /TILE/OFL02/CALIB/LAS/NLN +IOVDbSvc INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to TileOfl02NoiseSample-TwoGauss-19 for folder /TILE/OFL02/NOISE/SAMPLE +IOVDbSvc INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to TileOfl02StatusAdc-IOVDEP-03 for folder /TILE/OFL02/STATUS/ADC +IOVDbSvc INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to TileOfl02TimeChanneloffsetPhy-000-00 for folder /TILE/OFL02/TIME/CHANNELOFFSET/PHY +IOVDbSvc INFO Disconnecting from COOLOFL_TILE/OFLP200 +DbSession INFO Open DbSession +Domain[ROOT_All] INFO > Access DbDomain READ [ROOT_All] +Domain[ROOT_All] INFO -> Access DbDatabase READ [ROOT_All] EACFEBD4-9BD2-E211-848A-02163E006B20 +Domain[ROOT_All] INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cond09/cond09_mc.000057.gen.COND/cond09_mc.000057.gen.COND._0001.pool.root +RootDatabase.open INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cond09/cond09_mc.000057.gen.COND/cond09_mc.000057.gen.COND._0001.pool.root File version:52200 +ToolSvc.TileBad... INFO ToolSvc.TileBadChanLegacyTool.TileCondProxyCool_OnlBch: callback has been triggered by: /TILE/ONL01/STATUS/ADC +ToolSvc.TileBad... INFO ToolSvc.TileBadChanLegacyTool.TileCondProxyCool_OflBch: callback has been triggered by: /TILE/OFL02/STATUS/ADC +CaloMgrDetDescrCnv INFO in createObj: creating a Calo Detector Manager object in the detector store +CaloIdMgrDetDes... INFO in createObj: creating a CaloDescrManager object in the detector store +ClassIDSvc INFO getRegistryEntries: read 193 CLIDRegistry entries for module ALL +CaloIDHelper_ID... INFO in createObj: creating a CaloDM_ID helper object in the detector store +CaloDM_ID INFO initialize_from_dictionary +AtlasDetectorID INFO initialize_from_dictionary - OK +CaloIDHelper_ID... INFO in createObj: creating a TTOnlineID helper object in the detector store +TTOnlineID INFO initialize_from_dictionary +AtlasDetectorID INFO initialize_from_dictionary - OK +CaloIDHelper_ID... INFO in createObj: creating a CaloCell_SuperCell_ID helper object in the detector store +CaloIDHelper_ID... INFO in createObj: creating a LArEM_SuperCell_ID helper object in the detector store +AtlasDetectorID INFO initialize_from_dictionary - OK +CaloIDHelper_ID... INFO in createObj: creating a LArHEC_SuperCell_ID helper object in the detector store +AtlasDetectorID INFO initialize_from_dictionary - OK +CaloIDHelper_ID... INFO in createObj: creating a LArFCAL_SuperCell_ID helper object in the detector store +AtlasDetectorID INFO initialize_from_dictionary - OK +LArFCAL_Base_ID INFO Reading file /afs/cern.ch/user/s/ssnyder/atlas-work3/build-x86_64-slc6-gcc62-opt/x86_64-slc6-gcc62-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt +LArFCAL_Base_ID INFO Reading file /afs/cern.ch/user/s/ssnyder/atlas-work3/build-x86_64-slc6-gcc62-opt/x86_64-slc6-gcc62-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt +LArFCAL_Base_ID INFO Reading file /afs/cern.ch/user/s/ssnyder/atlas-work3/build-x86_64-slc6-gcc62-opt/x86_64-slc6-gcc62-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt +CaloIDHelper_ID... INFO in createObj: creating a Tile_SuperCell_ID helper object in the detector store +AtlasDetectorID INFO initialize_from_dictionary - OK +TileNeighbour INFO Reading file /afs/cern.ch/user/s/ssnyder/atlas-work3/build-x86_64-slc6-gcc62-opt/x86_64-slc6-gcc62-opt/share/TileSuperCellNeighbour.txt +AtlasDetectorID INFO initialize_from_dictionary - OK +CaloIdMgrDetDes... INFO Finished +CaloIdMgrDetDes... INFO Initializing CaloIdMgr from values in CaloIdMgrDetDescrCnv +Domain[ROOT_All] INFO -> Access DbDatabase READ [ROOT_All] 8667C6F2-1559-DE11-A611-000423D9A21A +Domain[ROOT_All] INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cond08/cond08_mc.000003.gen.COND/cond08_mc.000003.gen.COND._0064.pool.root +RootDatabase.open INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cond08/cond08_mc.000003.gen.COND/cond08_mc.000003.gen.COND._0064.pool.root File version:52200 +ToolSvc.TileBad... INFO TileBadChanLegacyTool::recache() has been triggered by: '/TILE/OFL02/STATUS/ADC' '/TILE/ONL01/STATUS/ADC' +ToolSvc.TileBad... INFO Updating TileBchStatus::isBad() definition from DB +ToolSvc.TileBad... INFO Updating TileBchStatus::isNoisy() definition from DB +ToolSvc.TileBad... INFO No TileBchStatus::isNoGainL1() definition found in DB, using defaults +ToolSvc.TileBad... INFO No TileBchStatus::isBadTiming() definition found in DB, using defaults +ToolSvc.TileBad... INFO TileBchStatus::isBad() is defined by: ADC masked (unspecified); ADC dead; Very large HF noise; No data; Wrong DSP configuration; Severe stuck bit; Severe data corruption; Channel masked (unspecified); No PMT connected; No HV; Wrong HV; +ToolSvc.TileBad... INFO TileBchStatus::isNoisy() is defined by: Large HF noise; Correlated noise; Large LF noise; +ToolSvc.TileBad... INFO TileBchStatus::isNoGainL1() is defined by: ADC dead; No PMT connected; No HV; Channel masked for LV1 (unspecified); LV1 channel no gain; LV1 channel noisy; <no description available>; +ToolSvc.TileBad... INFO TileBchStatus::isBadTiming() is defined by: Bad timing; Online bad timing; +ToolSvc.TileBad... INFO No drawer trips probabilities found in DB +xAODMaker::Even...WARNING Algorithm::BeginRun is deprecated. Use Start instead +AthenaEventLoopMgr INFO ===>>> start processing event #1, run #1 0 events processed so far <<<=== +TileBadChannels... INFO Updating TileBchStatus::isBad() definition from DB +TileBadChannels... INFO Updating TileBchStatus::isNoisy() definition from DB +TileBadChannels... INFO No TileBchStatus::isNoGainL1() definition found in DB, using defaults +TileBadChannels... INFO No TileBchStatus::isBadTiming() definition found in DB, using defaults +TileBadChannels... INFO TileBchStatus::isBad() is defined by: ADC masked (unspecified); ADC dead; Very large HF noise; No data; Wrong DSP configuration; Severe stuck bit; Severe data corruption; Channel masked (unspecified); No PMT connected; No HV; Wrong HV; +TileBadChannels... INFO TileBchStatus::isNoisy() is defined by: Large HF noise; Correlated noise; Large LF noise; +TileBadChannels... INFO TileBchStatus::isNoGainL1() is defined by: ADC dead; No PMT connected; No HV; Channel masked for LV1 (unspecified); LV1 channel no gain; LV1 channel noisy; <no description available>; +TileBadChannels... INFO TileBchStatus::isBadTiming() is defined by: Bad timing; Online bad timing; +TileBadChannels... INFO No drawer trips probabilities found in DB +tilecellbuilder... INFO Creating TileCondProxyFile(tilecellbuilder_bct1Cond.tilecellbuilder_bct1_onl) for ASCII file name: "/cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-09-24T2056/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/TileNoBad.oflBch" +tilecellbuilder... INFO Creating TileCondProxyFile(tilecellbuilder_bct1Cond.tilecellbuilder_bct1_ofl) for ASCII file name: "/cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-09-24T2056/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/TileNoBad.oflBch" +tilecellbuilder... INFO No TileBchStatus::isBad() definition found in DB, using defaults +tilecellbuilder... INFO No TileBchStatus::isNoisy() definition found in DB, using defaults +tilecellbuilder... INFO No TileBchStatus::isNoGainL1() definition found in DB, using defaults +tilecellbuilder... INFO No TileBchStatus::isBadTiming() definition found in DB, using defaults +tilecellbuilder... INFO TileBchStatus::isBad() is defined by: ADC masked (unspecified); ADC dead; Very large HF noise; No data; Wrong DSP configuration; Severe stuck bit; Severe data corruption; Channel masked (unspecified); No PMT connected; No HV; Wrong HV; Online ADC masked (unspecified); +tilecellbuilder... INFO TileBchStatus::isNoisy() is defined by: Large HF noise; Correlated noise; Large LF noise; +tilecellbuilder... INFO TileBchStatus::isNoGainL1() is defined by: ADC dead; No PMT connected; No HV; Channel masked for LV1 (unspecified); LV1 channel no gain; LV1 channel noisy; <no description available>; +tilecellbuilder... INFO TileBchStatus::isBadTiming() is defined by: Bad timing; Online bad timing; +tilecellbuilder... INFO No drawer trips probabilities found in DB +tilecellbuilder... INFO Creating TileCondProxyFile(tilecellbuilder_bct2Cond.tilecellbuilder_bct2_onl) for ASCII file name: "/cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-09-24T2056/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/TileNoBad.oflBch" +tilecellbuilder... INFO Creating TileCondProxyFile(tilecellbuilder_bct2Cond.tilecellbuilder_bct2_ofl) for ASCII file name: "/afs/cern.ch/work/s/ssnyder/builds/atlas-work3/build-x86_64-slc6-gcc62-opt/TileCalorimeter/TileRecUtils/unitTestRun/tilecellbuilder_bct2.bch" +tilecellbuilder... INFO No TileBchStatus::isBad() definition found in DB, using defaults +tilecellbuilder... INFO No TileBchStatus::isNoisy() definition found in DB, using defaults +tilecellbuilder... INFO No TileBchStatus::isNoGainL1() definition found in DB, using defaults +tilecellbuilder... INFO No TileBchStatus::isBadTiming() definition found in DB, using defaults +tilecellbuilder... INFO TileBchStatus::isBad() is defined by: ADC masked (unspecified); ADC dead; Very large HF noise; No data; Wrong DSP configuration; Severe stuck bit; Severe data corruption; Channel masked (unspecified); No PMT connected; No HV; Wrong HV; Online ADC masked (unspecified); +tilecellbuilder... INFO TileBchStatus::isNoisy() is defined by: Large HF noise; Correlated noise; Large LF noise; +tilecellbuilder... INFO TileBchStatus::isNoGainL1() is defined by: ADC dead; No PMT connected; No HV; Channel masked for LV1 (unspecified); LV1 channel no gain; LV1 channel noisy; <no description available>; +tilecellbuilder... INFO TileBchStatus::isBadTiming() is defined by: Bad timing; Online bad timing; +tilecellbuilder... INFO No drawer trips probabilities found in DB +ClassIDSvc INFO getRegistryEntries: read 650 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 67 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 8 CLIDRegistry entries for module ALL +zzz 0xf0f0005L 2 0xf0f0005 +AthenaEventLoopMgr INFO ===>>> done processing event #1, run #1 1 events processed so far <<<=== +/cvmfs/atlas-co... INFO Database being retired... +Domain[ROOT_All] INFO -> Deaccess DbDatabase READ [ROOT_All] EACFEBD4-9BD2-E211-848A-02163E006B20 +/cvmfs/atlas-co... INFO Database being retired... +Domain[ROOT_All] INFO -> Deaccess DbDatabase READ [ROOT_All] 8667C6F2-1559-DE11-A611-000423D9A21A +Domain[ROOT_All] INFO > Deaccess DbDomain READ [ROOT_All] +AthenaEventLoopMgr INFO ===>>> start processing event #2, run #1 1 events processed so far <<<=== +ClassIDSvc INFO getRegistryEntries: read 51 CLIDRegistry entries for module ALL +zzz 0xf0f0045L 2 0xf0f0045 +AthenaEventLoopMgr INFO ===>>> done processing event #2, run #1 2 events processed so far <<<=== +AthenaEventLoopMgr INFO ===>>> start processing event #3, run #1 2 events processed so far <<<=== +zzz 0xf0f0405L 2 0xf0f0405 +AthenaEventLoopMgr INFO ===>>> done processing event #3, run #1 3 events processed so far <<<=== +AthenaEventLoopMgr INFO ===>>> start processing event #4, run #1 3 events processed so far <<<=== +zzz 0xf0f0005L 2 0xf0f0005 +AthenaEventLoopMgr INFO ===>>> done processing event #4, run #1 4 events processed so far <<<=== +AthenaEventLoopMgr INFO ===>>> start processing event #5, run #1 4 events processed so far <<<=== +zzz 0xf0f0005L 2 0xf0f0005 +AthenaEventLoopMgr INFO ===>>> done processing event #5, run #1 5 events processed so far <<<=== +AthenaEventLoopMgr INFO ===>>> start processing event #6, run #1 5 events processed so far <<<=== +zzz 0xf0f0005L 2 0xf0f0005 +AthenaEventLoopMgr INFO ===>>> done processing event #6, run #1 6 events processed so far <<<=== +AthenaEventLoopMgr INFO ===>>> start processing event #7, run #1 6 events processed so far <<<=== +zzz 0xf0f0005L 2 0xf0f0005 +AthenaEventLoopMgr INFO ===>>> done processing event #7, run #1 7 events processed so far <<<=== +AthenaEventLoopMgr INFO ===>>> start processing event #8, run #1 7 events processed so far <<<=== +zzz 0xf0f0005L 2 0xf0f0005 +AthenaEventLoopMgr INFO ===>>> done processing event #8, run #1 8 events processed so far <<<=== +AthenaEventLoopMgr INFO ===>>> start processing event #9, run #1 8 events processed so far <<<=== +zzz 0xf0f0005L 2 0xf0f0005 +AthenaEventLoopMgr INFO ===>>> done processing event #9, run #1 9 events processed so far <<<=== +AthenaEventLoopMgr INFO ===>>> start processing event #10, run #1 9 events processed so far <<<=== +zzz 0xf0f0005L 2 0xf0f0005 +AthenaEventLoopMgr INFO ===>>> done processing event #10, run #1 10 events processed so far <<<=== +AthenaEventLoopMgr INFO ===>>> start processing event #11, run #1 10 events processed so far <<<=== +zzz 0xf0f0005L 2 0xf0f0005 +AthenaEventLoopMgr INFO ===>>> done processing event #11, run #1 11 events processed so far <<<=== +AthenaEventLoopMgr INFO ===>>> start processing event #12, run #1 11 events processed so far <<<=== +zzz 0xf0f0005L 2 0xf0f0005 +AthenaEventLoopMgr INFO ===>>> done processing event #12, run #1 12 events processed so far <<<=== +TileInfoLoader INFO Handling EndRun incident +TileInfoLoader INFO Removed TileInfo object from detector store. +Domain[ROOT_All] INFO > Deaccess DbDomain READ [ROOT_All] +ApplicationMgr INFO Application Manager Stopped successfully +IncidentProcAlg1 INFO Finalize +CondInputLoader INFO Finalizing CondInputLoader... +testalg1 INFO Finalizing testalg1... +IncidentProcAlg2 INFO Finalize +PyComponentMgr INFO Finalizing PyComponentMgr... +IdDictDetDescrCnv INFO in finalize +IOVDbSvc INFO Folder /LAR/Align (PoolRef) db-read 1/1 objs/chan/bytes 1/1/170 (( 0.04 ))s +IOVDbSvc INFO Folder /TILE/OFL02/CALIB/CES (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/103344 (( 0.06 ))s +IOVDbSvc INFO Folder /TILE/OFL02/CALIB/CIS/FIT/LIN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/80 (( 0.04 ))s +IOVDbSvc INFO Folder /TILE/OFL02/CALIB/CIS/FIT/NLN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/80 (( 0.03 ))s +IOVDbSvc INFO Folder /TILE/OFL02/CALIB/EMS (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/92 (( 0.02 ))s +IOVDbSvc INFO Folder /TILE/OFL02/CALIB/LAS/FIBER (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/940 (( 0.03 ))s +IOVDbSvc INFO Folder /TILE/OFL02/CALIB/LAS/LIN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/72 (( 0.03 ))s +IOVDbSvc INFO Folder /TILE/OFL02/CALIB/LAS/NLN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/76 (( 0.04 ))s +IOVDbSvc INFO Folder /TILE/OFL02/NOISE/SAMPLE (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/641476 (( 0.13 ))s +IOVDbSvc INFO Folder /TILE/OFL02/STATUS/ADC (AttrListColl) db-read 1/2 objs/chan/bytes 277/277/97884 (( 0.69 ))s +IOVDbSvc INFO Folder /TILE/OFL02/TIME/CHANNELOFFSET/PHY (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/96 (( 0.68 ))s +IOVDbSvc INFO Folder /TILE/ONL01/STATUS/ADC (AttrListColl) db-read 1/2 objs/chan/bytes 277/277/76 (( 0.07 ))s +IOVDbSvc INFO Folder /LAR/LArCellPositionShift (PoolRef) db-read 1/1 objs/chan/bytes 1/1/195 (( 0.01 ))s +IOVDbSvc INFO Total payload read from COOL: 844581 bytes in (( 1.87 ))s +IOVDbSvc INFO Connection sqlite://;schema=mycool.db;dbname=OFLP200 : nConnect: 0 nFolders: 0 ReadTime: (( 0.00 ))s +IOVDbSvc INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 2 nFolders: 2 ReadTime: (( 0.05 ))s +IOVDbSvc INFO Connection COOLOFL_TILE/OFLP200 : nConnect: 2 nFolders: 11 ReadTime: (( 1.82 ))s +TileInfoLoader INFO TileInfoLoader::finalize() +AthDictLoaderSvc INFO in finalize... +ToolSvc INFO Removing all tools created by ToolSvc +ToolSvc.tool11 INFO Finalizing +ToolSvc.tool10 INFO Finalizing +ToolSvc.tool9 INFO Finalizing +ToolSvc.tool8 INFO Finalizing +ToolSvc.tool7 INFO Finalizing +ToolSvc.tool6 INFO Finalizing +ToolSvc.tool5 INFO Finalizing +ToolSvc.tool4 INFO Finalizing +ToolSvc.tool2 INFO Finalizing +ToolSvc.tool1 INFO Finalizing +ToolSvc.beaminfo4 INFO Finalizing +ToolSvc.TileBea... INFO Finalizing +*****Chrono***** INFO **************************************************************************************************** +*****Chrono***** INFO The Final CPU consumption ( Chrono ) Table (ordered) +*****Chrono***** INFO **************************************************************************************************** +cObjR_ALL INFO Time User : Tot= 390 [ms] Ave/Min/Max= 195(+- 185)/ 10/ 380 [ms] #= 2 +cObj_ALL INFO Time User : Tot= 470 [ms] Ave/Min/Max= 31.3(+- 102)/ 0/ 410 [ms] #= 15 +ChronoStatSvc INFO Time User : Tot= 41.8 [s] #= 1 +*****Chrono***** INFO **************************************************************************************************** +ChronoStatSvc.f... INFO Service finalized successfully +ApplicationMgr INFO Application Manager Finalized successfully +ApplicationMgr INFO Application Manager Terminated successfully +Py:Athena INFO leaving with code 0: "successful run" diff --git a/TileCalorimeter/TileRecUtils/src/TileBeamInfoProvider.cxx b/TileCalorimeter/TileRecUtils/src/TileBeamInfoProvider.cxx index f2c2d783c415cd0a84d41d23339acc5f390f13f3..6d47670062537afc708c97eba837f083afd69979 100644 --- a/TileCalorimeter/TileRecUtils/src/TileBeamInfoProvider.cxx +++ b/TileCalorimeter/TileRecUtils/src/TileBeamInfoProvider.cxx @@ -8,12 +8,11 @@ #include "TileIdentifier/TileTBFrag.h" #include "TileIdentifier/TileTTL1Hash.h" #include "TileEvent/TileTrigger.h" -#include "TileConditions/TileDCSSvc.h" #include "TileConditions/TileBadChanTool.h" #include "TileCalibBlobObjs/TileCalibUtils.h" // Calo include -#include "CaloIdentifier/CaloLVL1_ID.h" +#include "CaloIdentifier/CaloLVL1_ID.h" // Atlas includes #include "StoreGate/ReadHandle.h" @@ -49,7 +48,6 @@ TileBeamInfoProvider::interfaceID() { TileBeamInfoProvider::TileBeamInfoProvider(const std::string& type, const std::string& name, const IInterface* parent) : AthAlgTool(type, name, parent) - , m_tileDCSSvc("TileDCSSvc", name) , m_rndmSvc ("AtRndmGenSvc", name) , m_tileBadChanTool("TileBadChanTool") , m_tileHWID(0) @@ -95,8 +93,11 @@ StatusCode TileBeamInfoProvider::initialize() { CHECK(detStore()->retrieve(m_tileHWID, "TileHWID")); //=== TileDCSSvc - if (m_checkDCS) - CHECK(m_tileDCSSvc.retrieve()); + if (m_checkDCS) { + ATH_CHECK(m_tileDCS.retrieve()); + } else { + m_tileDCS.disable(); + } m_evt = 0; m_trigType = 0; @@ -116,7 +117,7 @@ StatusCode TileBeamInfoProvider::initialize() { m_tileBadChanTool.disable(); } - if (!(m_beamElemContainerKey.key().empty() + if (!(m_beamElemContainerKey.key().empty() && m_digitsContainerKey.key().empty() && m_rawChannelContainerKey.key().empty()) || m_simulateTrips) { @@ -142,23 +143,23 @@ StatusCode TileBeamInfoProvider::initialize() { ATH_CHECK( m_eventInfoKey.initialize() ); if (!m_beamElemContainerKey.key().empty()) { - ATH_CHECK( m_beamElemContainerKey.initialize() ); + ATH_CHECK( m_beamElemContainerKey.initialize() ); } if (!m_digitsContainerKey.key().empty()) { - ATH_CHECK( m_digitsContainerKey.initialize() ); + ATH_CHECK( m_digitsContainerKey.initialize() ); } if (!m_rawChannelContainerKey.key().empty()) { - ATH_CHECK( m_rawChannelContainerKey.initialize() ); + ATH_CHECK( m_rawChannelContainerKey.initialize() ); } if (!m_triggerContainerKey.key().empty()) { - ATH_CHECK( m_triggerContainerKey.initialize() ); + ATH_CHECK( m_triggerContainerKey.initialize() ); } if (!m_laserObjectKey.key().empty()) { - ATH_CHECK( m_laserObjectKey.initialize() ); + ATH_CHECK( m_laserObjectKey.initialize() ); } @@ -463,9 +464,9 @@ void TileBeamInfoProvider::handle(const Incident& inc) { std::vector<double> boardtsum(maxboard); std::vector < Identifier > backtid(maxboard); std::vector<double> backtsum(maxboard); - + // FIXME:: convert coincTrig to TileTrigger - + TileTrigger* tileTrigger = new TileTrigger(mtid, mtsum, boardtid, boardtsum, backtid, backtsum); triggerContainer->push_back(tileTrigger); @@ -475,7 +476,7 @@ void TileBeamInfoProvider::handle(const Incident& inc) { << m_triggerContainerKey.key() << " in StoreGate"); } - + } // we are going to put TileLaserObject to StoreGate @@ -485,7 +486,7 @@ void TileBeamInfoProvider::handle(const Incident& inc) { if(laserObject.record( std::make_unique<TileLaserObject>() ).isSuccess()) { laserObject->setBCID(m_BCID); - // FIXME: a lot of set methods here + // FIXME: a lot of set methods here // to copy m_laspar to TileLaserObject } else { @@ -582,12 +583,12 @@ uint32_t TileBeamInfoProvider::checkCalibMode(void) { bool TileBeamInfoProvider::isChanDCSgood(int partition, int drawer, int channel) const { if (m_checkDCS) { - TileDCSSvc::TileDCSStatus Status = m_tileDCSSvc->getDCSSTATUS(partition, - drawer, channel); - if (Status > TileDCSSvc::WARNING) { - ATH_MSG_DEBUG("Module=" << m_tileDCSSvc->partitionName(partition) << std::setw(2) << std::setfill('0') << drawer + 1 + TileDCSState::TileDCSStatus status = m_tileDCS->getDCSStatus(partition, drawer, channel); + + if (status > TileDCSState::WARNING) { + ATH_MSG_DEBUG("Module=" << TileCalibUtils::getDrawerString(partition, drawer) << " channel=" << channel - << " masking becasue of bad DCS status=" << Status); + << " masking becasue of bad DCS status=" << status); return false; } else { return true; @@ -640,7 +641,7 @@ const TileDQstatus * TileBeamInfoProvider::getDQstatus() { TileFragHash::TYPE RChType = m_rcCnt->get_type(); if (RChType != TileFragHash::OptFilterDsp && RChType != TileFragHash::OptFilterDspCompressed) { - ATH_MSG_INFO("RawChannelContaier didn't come from BS - don't check DQ flags"); + ATH_MSG_INFO("RawChannelContainer didn't come from BS - don't check DQ flags"); ATH_MSG_INFO("RChType = " << RChType); m_DQstatus.setAllGood(); m_checkDQ = false; @@ -680,4 +681,3 @@ const TileDQstatus * TileBeamInfoProvider::getDQstatus() { m_DQstatus.setFilled(true); return &m_DQstatus; } - diff --git a/TileCalorimeter/TileRecUtils/src/TileCellBuilder.cxx b/TileCalorimeter/TileRecUtils/src/TileCellBuilder.cxx index 4d4761ec962a34ef2bbc1391e7586dcec4c1af44..c6ef0f9872c5b8730f7579dca31f69fabf0d1e40 100644 --- a/TileCalorimeter/TileRecUtils/src/TileCellBuilder.cxx +++ b/TileCalorimeter/TileRecUtils/src/TileCellBuilder.cxx @@ -172,7 +172,7 @@ TileCellBuilder::~TileCellBuilder(){ * Initializer */ StatusCode TileCellBuilder::initialize() { - + // retrieve MBTS and Tile detector manager, TileID helper and TileIfno from det store if (m_MBTSContainerKey.key().empty()) { m_mbtsMgr = nullptr; @@ -310,7 +310,7 @@ StatusCode TileCellBuilder::process(CaloCellContainer * theCellContainer) { } else { - ATH_MSG_DEBUG( "Container " << m_rawChannelContainerKey.key() << " with TileRawChannles found "); + ATH_MSG_DEBUG( "Container " << m_rawChannelContainerKey.key() << " with TileRawChannels found "); m_RChType = rawChannelContainer->get_type(); m_RChUnit = rawChannelContainer->get_unit(); @@ -402,7 +402,7 @@ StatusCode TileCellBuilder::process(CaloCellContainer * theCellContainer) { dspTimeCut = 63.9375; // 64-1/16 ns is hard limit in DSP dspCorrectAmplitude = ((dspFlags & 0x3000000) == 0); dspCorrectTime = ((dspFlags & 0x3000000) != 0); - } else { // dsp container contains resluts of offline reco + } else { // dsp container contains results of offline reco dspTimeCut = ((dspFlags >> 27) & 1) ? 100.0 : 75.0; // 100 or 75 ns is the limit for 9 or 7 samples } @@ -1006,12 +1006,6 @@ bool TileCellBuilder::maskBadChannels(TileCell* pCell) { template<class ITERATOR, class COLLECTION> void TileCellBuilder::build(const ITERATOR & begin, const ITERATOR & end, COLLECTION * coll) { - // disable checks for TileID and remember previous state - bool do_checks = m_tileID->do_checks(); - m_tileID->set_do_checks(false); - bool do_checks_tb = m_tileID->do_checks(); - m_tileTBID->set_do_checks(false); - // Now retrieve the TileDQStatus if(m_notUpgradeCabling) m_DQstatus = m_beamInfo->getDQstatus(); @@ -1140,7 +1134,7 @@ void TileCellBuilder::build(const ITERATOR & begin, const ITERATOR & end, COLLEC if (index == -3) { // E4' cells - if (m_E4prCells) { // do something with them only if contaier existst + if (m_E4prCells) { // do something with them only if container exists ++nE4pr; // convert ADC counts to MeV. like for normal cells @@ -1425,9 +1419,4 @@ void TileCellBuilder::build(const ITERATOR & begin, const ITERATOR & end, COLLEC msg(MSG::DEBUG) << endmsg; } - - m_tileID->set_do_checks(do_checks); - // set back this flag to TileID - m_tileTBID->set_do_checks(do_checks_tb); - } diff --git a/TileCalorimeter/TileRecUtils/src/TileCellBuilderFromHit.cxx b/TileCalorimeter/TileRecUtils/src/TileCellBuilderFromHit.cxx index 0a4eff3f873af35c1befe49be216db6530a65274..70ddb67e9dfbf160c22f92925456bdd7eaf59cfc 100644 --- a/TileCalorimeter/TileRecUtils/src/TileCellBuilderFromHit.cxx +++ b/TileCalorimeter/TileRecUtils/src/TileCellBuilderFromHit.cxx @@ -370,7 +370,7 @@ StatusCode TileCellBuilderFromHit::process(CaloCellContainer * theCellContainer) flag |= fl << (p - 1); } - // number of cosecutively masked modules (if it's > 15 we have error already set) + // number of consecutively masked modules (if it's > 15 we have error already set) flag |= (std::min(15, drConsecMaxMax) << 16); if (drConsecMaxMax > 1 && error < xAOD::EventInfo::Warning) { diff --git a/TileCalorimeter/TileRecUtils/test/TileCellBuilder_test.sh b/TileCalorimeter/TileRecUtils/test/TileCellBuilder_test.sh new file mode 100755 index 0000000000000000000000000000000000000000..04fd6c3842f085edb2fa1225c00b1d28c48259de --- /dev/null +++ b/TileCalorimeter/TileRecUtils/test/TileCellBuilder_test.sh @@ -0,0 +1,7 @@ +#!/bin/bash +# +# Script running the TileCellBuilder_test.py test with CTest. +# + +# Run the job: +athena.py TileRecUtils/TileCellBuilder_test.py diff --git a/TileCalorimeter/TileSimAlgs/src/TileDigitsMaker.cxx b/TileCalorimeter/TileSimAlgs/src/TileDigitsMaker.cxx index c529832b57cef445db65245c74d10635d55efb06..81670fd5d4f963780cb6481e1b1c0123fac0577d 100644 --- a/TileCalorimeter/TileSimAlgs/src/TileDigitsMaker.cxx +++ b/TileCalorimeter/TileSimAlgs/src/TileDigitsMaker.cxx @@ -524,8 +524,13 @@ StatusCode TileDigitsMaker::execute() { } else { ATH_MSG_DEBUG( "TileRawChannelContainer for DQ check retrieved"); } - TimedRawChanContList::iterator iTzeroRawChanCont(rawchanContList.begin()); - const TileRawChannelContainer * rndm_rawchan_container = (iTzeroRawChanCont->second); + + const TileRawChannelContainer* rndm_rawchan_container(nullptr); + if (!rawchanContList.empty()) { + TimedRawChanContList::iterator iTzeroRawChanCont(rawchanContList.begin()); + rndm_rawchan_container = iTzeroRawChanCont->second; + } + ATH_MSG_DEBUG( "setContainer method being called in TileDigitsMaker"); m_beamInfo->setContainers(rndm_digit_container, rndm_rawchan_container); ATH_MSG_DEBUG( "Containers successfully set in TileBeamInfoProvider"); diff --git a/TileCalorimeter/TileSimAlgs/src/TileHitVecToCntTool.cxx b/TileCalorimeter/TileSimAlgs/src/TileHitVecToCntTool.cxx index ade0f69bce1c5901f76e9982a32fe37e9953b320..fd82e8ded024e7ec2dcdb44e727888aaf57f39b5 100644 --- a/TileCalorimeter/TileSimAlgs/src/TileHitVecToCntTool.cxx +++ b/TileCalorimeter/TileSimAlgs/src/TileHitVecToCntTool.cxx @@ -470,7 +470,7 @@ void TileHitVecToCntTool::processHitVectorForPileUp(const TileHitVector* inputHi eHitTot += ener; TileHit * pHit = m_allHits[hit_idhash]; - TileHit * pHit_DigiHSTruth = nullptr; + TileHit * pHit_DigiHSTruth(nullptr); if(m_doDigiTruth) pHit_DigiHSTruth = m_allHits_DigiHSTruth[hit_idhash]; if (0 == pHit) { @@ -922,7 +922,7 @@ StatusCode TileHitVecToCntTool::mergeEvent() { for (; iHit != lastHit; ++iHit) { TileHit *pHit = (*iHit); - TileHit *pHit_DigiHSTruth = nullptr; + TileHit *pHit_DigiHSTruth(nullptr); if(m_doDigiTruth) pHit_DigiHSTruth = new TileHit(**iHit_DigiHSTruth); if (pHit->size() > 1 || pHit->energy() != 0.0) { // hit exists m_hits->push_back(pHit); // store hit in container diff --git a/TileCalorimeter/TileSvc/TileByteStream/src/TileCellCont.cxx b/TileCalorimeter/TileSvc/TileByteStream/src/TileCellCont.cxx index d9bb726933afb36269fdc32280af55d47d33c9a1..41a922ee1274e97c420c664b5ae2793cfd1f0ef3 100644 --- a/TileCalorimeter/TileSvc/TileByteStream/src/TileCellCont.cxx +++ b/TileCalorimeter/TileSvc/TileByteStream/src/TileCellCont.cxx @@ -79,7 +79,7 @@ StatusCode TileCellCont::initialize() { mbtsMgr = 0; } - ToolHandle<ITileBadChanTool> badChanTool("TileBadChanTool"); + ToolHandle<ITileBadChanTool> badChanTool("TileBadChanLegacyTool"); if (badChanTool.retrieve().isFailure()) { std::cout << "TileCellCont:initialize ERROR: Can not retrieve TileBadChanTool" << std::endl; return StatusCode::FAILURE; @@ -89,6 +89,7 @@ StatusCode TileCellCont::initialize() { std::cout << "TileCellCont:initialize ERROR: Can not initialize TileBadChanTool" << std::endl; return StatusCode::FAILURE; } + if ( !m_src ){ // if nothing set, use 2017 std::cout << "TileCellCont::initialize ERROR : TileHid2RESrc has to be initialized before this" << std::endl; } @@ -137,7 +138,7 @@ StatusCode TileCellCont::initialize() { } else if (index >= 0) { // normal cell one_good = one_good || (!badChanTool->getChannelStatus(channelID).isBad()); Rw2Pmt[channel] = pmt; - if (channel > 0 || ros != 2) { // ignoring D0 (first channel) in negative barrel + if (channel > 0 || ros != 2) { // ignoring D0 (first channel) in negative barrel cell_hash = tileID->cell_hash(cell_id); tmp.push_back(int_pair(channel, cell_hash)); } @@ -242,4 +243,3 @@ unsigned int TileCellCont::find_rod(const unsigned int& rodid) const { unsigned int rodidx = m_hash.identifier(rodid); return rodidx; } - diff --git a/TileCalorimeter/TileSvc/TileEventAthenaPool/share/TileTPCnv_15.6.4_test.py b/TileCalorimeter/TileSvc/TileEventAthenaPool/share/TileTPCnv_15.6.4_test.py index 2f80024fe2db21226ba0fe328334f59959d42979..ac2868486507aae19604f7c98b52128943bde665 100644 --- a/TileCalorimeter/TileSvc/TileEventAthenaPool/share/TileTPCnv_15.6.4_test.py +++ b/TileCalorimeter/TileSvc/TileEventAthenaPool/share/TileTPCnv_15.6.4_test.py @@ -16,7 +16,3 @@ noMuon = True noID = True include ('AthenaPoolUtilities/TPCnvTest.py') - -from TileConditions.TileInfoConfigurator import TileInfoConfigurator -tileInfoConfigurator = TileInfoConfigurator() - diff --git a/TileCalorimeter/TileSvc/TileEventAthenaPool/share/TileTPCnv_20.1.7.2_test.py b/TileCalorimeter/TileSvc/TileEventAthenaPool/share/TileTPCnv_20.1.7.2_test.py index 360517ac885e1f02cf872b47e34aeff438380800..00c316c6f2b8abd9aa220272a3bba356ed9d99c6 100644 --- a/TileCalorimeter/TileSvc/TileEventAthenaPool/share/TileTPCnv_20.1.7.2_test.py +++ b/TileCalorimeter/TileSvc/TileEventAthenaPool/share/TileTPCnv_20.1.7.2_test.py @@ -19,7 +19,3 @@ noMuon = True noID = True include ('AthenaPoolUtilities/TPCnvTest.py') - -from TileConditions.TileInfoConfigurator import TileInfoConfigurator -tileInfoConfigurator = TileInfoConfigurator() - diff --git a/Tools/DirectIOART/README.md b/Tools/DirectIOART/README.md index de314f6af076e482fbbf94ea4182171a10e27015..e6ffc19a5d27e33cb451e1eb2084372c4f97e158 100644 --- a/Tools/DirectIOART/README.md +++ b/Tools/DirectIOART/README.md @@ -11,6 +11,7 @@ Detailed lists of the tests that are performed within the particular software re ##### Tests: * **TFile::Open** (using an AOD input file) * master/Athena + * master/AthSimulation * 21.0/Athena * 21.0/AthSimulation * 21.2/AthAnalysis diff --git a/Tools/DirectIOART/generateARTtests.py b/Tools/DirectIOART/generateARTtests.py index 59d29b1b1190c9107504c27c213f9fc3fcdca9b6..ef18ee2fb7d3c8d7c8efc0ca61e4c161ec1d2c58 100755 --- a/Tools/DirectIOART/generateARTtests.py +++ b/Tools/DirectIOART/generateARTtests.py @@ -224,6 +224,7 @@ def writeTFileOpen(): # art-description: DirectIOART TFile::Open # art-type: grid # art-include master/Athena +# art-include master/AthSimulation # art-include 21.0/Athena # art-include 21.0/AthSimulation # art-include 21.2/AthAnalysis diff --git a/Tools/DirectIOART/test/test_directioart_tfileopen.py b/Tools/DirectIOART/test/test_directioart_tfileopen.py index 5cbfcfae4319517041fa2fe1411e255911ff01f6..c600b22e1ede0947c67ae273765f1291556de2b7 100755 --- a/Tools/DirectIOART/test/test_directioart_tfileopen.py +++ b/Tools/DirectIOART/test/test_directioart_tfileopen.py @@ -3,6 +3,7 @@ # art-description: DirectIOART TFile::Open # art-type: grid # art-include master/Athena +# art-include master/AthSimulation # art-include 21.0/Athena # art-include 21.0/AthSimulation # art-include 21.2/AthAnalysis @@ -37,4 +38,5 @@ outstr = """<?xml version="1.0" encoding="UTF-8" standalone="no" ?> </POOLFILECATALOG>""" with open("PoolFileCatalog.xml", "w") as outfile: - outfile.write(outstr) \ No newline at end of file + outfile.write(outstr) + diff --git a/Tools/FilePeeker/src/BSFilePeeker.cxx b/Tools/FilePeeker/src/BSFilePeeker.cxx index 969dde77ed4ec34d5a72eb43ee7277737bc3e10a..8ed6de269d14c470e81ea965cd562b7fc25a67c8 100644 --- a/Tools/FilePeeker/src/BSFilePeeker.cxx +++ b/Tools/FilePeeker/src/BSFilePeeker.cxx @@ -6,7 +6,17 @@ #include <iostream> #include <string> #include <unistd.h> +// Suppress a gcc8 warning from boost. +// (Binaries apparently include boost with -I rather than -isystem.) +// Fixed in boost 1.68 (see https://github.com/boostorg/mpl/issues/31) +#ifdef __GNUC__ +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wparentheses" +#endif #include "EventStorage/pickDataReader.h" +#ifdef __GNUC__ +# pragma GCC diagnostic pop +#endif #include "FileMetaData.h" class BSFilePeeker { diff --git a/Tools/PyJobTransforms/python/trfArgClasses.py b/Tools/PyJobTransforms/python/trfArgClasses.py index 1ee21b953cbafbd22033b4534c265de1d7ce7337..49637b8f401cda44f77638b4eb15bb0b796ddb6e 100644 --- a/Tools/PyJobTransforms/python/trfArgClasses.py +++ b/Tools/PyJobTransforms/python/trfArgClasses.py @@ -2179,7 +2179,7 @@ class argSubstepSteering(argSubstep): # "doRAWtoALL" - produce all DESDs and AODs directly from bytestream steeringAlises = { 'no': {}, - 'doRDO_TRIG': {'RAWtoESD': [('in', '-', 'RDO'), ('in', '+', 'RDO_TRIG'), ('in', '-', 'BS')]}, + 'doRDO_TRIG': {'RAWtoESD': [('in', '-', 'RDO'), ('in', '-', 'RDO_FTK'), ('in', '+', 'RDO_TRIG'), ('in', '-', 'BS')]}, 'doOverlay': {'HITtoRDO': [('in', '-', 'HITS'), ('out', '-', 'RDO'), ('out', '-', 'RDO_FILT')], 'OverlayPool': [('in', '+', ('HITS', 'RDO_BKG')), ('out', '+', 'RDO')]}, 'afterburn': {'generate': [('out', '-', 'EVNT')]}, diff --git a/Tools/PyJobTransforms/python/trfExe.py b/Tools/PyJobTransforms/python/trfExe.py index 0b420f93576138292bef7c1a84f95beaba4983a7..985d30842ace8b29e4f79ccb8ef51e27a6473a99 100755 --- a/Tools/PyJobTransforms/python/trfExe.py +++ b/Tools/PyJobTransforms/python/trfExe.py @@ -1859,16 +1859,6 @@ class archiveExecutor(scriptExecutor): self.setPreExeStart() self._memMonitor = False - #unpack archived inputs - import zipfile - if 'inputDataFile' in self.conf.argdict: - for f in self.conf.argdict['inputDataFile'].value: - if zipfile.is_zipfile(f): - archive = zipfile.ZipFile(f, mode='r') - print 'Extracting input zip file {0} to temporary directory {1}'.format(f,'tmp') - archive.extractall('tmp') - archive.close() - #archiving if self._exe == 'zip': if 'outputArchFile' not in self.conf.argdict: @@ -1877,7 +1867,7 @@ class archiveExecutor(scriptExecutor): self._cmd = ['python'] try: with open('zip_wrapper.py', 'w') as zip_wrapper: - print >> zip_wrapper, "import zipfile, tarfile, os, shutil" + print >> zip_wrapper, "import zipfile, os, shutil" if os.path.exists(self.conf.argdict['outputArchFile'].value[0]): #appending input file(s) to existing archive print >> zip_wrapper, "zf = zipfile.ZipFile('{}', mode='a', allowZip64=True)".format(self.conf.argdict['outputArchFile'].value[0]) @@ -1885,18 +1875,27 @@ class archiveExecutor(scriptExecutor): #creating new archive print >> zip_wrapper, "zf = zipfile.ZipFile('{}', mode='w', allowZip64=True)".format(self.conf.argdict['outputArchFile'].value[0]) print >> zip_wrapper, "for f in {}:".format(self.conf.argdict['inputDataFile'].value) - print >> zip_wrapper, " if not zipfile.is_zipfile(f):" + print >> zip_wrapper, " if zipfile.is_zipfile(f):" + print >> zip_wrapper, " archive = zipfile.ZipFile(f, mode='r')" + print >> zip_wrapper, " print 'Extracting input zip file {0} to temporary directory {1}'.format(f,'tmp')" + print >> zip_wrapper, " archive.extractall('tmp')" + print >> zip_wrapper, " archive.close()" + # remove stuff as soon as it is saved to output in order to save disk space at worker node + print >> zip_wrapper, " if os.access(f, os.F_OK):" + print >> zip_wrapper, " print 'Removing input zip file {}'.format(f)" + print >> zip_wrapper, " os.unlink(f)" + print >> zip_wrapper, " if os.path.isdir('tmp'):" + print >> zip_wrapper, " for root, dirs, files in os.walk('tmp'):" + print >> zip_wrapper, " for name in files:" + print >> zip_wrapper, " print 'Zipping {}'.format(name)" + print >> zip_wrapper, " zf.write(os.path.join(root, name), name, compress_type=zipfile.ZIP_STORED)" + print >> zip_wrapper, " shutil.rmtree('tmp')" + print >> zip_wrapper, " else:" print >> zip_wrapper, " print 'Zipping {}'.format(os.path.basename(f))" print >> zip_wrapper, " zf.write(f, arcname=os.path.basename(f), compress_type=zipfile.ZIP_STORED)" - print >> zip_wrapper, " if os.access(f, os.F_OK):" - print >> zip_wrapper, " print 'Removing input file {}'.format(f)" - print >> zip_wrapper, " os.unlink(f)" - print >> zip_wrapper, "if os.path.isdir('tmp'):" - print >> zip_wrapper, " for root, dirs, files in os.walk('tmp'):" - print >> zip_wrapper, " for name in files:" - print >> zip_wrapper, " print 'Zipping {}'.format(name)" - print >> zip_wrapper, " zf.write(os.path.join(root, name), name, compress_type=zipfile.ZIP_STORED)" - print >> zip_wrapper, " shutil.rmtree('tmp')" + print >> zip_wrapper, " if os.access(f, os.F_OK):" + print >> zip_wrapper, " print 'Removing input file {}'.format(f)" + print >> zip_wrapper, " os.unlink(f)" print >> zip_wrapper, "zf.close()" os.chmod('zip_wrapper.py', 0755) except (IOError, OSError) as e: @@ -1911,6 +1910,7 @@ class archiveExecutor(scriptExecutor): #unarchiving elif self._exe == 'unarchive': + import zipfile for infile in self.conf.argdict['inputArchFile'].value: if not zipfile.is_zipfile(infile): raise trfExceptions.TransformExecutionException(trfExit.nameToCode('TRF_INPUT_FILE_ERROR'), @@ -1936,3 +1936,4 @@ class archiveExecutor(scriptExecutor): ) self._cmd.append('unarchive_wrapper.py') super(archiveExecutor, self).preExecute(input=input, output=output) + diff --git a/Tracking/TrkAlgorithms/TrkTrackCollectionMerger/TrkTrackCollectionMerger/TrackCollectionMerger.h b/Tracking/TrkAlgorithms/TrkTrackCollectionMerger/TrkTrackCollectionMerger/TrackCollectionMerger.h index 293ed8ee983ef62747804874e45b9f589697e727..5d0ac579a6632647d10f9af48a7e6c984c574019 100644 --- a/Tracking/TrkAlgorithms/TrkTrackCollectionMerger/TrkTrackCollectionMerger/TrackCollectionMerger.h +++ b/Tracking/TrkAlgorithms/TrkTrackCollectionMerger/TrkTrackCollectionMerger/TrackCollectionMerger.h @@ -10,7 +10,7 @@ #include <string> #include <map> -#include "AthenaBaseComps/AthReentrantAlgorithm.h" +#include "AthenaBaseComps/AthAlgorithm.h" #include "GaudiKernel/ToolHandle.h" #include "TrkTrack/TrackCollection.h" @@ -23,7 +23,7 @@ namespace Trk { /** @brief Class-algorithm for track collection merging and removalof potential duplicate tracks. */ - class TrackCollectionMerger : public AthReentrantAlgorithm + class TrackCollectionMerger : public AthAlgorithm { /////////////////////////////////////////////////////////////////// @@ -39,7 +39,7 @@ namespace Trk { TrackCollectionMerger(const std::string &name, ISvcLocator *pSvcLocator); virtual ~TrackCollectionMerger() {} StatusCode initialize(); - StatusCode execute_r (const EventContext& ctx) const; + StatusCode execute(); StatusCode finalize(); /////////////////////////////////////////////////////////////////// diff --git a/Tracking/TrkAlgorithms/TrkTrackCollectionMerger/src/TrackCollectionMerger.cxx b/Tracking/TrkAlgorithms/TrkTrackCollectionMerger/src/TrackCollectionMerger.cxx index a2d6cdde9e372869451ad0680826c6a386ca1756..ffc442ccace5ff619471ae2fa233c3a0092e1102 100644 --- a/Tracking/TrkAlgorithms/TrkTrackCollectionMerger/src/TrackCollectionMerger.cxx +++ b/Tracking/TrkAlgorithms/TrkTrackCollectionMerger/src/TrackCollectionMerger.cxx @@ -21,7 +21,7 @@ Trk::TrackCollectionMerger::TrackCollectionMerger (const std::string& name, ISvcLocator* pSvcLocator ) : - AthReentrantAlgorithm(name, pSvcLocator ), + AthAlgorithm(name, pSvcLocator ), m_createViewCollection(true), m_updateSharedHitsOnly(true), m_updateAdditionalInfo(false) @@ -73,7 +73,7 @@ StatusCode Trk::TrackCollectionMerger::initialize() /////////////////////////////////////////////////////////////////// // Execute /////////////////////////////////////////////////////////////////// -StatusCode Trk::TrackCollectionMerger::execute_r(const EventContext& ctx) const +StatusCode Trk::TrackCollectionMerger::execute() { // clean up association tool m_assoTool->reset(); @@ -88,7 +88,7 @@ StatusCode Trk::TrackCollectionMerger::execute_r(const EventContext& ctx) const size_t ttNumber = 0; for (auto& tcname : m_tracklocation){ ///Retrieve forward tracks from StoreGate - SG::ReadHandle<TrackCollection> trackCol (tcname,ctx); + SG::ReadHandle<TrackCollection> trackCol (tcname); trackCollections.push_back(trackCol.cptr()); ttNumber += trackCol->size(); } @@ -113,7 +113,7 @@ StatusCode Trk::TrackCollectionMerger::execute_r(const EventContext& ctx) const else m_trkSummaryTool->updateTrack(*trk); } - SG::WriteHandle<TrackCollection> h_write(m_outtracklocation,ctx); + SG::WriteHandle<TrackCollection> h_write(m_outtracklocation); ATH_CHECK(h_write.record(std::move(outputCol))); diff --git a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/DiscSurface.h b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/DiscSurface.h index 4b07e59b0cc13cbbbfcd81f40eb921cac9786645..2c0c7fe9c9c69ecd504231cffe5638eb5c12384f 100644 --- a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/DiscSurface.h +++ b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/DiscSurface.h @@ -19,6 +19,8 @@ // Amg #include "EventPrimitives/EventPrimitives.h" #include "GeoPrimitives/GeoPrimitives.h" +//std +#include <cmath> //for cos, sin etc class MsgStream; template< class SURFACE, class BOUNDS_CNV > class BoundSurfaceCnv_p1; @@ -174,6 +176,9 @@ namespace Trk { /** Special method for Disc surface : local<->local transformations polar <-> cartesian */ const Amg::Vector2D* localCartesianToPolar(const Amg::Vector2D& loccart) const; + /** Special method for Disc surface : local<->local transformations polar <-> cartesian by value*/ + Amg::Vector2D localCartesianToPolarValue(const Amg::Vector2D& loccart) const; + /** Special method for DiscSurface : local<->local transformations polar <-> cartesian */ const Amg::Vector2D* localPolarToLocalCartesian(const Amg::Vector2D& locpol) const; @@ -257,12 +262,17 @@ namespace Trk { } inline const Amg::Vector2D* DiscSurface::localPolarToCartesian(const Amg::Vector2D& locpol) const - { return(new Amg::Vector2D(locpol[locR]*cos(locpol[locPhi]),locpol[locR]*sin(locpol[locPhi]))); } + { return(new Amg::Vector2D(locpol[locR]*std::cos(locpol[locPhi]),locpol[locR]*std::sin(locpol[locPhi]))); } inline const Amg::Vector2D* DiscSurface::localCartesianToPolar(const Amg::Vector2D& loccart) const { - return(new Amg::Vector2D(sqrt(loccart[locX]*loccart[locX]+loccart[locY]*loccart[locY]), - atan2(loccart[locY], loccart[locX]))); + return(new Amg::Vector2D(std::sqrt(loccart[locX]*loccart[locX]+loccart[locY]*loccart[locY]), + std::atan2(loccart[locY], loccart[locX]))); + } + inline Amg::Vector2D DiscSurface::localCartesianToPolarValue(const Amg::Vector2D& loccart) const + { + return(Amg::Vector2D(std::sqrt(loccart[locX]*loccart[locX]+loccart[locY]*loccart[locY]), + std::atan2(loccart[locY], loccart[locX]))); } inline Intersection DiscSurface::straightLineIntersection(const Amg::Vector3D& pos, diff --git a/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/LocalDirection.h b/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/LocalDirection.h index 3219de3b80fc8414d64678592b0dae09b8120d4e..3a850b9062b9d3fcbb9377c0c662739519c81a00 100755 --- a/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/LocalDirection.h +++ b/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/LocalDirection.h @@ -70,20 +70,13 @@ namespace Trk { class LocalDirection { public: - /** Default ctor - needed by POOL */ - LocalDirection(); - /** copy constructor */ - LocalDirection(const LocalDirection& err); - - /** constructors with parameters */ - LocalDirection(double alphaXZ, double betaYZ); - - /** destructor, virtual as other classes may inherit */ - virtual ~LocalDirection(); + LocalDirection() {}; - /** assignment operator */ - LocalDirection& operator=(const LocalDirection &err); + LocalDirection(double axz, double ayz) : + m_angleXZ(axz), + m_angleYZ(ayz) + {} /** access method for angle of local XZ projection */ const double& angleXZ() const; @@ -91,10 +84,9 @@ namespace Trk { /** access method for angle of local YZ projection */ const double& angleYZ() const; - protected: - double m_angleXZ; - double m_angleYZ; + double m_angleXZ = 0.; + double m_angleYZ = 0.; }; diff --git a/Tracking/TrkEvent/TrkEventPrimitives/src/LocalDirection.cxx b/Tracking/TrkEvent/TrkEventPrimitives/src/LocalDirection.cxx index e1d82dfbf8e313bb17691c001ceba88d62538316..86cfa90f0f49e71b3190c92a6f5e8cf05c38b332 100755 --- a/Tracking/TrkEvent/TrkEventPrimitives/src/LocalDirection.cxx +++ b/Tracking/TrkEvent/TrkEventPrimitives/src/LocalDirection.cxx @@ -10,33 +10,6 @@ //Gaudi #include "GaudiKernel/MsgStream.h" -Trk::LocalDirection::LocalDirection() : - m_angleXZ(0.), - m_angleYZ(0.) -{} - -Trk::LocalDirection::LocalDirection(double axz, double ayz) : - m_angleXZ(axz), - m_angleYZ(ayz) -{} - -Trk::LocalDirection::LocalDirection(const LocalDirection& locdir) : - m_angleXZ(locdir.m_angleXZ), - m_angleYZ(locdir.m_angleYZ) -{} - - -Trk::LocalDirection::~LocalDirection() -{} - -Trk::LocalDirection& Trk::LocalDirection::operator=(const Trk::LocalDirection& rhs) -{ - if (this != &rhs){ - m_angleXZ = rhs.m_angleXZ; - m_angleYZ = rhs.m_angleYZ; - } - return(*this); -} /**Overload of << operator for both, MsgStream and std::ostream for debug output*/ MsgStream& Trk::operator << ( MsgStream& ls, const Trk::LocalDirection& lom) diff --git a/Tracking/TrkExtrapolation/TrkExRungeKuttaIntersector/TrkExRungeKuttaIntersector/IntersectorWrapper.h b/Tracking/TrkExtrapolation/TrkExRungeKuttaIntersector/TrkExRungeKuttaIntersector/IntersectorWrapper.h index c8b2115419ae40dd028b41de9a0ae533f8f162e7..c91108a7c3cf6f51776e8743fcf6f9ce5c922ab9 100755 --- a/Tracking/TrkExtrapolation/TrkExRungeKuttaIntersector/TrkExRungeKuttaIntersector/IntersectorWrapper.h +++ b/Tracking/TrkExtrapolation/TrkExRungeKuttaIntersector/TrkExRungeKuttaIntersector/IntersectorWrapper.h @@ -1,214 +1,224 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + */ + +////////////////////////////////////////////////////////////////////// +// wrapper to IIntersector tool to provide IPropagator functionality +// default configuration wraps the RungeKutta intersector +// (c) ATLAS Detector software +////////////////////////////////////////////////////////////////////// + +#ifndef TRKEXRUNGEKUTTAINTERSECTOR_INTERSECTORWRAPPER_H +#define TRKEXRUNGEKUTTAINTERSECTOR_INTERSECTORWRAPPER_H + +#include "AthenaBaseComps/AthAlgTool.h" +#include "GaudiKernel/ToolHandle.h" +#include "GeoPrimitives/GeoPrimitives.h" +#include "TrkExInterfaces/IPropagator.h" + +namespace Trk +{ +class IIntersector; +class TrackSurfaceIntersection; + +class IntersectorWrapper: public AthAlgTool, + virtual public IPropagator + { -////////////////////////////////////////////////////////////////////// -// wrapper to IIntersector tool to provide IPropagator functionality -// default configuration wraps the RungeKutta intersector -// (c) ATLAS Detector software -////////////////////////////////////////////////////////////////////// - -#ifndef TRKEXRUNGEKUTTAINTERSECTOR_INTERSECTORWRAPPER_H -#define TRKEXRUNGEKUTTAINTERSECTOR_INTERSECTORWRAPPER_H - -#include "AthenaBaseComps/AthAlgTool.h" -#include "GaudiKernel/ToolHandle.h" -#include "GeoPrimitives/GeoPrimitives.h" -#include "TrkExInterfaces/IPropagator.h" - -namespace Trk -{ -class IIntersector; -class TrackSurfaceIntersection; - -class IntersectorWrapper: public AthAlgTool, - virtual public IPropagator -{ - -public: + public: using IPropagator::propagate; using IPropagator::propagateT; - IntersectorWrapper (const std::string& type, - const std::string& name, - const IInterface* parent); - ~IntersectorWrapper (void); // destructor - - StatusCode initialize(); - StatusCode finalize(); - - - - /** N 0) <b>Neutral parameters method </b> - - returns a ParametersBase object as well, 0 if the extrapolation did not succeed - */ - /// implemented - const NeutralParameters* propagate(const NeutralParameters&, - const Surface&, - PropDirection, - BoundaryCheck, - bool) const; - - /** [TrackParameters] --------------------------------------------------------- */ - - /** Propagation interface: - - The propagation method called by the TrkExtrapolator. The extrapolator - is responsible for the underlying logic of which surface to go to. - */ - /// implemented - const TrackParameters* propagate( const TrackParameters& parm, - const Surface& sf, - PropDirection dir, - BoundaryCheck bcheck, - const MagneticFieldProperties& mprop, - ParticleHypothesis particle, - bool returnCurv, - const TrackingVolume*) const; - - - /** Propagation interface: - - The propagation method called by the TrkExtrapolator. The propagator - finds the closest surface. - */ - const TrackParameters* propagate( const TrackParameters&, - std::vector<DestSurf>&, - PropDirection, - const MagneticFieldProperties&, - ParticleHypothesis, - std::vector<unsigned int>&, - double&, - bool, - bool, - const TrackingVolume*) const { return 0; } - - /** Propagation interface: - - The propagation method called by the TrkExtrapolator. The propagator - finds the closest surface. Timing included. - */ - const TrackParameters* propagateT( const TrackParameters&, - std::vector<DestSurf>&, - PropDirection, - const MagneticFieldProperties&, - ParticleHypothesis, - std::vector<unsigned int>&, - PathLimit&, TimeLimit&, - bool, - const TrackingVolume*, - std::vector<Trk::HitInfo>*&) const { return 0; } - - - /** Propagation interface: - - The propagation method including the return of the TransportJacobian matrix. - - */ - /// implemented - const TrackParameters* propagate( const TrackParameters&, - const Surface&, - PropDirection, - BoundaryCheck, - const MagneticFieldProperties&, - TransportJacobian*&, - double&, - ParticleHypothesis, - bool, - const TrackingVolume*) const; - - - /** Propagation interface without Covariance matrix propagation - the pathlength has to be returned for eventual following propagateCovariance - */ - /// implemented - const TrackParameters* propagateParameters( const TrackParameters& parm, - const Surface& sf, - PropDirection dir, - BoundaryCheck bcheck, - const MagneticFieldProperties& mprop, - ParticleHypothesis particle=pion, - bool returnCurv = false, - const TrackingVolume* tVol=0) const; - - /// implemented - const TrackParameters* propagateParameters( const TrackParameters& parm, - const Surface& sf, - PropDirection dir, - BoundaryCheck bcheck, - const MagneticFieldProperties& mprop, - TransportJacobian*&, - ParticleHypothesis particle=pion, - bool returnCurv = false, - const TrackingVolume* tVol=0) const; - - - /** Intersection interface: - - The intersection interface might be used by the material service as well to estimate - the surfaces (sensitive and nonesensitive) while propagation - */ - const IntersectionSolution* intersect( const TrackParameters& parm, - const Surface& sf, - const MagneticFieldProperties& mprop, - ParticleHypothesis particle=pion, - const TrackingVolume* tVol=0) const; - - /** GlobalPositions list interface: - This is used mostly in pattern recognition in the road finder, the propagation direction is intrinsically given - by the sign of the stepSize. - - To avoid memory fragmentation in multiple use of pattern recognition processes and respecting the possible iterative - filling of the positions list, the list of GlobalPositions is given by reference through the signature and a void - method has been chosen. - */ - void globalPositions(std::list<Amg::Vector3D>& positionslist, - const TrackParameters& parm, - const MagneticFieldProperties& mprop, - const CylinderBounds& cylbo, - double stepSize, - ParticleHypothesis particle=pion, - const TrackingVolume* tVol=0) const; - - //placeholder for compatibility with new interface - const TrackSurfaceIntersection* intersectSurface(const Surface&, - const TrackSurfaceIntersection*, - const double, - const MagneticFieldProperties&, - ParticleHypothesis) const {return 0;} - - /** Validation Action: - Can be implemented optionally, outside access to internal validation steps */ - void validationAction() const {} - - - -private: - - // private methods - void - createParameters (const Surface& surface, - BoundaryCheck boundsCheck, - bool curvilinear) const; - void - findIntersection (const TrackParameters& parameters, - const Surface& surface, - PropDirection dir = Trk::anyDirection) const; - - // helpers, managers, tools - ToolHandle<IIntersector> m_intersector; - ToolHandle<IPropagator> m_linePropagator; - - // current parameter cache - mutable double m_charge; - mutable const TrackSurfaceIntersection* m_intersection; - mutable Amg::Vector3D m_momentum; - mutable const TrackParameters* m_parameters; - mutable Amg::Vector3D m_position; - mutable double m_qOverP; -}; - -} // end of namespace - - -#endif // TRKEXRUNGEKUTTAINTERSECTOR_INTERSECTORWRAPPER_H + IntersectorWrapper (const std::string& type, + const std::string& name, + const IInterface* parent); + ~IntersectorWrapper (void); // destructor + + StatusCode initialize(); + StatusCode finalize(); + + + + /** N 0) <b>Neutral parameters method </b> + - returns a ParametersBase object as well, 0 if the extrapolation did not succeed + */ + /// implemented + virtual const NeutralParameters* propagate(const NeutralParameters&, + const Surface&, + PropDirection, + BoundaryCheck, + bool) const override; + + /** [TrackParameters] --------------------------------------------------------- */ + + /** Propagation interface: + + The propagation method called by the TrkExtrapolator. The extrapolator + is responsible for the underlying logic of which surface to go to. + */ + /// implemented + virtual const TrackParameters* propagate( const TrackParameters& parm, + const Surface& sf, + PropDirection dir, + BoundaryCheck bcheck, + const MagneticFieldProperties& mprop, + ParticleHypothesis particle, + bool returnCurv, + const TrackingVolume*) const override; + + + /** Propagation interface: + + The propagation method called by the TrkExtrapolator. The propagator + finds the closest surface. + */ + virtual const TrackParameters* propagate( const TrackParameters&, + std::vector<DestSurf>&, + PropDirection, + const MagneticFieldProperties&, + ParticleHypothesis, + std::vector<unsigned int>&, + double&, + bool, + bool, + const TrackingVolume*) const override{ return 0; } + + /** Propagation interface: + + The propagation method called by the TrkExtrapolator. The propagator + finds the closest surface. Timing included. + */ + virtual const TrackParameters* propagateT( const TrackParameters&, + std::vector<DestSurf>&, + PropDirection, + const MagneticFieldProperties&, + ParticleHypothesis, + std::vector<unsigned int>&, + PathLimit&, TimeLimit&, + bool, + const TrackingVolume*, + std::vector<Trk::HitInfo>*&) const override{ return 0; } + + + /** Propagation interface: + + The propagation method including the return of the TransportJacobian matrix. + +*/ + /// implemented + virtual const TrackParameters* propagate( const TrackParameters&, + const Surface&, + PropDirection, + BoundaryCheck, + const MagneticFieldProperties&, + TransportJacobian*&, + double&, + ParticleHypothesis, + bool, + const TrackingVolume*) const override; + + + /** Propagation interface without Covariance matrix propagation + the pathlength has to be returned for eventual following propagateCovariance + */ + /// implemented + virtual const TrackParameters* propagateParameters( const TrackParameters& parm, + const Surface& sf, + PropDirection dir, + BoundaryCheck bcheck, + const MagneticFieldProperties& mprop, + ParticleHypothesis particle=pion, + bool returnCurv = false, + const TrackingVolume* tVol=0) const override; + + /// implemented + virtual const TrackParameters* propagateParameters( const TrackParameters& parm, + const Surface& sf, + PropDirection dir, + BoundaryCheck bcheck, + const MagneticFieldProperties& mprop, + TransportJacobian*&, + ParticleHypothesis particle=pion, + bool returnCurv = false, + const TrackingVolume* tVol=0) const override; + + + /** Intersection interface: + + The intersection interface might be used by the material service as well to estimate + the surfaces (sensitive and nonesensitive) while propagation + */ + virtual const IntersectionSolution* intersect( const TrackParameters& parm, + const Surface& sf, + const MagneticFieldProperties& mprop, + ParticleHypothesis particle=pion, + const TrackingVolume* tVol=0) const override; + + /** GlobalPositions list interface: + This is used mostly in pattern recognition in the road finder, the propagation direction is intrinsically given + by the sign of the stepSize. + + To avoid memory fragmentation in multiple use of pattern recognition processes and respecting the possible iterative + filling of the positions list, the list of GlobalPositions is given by reference through the signature and a void + method has been chosen. + */ + virtual void globalPositions(std::list<Amg::Vector3D>& positionslist, + const TrackParameters& parm, + const MagneticFieldProperties& mprop, + const CylinderBounds& cylbo, + double stepSize, + ParticleHypothesis particle=pion, + const TrackingVolume* tVol=0) const override; + + //placeholder for compatibility with new interface + virtual const TrackSurfaceIntersection* intersectSurface(const Surface&, + const TrackSurfaceIntersection*, + const double, + const MagneticFieldProperties&, + ParticleHypothesis) const override{return 0;} + + /** Validation Action: + Can be implemented optionally, outside access to internal validation steps */ + virtual void validationAction() const override{} + + + + private: + struct Cache{ + double m_charge; + double m_qOverP; + std::unique_ptr<const TrackSurfaceIntersection> m_intersection; + const TrackParameters* m_parameters; + Amg::Vector3D m_position; + Amg::Vector3D m_momentum; + + Cache(): + m_charge{}, + m_qOverP{}, + m_intersection{nullptr}, + m_parameters{nullptr}, + m_position{}, + m_momentum{}{ + } + }; + // private methods + void + createParameters (Cache& cache, + const Surface& surface, + BoundaryCheck boundsCheck, + bool curvilinear) const; + void + findIntersection (Cache& cache, + const TrackParameters& parameters, + const Surface& surface, + PropDirection dir = Trk::anyDirection) const; + + // helpers, managers, tools + ToolHandle<IIntersector> m_intersector; + ToolHandle<IPropagator> m_linePropagator; + }; + +} // end of namespace + + +#endif // TRKEXRUNGEKUTTAINTERSECTOR_INTERSECTORWRAPPER_H diff --git a/Tracking/TrkExtrapolation/TrkExRungeKuttaIntersector/src/IntersectorWrapper.cxx b/Tracking/TrkExtrapolation/TrkExRungeKuttaIntersector/src/IntersectorWrapper.cxx index db3c53eddd4ad35c25fee262182b33de42655feb..d1d40d98d0a6d710edb510d8e8c78cc175919ff0 100755 --- a/Tracking/TrkExtrapolation/TrkExRungeKuttaIntersector/src/IntersectorWrapper.cxx +++ b/Tracking/TrkExtrapolation/TrkExRungeKuttaIntersector/src/IntersectorWrapper.cxx @@ -1,258 +1,260 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + */ + +////////////////////////////////////////////////////////////////////// +// wrapper to IIntersector tool to provide IPropagator functionality +// default configuration wraps the RungeKutta intersector +// (c) ATLAS Detector software +////////////////////////////////////////////////////////////////////// + +#include <iomanip> +#include <vector> +#include "GaudiKernel/SystemOfUnits.h" +#include "TrkExInterfaces/IIntersector.h" +#include "TrkExRungeKuttaIntersector/IntersectorWrapper.h" +#include "TrkExUtils/IntersectionSolution.h" +#include "TrkExUtils/TrackSurfaceIntersection.h" +#include "TrkGeometry/MagneticFieldProperties.h" +#include "TrkSurfaces/CylinderSurface.h" +#include "TrkSurfaces/DiscSurface.h" +#include "TrkSurfaces/PerigeeSurface.h" +#include "TrkSurfaces/PlaneSurface.h" +#include "TrkSurfaces/StraightLineSurface.h" +#include "TrkSurfaces/Surface.h" +#include "TrkParameters/TrackParameters.h" + +namespace Trk +{ + +//<<<<<< CLASS STRUCTURE INITIALIZATION >>>>>> + +IntersectorWrapper::IntersectorWrapper (const std::string& type, + const std::string& name, + const IInterface* parent) + :AthAlgTool (type, name, parent), + m_intersector ("Trk::RungeKuttaIntersector/RungeKuttaIntersector"), + m_linePropagator ("") + { + declareInterface<Trk::IPropagator>(this); + declareProperty("Intersector", m_intersector); + declareProperty("LinePropagator", m_linePropagator); + } + +IntersectorWrapper::~IntersectorWrapper (void) +{} + +//<<<<<< PUBLIC MEMBER FUNCTION DEFINITIONS >>>>>> + +StatusCode +IntersectorWrapper::initialize(){ + // get the Tools + + ATH_CHECK(m_intersector.retrieve()); + + ATH_MSG_VERBOSE( "Retrieved tool " << m_intersector ); + + if (!m_linePropagator.empty()) { + ATH_CHECK( m_linePropagator.retrieve()); + } + return StatusCode::SUCCESS; +} + + +StatusCode IntersectorWrapper::finalize() +{ + return StatusCode::SUCCESS; +} + +const NeutralParameters* +IntersectorWrapper::propagate (const NeutralParameters& parameters, + const Surface& surface, + PropDirection dir, + BoundaryCheck boundsCheck, + bool curvilinear) const +{ + return m_linePropagator->propagate(parameters,surface,dir,boundsCheck,curvilinear); +} + +const TrackParameters* +IntersectorWrapper::propagate (const TrackParameters& parameters, + const Surface& surface, + PropDirection dir, + BoundaryCheck boundsCheck, + const MagneticFieldProperties& /*magProperties*/, + ParticleHypothesis /*particle*/, + bool curvilinear, + const TrackingVolume*) const +{ + Cache cache{}; + findIntersection(cache,parameters,surface, dir); + createParameters(cache,surface,boundsCheck,curvilinear); + return cache.m_parameters; +} + +const TrackParameters* +IntersectorWrapper::propagate (const TrackParameters& parameters, + const Surface& surface, + PropDirection dir, + BoundaryCheck boundsCheck, + const MagneticFieldProperties& /*magProperties*/, + TransportJacobian*& /*transportJac*/, + double&, + ParticleHypothesis /*particle*/, + bool curvilinear, + const TrackingVolume*) const +{ + Cache cache{}; + findIntersection(cache,parameters,surface,dir); + createParameters(cache,surface,boundsCheck,curvilinear); + return cache.m_parameters; +} + +const TrackParameters* +IntersectorWrapper::propagateParameters (const TrackParameters& parameters, + const Surface& surface, + PropDirection dir, + BoundaryCheck boundsCheck, + const MagneticFieldProperties& /*magProperties*/, + ParticleHypothesis /*particle*/, + bool curvilinear, + const TrackingVolume*) const +{ + + Cache cache{}; + findIntersection(cache,parameters,surface,dir); + createParameters(cache,surface,boundsCheck,curvilinear); + return cache.m_parameters; +} + +const TrackParameters* +IntersectorWrapper::propagateParameters (const TrackParameters& parameters, + const Surface& surface, + PropDirection dir, + BoundaryCheck boundsCheck, + const MagneticFieldProperties& /*magProperties*/, + TransportJacobian*& /*transportJac*/, + ParticleHypothesis /*particle*/, + bool curvilinear, + const TrackingVolume*) const +{ + Cache cache{}; + findIntersection(cache,parameters,surface,dir); + createParameters(cache,surface,boundsCheck,curvilinear); + return cache.m_parameters; +} + +const IntersectionSolution* +IntersectorWrapper::intersect (const TrackParameters& parameters, + const Surface& surface, + const MagneticFieldProperties& /*magProperties*/, + ParticleHypothesis /*particle*/, + const TrackingVolume*) const +{ + Cache cache{}; + findIntersection(cache,parameters,surface); + IntersectionSolution* solution = new IntersectionSolution; + if (cache.m_intersection.get()) { + solution->push_back(cache.m_intersection.release()); + } + return solution; +} + +void +IntersectorWrapper::globalPositions (std::list<Amg::Vector3D>&, + const TrackParameters&, + const MagneticFieldProperties&, + const CylinderBounds&, + double, + ParticleHypothesis, + const TrackingVolume* ) const +{ + ATH_MSG_WARNING( "globalPositions method from the IPropagator interface" + << " has NOT been implememnted" ); +} + +//<<<<<< PRIVATE MEMBER FUNCTION DEFINITIONS >>>>>> + +void +IntersectorWrapper::createParameters (Cache& cache, + const Surface& surface, + BoundaryCheck /*boundsCheck*/, + bool curvilinear) const +{ + cache.m_parameters = nullptr; + if (! cache.m_intersection) return; + + // curvilinear special (simple) case + if (curvilinear) + { + cache.m_parameters=new CurvilinearParameters(cache.m_intersection->position(), + cache.m_intersection->direction().phi(), + cache.m_intersection->direction().theta(), + cache.m_qOverP); + return; + } + + cache.m_parameters=surface.createTrackParameters(cache.m_intersection->position(), + cache.m_intersection->direction(), + cache.m_charge,nullptr); + // unrecognized Surface + if( !cache.m_parameters ) ATH_MSG_WARNING( " Failed to create parameters " ); +} + +void +IntersectorWrapper::findIntersection (Cache& cache, + const TrackParameters& parameters, + const Surface& surface, + PropDirection dir) const +{ + cache.m_charge = parameters.charge(); + cache.m_momentum = parameters.momentum(); + cache.m_parameters=¶meters; + cache.m_position = Amg::Vector3D(parameters.position()); + cache.m_qOverP = 1./cache.m_momentum.mag(); + cache.m_intersection.reset(new TrackSurfaceIntersection(cache.m_position,cache.m_momentum*cache.m_qOverP,0.)); + cache.m_qOverP *= cache.m_charge; + + const TrackSurfaceIntersection* oldIntersection = cache.m_intersection.release(); + cache.m_intersection.reset( m_intersector->intersectSurface(surface, + oldIntersection, + cache.m_qOverP)); + delete oldIntersection; + if (! cache.m_intersection.get()) + { + ATH_MSG_DEBUG( " no intersection found " ); + return; + } + + // check for correct propagation direction + if ((dir == Trk::alongMomentum && cache.m_intersection->pathlength() < 0.) + || (dir == Trk::oppositeMomentum && cache.m_intersection->pathlength() > 0.)) + { + if (msgLvl(MSG::DEBUG)) + { + if (dir == Trk::alongMomentum) + { + ATH_MSG_DEBUG( " requested alongMomentum, but pathlength " + << cache.m_intersection->pathlength() ); + } + else if (dir == Trk::oppositeMomentum) + { + ATH_MSG_DEBUG( " requested oppositeMomentum, but pathlength " + << cache.m_intersection->pathlength() ); + } + } + cache.m_intersection=nullptr; + return; + } + + ATH_MSG_DEBUG( std::setiosflags(std::ios::fixed) + << " intersection at r,phi,z " + << std::setw(10) << std::setprecision(1) << cache.m_intersection->position().perp() + << std::setw(9) << std::setprecision(4) << cache.m_intersection->position().phi() + << std::setw(10) << std::setprecision(1) << cache.m_intersection->position().z() + << " momentum " + << std::setw(9) << std::setprecision(3) << 1./fabs(cache.m_qOverP*Gaudi::Units::GeV) ); +} + +} // end of namespace -////////////////////////////////////////////////////////////////////// -// wrapper to IIntersector tool to provide IPropagator functionality -// default configuration wraps the RungeKutta intersector -// (c) ATLAS Detector software -////////////////////////////////////////////////////////////////////// - -#include <iomanip> -#include <vector> -#include "GaudiKernel/SystemOfUnits.h" -#include "TrkExInterfaces/IIntersector.h" -#include "TrkExRungeKuttaIntersector/IntersectorWrapper.h" -#include "TrkExUtils/IntersectionSolution.h" -#include "TrkExUtils/TrackSurfaceIntersection.h" -#include "TrkGeometry/MagneticFieldProperties.h" -#include "TrkSurfaces/CylinderSurface.h" -#include "TrkSurfaces/DiscSurface.h" -#include "TrkSurfaces/PerigeeSurface.h" -#include "TrkSurfaces/PlaneSurface.h" -#include "TrkSurfaces/StraightLineSurface.h" -#include "TrkSurfaces/Surface.h" -#include "TrkParameters/TrackParameters.h" - -namespace Trk -{ - -//<<<<<< CLASS STRUCTURE INITIALIZATION >>>>>> - -IntersectorWrapper::IntersectorWrapper (const std::string& type, - const std::string& name, - const IInterface* parent) - : AthAlgTool (type, name, parent), - m_intersector ("Trk::RungeKuttaIntersector/RungeKuttaIntersector"), - m_linePropagator (""), - m_charge{}, - m_intersection (nullptr), - m_momentum{}, - m_parameters (nullptr), - m_position{}, - m_qOverP{} -{ - declareInterface<Trk::IPropagator>(this); - declareProperty("Intersector", m_intersector); - declareProperty("LinePropagator", m_linePropagator); -} - -IntersectorWrapper::~IntersectorWrapper (void) -{} - -//<<<<<< PUBLIC MEMBER FUNCTION DEFINITIONS >>>>>> - -StatusCode -IntersectorWrapper::initialize(){ - // get the Tools - ATH_CHECK(m_intersector.retrieve()); - ATH_MSG_VERBOSE( "Retrieved tool " << m_intersector ); - if (!m_linePropagator.empty()) ATH_CHECK( m_linePropagator.retrieve()); - return StatusCode::SUCCESS; -} - -StatusCode -IntersectorWrapper::finalize() -{ - delete m_intersection; - - return StatusCode::SUCCESS; -} - -const NeutralParameters* -IntersectorWrapper::propagate (const NeutralParameters& parameters, - const Surface& surface, - PropDirection dir, - BoundaryCheck boundsCheck, - bool curvilinear) const -{ - return m_linePropagator->propagate(parameters,surface,dir,boundsCheck,curvilinear); -} - -const TrackParameters* -IntersectorWrapper::propagate (const TrackParameters& parameters, - const Surface& surface, - PropDirection dir, - BoundaryCheck boundsCheck, - const MagneticFieldProperties& /*magProperties*/, - ParticleHypothesis /*particle*/, - bool curvilinear, - const TrackingVolume*) const -{ - findIntersection(parameters,surface, dir); - createParameters(surface,boundsCheck,curvilinear); - return m_parameters; -} - -const TrackParameters* -IntersectorWrapper::propagate (const TrackParameters& parameters, - const Surface& surface, - PropDirection dir, - BoundaryCheck boundsCheck, - const MagneticFieldProperties& /*magProperties*/, - TransportJacobian*& /*transportJac*/, - double&, - ParticleHypothesis /*particle*/, - bool curvilinear, - const TrackingVolume*) const -{ - findIntersection(parameters,surface,dir); - createParameters(surface,boundsCheck,curvilinear); - return m_parameters; -} - -const TrackParameters* -IntersectorWrapper::propagateParameters (const TrackParameters& parameters, - const Surface& surface, - PropDirection dir, - BoundaryCheck boundsCheck, - const MagneticFieldProperties& /*magProperties*/, - ParticleHypothesis /*particle*/, - bool curvilinear, - const TrackingVolume*) const -{ - - findIntersection(parameters,surface,dir); - createParameters(surface,boundsCheck,curvilinear); - return m_parameters; -} - -const TrackParameters* -IntersectorWrapper::propagateParameters (const TrackParameters& parameters, - const Surface& surface, - PropDirection dir, - BoundaryCheck boundsCheck, - const MagneticFieldProperties& /*magProperties*/, - TransportJacobian*& /*transportJac*/, - ParticleHypothesis /*particle*/, - bool curvilinear, - const TrackingVolume*) const -{ - findIntersection(parameters,surface,dir); - createParameters(surface,boundsCheck,curvilinear); - return m_parameters; -} - -const IntersectionSolution* -IntersectorWrapper::intersect (const TrackParameters& parameters, - const Surface& surface, - const MagneticFieldProperties& /*magProperties*/, - ParticleHypothesis /*particle*/, - const TrackingVolume*) const -{ - findIntersection(parameters,surface); - IntersectionSolution* solution = new IntersectionSolution; - if (m_intersection) solution->push_back(m_intersection); - return solution; -} - -void -IntersectorWrapper::globalPositions (std::list<Amg::Vector3D>&, - const TrackParameters&, - const MagneticFieldProperties&, - const CylinderBounds&, - double, - ParticleHypothesis, - const TrackingVolume* ) const -{ - ATH_MSG_WARNING( "globalPositions method from the IPropagator interface" - << " has NOT been implememnted" ); -} - -//<<<<<< PRIVATE MEMBER FUNCTION DEFINITIONS >>>>>> - -void -IntersectorWrapper::createParameters (const Surface& surface, - BoundaryCheck /*boundsCheck*/, - bool curvilinear) const -{ - m_parameters = 0; - if (! m_intersection) return; - - // curvilinear special (simple) case - if (curvilinear) - { - m_parameters = new CurvilinearParameters(m_intersection->position(), - m_intersection->direction().phi(), - m_intersection->direction().theta(), - m_qOverP); - return; - } - - m_parameters = surface.createTrackParameters(m_intersection->position(),m_intersection->direction(),m_charge,nullptr); - // unrecognized Surface - if( !m_parameters ) ATH_MSG_WARNING( " Failed to create parameters " ); -} - -void -IntersectorWrapper::findIntersection (const TrackParameters& parameters, - const Surface& surface, - PropDirection dir) const -{ - //if (! m_intersection || ¶meters != m_parameters) - { - delete m_intersection; - m_charge = parameters.charge(); - m_momentum = parameters.momentum(); - m_parameters = ¶meters; - m_position = parameters.position(); - m_position = Amg::Vector3D(parameters.position()); - m_qOverP = 1./m_momentum.mag(); - m_intersection = new TrackSurfaceIntersection(m_position,m_momentum*m_qOverP,0.); - m_qOverP *= m_charge; - } - - const TrackSurfaceIntersection* oldIntersection = m_intersection; - m_intersection = m_intersector->intersectSurface(surface, - oldIntersection, - m_qOverP); - delete oldIntersection; - if (! m_intersection) - { - ATH_MSG_DEBUG( " no intersection found " ); - return; - } - - // check for correct propagation direction - if ((dir == Trk::alongMomentum && m_intersection->pathlength() < 0.) - || (dir == Trk::oppositeMomentum && m_intersection->pathlength() > 0.)) - { - if (msgLvl(MSG::DEBUG)) - { - if (dir == Trk::alongMomentum) - { - ATH_MSG_DEBUG( " requested alongMomentum, but pathlength " - << m_intersection->pathlength() ); - } - else if (dir == Trk::oppositeMomentum) - { - ATH_MSG_DEBUG( " requested oppositeMomentum, but pathlength " - << m_intersection->pathlength() ); - } - } - delete m_intersection; - m_intersection = 0; - return; - } - - ATH_MSG_DEBUG( std::setiosflags(std::ios::fixed) - << " intersection at r,phi,z " - << std::setw(10) << std::setprecision(1) << m_intersection->position().perp() - << std::setw(9) << std::setprecision(4) << m_intersection->position().phi() - << std::setw(10) << std::setprecision(1) << m_intersection->position().z() - << " momentum " - << std::setw(9) << std::setprecision(3) << 1./fabs(m_qOverP*Gaudi::Units::GeV) ); -} - -} // end of namespace - diff --git a/Tracking/TrkExtrapolation/TrkExTools/TrkExTools/MaterialEffectsUpdator.h b/Tracking/TrkExtrapolation/TrkExTools/TrkExTools/MaterialEffectsUpdator.h index ca396bd94b6d67d570f0e03d797110907e18facb..de940472d472ae261690d9ec63088e26a6116821 100755 --- a/Tracking/TrkExtrapolation/TrkExTools/TrkExTools/MaterialEffectsUpdator.h +++ b/Tracking/TrkExtrapolation/TrkExTools/TrkExTools/MaterialEffectsUpdator.h @@ -184,52 +184,6 @@ class MaterialEffectsUpdator : public AthAlgTool, return; } - private: - /* - * Each instance (out of N) needs a have cache in order to accumulate calculation - * between calls to its methods. In a Multi Thread environment we will - * have pontially M threads running. So we need MxN cache instance. - * - * The solution adopted here is an effort to implement - * "Schmidt, Douglas & Pryce, Nat & H. Harrison, Timothy. (1998). - * Thread-Specific Storage for C/C++ - An Object - * Behavioral Pattern for Accessing per-Thread State Efficiently." - * Published in "More C++ Gems (SIGS Reference Library)". - * The solution in Figure 5 is adopted here. One could also adopt Figure 4 as - * an alternative - * - * We have M thread_local ptr to vectors. So one vector for each thread. - * For the lookup each object needs a uniqueID. This is created in the initialize - * by hashing the unique's instance full name. - * - * Following https://google.github.io/styleguide/cppguide.html#thread_local - * the thread local is only exposed from inside a function. - * - * Using thread_local unique_ptr<T> achieves - * the same behaviour as boost::thread_specific_ptr<T> - */ - - Cache* getTLSCache() const{ - - typedef std::vector<std::unique_ptr<Cache>> TLSCollection; - /* Initialize a unique ptr to default constructed TLSCollection*/ - thread_local std::unique_ptr<TLSCollection> s_cacheStore= std::make_unique<TLSCollection>(); - - /*This should never happen*/ - if(s_cacheStore.get()==nullptr){ - return nullptr; - } - /* Get the actual cache*/ - size_t index= m_uniqueID-1; - if (m_uniqueID>s_cacheStore->size()) { - s_cacheStore->resize(m_uniqueID); - } - if (s_cacheStore->operator[](index).get()==nullptr) { - s_cacheStore->operator[](index)= std::make_unique<Cache>(); - } - return s_cacheStore->operator[](index).get(); - } - public: /* * Public methods using the TLS cache. @@ -240,7 +194,7 @@ class MaterialEffectsUpdator : public AthAlgTool, ParticleHypothesis particle=pion, MaterialUpdateMode matupmode=addNoise) const override{ - Cache& cache = (*getTLSCache()); + Cache& cache = getTLSCache(); const TrackParameters* outparam = updateImpl(cache,parm,sf,dir,particle,matupmode); return outparam; } @@ -249,7 +203,7 @@ class MaterialEffectsUpdator : public AthAlgTool, const MaterialEffectsOnTrack& meff, Trk::ParticleHypothesis particle=pion, MaterialUpdateMode matupmode=addNoise) const override{ - Cache& cache = (*getTLSCache()); + Cache& cache = getTLSCache(); const TrackParameters* outparam = updateImpl(cache,parm,meff,particle,matupmode); return outparam; } @@ -259,7 +213,7 @@ class MaterialEffectsUpdator : public AthAlgTool, PropDirection dir=alongMomentum, ParticleHypothesis particle=pion, MaterialUpdateMode matupmode=addNoise) const override{ - Cache& cache = (*getTLSCache()); + Cache& cache = getTLSCache(); const TrackParameters* outparam = preUpdateImpl(cache,parm,sf,dir,particle,matupmode); return outparam; } @@ -269,7 +223,7 @@ class MaterialEffectsUpdator : public AthAlgTool, PropDirection dir=alongMomentum, ParticleHypothesis particle=pion, MaterialUpdateMode matupmode=addNoise) const override{ - Cache& cache = (*getTLSCache()); + Cache& cache = getTLSCache(); const TrackParameters* outparam = postUpdateImpl(cache,parm,sf,dir,particle,matupmode); return outparam; } @@ -280,20 +234,19 @@ class MaterialEffectsUpdator : public AthAlgTool, PropDirection dir=alongMomentum, ParticleHypothesis particle=pion, MaterialUpdateMode matupmode=addNoise) const override{ - Cache& cache = (*getTLSCache()); + Cache& cache = getTLSCache(); const TrackParameters* outparam = updateImpl(cache,parm,mprop,pathcorrection,dir,particle,matupmode); return outparam; } virtual void validationAction() const override{ - Cache& cache = (*getTLSCache()); + Cache& cache = getTLSCache(); validationActionImpl(cache); - return; } virtual void modelAction(const TrackParameters* parm = 0) const override{ - Cache& cache = (*getTLSCache()); + Cache& cache = getTLSCache(); modelActionImpl(cache,parm); return; } @@ -365,7 +318,6 @@ class MaterialEffectsUpdator : public AthAlgTool, bool m_landauMode; //!< If in Landau mode, error propagation is done as for landaus int m_validationDirection; //!< validation direction // ------------------------------ - std::size_t m_uniqueID; //!< UniqueID Hash based on the unique instance name double m_momentumCut; //!< Minimal momentum cut for update double m_momentumMax; //!< Maximal momentum cut for update double m_forcedMomentum; //!< Forced momentum value @@ -374,6 +326,27 @@ class MaterialEffectsUpdator : public AthAlgTool, ToolHandle< IMultipleScatteringUpdator > m_msUpdator; //!< AlgoTool for MultipleScatterin effects // the material mapper for the validation process ToolHandle< IMaterialMapper > m_materialMapper; //!< the material mapper for recording the layer material + + /* + * TLS part + * The solution adopted here is an effort to implement + * "Schmidt, Douglas & Pryce, Nat & H. Harrison, Timothy. (1998). + * Thread-Specific Storage for C/C++ - An Object + * Behavioral Pattern for Accessing per-Thread State Efficiently." + * Published in "More C++ Gems (SIGS Reference Library)". + * Adopted here via boost::thread_specific_ptr + */ + + mutable boost::thread_specific_ptr<Cache> m_cache_tls; + Cache& getTLSCache() const{ + Cache* cache = m_cache_tls.get(); + if (!cache) { + cache = new Cache(); + m_cache_tls.reset( cache ); + } + return *cache; + } + }; } // end of namespace diff --git a/Tracking/TrkExtrapolation/TrkExTools/TrkExTools/MultipleScatteringUpdator.h b/Tracking/TrkExtrapolation/TrkExTools/TrkExTools/MultipleScatteringUpdator.h index bbd7547f9d638b3212b01e6d68885d80d22e237a..7a11175e96bb9aae4ff0c0d59699407ad86ef397 100755 --- a/Tracking/TrkExtrapolation/TrkExTools/TrkExTools/MultipleScatteringUpdator.h +++ b/Tracking/TrkExtrapolation/TrkExTools/TrkExTools/MultipleScatteringUpdator.h @@ -78,31 +78,6 @@ namespace Trk { /** Random engine */ CLHEP::HepRandomEngine* m_randomEngine; std::string m_randomEngineName; //!< Name of the random number stream - - static ParticleMasses s_particleMasses; //!< struct of Particle masses - - static double s_main_RutherfordScott; //!< main factor of Rutherford-Scott formula - static double s_log_RutherfordScott; //!< log factor of Rutherford-Scott formula - - static double s_main_RossiGreisen; //!< main factor for Rossi-Greisen formula - static double s_log_RossiGreisen; //!< main factor for Rossi-Greisen formula - - - // ========= Gaussian mixture model Fruehwirth, Regler Nucl. Inst. Methods A 456(2001) ========= - - static double s_gausMixSigma1_a0; //!< Gaussian mixture model: Sigma parameter a0 - static double s_gausMixSigma1_a1; //!< Gaussian mixture model: Sigma parameter a1 - static double s_gausMixSigma1_a2; //!< Gaussian mixture model: Sigma parameter a2 - - static double s_gausMixEpsilon_a0; //!< Gaussian mixture model: Epsilon parameter a0 - static double s_gausMixEpsilon_a1; //!< Gaussian mixture model: Epsilon parameter a1 - static double s_gausMixEpsilon_a2; //!< Gaussian mixture model: Epsilon parameter a2 - - static double s_gausMixEpsilon_b0; //!< Gaussian mixture model: Epsilon parameter b0 - static double s_gausMixEpsilon_b1; //!< Gaussian mixture model: Epsilon parameter b1 - static double s_gausMixEpsilon_b2; //!< Gaussian mixture model: Epsilon parameter b2 - - }; diff --git a/Tracking/TrkExtrapolation/TrkExTools/TrkExTools/Navigator.h b/Tracking/TrkExtrapolation/TrkExTools/TrkExTools/Navigator.h index 35380db968da604b4e1995a1c727190638ea52e2..567f05c3968b327283612c4fc98c4bf48f5fa876 100755 --- a/Tracking/TrkExtrapolation/TrkExTools/TrkExTools/Navigator.h +++ b/Tracking/TrkExtrapolation/TrkExTools/TrkExTools/Navigator.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -23,24 +23,17 @@ #include <cstring> #include <exception> #include <atomic> -#include <mutex> -#define TRKEXTOOLS_MAXNAVSTEPS 100 - -class TTree; namespace Trk { class ITrackingGeometrySvc; - /** Exception to be thrown when TrackingGeometry not found */ - class NavigatorException : public std::exception { virtual const char* what() const throw() { return "Problem with TrackingGeometry loading"; } - }; class IGeometryBuilder; @@ -79,106 +72,111 @@ namespace Trk { StatusCode finalize(); /** INavigator interface method - returns the TrackingGeometry used for navigation */ - const TrackingGeometry* trackingGeometry() const; + virtual const TrackingGeometry* trackingGeometry() const override; /** INavigator interface methods - global search for the Volume one is in */ - const TrackingVolume* volume(const Amg::Vector3D& gp) const; + virtual const TrackingVolume* volume(const Amg::Vector3D& gp) const override; /** INavigator interface method - forward hightes TrackingVolume */ - const TrackingVolume* highestVolume() const; + virtual const TrackingVolume* highestVolume() const override; /** INavigator interface methods - getting the next BoundarySurface not knowing the Volume*/ - const BoundarySurface<TrackingVolume>* nextBoundarySurface( const IPropagator& prop, + virtual const BoundarySurface<TrackingVolume>* nextBoundarySurface( const IPropagator& prop, const TrackParameters& parms, - PropDirection dir) const; + PropDirection dir) const override; /** INavigator interface methods - getting the next BoundarySurface when knowing the Volume*/ - const BoundarySurface<TrackingVolume>* nextBoundarySurface( const IPropagator& prop, + virtual const BoundarySurface<TrackingVolume>* nextBoundarySurface( const IPropagator& prop, const TrackParameters& parms, PropDirection dir, - const TrackingVolume& vol ) const; + const TrackingVolume& vol ) const override; /** INavigator interface method - getting the next Volume and the parameter for the next Navigation*/ - const NavigationCell nextTrackingVolume( const IPropagator& prop, + virtual const NavigationCell nextTrackingVolume( const IPropagator& prop, const TrackParameters& parms, PropDirection dir, - const TrackingVolume& vol) const; + const TrackingVolume& vol) const override; /** INavigator interface method - getting the next Volume and the parameter for the next Navigation - contains full loop over volume boundaries */ - const NavigationCell nextDenseTrackingVolume( const IPropagator& prop, + virtual const NavigationCell nextDenseTrackingVolume( const IPropagator& prop, const TrackParameters& parms, const Surface* destination, PropDirection dir, ParticleHypothesis particle, const TrackingVolume& vol, - double& path) const; + double& path) const override; /** INavigator interface method - getting the closest TrackParameters from a Track to a Surface*/ - const TrackParameters* closestParameters( const Track& trk, + virtual const TrackParameters* closestParameters( const Track& trk, const Surface& sf, - const IPropagator* prop = 0) const; + const IPropagator* prop = 0) const override; /** INavigator method to resolve navigation at boundary */ - bool atVolumeBoundary( const Trk::TrackParameters* parms, + virtual bool atVolumeBoundary( const Trk::TrackParameters* parms, const Trk::TrackingVolume* vol, Trk::PropDirection dir, const Trk::TrackingVolume*& nextVol, - double tol) const; - /** Validation Action: - Can be implemented optionally, outside access to internal validation steps */ - virtual void validationAction() const; - - private: - //!< retrieve TrackingGeometry (almost callback ready!) - StatusCode updateTrackingGeometry() const; + double tol) const override; + + /** Validation Action: + Can be implemented optionally, outside access to internal validation steps */ + virtual void validationAction() const override{ + } + + private: + /* + * Methods to be overriden by the NavigatorValidation + */ + virtual void validationInitialize() { + } + virtual void validationFill(const Trk::TrackParameters* trackPar) const{ + static int numPrint{0}; + if (m_validationMode && numPrint<10&&trackPar){ + ATH_MSG_INFO("No Validation implemented. Use an instance of NavigatorValidation"); + ++numPrint; + } + } + + bool m_validationMode; //!<This becomes a dummy option for now + /* + **************************************************************** + * According to Goetz Gaycken this needs special attention marking as + * @TODO replace by conditions handle. + */ + StatusCode updateTrackingGeometry() const; mutable const TrackingGeometry* m_trackingGeometry; //!< the tracking geometry owned by the navigator ServiceHandle<Trk::ITrackingGeometrySvc> m_trackingGeometrySvc; //!< ToolHandle to the TrackingGeometrySvc std::string m_trackingGeometryName; //!< Name of the TrackingGeometry as given in Detector Store + /******************************************************************/ + double m_insideVolumeTolerance; //!< Tolerance for inside() method of Volumes - double m_isOnSurfaceTolerance; //!< Tolerance for isOnSurface() method of BoundarySurfaces - + double m_isOnSurfaceTolerance; //!< Tolerance for isOnSurface() method of BoundarySurfaces bool m_useStraightLineApproximation; //!< use the straight line approximation for the next boundary sf bool m_searchWithDistance; //!< search with new distanceToSurface() method + + //------------ Magnetic field properties + bool m_fastField; + Trk::MagneticFieldProperties m_fieldProperties; - //------VALIDATION MODE SECTION ----------------------------------// - bool m_validationMode; //!< boolean to switch to validation mode - std::string m_validationTreeName; //!< validation tree name - to be acessed by this from root - std::string m_validationTreeDescription; //!< validation tree description - second argument in TTree - std::string m_validationTreeFolder; //!< stream/folder to for the TTree to be written out - /* - * Is this really needed? - */ - TTree* m_validationTree; //!< Root Validation Tree - mutable int m_boundariesCounter; //!< counter for boundary surfaces hit - mutable int m_boundaries; //!< associated Ntuple variable - mutable float m_boundaryHitX[TRKEXTOOLS_MAXNAVSTEPS]; //!< x Position of interseciton with BoundarySurface - mutable float m_boundaryHitY[TRKEXTOOLS_MAXNAVSTEPS]; //!< y Position of interseciton with BoundarySurface - mutable float m_boundaryHitR[TRKEXTOOLS_MAXNAVSTEPS]; //!< Radius of interseciton with BoundarySurface - mutable float m_boundaryHitZ[TRKEXTOOLS_MAXNAVSTEPS]; //!< z Position of interseciton with BoundarySurface // ------ PERFORMANCE STATISTICS -------------------------------- // - /* All performance stat counters are atomic (the simplest solution perhaps not the most performant one)*/ - mutable std::atomic<int> m_forwardCalls; //!< couter for forward nextBounday calls - mutable std::atomic<int> m_forwardFirstBoundSwitch; //!< couter for failed first forward nextBounday calls - mutable std::atomic<int> m_forwardSecondBoundSwitch; //!< couter for failed second forward nextBounday calls - mutable std::atomic<int> m_forwardThirdBoundSwitch; //!< couter for failed third forward nextBounday calls + mutable std::atomic<int> m_forwardCalls; //!< counter for forward nextBounday calls + mutable std::atomic<int> m_forwardFirstBoundSwitch; //!< counter for failed first forward nextBounday calls + mutable std::atomic<int> m_forwardSecondBoundSwitch; //!< counter for failed second forward nextBounday calls + mutable std::atomic<int> m_forwardThirdBoundSwitch; //!< counter for failed third forward nextBounday calls - mutable std::atomic<int> m_backwardCalls; //!< couter for backward nextBounday calls - mutable std::atomic<int> m_backwardFirstBoundSwitch; //!< couter for failed first backward nextBounday calls - mutable std::atomic<int> m_backwardSecondBoundSwitch; //!< couter for failed second backward nextBounday calls - mutable std::atomic<int> m_backwardThirdBoundSwitch; //!< couter for failed third backward nextBounday calls + mutable std::atomic<int> m_backwardCalls; //!< counter for backward nextBounday calls + mutable std::atomic<int> m_backwardFirstBoundSwitch; //!< counter for failed first backward nextBounday calls + mutable std::atomic<int> m_backwardSecondBoundSwitch; //!< counter for failed second backward nextBounday calls + mutable std::atomic<int> m_backwardThirdBoundSwitch; //!< counter for failed third backward nextBounday calls mutable std::atomic<int> m_outsideVolumeCase; //!< counter for navigation-break in outside volume cases (ovc) mutable std::atomic<int> m_sucessfulBackPropagation; //!< counter for sucessful recovery of navigation-break in ovc - - //------------ Magnetic field properties - bool m_fastField; - Trk::MagneticFieldProperties m_fieldProperties; - }; + }; } // end of namespace diff --git a/Tracking/TrkExtrapolation/TrkExTools/TrkExTools/NavigatorValidation.h b/Tracking/TrkExtrapolation/TrkExTools/TrkExTools/NavigatorValidation.h new file mode 100755 index 0000000000000000000000000000000000000000..988598d33e365aa9dcb303a2743911236b990125 --- /dev/null +++ b/Tracking/TrkExtrapolation/TrkExTools/TrkExTools/NavigatorValidation.h @@ -0,0 +1,66 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +/////////////////////////////////////////////////////////////////// +// Navigator.h, (c) ATLAS Detector software +/////////////////////////////////////////////////////////////////// + +#ifndef TRKEXTOOLS_NAVIGATORVALIDATION_H +#define TRKEXTOOLS_NAVIGATORVALIDATION_H + +// Gaudi +#include "AthenaBaseComps/AthAlgTool.h" +#include "GaudiKernel/ServiceHandle.h" +// Trk +#include "TrkExInterfaces/INavigator.h" +#include "TrkExTools/Navigator.h" +#include <atomic> + +#define TRKEXTOOLS_MAXNAVSTEPS 100 +class TTree; + /** + @class NavigatorValidation + It implements the validation methods of the standard + Navigator adding Validation output. + Currently no thread safe, perhaps a better solution + should be used for the navigator section. + Split away to allow thread safe use of the main tool + */ +namespace Trk{ + + class NavigatorValidation : public Navigator, + virtual public INavigator { + public: + /** Constructor */ + NavigatorValidation(const std::string&,const std::string&,const IInterface*); + /** Destructor */ + virtual ~NavigatorValidation(); + /** Validation Action: + Can be implemented optionally, outside access to internal validation steps */ + virtual void validationAction() const override; + + private: + + virtual void validationInitialize() override ; + /* no-op here */ + virtual void validationFill(const Trk::TrackParameters* trackPar) const override; + + //------VALIDATION MODE SECTION ----------------------------------// + std::string m_validationTreeName; //!< validation tree name - to be acessed by this from root + std::string m_validationTreeDescription; //!< validation tree description - second argument in TTree + std::string m_validationTreeFolder; //!< stream/folder to for the TTree to be written out + TTree* m_validationTree; //!< Root Validation Tree + mutable int m_boundariesCounter; //!< counter for boundary surfaces hit + mutable int m_boundaries; //!< associated Ntuple variable + mutable float m_boundaryHitX[TRKEXTOOLS_MAXNAVSTEPS]; //!< x Position of interseciton with BoundarySurface + mutable float m_boundaryHitY[TRKEXTOOLS_MAXNAVSTEPS]; //!< y Position of interseciton with BoundarySurface + mutable float m_boundaryHitR[TRKEXTOOLS_MAXNAVSTEPS]; //!< Radius of interseciton with BoundarySurface + mutable float m_boundaryHitZ[TRKEXTOOLS_MAXNAVSTEPS]; //!< z Position of interseciton with BoundarySurface + }; + +} // end of namespace + + +#endif // TRKEXTOOLS_NAVIGATORVALIDATION_H + diff --git a/Tracking/TrkExtrapolation/TrkExTools/src/MaterialEffectsUpdator.cxx b/Tracking/TrkExtrapolation/TrkExTools/src/MaterialEffectsUpdator.cxx index eb18e125e6d4848efbf1aacc6e69ad2e2d5964b0..70801fd86320bb1c8b55b4a42b85752c36e629a9 100755 --- a/Tracking/TrkExtrapolation/TrkExTools/src/MaterialEffectsUpdator.cxx +++ b/Tracking/TrkExtrapolation/TrkExTools/src/MaterialEffectsUpdator.cxx @@ -50,7 +50,6 @@ Trk::MaterialEffectsUpdator::MaterialEffectsUpdator(const std::string &t, const m_validationIgnoreUnmeasured(true), m_landauMode(false), m_validationDirection(1), - m_uniqueID{1}, m_momentumCut(50. * Gaudi::Units::MeV), m_momentumMax(10. * Gaudi::Units::TeV), m_forcedMomentum(2000. * Gaudi::Units::MeV), @@ -89,23 +88,6 @@ Trk::MaterialEffectsUpdator::~MaterialEffectsUpdator() { StatusCode Trk::MaterialEffectsUpdator::initialize() { - /* - * Create a unique_ID (in range 1 ... N) based on the unique AlgTool name - * Initialize is a non-const method. We expect a small vector - * and the initialize to run only a few times - */ - size_t NameID=std::hash<std::string>{}(this->name()); - - static std::unique_ptr< std::vector<size_t> > s_vectorNamedIDs - =std::make_unique<std::vector<size_t>>(); - auto iter= std::find(s_vectorNamedIDs->begin(),s_vectorNamedIDs->end(),NameID); - if(iter==s_vectorNamedIDs->end()){ - s_vectorNamedIDs->push_back(NameID); - m_uniqueID=s_vectorNamedIDs->size(); - }else{ - m_uniqueID = std::distance(s_vectorNamedIDs->begin(),iter) +1; - } - ATH_MSG_INFO("Minimal momentum cut for material update : " << m_momentumCut << " MeV"); // retrieve the EnergyLoss Updator and Material Effects updator diff --git a/Tracking/TrkExtrapolation/TrkExTools/src/MultipleScatteringUpdator.cxx b/Tracking/TrkExtrapolation/TrkExTools/src/MultipleScatteringUpdator.cxx index 09715ddf7131bea0a88daba88ead0d0bfce7eff2..cf93e7a7356d450fff5a78ae6a9ed4355ea83a98 100755 --- a/Tracking/TrkExtrapolation/TrkExTools/src/MultipleScatteringUpdator.cxx +++ b/Tracking/TrkExtrapolation/TrkExTools/src/MultipleScatteringUpdator.cxx @@ -14,28 +14,30 @@ #include "TrkExUtils/MaterialInteraction.h" #include "CLHEP/Random/RandFlat.h" +namespace{ // static particle masses -Trk::ParticleMasses Trk::MultipleScatteringUpdator::s_particleMasses; +constexpr Trk::ParticleMasses s_particleMasses; // static doubles -double Trk::MultipleScatteringUpdator::s_main_RutherfordScott = 13.6 * Gaudi::Units::MeV; -double Trk::MultipleScatteringUpdator::s_log_RutherfordScott = 0.038; +constexpr double s_main_RutherfordScott = 13.6 * Gaudi::Units::MeV; +constexpr double s_log_RutherfordScott = 0.038; -double Trk::MultipleScatteringUpdator::s_main_RossiGreisen = 17.5 * Gaudi::Units::MeV; -double Trk::MultipleScatteringUpdator::s_log_RossiGreisen = 0.125; +constexpr double s_main_RossiGreisen = 17.5 * Gaudi::Units::MeV; +constexpr double s_log_RossiGreisen = 0.125; // ============================= Gaussian mixture model ============= -double Trk::MultipleScatteringUpdator::s_gausMixSigma1_a0 = 8.471e-1; -double Trk::MultipleScatteringUpdator::s_gausMixSigma1_a1 = 3.347e-2; -double Trk::MultipleScatteringUpdator::s_gausMixSigma1_a2 = -1.843e-3; +constexpr double s_gausMixSigma1_a0 = 8.471e-1; +constexpr double s_gausMixSigma1_a1 = 3.347e-2; +constexpr double s_gausMixSigma1_a2 = -1.843e-3; -double Trk::MultipleScatteringUpdator::s_gausMixEpsilon_a0 = 4.841e-2; -double Trk::MultipleScatteringUpdator::s_gausMixEpsilon_a1 = 6.348e-3; -double Trk::MultipleScatteringUpdator::s_gausMixEpsilon_a2 = 6.096e-4; +constexpr double s_gausMixEpsilon_a0 = 4.841e-2; +constexpr double s_gausMixEpsilon_a1 = 6.348e-3; +constexpr double s_gausMixEpsilon_a2 = 6.096e-4; + +constexpr double s_gausMixEpsilon_b0 = -1.908e-2; +constexpr double s_gausMixEpsilon_b1 = 1.106e-1; +constexpr double s_gausMixEpsilon_b2 = -5.729e-3; +} -double Trk::MultipleScatteringUpdator::s_gausMixEpsilon_b0 = -1.908e-2; -double Trk::MultipleScatteringUpdator::s_gausMixEpsilon_b1 = 1.106e-1; -double Trk::MultipleScatteringUpdator::s_gausMixEpsilon_b2 = -5.729e-3; -Trk::MaterialInteraction matInt; // constructor Trk::MultipleScatteringUpdator::MultipleScatteringUpdator(const std::string &t, const std::string &n, @@ -125,6 +127,7 @@ Trk::MultipleScatteringUpdator::sigmaSquare(const MaterialProperties &mat, double sigma2(0.); + Trk::MaterialInteraction matInt; double sigma = matInt.sigmaMS(t, p, beta); sigma2 = sigma * sigma; diff --git a/Tracking/TrkExtrapolation/TrkExTools/src/Navigator.cxx b/Tracking/TrkExtrapolation/TrkExTools/src/Navigator.cxx index d7c5128c20879f4a281e75244bdf3a183adda8f0..04a67fa28d92b909900f4a0a8f5ebc9d8e8cb55c 100755 --- a/Tracking/TrkExtrapolation/TrkExTools/src/Navigator.cxx +++ b/Tracking/TrkExtrapolation/TrkExTools/src/Navigator.cxx @@ -6,8 +6,6 @@ // Navigator.cxx, (c) ATLAS Detector Software /////////////////////////////////////////////////////////////////// -// Gaudi Kernel -#include "GaudiKernel/INTupleSvc.h" #include "GaudiKernel/ISvcLocator.h" #include "GaudiKernel/SmartDataPtr.h" // Trk inlcudes @@ -31,9 +29,6 @@ #include "TrkVolumes/CylinderVolumeBounds.h" #include "TrkParameters/TrackParameters.h" #include "TrkTrack/Track.h" -// Validation mode - TTree includes -#include "TTree.h" -#include "GaudiKernel/ITHistSvc.h" // Data Model #include "AthContainers/DataVector.h" // Amg @@ -43,9 +38,11 @@ namespace{ const Trk::MagneticFieldProperties s_zeroMagneticField(Trk::NoField); } + // constructor Trk::Navigator::Navigator(const std::string &t, const std::string &n, const IInterface *p) : AthAlgTool(t, n, p), + m_validationMode(false), m_trackingGeometry(0), m_trackingGeometrySvc("AtlasTrackingGeometrySvc", n), m_trackingGeometryName("AtlasTrackingGeometry"), @@ -53,17 +50,7 @@ Trk::Navigator::Navigator(const std::string &t, const std::string &n, const IInt m_isOnSurfaceTolerance(0.005 * Gaudi::Units::mm), m_useStraightLineApproximation(false), m_searchWithDistance(true), - m_validationMode(false), - m_validationTreeName("NavigatorValidation"), - m_validationTreeDescription("Boundary Surface hits"), - m_validationTreeFolder("/val/NavigationValidation"), - m_validationTree(0), - m_boundariesCounter(0), - m_boundaries{}, - m_boundaryHitX{}, - m_boundaryHitY{}, - m_boundaryHitR{}, - m_boundaryHitZ{}, + m_fastField(false), m_forwardCalls{0}, m_forwardFirstBoundSwitch{0}, m_forwardSecondBoundSwitch{0}, @@ -73,8 +60,8 @@ Trk::Navigator::Navigator(const std::string &t, const std::string &n, const IInt m_backwardSecondBoundSwitch{0}, m_backwardThirdBoundSwitch{0}, m_outsideVolumeCase{0}, - m_sucessfulBackPropagation{0}, - m_fastField(false) { + m_sucessfulBackPropagation{0} + { declareInterface<INavigator>(this); // steering of algorithms declareProperty("TrackingGeometrySvc", m_trackingGeometrySvc); @@ -83,14 +70,10 @@ Trk::Navigator::Navigator(const std::string &t, const std::string &n, const IInt declareProperty("UseStraightLineApproximation", m_useStraightLineApproximation); // closest parameter search with new Surface::distance method declareProperty("SearchWithDistanceToSurface", m_searchWithDistance); - // switch for Validation mode - declareProperty("ValidationMode", m_validationMode); - declareProperty("ValidationTreeName", m_validationTreeName); - declareProperty("ValidationTreeDescription", m_validationTreeDescription); - declareProperty("ValidationTreeFolder", m_validationTreeFolder); // Magnetic field properties declareProperty("MagneticFieldProperties", m_fastField); -} + declareProperty("ValidationMode", m_validationMode); + } // destructor Trk::Navigator::~Navigator() { @@ -112,33 +95,10 @@ Trk::Navigator::initialize() { ATH_MSG_WARNING(" -> Trying to retrieve default '" << m_trackingGeometryName << "' from DetectorStore."); } - // the validation setup ---------------------------------------------------------------------------------- - if (m_validationMode) { - // create the new Tree - m_validationTree = new TTree(m_validationTreeName.c_str(), m_validationTreeDescription.c_str()); - - // counter for boundary surfaces - m_validationTree->Branch("BoundaySurfacesHit", &m_boundaries, "boundshit/I"); - m_validationTree->Branch("BoundaryHitX", m_boundaryHitX, "boundshitx[boundshit]/F"); - m_validationTree->Branch("BoundaryHitY", m_boundaryHitY, "boundshity[boundshit]/F"); - m_validationTree->Branch("BoundaryHitR", m_boundaryHitR, "boundshitz[boundshit]/F"); - m_validationTree->Branch("BoundaryHitZ", m_boundaryHitZ, "boundshitr[boundshit]/F"); - - // now register the Tree - ITHistSvc *tHistSvc = nullptr; - if (service("THistSvc", tHistSvc).isFailure()) { - ATH_MSG_ERROR("Could not find Hist Service -> Switching ValidationMode Off !"); - delete m_validationTree; - m_validationTree = nullptr; - } - if ((tHistSvc->regTree(m_validationTreeFolder, m_validationTree)).isFailure()) { - ATH_MSG_ERROR("Could not register the validation Tree -> Switching ValidationMode Off !"); - delete m_validationTree; - m_validationTree = nullptr; - } - } // ------------- end of validation mode ----------------------------------------------------------------- - m_fieldProperties = m_fastField ? Trk::MagneticFieldProperties(Trk::FastField) : Trk::MagneticFieldProperties( - Trk::FullField); + validationInitialize(); + + m_fieldProperties = m_fastField ? Trk::MagneticFieldProperties(Trk::FastField) : + Trk::MagneticFieldProperties(Trk::FullField); ATH_MSG_DEBUG("initialize() successful"); return StatusCode::SUCCESS; @@ -215,7 +175,6 @@ Trk::Navigator::nextBoundarySurface(const Trk::IPropagator &prop, prop.propagateParameters(parms, currentSurface, searchDir, true, - // vol) : m_fieldProperties) : prop.propagateParameters(parms, currentSurface, @@ -224,20 +183,7 @@ Trk::Navigator::nextBoundarySurface(const Trk::IPropagator &prop, if (trackPar) { ATH_MSG_VERBOSE(" [N] --> next BoundarySurface found with Parameters: " << *trackPar); - // ----------------- output to screen if outputLevel() says so -------- - - // ----------------- record if in validation mode ---------------------- - if (m_validationMode) { - if(m_boundariesCounter < TRKEXTOOLS_MAXNAVSTEPS) { - const Amg::Vector3D &posOnBoundary = trackPar->position(); - m_boundaryHitX[m_boundariesCounter] = posOnBoundary.x(); - m_boundaryHitY[m_boundariesCounter] = posOnBoundary.y(); - m_boundaryHitR[m_boundariesCounter] = posOnBoundary.perp(); - m_boundaryHitZ[m_boundariesCounter] = posOnBoundary.z(); - m_boundariesCounter++; - } - } // ------------------------------------------------------------------ - + validationFill(trackPar); delete trackPar; return currentBoundary; } @@ -329,7 +275,6 @@ Trk::Navigator::nextTrackingVolume(const Trk::IPropagator &prop, prop.propagateParameters(parms, currentSurface, searchDir, true, - // vol) : m_fieldProperties) : prop.propagateParameters(parms, currentSurface, @@ -354,19 +299,7 @@ Trk::Navigator::nextTrackingVolume(const Trk::IPropagator &prop, ATH_MSG_VERBOSE('\t' << '\t' << (nextVolume ? nextVolume->volumeName() : "None")); } - - // ----------------- record if in validation mode ---------------------- - if (m_validationMode) { - if(m_boundariesCounter < TRKEXTOOLS_MAXNAVSTEPS){ - const Amg::Vector3D &posOnBoundary = trackPar->position(); - m_boundaryHitX[m_boundariesCounter] = posOnBoundary.x(); - m_boundaryHitY[m_boundariesCounter] = posOnBoundary.y(); - m_boundaryHitR[m_boundariesCounter] = posOnBoundary.perp(); - m_boundaryHitZ[m_boundariesCounter] = posOnBoundary.z(); - m_boundariesCounter++; - } - } // ------------------------------------------------------------------ - + validationFill(trackPar); return Trk::NavigationCell(nextVolume, trackPar, Trk::BoundarySurfaceFace(surfAcc.accessor())); } @@ -520,29 +453,6 @@ Trk::Navigator::atVolumeBoundary(const Trk::TrackParameters *parms, const Trk::T } } - /* for debugging - ATH_MSG_DEBUG("navigator particle R,phi,z, momentum:"<< - parms->position().perp()<<","<<parms->position().phi()<<","<<parms->position().z() <<","<<parms->momentum()); - ATH_MSG_DEBUG("navigator static volume position:"<< vol->center()); - const Trk::CylinderVolumeBounds* cyl = dynamic_cast<const Trk::CylinderVolumeBounds*> (&(vol->volumeBounds())); - if (cyl) ATH_MSG_DEBUG("---> cylinder volume - dimensions:"<<cyl->innerRadius()<<","<<cyl->outerRadius()<<","<<cyl->halflengthZ()); - - for (unsigned int ib=0; ib< bounds.size(); ib++ ){ - const Trk::Surface& surf = (bounds[ib].getPtr())->surfaceRepresentation(); - Trk::DistanceSolution distSol = surf.straightLineDistanceEstimate(parms->position(), - dir*parms->momentum().unit()); - ATH_MSG_DEBUG("---> decomposed boundary surface position, normal, current - distance:"<<ib<<","<<surf.center()<<","<<surf.normal()<<","<<distSol.currentDistance(false)); - ATH_MSG_DEBUG("---> estimated distance to (first solution):boundary - check:"<<distSol.numberOfSolutions()<<","<<distSol.first()<<":"<< - surf.isOnSurface(parms->position()+distSol.first()*dir*parms->momentum().unit(),true,tol,tol)); - if (distSol.numberOfSolutions()>1) - ATH_MSG_DEBUG("---> estimated distance to (second solution):boundary check:" << distSol.second()<< ","<< - surf.isOnSurface(parms->position()+distSol.second()*dir*parms->momentum().unit(),true,tol,tol)); - } - */ - return isAtBoundary; } @@ -671,19 +581,6 @@ Trk::Navigator::closestParameters(const Trk::Track &trk, return closestTrackParameters; } -void -Trk::Navigator::validationAction() const { - // first record the values - if(m_validationMode){ - if (m_validationTree) { - m_boundaries = long(m_boundariesCounter); - m_validationTree->Fill(); - // then reset - } - m_boundariesCounter = 0; - } -} - // finalize StatusCode Trk::Navigator::finalize() { diff --git a/Tracking/TrkExtrapolation/TrkExTools/src/NavigatorValidation.cxx b/Tracking/TrkExtrapolation/TrkExTools/src/NavigatorValidation.cxx new file mode 100755 index 0000000000000000000000000000000000000000..6baf5f08640be5b35c52c81f41238633bc8db7df --- /dev/null +++ b/Tracking/TrkExtrapolation/TrkExTools/src/NavigatorValidation.cxx @@ -0,0 +1,95 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +/////////////////////////////////////////////////////////////////// +// Navigator.cxx, (c) ATLAS Detector Software +/////////////////////////////////////////////////////////////////// + +// Gaudi Kernel +#include "GaudiKernel/INTupleSvc.h" +#include "GaudiKernel/ISvcLocator.h" +#include "GaudiKernel/SmartDataPtr.h" +// Trk inlcudes +#include "TrkExTools/NavigatorValidation.h" +#include "TrkParameters/TrackParameters.h" +#include "TrkTrack/Track.h" +// Validation mode - TTree includes +#include "TTree.h" +#include "GaudiKernel/ITHistSvc.h" +// Data Model +#include "AthContainers/DataVector.h" +// Amg +#include "EventPrimitives/EventPrimitives.h" +#include "GeoPrimitives/GeoPrimitives.h" + +// constructor +Trk::NavigatorValidation::NavigatorValidation(const std::string &t, const std::string &n, const IInterface *p) : + Navigator(t, n, p), + m_validationTreeName("NavigatorValidation"), + m_validationTreeDescription("Boundary Surface hits"), + m_validationTreeFolder("/val/NavigationValidation"), + m_validationTree(nullptr), + m_boundariesCounter(0), + m_boundaries{}, + m_boundaryHitX{}, + m_boundaryHitY{}, + m_boundaryHitR{}, + m_boundaryHitZ{} + { + declareInterface<INavigator>(this); + // switch for Validation mode + declareProperty("ValidationTreeName", m_validationTreeName); + declareProperty("ValidationTreeDescription", m_validationTreeDescription); + declareProperty("ValidationTreeFolder", m_validationTreeFolder); +} + +// destructor +Trk::NavigatorValidation::~NavigatorValidation() { +} + +void Trk::NavigatorValidation::validationInitialize() { + // create the new Tree + m_validationTree = new TTree(m_validationTreeName.c_str(), m_validationTreeDescription.c_str()); + // counter for boundary surfaces + m_validationTree->Branch("BoundaySurfacesHit", &m_boundaries, "boundshit/I"); + m_validationTree->Branch("BoundaryHitX", m_boundaryHitX, "boundshitx[boundshit]/F"); + m_validationTree->Branch("BoundaryHitY", m_boundaryHitY, "boundshity[boundshit]/F"); + m_validationTree->Branch("BoundaryHitR", m_boundaryHitR, "boundshitz[boundshit]/F"); + m_validationTree->Branch("BoundaryHitZ", m_boundaryHitZ, "boundshitr[boundshit]/F"); + // now register the Tree + ITHistSvc *tHistSvc = nullptr; + if (service("THistSvc", tHistSvc).isFailure()) { + ATH_MSG_ERROR("Could not find Hist Service -> Switching ValidationMode Off !"); + delete m_validationTree; + m_validationTree = nullptr; + } + if ((tHistSvc->regTree(m_validationTreeFolder, m_validationTree)).isFailure()) { + ATH_MSG_ERROR("Could not register the validation Tree -> Switching ValidationMode Off !"); + delete m_validationTree; + m_validationTree = nullptr; + } +} + +void Trk::NavigatorValidation::validationFill(const Trk::TrackParameters* trackPar) const{ + + if(m_boundariesCounter < TRKEXTOOLS_MAXNAVSTEPS) { + const Amg::Vector3D &posOnBoundary = trackPar->position(); + m_boundaryHitX[m_boundariesCounter] = posOnBoundary.x(); + m_boundaryHitY[m_boundariesCounter] = posOnBoundary.y(); + m_boundaryHitR[m_boundariesCounter] = posOnBoundary.perp(); + m_boundaryHitZ[m_boundariesCounter] = posOnBoundary.z(); + m_boundariesCounter++; + } +} + +void Trk::NavigatorValidation::validationAction() const { + // first record the values + if (m_validationTree) { + m_boundaries = long(m_boundariesCounter); + m_validationTree->Fill(); + // then reset + } + m_boundariesCounter = 0; +} + diff --git a/Tracking/TrkExtrapolation/TrkExTools/src/components/TrkExTools_entries.cxx b/Tracking/TrkExtrapolation/TrkExTools/src/components/TrkExTools_entries.cxx index 31812da21b36858f0bcc30c0310b3d4d0e843bf1..3974668ef42d78f0ec0e97fd8d45acbe54cf4ac5 100644 --- a/Tracking/TrkExtrapolation/TrkExTools/src/components/TrkExTools_entries.cxx +++ b/Tracking/TrkExtrapolation/TrkExTools/src/components/TrkExTools_entries.cxx @@ -6,15 +6,17 @@ #include "TrkExTools/MultipleScatteringUpdator.h" #include "TrkExTools/TimedExtrapolator.h" #include "TrkExTools/NIMatEffUpdator.h" +#include "TrkExTools/NavigatorValidation.h" using namespace Trk; DECLARE_COMPONENT( Extrapolator ) -DECLARE_COMPONENT( TimedExtrapolator ) DECLARE_COMPONENT( Navigator ) DECLARE_COMPONENT( MaterialEffectsUpdator ) DECLARE_COMPONENT( DummyMaterialEffectsUpdator ) DECLARE_COMPONENT( EnergyLossUpdator ) DECLARE_COMPONENT( MultipleScatteringUpdator ) DECLARE_COMPONENT( NIMatEffUpdator ) +DECLARE_COMPONENT( TimedExtrapolator ) +DECLARE_COMPONENT( NavigatorValidation ) diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/BremFind.h b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/BremFind.h deleted file mode 100644 index 5d549bab03fb4a9454c573798dded0ca9bdefe04..0000000000000000000000000000000000000000 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/BremFind.h +++ /dev/null @@ -1,229 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -/******************************************************************************** - BremFind.h * description - -completed : Tuesday 18th November 2008 -author : Tony Shao -email : Qi.Tao.Shao@cern.ch -description : Class for finding brem points in the inner detector using the GSF -**********************************************************************************/ - -#ifndef Trk_BremFind_H -#define Trk_BremFind_H - -#include "TrkGaussianSumFilter/IBremsstrahlungFinder.h" - -#include "AthenaBaseComps/AthAlgTool.h" -#include "GaudiKernel/ToolHandle.h" -#include "GaudiKernel/ServiceHandle.h" - -#include "AthContainers/DataVector.h" -#include "TrkFitterUtils/FitterTypes.h" -#include "TrkParameters/TrackParameters.h" - -#include "TrkExInterfaces/IPropagator.h" -#include "TrkDetDescrInterfaces/ITrackingGeometrySvc.h" -#include "TrkGeometry/MagneticFieldProperties.h" - -#include "GeoPrimitives/GeoPrimitives.h" - -#include "StoreGate/ReadHandleKey.h" -#include "xAODEventInfo/EventInfo.h" - -#include <vector> - -//class ITrackingGeometrySvc; -class TTree; - -namespace Trk { - -class IMultiComponentStateCombiner; -class MultiComponentStateOnSurface; -class TrackStateOnSurface; -class EstimatedBremOnTrack; -class Layer; -class TrackingVolume; -class TrackingGeometry; -class EntryLayerProvider; -class AbstractVolume; -class Surface; -class QoverPBremFit; - -struct GraphParameter { - double constant; - std::vector<double> coefficient{}; - std::vector<double> value{}; - std::vector<double> width{}; -}; - -struct Element { - double value{}; - double width{}; - bool sign{}; -}; - - -#define TRKFGSF_VALSURFACES 100 -#define TRKGSF_VALSTATES 24 -#define POTENTIAL_BREM_THRESHOLD 0.0001 -#define MIN_KINK_THRESHOLD 0.005 -#define BREM_AMPLITUDE 1.0 //in GeV -#define BREM_SEPARATION 0.005 -#define COEFFICIENT_THRESHOLD 0.005 -#define BOUND_THRESHOLD 20.0 //in percentage - -class BremFind : public AthAlgTool, virtual public IBremsstrahlungFinder{ - public: - - BremFind(const std::string&, const std::string&, const IInterface*); - - virtual ~BremFind () {}; - - StatusCode initialize(); - - /** AlgTool finalise method */ - StatusCode finalize(); - - //Find the brem points from a forward and smooth track fit - virtual void BremFinder(const Trk::ForwardTrajectory&, const Trk::SmoothedTrajectory&); - - virtual void BremFinder(const Trk::ForwardTrajectory&, const Trk::SmoothedTrajectory&, bool); - - virtual void CombineParameters(); - - virtual void GetBremLocations(); - - virtual double GetBound(double, int); - - virtual double BremSignificance(double, QoverPBremFit*, QoverPBremFit*); - - virtual double GetPhiFromValue(double, QoverPBremFit*); - - virtual int ClosestMeasurement(double, QoverPBremFit*); - - virtual void CalibrateValue(); - - virtual const Surface* ClosestSurface(double, double, double, const TrackParameters&); - - virtual Amg::Vector3D SurfacePosition(const TrackParameters&, const Surface&, double, double, double); - - virtual StatusCode retrieveTrackingGeometry(); - - virtual int GetNBrems(); - - virtual void MakeTrackStateOnSurfaces (); - - virtual const TrackStateOnSurface* GetEstimatedBremOnTrack(int); - - - private: - - double Graph_value(GraphParameter, double); - - double GetMaximumX(GraphParameter, double, double); - - double GetMaximumY(GraphParameter, double, double); - - double UniqueAngle(double); - - void SeparationQuality(std::vector<double>*, std::vector<double>*); - - std::pair<double,double> ProbabilityScore(double, double, double, double); - - //defining the tools used in this package - ToolHandle<IMultiComponentStateCombiner> m_stateCombiner; - - ToolHandle<IPropagator> m_propagator; - MagneticFieldProperties m_fieldProperties; - - ServiceHandle<ITrackingGeometrySvc> m_trackingGeometrySvc; //!< Name of the TrackingGeometrySvc - std::string m_trackingGeometryName; //!< TrackingGeometry to be retrieved from DetectorStore - mutable const TrackingGeometry* m_trackingGeometry; //!< The underlying TrackingGeometry - - //Validation variables - - bool m_validationMode; - std::string m_validationTreeName; - std::string m_validationTreeName2; - std::string m_validationTreeDescription; - std::string m_validationTreeFolder; - std::string m_validationTreeFolder2; - - TTree* m_validationTree; - TTree* m_validationTree2; - - //Calibration option - bool m_useCalibration; - - //Propagation option - bool m_usePropagate; - - //Class variables - GraphParameter m_forwardparameters; - GraphParameter m_smoothedparameters; - GraphParameter m_combinedparameters; - - double m_perigee_1overP; - double m_perigee_Phi; - double m_perigee_Theta; - double m_perigee_d0; - double m_perigee_z0; - - std::vector<double> *m_brem_value; //could be R or Z; - std::vector<double> *m_brem_phi; - std::vector<double> *m_brem_theta; - std::vector<double> *m_brem_energy; - std::vector<double> *m_brem_UpperBound; - std::vector<double> *m_brem_LowerBound; - std::vector<double> *m_forward_kink; - std::vector<double> *m_smoothed_kink; - std::vector<double> *m_brem_significance; - std::vector<double> *m_brem_valueCalibrated; - std::vector<double> *m_surfaceX; - std::vector<double> *m_surfaceY; - std::vector<double> *m_surfaceZ; - - - int m_nBrems; - bool m_Z_mode; - - std::vector<const Trk::TrackStateOnSurface*> m_brem_trackStateOnSurface; - std::vector<const Trk::TrackParameters*> m_brem_TrackParameters; - std::vector<const Trk::EstimatedBremOnTrack*> m_EstimatedBremOnTrack; - std::vector<const Trk::Surface*> m_brem_surfaces; - std::vector<const Trk::Layer*> m_brem_layers; - std::vector<Amg::Vector3D> m_surface_positions; - - int m_event_ID; - double m_forwardparameter_constant; - std::vector<double> *m_forwardparameter_coefficient; - std::vector<double> *m_forwardparameter_value; - std::vector<double> *m_forwardparameter_width; - double m_smoothparameter_constant; - std::vector<double> *m_smoothparameter_coefficient; - std::vector<double> *m_smoothparameter_value; - std::vector<double> *m_smoothparameter_width; - - std::vector<double> *m_forward_1overP; - std::vector<double> *m_forward_1overPerr; - std::vector<double> *m_forward_value; - std::vector<double> *m_smooth_1overP; - std::vector<double> *m_smooth_1overPerr; - std::vector<double> *m_smooth_value; - - std::vector<double> *m_KinkSeparationScores; - std::vector<double> *m_KinkSeparationScoresErr; - - QoverPBremFit *m_forwardBremFit; - QoverPBremFit *m_smoothedBremFit; - - SG::ReadHandleKey<xAOD::EventInfo> m_readKey; - - }; - -} - -#endif diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GaussianSumFitter.h b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GaussianSumFitter.h index 4665c9212f6533f603d480b5bcfbb89c742f222c..9c80d601ac973a40df7b2e04264c919dd0c364d6 100755 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GaussianSumFitter.h +++ b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GaussianSumFitter.h @@ -40,7 +40,6 @@ class TrackFitInputPreparator; class IForwardGsfFitter; class IGsfSmoother; class Track; -class IBremsstrahlungFinder; #define TRKFGSF_VALSURFACES 100 #define TRKGSF_VALSTATES 24 @@ -139,19 +138,12 @@ class GaussianSumFitter : virtual public ITrackFitter, public AthAlgTool { bool m_makePerigee; PropDirection m_directionToPerigee; - - bool m_runBremFinder; - bool m_refitOnMeasurementBase; - bool m_doHitSorting; TrkParametersComparisonFunction* m_trkParametersComparisonFunction; std::vector<double> m_sortingReferencePoint; ToolHandle<IMultiComponentStateCombiner> m_stateCombiner; - ToolHandle<IBremsstrahlungFinder> m_BremFind; - ToolHandle<IBremsstrahlungFinder> m_BremFind2; - ServiceHandle<IChronoStatSvc> m_chronoSvc; TrackFitInputPreparator* m_inputPreparator; diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfMaterialEffectsUpdator.h b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfMaterialEffectsUpdator.h index 8684faf07d76d60489247126afba693d6b361bbc..6003f11dee7cea8740c08138a7d846ea49de9e60 100755 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfMaterialEffectsUpdator.h +++ b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfMaterialEffectsUpdator.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ /********************************************************************************* @@ -79,15 +79,9 @@ class GsfMaterialEffectsUpdator : public AthAlgTool, virtual public IMultiStateM private: - int m_outputlevel; //!< to cache current output level - - PublicToolHandle<IMultiComponentStateAssembler> m_stateAssembler - {this,"MultiComponentStateAssembler","Trk::MultiComponentStateAssembler/GsfMaterialEffectsStateAssembler",""}; - + int m_outputlevel; //!< to cache current output level ToolHandle<IMultiStateMaterialEffects> m_materialEffects; - bool m_useReferenceMaterial; - double m_momentumCut; }; diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/IBremsstrahlungFinder.h b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/IBremsstrahlungFinder.h deleted file mode 100644 index c54728fcfd8412c849cd66b5bafe70752ff535d9..0000000000000000000000000000000000000000 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/IBremsstrahlungFinder.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -/********************************************************************************* - IBremsstrahlungFinder.h - description - --------------------------------------------- -created : Thursday 8th January 2009 -author : amorley -email : Anthony.Morley@cern.ch -description : Interface for bremsstrahlung finding using the GSF -*********************************************************************************/ - - -#ifndef Trk_IBremsstrahlungFinder_H -#define Trk_IBremsstrahlungFinder_H - -#include "GaudiKernel/IAlgTool.h" - -#include "TrkParameters/TrackParameters.h" -#include "TrkFitterUtils/FitterTypes.h" - -#include "GeoPrimitives/GeoPrimitives.h" - -namespace Trk{ - -class MultiComponentState; -class TrackStateOnSurface; -class Surface; -class QoverPBremFit; - - -//!< Interface ID for IBremsstrahlungFinder -static const InterfaceID IID_IBremsstrahlungFinder( "IBremsstrahlungFinder", 1, 0 ); - -class IBremsstrahlungFinder : virtual public IAlgTool{ - - public: - - //!< Virtual destructor - virtual ~IBremsstrahlungFinder(){}; - - //!< IAlgTool-AlgTool interface - static const InterfaceID& interfaceID() { return IID_IBremsstrahlungFinder; }; - - //Find the brem points from a forward and smooth track fit - virtual void BremFinder(const Trk::ForwardTrajectory&, const Trk::SmoothedTrajectory&) = 0; - - virtual void BremFinder(const Trk::ForwardTrajectory&, const Trk::SmoothedTrajectory&, bool) = 0; - - virtual void CombineParameters() = 0; - - virtual void GetBremLocations() = 0; - - virtual double GetBound(double, int) = 0; - - virtual double BremSignificance(double, QoverPBremFit*, QoverPBremFit*) = 0; - - virtual double GetPhiFromValue(double, QoverPBremFit*) = 0; - - virtual int ClosestMeasurement(double, QoverPBremFit*) = 0; - - virtual void CalibrateValue() = 0; - - virtual const Surface* ClosestSurface(double, double, double, const TrackParameters&) = 0; - - virtual Amg::Vector3D SurfacePosition(const TrackParameters&, const Surface&, double, double, double) = 0; - - virtual StatusCode retrieveTrackingGeometry() = 0; - - virtual int GetNBrems() = 0; - - virtual void MakeTrackStateOnSurfaces () = 0; - - virtual const TrackStateOnSurface* GetEstimatedBremOnTrack(int) = 0; - -}; - -} // end Trk namespace - -#endif diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/IMultiComponentStateAssembler.h b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/IMultiComponentStateAssembler.h index 4a5c7f59709a48bf72f49ab6e9694f8f1a42e5b3..3212bc6bb1f2cf0c1bd79319e4ca5f0c573c5bd7 100755 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/IMultiComponentStateAssembler.h +++ b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/IMultiComponentStateAssembler.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ /*************************************************************************** @@ -16,11 +16,10 @@ decription : Abstract interface for Multi Component State Assembler #include "TrkMultiComponentStateOnSurface/MultiComponentState.h" #include "GaudiKernel/IAlgTool.h" +#include <memory> namespace Trk { - static const InterfaceID IID_MultiComponentStateAssembler("MultiComponentStateAssembler", 1, 0); - class IMultiComponentStateAssembler : virtual public IAlgTool { public: @@ -30,26 +29,37 @@ class IMultiComponentStateAssembler : virtual public IAlgTool { /** AlgTool interface methods */ static const InterfaceID& interfaceID () { return IID_MultiComponentStateAssembler; }; + struct Cache{ + Cache():validWeightSum{0}, + invalidWeightSum{0}, + multiComponentState{std::make_unique<MultiComponentState>()}, + assemblyDone{false}{ + } + double validWeightSum; + double invalidWeightSum; + std::unique_ptr<MultiComponentState> multiComponentState; + bool assemblyDone; + }; /** Resets the AlgTool */ - virtual bool reset() = 0 ; + virtual bool reset(Cache& cache) const = 0 ; /** Print the status of the assembler */ - virtual void status() const = 0; + virtual void status(const Cache& cache) const = 0; /** Method to add a single set of Trk::ComponentParameters to the cashed Trk::MultiComponentState object under construction */ - virtual bool addComponent (const ComponentParameters&) = 0; + virtual bool addComponent (Cache& cache, const ComponentParameters&) const = 0; /** Method to add a new Trk::MultiComponentState to the cashed Trk::MultiComponentState onject under construction */ - virtual bool addMultiState (const MultiComponentState&) = 0; + virtual bool addMultiState (Cache& cache,const MultiComponentState&) const = 0; /** Method to include the weights of states that are invalid */ - virtual bool addInvalidComponentWeight (const double&) = 0; + virtual bool addInvalidComponentWeight (Cache& cache,const double) const = 0; /** Method to return the cashed state object - it performs a reweighting before returning the object based on the valid and invaid weights */ - virtual const MultiComponentState* assembledState () = 0; + virtual const MultiComponentState* assembledState (Cache& cache) const = 0; /** Method to return the cashed state object - it performs a reweighting based on the input parameter */ - virtual const MultiComponentState* assembledState (const double&) = 0; + virtual const MultiComponentState* assembledState (Cache& cache, const double) const = 0; }; } // End Trk namepace diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/MultiComponentStateAssembler.h b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/MultiComponentStateAssembler.h index 7c5a813dd7716ec102d66f7221611abcc62ad10d..bf0a627b4674cc061e578bf8edabb7654b29b2c4 100755 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/MultiComponentStateAssembler.h +++ b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/MultiComponentStateAssembler.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ /*************************************************************************** @@ -40,65 +40,61 @@ class MultiComponentStateAssembler : public AthAlgTool, virtual public IMultiCom virtual ~MultiComponentStateAssembler (); /** AlgTool initialise method */ - StatusCode initialize(); + virtual StatusCode initialize() override; /** AlgTool finalise method */ - StatusCode finalize(); + virtual StatusCode finalize() override; + + typedef IMultiComponentStateAssembler::Cache Cache; /** Resets the AlgTool */ - virtual bool reset(); + virtual bool reset(Cache& cache) const override; /** Print the status of the assembler */ - virtual void status() const; + virtual void status(const Cache& cache) const override; /** Method to add a single set of Trk::ComponentParameters to the cashed Trk::MultiComponentState object under construction */ - virtual bool addComponent (const ComponentParameters&); + virtual bool addComponent (Cache& cache, const ComponentParameters&) const override ; /** Method to add a new Trk::MultiComponentState to the cashed Trk::MultiComponentState onject under construction */ - virtual bool addMultiState (const MultiComponentState&); + virtual bool addMultiState (Cache& cache, const MultiComponentState&) const override ; /** Method to include the weights of states that are invalid */ - virtual bool addInvalidComponentWeight (const double&); + virtual bool addInvalidComponentWeight (Cache& cache, const double) const override; /** Method to return the cashed state object - it performs a reweighting before returning the object based on the valid and invaid weights */ - virtual const MultiComponentState* assembledState (); + virtual const MultiComponentState* assembledState (Cache& cache) const override ; /** Method to return the cashed state object - it performs a reweighting based on the input parameter */ - virtual const MultiComponentState* assembledState (const double&); + virtual const MultiComponentState* assembledState (Cache& cache, const double) const override; private: /** Method to Check component entries before full assembly */ - bool prepareStateForAssembly (); + bool prepareStateForAssembly (Cache& cache) const; /** Method to assemble state with correct weightings */ - const MultiComponentState* doStateAssembly (const double&); + const MultiComponentState* doStateAssembly (Cache& cache,const double) const; /** Method to check the validity of of the cashed state */ - bool isStateValid () const; + bool isStateValid (Cache& cache) const; /** Method to Remove components with insignificantly small weightings */ - void removeSmallWeights (); + void removeSmallWeights (Cache& cache) const; /** Method for the actual addition of a multi-component state to the cashed state */ - void addComponentsList (const MultiComponentState*); + void addComponentsList (Cache& cache, const MultiComponentState*) const; // Private data members private: - int m_outputlevel; //!< to cache current output level bool m_sortComponents; - bool m_assemblyDone; - double m_minimumFractionalWeight; - double m_minimumValidFraction; - double m_validWeightSum; - double m_invalidWeightSum; - MultiComponentState* m_multiComponentState; - + Gaudi::Property<double> m_minimumFractionalWeight {this, "minimumFractionalWeight",1.e-9," Minimum Fractional Weight"}; + Gaudi::Property<double> m_minimumValidFraction {this, "minimumValidFraction",0.01," Minimum Valid Fraction"}; }; } // End Trk namepace -inline bool Trk::MultiComponentStateAssembler::isStateValid () const +inline bool Trk::MultiComponentStateAssembler::isStateValid ( Cache& cache) const { - return !m_multiComponentState->empty(); + return !cache.multiComponentState->empty(); } #endif diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/MultiComponentStateModeCalculator.h b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/MultiComponentStateModeCalculator.h index b747f636cd44efd739997092a0b1071e8f9fce96..749ddab0d767c90b749e5e809bdede07664292c4 100755 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/MultiComponentStateModeCalculator.h +++ b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/MultiComponentStateModeCalculator.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ /*********************************************************************************** @@ -8,7 +8,7 @@ begin : Thursday 6th July 2006 author : atkinson email : Tom.Atkinson@cern.ch -description : Class to calculate the mode (q/p) of a gaussian mixture +description : Class to calculate the mode (q/p) of a gaussian mixtureArray ***********************************************************************************/ #ifndef Trk_MultiComponentStateModeCalculator_H @@ -16,6 +16,9 @@ description : Class to calculate the mode (q/p) of a gaussian mixture #include "AthenaBaseComps/AthAlgTool.h" #include "TrkGaussianSumFilter/IMultiComponentStateModeCalculator.h" +#include <atomic> +#include <array> +#include <vector> namespace Trk{ @@ -38,72 +41,75 @@ class MultiComponentStateModeCalculator : public AthAlgTool, virtual public IMul StatusCode finalize(); //!< IMultiComponentStateModeCalculator interface method to calculate mode - Amg::VectorX calculateMode( const MultiComponentState& ) const; - - private: - - //!< Private method to extract the weight, mean and sigma values from the multi-component state - void fillMixture( const MultiComponentState& ) const; - - //!< Private method to find the mode using the Newton-Raphson method based on a starting guess - double findMode( double, int ) const; - - //!< Private method to determine the pdf of the cashed mixture at a given value - double pdf( double, int ) const; - - //!< Private method to determine the first order derivative of the pdf at a given value - double d1pdf( double, int ) const; - - //!< Private method to determine the second order derivative of the pdf at a given value - double d2pdf( double, int) const; - - //!< Private method to determine the value of the a gaussian distribution at a given value - double gaus( double x, double mean, double sigma ) const; - - double findModeGlobal(double, int) const; - - double width( int i) const; - - double findRoot(double &result, double xlo, double xhi, double value, double i) const; - + virtual Amg::VectorX calculateMode( const MultiComponentState& ) const override; private: - //!< Private mixture structure + //!< Private Mixture structure struct Mixture{ // Default constructor - Mixture() - : + Mixture(): weight(0.), mean(0.), sigma(0.) {} // Constructor with arguments - Mixture( double aWeight, double aMean, double aSigma ) - : + Mixture( double aWeight, double aMean, double aSigma ): weight( aWeight ), mean( aMean ), sigma( aSigma ) {} - double weight; double mean; double sigma; }; + + //!< Private method to extract the weight, mean and sigma values from the multi-component state + void fillMixture( std::array<std::vector< Mixture >,5>& mixtureArray, + const MultiComponentState& ) const; + + //!< Private method to find the mode using the Newton-Raphson method based on a starting guess + double findMode( const std::array<std::vector< Mixture >,5>& mixtureArray, + double, int ) const; + + //!< Private method to determine the pdf of the cashed mixtureArray at a given value + double pdf( const std::array<std::vector< Mixture >,5>& mixtureArray, + double, int ) const; + + //!< Private method to determine the first order derivative of the pdf at a given value + double d1pdf( const std::array<std::vector< Mixture >,5>& mixtureArray, + double, int ) const; + + //!< Private method to determine the second order derivative of the pdf at a given value + double d2pdf( const std::array<std::vector< Mixture >,5>& mixtureArray, + double, int) const; + + //!< Private method to determine the value of the a gaussian distribution at a given value + double gaus( double x, double mean, double sigma ) const; + + double findModeGlobal(const std::array<std::vector< Mixture >,5>& mixtureArray, + double, int) const; + + double width( const std::array<std::vector< Mixture >,5>& mixtureArray, + int i) const; + + double findRoot(const std::array<std::vector< Mixture >,5>& mixtureArray, + double &result, double xlo, double xhi, double value, double i) const; + + private: int m_outputlevel; //!< to cache current output level - mutable std::vector< Mixture > m_mixture[5]; //!< Mixture //ModeCalualtor Stats - mutable int m_NumberOfCalls; - mutable int m_ConverganceFilures; - mutable int m_NoErrorMatrix; - mutable int m_MixtureSizeZero; + mutable std::atomic<int> m_NumberOfCalls; + mutable std::atomic<int> m_ConverganceFilures; + mutable std::atomic<int> m_NoErrorMatrix; + mutable std::atomic<int> m_MixtureSizeZero; }; diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/QuickCloseComponentsMultiStateMerger.h b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/QuickCloseComponentsMultiStateMerger.h index fd16e666b6785c73f0d44c579a5f72b642112384..ec756407c2dcf7901f349f91f5e80a392f478fcc 100644 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/QuickCloseComponentsMultiStateMerger.h +++ b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/QuickCloseComponentsMultiStateMerger.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ /********************************************************************************* @@ -84,8 +84,10 @@ namespace Trk{ std::vector<const ComponentParameters*>&, int& minIndex) const; - const MultiComponentState* mergeFullDistVector(const MultiComponentState&) const; - const MultiComponentState* mergeFullDistArray(const MultiComponentState&) const; + const MultiComponentState* mergeFullDistVector(IMultiComponentStateAssembler::Cache& cache, + const MultiComponentState&) const; + const MultiComponentState* mergeFullDistArray(IMultiComponentStateAssembler::Cache& cache, + const MultiComponentState&) const; void deleteStateComponents(int ind1, int ind2, std::vector<const ComponentParameters*>&) const; diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/src/BremFind.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/src/BremFind.cxx deleted file mode 100644 index 88733889ac8814888cee8ebf807088822d53bcb0..0000000000000000000000000000000000000000 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/src/BremFind.cxx +++ /dev/null @@ -1,1001 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -/******************************************************************************** - BremFind.cxx * description - -completed : Tuesday 18th November 2008 -author : Tony Shao -email : Qi.Tao.Shao@cern.ch -description : Class for finding brem points in the inner detector using the GSF -**********************************************************************************/ - - - -#include "TrkGaussianSumFilter/BremFind.h" -#include "QoverPBremFit.h" - -#include <math.h> -#include "TMath.h" - -#include "TrkGaussianSumFilter/IMultiComponentStateCombiner.h" - -#include "TrkMultiComponentStateOnSurface/MultiComponentStateOnSurface.h" -#include "TrkParameters/TrackParameters.h" - -#include "TrkTrack/Track.h" -#include "TrkMaterialOnTrack/EstimatedBremOnTrack.h" - -#include "TrkGeometry/Layer.h" -#include "TrkGeometry/TrackingVolume.h" -#include "TrkGeometry/TrackingGeometry.h" -#include "TrkGeometry/MagneticFieldProperties.h" - -#include "TrkVolumes/AbstractVolume.h" -#include "TrkSurfaces/Surface.h" -#include "TrkSurfaces/CylinderSurface.h" - -#include "GaudiKernel/ITHistSvc.h" - -#include "TTree.h" - - - -Trk::BremFind::BremFind(const std::string& type, const std::string& name, const IInterface* parent): - AthAlgTool(type, name, parent), - m_stateCombiner("Trk::MultiComponentStateCombiner"), - m_propagator("Trk::IntersectorWrapper/IntersectorWrapper"), - //m_fieldProperties - m_trackingGeometrySvc("TrackingGeometrySvc","AtlasTrackingGeometrySvc"), - m_trackingGeometryName("AtlasTrackingGeometry"), - m_trackingGeometry(nullptr), - //m_validationMode - m_validationTreeName("BremInfo"), - m_validationTreeName2("BremInfoZ"), - m_validationTreeDescription("Brem Information"), - m_validationTreeFolder("/valGSF2/BremInfo"), - m_validationTreeFolder2("/valGSF2/BremInfoZ"), - m_validationTree(nullptr), - m_validationTree2(nullptr), - //m_useCalibration{}, - //m_usePropagate{}, - m_forwardparameters{}, - m_smoothedparameters{}, - m_combinedparameters{}, - m_perigee_1overP{}, - m_perigee_Phi{}, - m_perigee_Theta{}, - m_perigee_d0{}, - m_perigee_z0{}, - m_brem_value{}, - m_brem_phi{}, - m_brem_theta{}, - m_brem_energy{}, - m_brem_UpperBound{}, - m_brem_LowerBound{}, - m_forward_kink{}, - m_smoothed_kink{}, - m_brem_significance{}, - m_brem_valueCalibrated{}, - m_surfaceX{}, - m_surfaceY{}, - m_surfaceZ{}, - m_nBrems{}, - m_Z_mode{}, - //vectors could be initialised here - m_event_ID{}, - m_forwardparameter_constant{}, - m_forwardparameter_coefficient{}, - m_forwardparameter_value{}, - m_forwardparameter_width{}, - m_smoothparameter_constant{}, - m_smoothparameter_coefficient{}, - m_smoothparameter_value{}, - m_smoothparameter_width{}, - m_forward_1overP{}, - m_forward_1overPerr{}, - m_forward_value{}, - m_smooth_1overP{}, - m_smooth_1overPerr{}, - m_smooth_value{}, - m_KinkSeparationScores{}, - m_KinkSeparationScoresErr{}, - m_forwardBremFit{}, - m_smoothedBremFit{} -{ - declareInterface<IBremsstrahlungFinder>(this); - //jobOptions Variables - declareProperty("StateCombiner", m_stateCombiner ); - declareProperty("TrackingGeometrySvc", m_trackingGeometrySvc); - declareProperty("Propagator", m_propagator); - declareProperty("UseCalibration", m_useCalibration=true); - declareProperty("ValidationMode", m_validationMode=false); - declareProperty("UseSurfacePropagation", m_usePropagate=false); - declareProperty("TreeFolderName", m_validationTreeFolder); - declareProperty("TreeFolderName2", m_validationTreeFolder2); - declareProperty("EventInfoKey", m_readKey = "EventInfo"); -} - - -StatusCode Trk::BremFind::initialize() -{ - // The TrackingGeometrySvc ------------------------------------------------------ - ATH_CHECK (m_trackingGeometrySvc.retrieve()); - - msg(MSG::DEBUG) << "Retrieved service " << m_trackingGeometrySvc << endmsg; - m_trackingGeometryName = m_trackingGeometrySvc->trackingGeometryName(); - - - // Request the state combiner - ATH_CHECK ( m_stateCombiner.retrieve() ); - - //Retrieve the propagator - ATH_CHECK (m_propagator.retrieve()); - - m_fieldProperties= Trk::MagneticFieldProperties(Trk::FullField); - - - - //The Validation step ---------------------------------------------------------- - - if (m_validationMode) { - - if (not m_validationTree) { - //Crate a new tree if there doesn't exist one already - m_validationTree = new TTree( m_validationTreeName.c_str(), m_validationTreeDescription.c_str() ); - - - m_validationTree->Branch("nBrems" , &m_nBrems, "nBrems/I"); - m_validationTree->Branch("Brem_Radii", &m_brem_value); - m_validationTree->Branch("Brem_Phi", &m_brem_phi); - m_validationTree->Branch("Brem_Theta", &m_brem_theta); - m_validationTree->Branch("Brem_Energy", &m_brem_energy); - m_validationTree->Branch("Brem_UpperBound", &m_brem_UpperBound); - m_validationTree->Branch("Brem_LowerBound", &m_brem_LowerBound); - m_validationTree->Branch("Forward_Kink", &m_forward_kink); - m_validationTree->Branch("Backward_Kink", &m_smoothed_kink); - m_validationTree->Branch("Brem_Significance", &m_brem_significance); - m_validationTree->Branch("Brem_RadiiCalibrated", &m_brem_valueCalibrated); - m_validationTree->Branch("SurfaceX", &m_surfaceX); - m_validationTree->Branch("SurfaceY", &m_surfaceY); - m_validationTree->Branch("SurfaceZ", &m_surfaceZ); - m_validationTree->Branch("EventID" , &m_event_ID, "EventID/I"); - m_validationTree->Branch("ForwardParameterConstant", &m_forwardparameter_constant,"ForwardParameterConstant/D"); - m_validationTree->Branch("SmoothParameterConstant", &m_smoothparameter_constant,"SmoothParameterConstant/D"); - m_validationTree->Branch("ForwardParameterCoefficient", &m_forwardparameter_coefficient); - m_validationTree->Branch("ForwardParameterRadii", &m_forwardparameter_value); - m_validationTree->Branch("ForwardParameterWidth", &m_forwardparameter_width); - m_validationTree->Branch("SmoothParameterCoefficient", &m_smoothparameter_coefficient); - m_validationTree->Branch("SmoothParameterRadii", &m_smoothparameter_value); - m_validationTree->Branch("SmoothParameterWidth", &m_smoothparameter_width); - m_validationTree->Branch("Forward1overP", &m_forward_1overP); - m_validationTree->Branch("Forward1overPerr", &m_forward_1overPerr); - m_validationTree->Branch("ForwardRadii", &m_forward_value); - m_validationTree->Branch("Smooth1overP", &m_smooth_1overP); - m_validationTree->Branch("Smooth1overPerr", &m_smooth_1overPerr); - m_validationTree->Branch("SmoothRadii", &m_smooth_value); - m_validationTree->Branch("SeparationQuality", &m_KinkSeparationScores); - m_validationTree->Branch("SeparationQualityErr", &m_KinkSeparationScoresErr); - - } - - - - - if (not m_validationTree2) { - //Crate a new tree if there doesn't exist one already - m_validationTree2 = new TTree( m_validationTreeName2.c_str(), m_validationTreeDescription.c_str() ); - - - m_validationTree2->Branch("nBrems" , &m_nBrems, "nBrems/I"); - m_validationTree2->Branch("Brem_Z", &m_brem_value); - m_validationTree2->Branch("Brem_Phi", &m_brem_phi); - m_validationTree2->Branch("Brem_Theta", &m_brem_theta); - m_validationTree2->Branch("Brem_Energy", &m_brem_energy); - m_validationTree2->Branch("Brem_UpperBound", &m_brem_UpperBound); - m_validationTree2->Branch("Brem_LowerBound", &m_brem_LowerBound); - m_validationTree2->Branch("Forward_Kink", &m_forward_kink); - m_validationTree2->Branch("Backward_Kink", &m_smoothed_kink); - m_validationTree2->Branch("Brem_Significance", &m_brem_significance); - m_validationTree2->Branch("Brem_ZCalibrated", &m_brem_valueCalibrated); - m_validationTree2->Branch("SurfaceX", &m_surfaceX); - m_validationTree2->Branch("SurfaceY", &m_surfaceY); - m_validationTree2->Branch("SurfaceZ", &m_surfaceZ); - m_validationTree2->Branch("EventID" , &m_event_ID, "EventID/I"); - m_validationTree2->Branch("ForwardParameterConstant", &m_forwardparameter_constant,"ForwardParameterConstant/D"); - m_validationTree2->Branch("SmoothParameterConstant", &m_smoothparameter_constant,"SmoothParameterConstant/D"); - m_validationTree2->Branch("ForwardParameterCoefficient", &m_forwardparameter_coefficient); - m_validationTree2->Branch("ForwardParameterZ", &m_forwardparameter_value); - m_validationTree2->Branch("ForwardParameterWidth", &m_forwardparameter_width); - m_validationTree2->Branch("SmoothParameterCoefficient", &m_smoothparameter_coefficient); - m_validationTree2->Branch("SmoothParameterZ", &m_smoothparameter_value); - m_validationTree2->Branch("SmoothParameterWidth", &m_smoothparameter_width); - m_validationTree2->Branch("Forward1overP", &m_forward_1overP); - m_validationTree2->Branch("Forward1overPerr", &m_forward_1overPerr); - m_validationTree2->Branch("ForwardZ", &m_forward_value); - m_validationTree2->Branch("Smooth1overP", &m_smooth_1overP); - m_validationTree2->Branch("Smooth1overPerr", &m_smooth_1overPerr); - m_validationTree2->Branch("SmoothZ", &m_smooth_value); - m_validationTree2->Branch("SeparationQuality", &m_KinkSeparationScores); - m_validationTree2->Branch("SeparationQualityErr", &m_KinkSeparationScoresErr); - - } - - - //register the Tree - ITHistSvc* tHistSvc = 0; - if (service("THistSvc",tHistSvc).isFailure()) { - msg(MSG::ERROR) << "initialize() Could not find Hist Service -> Switching ValidationMode Off !" << endmsg; - delete m_validationTree; - delete m_validationTree2; - m_validationTree=0; - m_validationTree2=0; - } - if ((tHistSvc->regTree(m_validationTreeFolder, m_validationTree)).isFailure()) { - msg(MSG::ERROR)<<"initialize() Could not register the validation Tree -> Switching ValidationMode off !" << endmsg; - delete m_validationTree; - m_validationTree = 0; - } - if ((tHistSvc->regTree(m_validationTreeFolder2, m_validationTree2)).isFailure()) { - msg(MSG::ERROR)<<"initialize() Could not register the validation Tree 2 -> Switching ValidationMode off !" << endmsg; - delete m_validationTree2; - m_validationTree2 = 0; - } - - } - - //---------------------------- end of validation mode ------------------------------------ - - - ATH_CHECK( m_readKey.initialize() ); - - ATH_MSG_DEBUG( "Initialisation of " << name() << " was successful" ); - - return StatusCode::SUCCESS; - -} - - -StatusCode Trk::BremFind::finalize(){ - - ATH_MSG_DEBUG( "Finalisation of " << name() << " was successful" ); - - return StatusCode::SUCCESS; - -} - -void Trk::BremFind::BremFinder(const Trk::ForwardTrajectory& forwardTrajectory, const Trk::SmoothedTrajectory& smoothedTrajectory) { - BremFinder(forwardTrajectory, smoothedTrajectory, false); -} - -void Trk::BremFind::BremFinder(const Trk::ForwardTrajectory& forwardTrajectory, const Trk::SmoothedTrajectory& smoothedTrajectory, bool Z_mode) -{ - m_Z_mode = Z_mode; - - if (!m_trackingGeometry) - retrieveTrackingGeometry(); - - - msg(MSG::DEBUG) << "Entering BremFinder Function " << endmsg; - - m_brem_value = new std::vector<double>; - m_brem_phi = new std::vector<double>; - m_brem_theta = new std::vector<double>; - m_brem_energy = new std::vector<double>; - m_brem_UpperBound = new std::vector<double>; - m_brem_LowerBound = new std::vector<double>; - m_forward_kink = new std::vector<double>; - m_smoothed_kink = new std::vector<double>; - m_brem_significance = new std::vector<double>; - m_brem_valueCalibrated = new std::vector<double>; - m_surfaceX = new std::vector<double>; - m_surfaceY = new std::vector<double>; - m_surfaceZ = new std::vector<double>; - m_brem_trackStateOnSurface.clear(); - m_EstimatedBremOnTrack.clear(); - m_brem_TrackParameters.clear(); - m_brem_surfaces.clear(); - m_brem_layers.clear(); - m_surface_positions.clear(); - - m_forwardparameter_coefficient = new std::vector<double>; - m_forwardparameter_value = new std::vector<double>; - m_forwardparameter_width = new std::vector<double>; - m_smoothparameter_coefficient = new std::vector<double>; - m_smoothparameter_value = new std::vector<double>; - m_smoothparameter_width = new std::vector<double>; - m_forward_1overP = new std::vector<double>; - m_forward_1overPerr = new std::vector<double>; - m_forward_value = new std::vector<double>; - m_smooth_1overP = new std::vector<double>; - m_smooth_1overPerr = new std::vector<double>; - m_smooth_value = new std::vector<double>; - m_KinkSeparationScores = new std::vector<double>; - m_KinkSeparationScoresErr = new std::vector<double>; - - - //Obtain the parameters of the Tanh fit for both forward and smooth trajectories - m_forwardBremFit = new QoverPBremFit(1,m_Z_mode); - m_forwardparameters = m_forwardBremFit->GetParameters(forwardTrajectory); - m_smoothedBremFit = new QoverPBremFit(-1,m_Z_mode); - m_smoothedparameters = m_smoothedBremFit->GetParameters(smoothedTrajectory); - //GetPerigee functions will only make sense when using the smoothed trajectory - m_perigee_1overP = m_smoothedBremFit->GetPerigee_1overP(); - m_perigee_Phi = m_smoothedBremFit->GetPerigee_Phi(); - m_perigee_Theta = m_smoothedBremFit->GetPerigee_Theta(); - m_perigee_d0 = m_smoothedBremFit->GetPerigee_d0(); - m_perigee_z0 = m_smoothedBremFit->GetPerigee_z0(); - - - CombineParameters(); - - GetBremLocations(); - - m_nBrems = m_brem_value->size(); - - for (int bound_counter(0); bound_counter < (int) m_brem_value->size(); bound_counter++) { - m_brem_UpperBound->push_back(GetBound((*m_brem_value)[bound_counter],1)); - m_brem_LowerBound->push_back(GetBound((*m_brem_value)[bound_counter],-1)); - m_brem_significance->push_back(BremSignificance((*m_brem_value)[bound_counter],m_forwardBremFit,m_smoothedBremFit)); - } - - //Calibration of the brem value - if (m_useCalibration) { - CalibrateValue(); - } - else { - for (int copy_counter(0); copy_counter < (int) m_brem_value->size(); copy_counter++) { - m_brem_valueCalibrated->push_back((*m_brem_value)[copy_counter]); - } - } - - for (int fill_counter(0); fill_counter < (int) m_brem_value->size(); fill_counter++) { - m_brem_theta->push_back(m_perigee_Theta); - m_brem_phi->push_back(GetPhiFromValue((*m_brem_valueCalibrated)[fill_counter],m_smoothedBremFit)); - } - - //double closest_floorF,closest_floorS; - //int closestSurfaceNoF(0); - int closestSurfaceNoS(0); - - for (int brem_counter2(0); brem_counter2 < (int) m_brem_value->size(); brem_counter2++) { - - //The closest measurement numbers to the brem location - //closestSurfaceNoF=ClosestMeasurement((*m_brem_valueCalibrated)[brem_counter2],m_forwardBremFit); - closestSurfaceNoS=ClosestMeasurement((*m_brem_valueCalibrated)[brem_counter2],m_smoothedBremFit); - - //closest_floorF = m_forwardBremFit->GetValue(closestSurfaceNoF); - //closest_floorS = m_smoothedBremFit->GetValue(closestSurfaceNoS); - - //Filling the associated surfaces for each brem - const Trk::TrackParameters* closestTrackParameters = m_smoothedBremFit->GetTrackParameters(closestSurfaceNoS); - m_brem_surfaces.push_back(ClosestSurface((*m_brem_value)[brem_counter2],(*m_brem_phi)[brem_counter2],(*m_brem_theta)[brem_counter2],*closestTrackParameters)); - - m_surface_positions.push_back(SurfacePosition(*closestTrackParameters,*m_brem_surfaces[brem_counter2],(*m_brem_value)[brem_counter2],(*m_brem_phi)[brem_counter2],(*m_brem_theta)[brem_counter2])); - - - m_surfaceX->push_back(m_surface_positions[brem_counter2].x()); - m_surfaceY->push_back(m_surface_positions[brem_counter2].y()); - m_surfaceZ->push_back(m_surface_positions[brem_counter2].z()); - - - } - - double remaining_energy(1/m_perigee_1overP); - - - //This loop fills the EstimatedBremOnTrack vector - - for (int brem_counter(0); brem_counter < (int) m_brem_value->size(); brem_counter++) { - - - Trk::EstimatedBremOnTrack *estimatedBremOnTrack(0); - remaining_energy -= (*m_brem_energy)[brem_counter]; - double retainedEnFraction(remaining_energy*m_perigee_1overP); - - double sigma1overPsquared(m_smoothedBremFit->Get1overPerror(0)); - - - if (m_brem_layers[brem_counter] && m_brem_surfaces[brem_counter] && m_brem_TrackParameters[brem_counter]) { - estimatedBremOnTrack = new EstimatedBremOnTrack(m_brem_layers[brem_counter]->thickness(), - retainedEnFraction,0.0, - sigma1overPsquared, - //*m_brem_surfaces[brem_counter], - *m_brem_TrackParameters[brem_counter]->associatedSurface().clone(), - bothway); - - } - - m_EstimatedBremOnTrack.push_back(estimatedBremOnTrack); - - } - - //Creates a vector of TrackStateOnSurface - MakeTrackStateOnSurfaces(); - - - //* Retrieve the event info for later syncrinization - SG::ReadHandle< xAOD::EventInfo> eventInfo (m_readKey); - if (!eventInfo.isValid()) { - msg(MSG::ERROR) << "Could not retrieve event info" << endmsg; - } - - m_event_ID = eventInfo->eventNumber(); - - //Fill the TanH coefficients and graph values - for (int forward_fill(0); forward_fill < (int) m_forwardparameters.coefficient.size(); forward_fill++) { - m_forwardparameter_coefficient->push_back(m_forwardparameters.coefficient[forward_fill]); - m_forwardparameter_value->push_back(m_forwardparameters.value[forward_fill]); - m_forwardparameter_width->push_back(m_forwardparameters.width[forward_fill]); - } - - for (int smooth_fill(0); smooth_fill < (int) m_smoothedparameters.coefficient.size(); smooth_fill++) { - m_smoothparameter_coefficient->push_back(m_smoothedparameters.coefficient[smooth_fill]); - m_smoothparameter_value->push_back(m_smoothedparameters.value[smooth_fill]); - m_smoothparameter_width->push_back(m_smoothedparameters.width[smooth_fill]); - } - - for (int forwardgraph_fill(0); forwardgraph_fill < m_forwardBremFit->GetnSurfaces(); forwardgraph_fill++) { - m_forward_1overP->push_back(m_forwardBremFit->Get1overP(forwardgraph_fill)); - m_forward_1overPerr->push_back(m_forwardBremFit->Get1overPerror(forwardgraph_fill)); - m_forward_value->push_back(m_forwardBremFit->GetValue(forwardgraph_fill)); - } - - for (int smoothgraph_fill(0); smoothgraph_fill < m_smoothedBremFit->GetnSurfaces(); smoothgraph_fill++) { - m_smooth_1overP->push_back(m_smoothedBremFit->Get1overP(smoothgraph_fill)); - m_smooth_1overPerr->push_back(m_smoothedBremFit->Get1overPerror(smoothgraph_fill)); - m_smooth_value->push_back(m_smoothedBremFit->GetValue(smoothgraph_fill)); - } - - m_forwardparameter_constant = m_forwardparameters.constant; - m_smoothparameter_constant = m_smoothedparameters.constant; - - //Calculate the SeparationQuality - - SeparationQuality(m_smoothed_kink,m_forward_kink); - - if (m_validationTree && !m_Z_mode) - m_validationTree->Fill(); - else if (m_validationTree2 && m_Z_mode) - m_validationTree2->Fill(); - - delete m_brem_value; - delete m_brem_phi; - delete m_brem_theta; - delete m_brem_energy; - delete m_brem_UpperBound; - delete m_brem_LowerBound; - delete m_forward_kink; - delete m_smoothed_kink; - delete m_brem_significance; - delete m_brem_valueCalibrated; - delete m_surfaceX; - delete m_surfaceY; - delete m_surfaceZ; - - delete m_forwardBremFit; - delete m_smoothedBremFit; - - - delete m_forwardparameter_coefficient; - delete m_forwardparameter_value; - delete m_forwardparameter_width; - delete m_smoothparameter_coefficient; - delete m_smoothparameter_value; - delete m_smoothparameter_width; - delete m_forward_1overP; - delete m_forward_1overPerr; - delete m_forward_value; - delete m_smooth_1overP; - delete m_smooth_1overPerr; - delete m_smooth_value; - delete m_KinkSeparationScores; - delete m_KinkSeparationScoresErr; - - -} - -void Trk::BremFind::CombineParameters() -{ - //Firstly clear all previous entries - m_combinedparameters.coefficient.clear(); - m_combinedparameters.width.clear(); - m_combinedparameters.value.clear(); - - //The combined graph is the backward fit - forward fit - m_combinedparameters.constant = m_smoothedparameters.constant - m_forwardparameters.constant; - - for (int forward_counter(0); forward_counter < (int) m_forwardparameters.value.size(); forward_counter++) { - m_combinedparameters.coefficient.push_back(-m_forwardparameters.coefficient[forward_counter]); - m_combinedparameters.value.push_back(m_forwardparameters.value[forward_counter]); - m_combinedparameters.width.push_back(m_forwardparameters.width[forward_counter]); - } - - for (int smooth_counter(0); smooth_counter < (int) m_smoothedparameters.value.size(); smooth_counter++) { - m_combinedparameters.coefficient.push_back(m_smoothedparameters.coefficient[smooth_counter]); - m_combinedparameters.value.push_back(m_smoothedparameters.value[smooth_counter]); - m_combinedparameters.width.push_back(m_smoothedparameters.width[smooth_counter]); - } - -} - - -//This function returns the value of the tanh series at position x -double Trk::BremFind::Graph_value(GraphParameter graphparameter, double x) -{ - double arg = graphparameter.constant; - - for (int arg_counter(0); arg_counter < (int) graphparameter.value.size(); arg_counter++) { - arg+=graphparameter.coefficient[arg_counter]*TMath::TanH(x/graphparameter.width[arg_counter] - graphparameter.value[arg_counter]/graphparameter.width[arg_counter]); - } - return arg; - -} - -//Returns the x value of the local maximum between the min and max terms -double Trk::BremFind::GetMaximumX(GraphParameter graphparameter, double min, double max) -{ - double value(0); - double maximum(0); - double eval(0); - for (double value_counter(min); value_counter < max; value_counter++) { - eval=Graph_value(graphparameter, value_counter); - - if (eval > maximum) { - maximum=eval; - value=value_counter; - } - - } - return value; -} - -//Returns the y value of the local maximum between the min and max terms -double Trk::BremFind::GetMaximumY(GraphParameter graphparameter, double min, double max) -{ - double maximum(0); - double eval(0); - for (double value_counter(min); value_counter < max; value_counter++) { - eval=Graph_value(graphparameter, value_counter); - if (eval > maximum) { - maximum = eval; - } - } - return maximum; -} - - -void Trk::BremFind::GetBremLocations() -{ - bool double_back_boolean=false; - //Normalisation factor introduced because initial parameters were chosen and optimised - //for 10GeV Pt electrons. So the normalization factor for 10GeV events will be 1.0 - - double P_T(sin(m_perigee_Theta)*(1/(m_perigee_1overP))); - - double normalisation(P_T/10.0); - - for (int smooth_counter(0); smooth_counter < (int) m_smoothedparameters.value.size(); smooth_counter++) { - double_back_boolean=false; - - for (int forward_counter(0); forward_counter < (int) m_forwardparameters.value.size(); forward_counter++) { - - //backward kink must have a value lower than the forward kink - if (m_forwardparameters.value[forward_counter] < m_smoothedparameters.value[smooth_counter]) { - continue; - } - - //If there are multiple back kinks before the forward kink, then the back kinks must - //iterate forward until it's just before the forward kink - //Therefore the forward loop is broken to iterate the smooth_counter - if ((smooth_counter+1 < (int) m_smoothedparameters.value.size()) ) { - if (m_forwardparameters.value[forward_counter] > m_smoothedparameters.value[smooth_counter+1] && m_smoothedparameters.coefficient[smooth_counter+1]/sin(m_perigee_Theta) > (MIN_KINK_THRESHOLD/normalisation)) { - double_back_boolean=true; - } - } - - if (double_back_boolean) { - break; - } - - //If forward kink is just in front of the backward kink then proceed to find the brem value - else if (m_forwardparameters.value[forward_counter] > m_smoothedparameters.value[smooth_counter]) { - - double brem_separation( GetMaximumY(m_combinedparameters, m_smoothedparameters.value[smooth_counter], m_forwardparameters.value[forward_counter])/sin(m_perigee_Theta) ); - - - //Calculates the energy of the brem based on the change in momentum in the - //1overP parameter - double coefficient_average( (m_forwardparameters.coefficient[forward_counter]+m_smoothedparameters.coefficient[smooth_counter])/(2*m_perigee_Theta) ); - double p_before_bremF( Graph_value(m_forwardparameters, m_forwardparameters.value[forward_counter] - 2*m_forwardparameters.width[forward_counter])/m_perigee_Theta ); - double p_before_bremS( Graph_value(m_smoothedparameters, m_smoothedparameters.value[smooth_counter] - 2*m_smoothedparameters.width[smooth_counter])/m_perigee_Theta ); - double p_before_bremAverage( (p_before_bremF + p_before_bremS)/2 ); - double p_after_brem( p_before_bremAverage + 2*coefficient_average ); - double brem_amplitude( 1/p_before_bremAverage - 1/p_after_brem ); - - - //Check the strength of the brem and its coefficients - if (brem_amplitude > (BREM_AMPLITUDE*normalisation) && brem_separation > (BREM_SEPARATION/normalisation) && m_forwardparameters.coefficient[forward_counter]/sin(m_perigee_Theta) > (COEFFICIENT_THRESHOLD/normalisation) && m_smoothedparameters.coefficient[smooth_counter]/sin(m_perigee_Theta) > (COEFFICIENT_THRESHOLD/normalisation)) { - - m_brem_energy->push_back(brem_amplitude); - m_brem_value->push_back( GetMaximumX(m_combinedparameters,m_smoothedparameters.value[smooth_counter],m_forwardparameters.value[forward_counter]) ); - m_forward_kink->push_back(m_forwardparameters.value[forward_counter]); - m_smoothed_kink->push_back(m_smoothedparameters.value[smooth_counter]); - - break; - } - - } - - } - - } - -} - -//This function obtains the upper and lower bounds of the brem value by scanning the peak -//till there's a drop in magnitude equal to the desired threshold. If type=1 then, this -//function will return an upperbound. If type=-1, then this function will return the lower -//bound. Threshold must be used as a percentage in drop from the maximum Y value. -double Trk::BremFind::GetBound(double start, int type) -{ - double maximum(Graph_value(m_combinedparameters,start)); - double eval(maximum); - double value(start); - - while (eval > ((100.0-BOUND_THRESHOLD)/100.0)*maximum) { - eval = Graph_value(m_combinedparameters,value); - value+=type; - - //if the value is above the end of the inner detector - if (value > m_smoothedBremFit->LastFitMeasurement()) { - return m_smoothedBremFit->LastFitMeasurement(); - } - //if the value is below zero, then return 0 as the lower bound - if (value < 0.0) { - return 0.0; - } - } - - return value; -} - -int Trk::BremFind::ClosestMeasurement(double x, QoverPBremFit *BremFit) -{ - double min_distance(1000); - double distance(1000); - //double value(x); - int measurement_no(0); - - for (int counter(0); counter < BremFit->GetNMeasurements(); counter++) { - distance = fabs(x - BremFit->GetValue(counter)); - if (distance < min_distance) { - min_distance = distance; - //value = BremFit->GetValue(counter); - measurement_no = counter; - } - } - return measurement_no; -} - -double Trk::BremFind::BremSignificance(double x,QoverPBremFit *forwardBremFit, QoverPBremFit *smoothedBremFit) -{ - int measurement_noF( ClosestMeasurement(x, forwardBremFit) ); - double PiF( 1/forwardBremFit->Get1overP(measurement_noF) ); - - //Making sure the next measurement is not on the same surface - int additional_forward(1); - double value1F( forwardBremFit->GetValue(measurement_noF+1) ); - while (fabs(x-value1F) < 20.0) { - additional_forward++; - value1F = forwardBremFit->GetValue(measurement_noF + additional_forward); - } - double Pi1F( 1/forwardBremFit->Get1overP(measurement_noF+1) ); - - - int measurement_noS( ClosestMeasurement(x, smoothedBremFit) ); - double PiS( 1/smoothedBremFit->Get1overP(measurement_noS) ); - - int additional_smoothed(1); - double value1S( smoothedBremFit->GetValue(measurement_noS-1) ); - while (fabs(x-value1S) < 20.0){ - additional_smoothed++; - value1S = smoothedBremFit->GetValue(measurement_noS - additional_smoothed); - } - double Pi1S( 1/smoothedBremFit->Get1overP(measurement_noS-1) ); - - double sigf( (1-(Pi1F/PiF))/forwardBremFit->Get1overPerror(measurement_noF) ); - double sigb( (1-(PiS/Pi1S))/smoothedBremFit->Get1overPerror(measurement_noS) ); - - double sigsum( sigf + sigb); - - return std::max(sigsum, std::max(sigf,sigb)); -} - -//This function provides an estimate of the phi position using the value -//The smoothed trajectory is used because it is more accurate in the pixels -//where the majority of brems occur -double Trk::BremFind::GetPhiFromValue(double value, QoverPBremFit* smoothedBremFit) -{ - int closest_measurement_no( ClosestMeasurement(value, smoothedBremFit) ); - - double value_difference; - double phi_difference; - - if (closest_measurement_no == 0) { - value_difference = smoothedBremFit->GetValue(closest_measurement_no) - smoothedBremFit->GetValue(closest_measurement_no + 1); - phi_difference = smoothedBremFit->GetPhi(closest_measurement_no) - smoothedBremFit->GetPhi(closest_measurement_no + 1); - } - - else { - value_difference = smoothedBremFit->GetValue(closest_measurement_no) - smoothedBremFit->GetValue(closest_measurement_no - 1); - phi_difference = smoothedBremFit->GetPhi(closest_measurement_no) - smoothedBremFit->GetPhi(closest_measurement_no - 1); - } - - double gradient( phi_difference/value_difference ); - double estimated_phi; - if (closest_measurement_no == 0) - estimated_phi = smoothedBremFit->GetPhi(closest_measurement_no+1) + gradient*(value - smoothedBremFit->GetValue(closest_measurement_no + 1)); - else - estimated_phi = smoothedBremFit->GetPhi(closest_measurement_no-1) + gradient*(value - smoothedBremFit->GetValue(closest_measurement_no - 1)); - - return estimated_phi; - -} - -void Trk::BremFind::CalibrateValue() -{ - double new_value(0); - double max_value_measurement(m_smoothedBremFit->LastFitMeasurement()); - double min_value_measurement(m_smoothedBremFit->FirstFitMeasurement()); - - - for (int counter(0); counter < (int) m_brem_value->size(); counter++) { - - double smoothed_kink((*m_smoothed_kink)[counter]); - double forward_kink((*m_forward_kink)[counter]); - new_value = ((max_value_measurement - min_value_measurement)-((*m_brem_value)[counter]-min_value_measurement))*smoothed_kink/(max_value_measurement-min_value_measurement); - new_value += ((*m_brem_value)[counter]-min_value_measurement)*forward_kink/(max_value_measurement-min_value_measurement); - m_brem_valueCalibrated->push_back( new_value ); - } -} - - -//This function uses the closest measurement trackparameter and propagates to the brem surface -//and returns the global position at the intersection. It also fills a vector of trackparameters -//at the brem surface. -Amg::Vector3D Trk::BremFind::SurfacePosition(const Trk::TrackParameters& trackparameter, const Trk::Surface& surface, double bremvalue, double bremphi, double bremtheta) -{ - const Trk::TrackParameters* surfaceParameters1; - const Trk::TrackParameters* surfaceParameters2; - - Amg::Vector3D Pos1 (0, 0, 0); - Amg::Vector3D Pos2 (0, 0, 0); - double phidifference1(0.), phidifference2(0.); - - //Pushing back just the global position of the brem not the extrapolated - double x,y,z,r; - if (m_Z_mode) { - x = bremvalue * tan(bremtheta) * cos(bremphi); - y = bremvalue * tan(bremtheta) * sin(bremphi); - z = bremvalue; - r = sqrt(x*x+y*y); - } - else { - x = bremvalue * cos(bremphi); - y = bremvalue * sin(bremphi); - z = bremvalue * cos(bremtheta); - r = bremvalue; - } - - const Amg::Vector3D position(x,y,z); - const Amg::Vector3D momentum((&trackparameter)->momentum()); - - ATH_MSG_DEBUG("x,y,z,r = " << x << "," << y << "," << z << "," << r); - ATH_MSG_DEBUG("momentum = " << momentum.mag()); - ATH_MSG_DEBUG("charge = " << (&trackparameter)->charge()); - - if (!m_usePropagate && momentum.mag() > 0) { - - Amg::Transform3D *trans = new Amg::Transform3D(trackparameter.associatedSurface().transform()); - Trk::CylinderSurface cylinderSurface(trans, r, 5000.0); - const Trk::TrackParameters *bremParameters = new AtaCylinder(position, momentum, (&trackparameter)->charge(), cylinderSurface); - - //Broken code - causes FPEs. - //Trk::CylinderSurface cylinderSurface(new Amg::Transform3D, r, 5000.0); - - m_brem_TrackParameters.push_back(bremParameters); - return position; - } - - //function will propagate both ways and return the trackparameter that has the closest phi - //to the measured brem phi angle - surfaceParameters1 = m_propagator->propagate(trackparameter,surface,Trk::oppositeMomentum,true,m_fieldProperties,electron); - if (surfaceParameters1) { - Pos1 = surfaceParameters1->position(); - double phi1(atan(Pos1.y()/Pos1.x())); - phidifference1 = UniqueAngle(phi1 - bremphi); - } - surfaceParameters2 = m_propagator->propagate(trackparameter,surface,Trk::alongMomentum,true,m_fieldProperties,electron); - if (surfaceParameters2) { - Pos2 = surfaceParameters2->position(); - double phi2((Pos2.y()/Pos2.x())); - phidifference2 = UniqueAngle(phi2 - bremphi); - } - if (surfaceParameters1 && !surfaceParameters2) { - m_brem_TrackParameters.push_back(surfaceParameters1); - return Pos1; - } - else if (!surfaceParameters1 && surfaceParameters2) { - m_brem_TrackParameters.push_back(surfaceParameters2); - return Pos2; - } - else if (surfaceParameters1 && surfaceParameters2) { - if (phidifference1 > phidifference2) { - m_brem_TrackParameters.push_back(surfaceParameters2); - return Pos2; - } - else { - m_brem_TrackParameters.push_back(surfaceParameters1); - return Pos1; - } - - } - - //backup method. This really shouldn't be called - const Trk::TrackParameters* surfaceParameters3 = m_propagator->propagate(trackparameter,surface,Trk::anyDirection,true,m_fieldProperties,electron); - if (surfaceParameters3) { - m_brem_TrackParameters.push_back(surfaceParameters3); - return surfaceParameters3->position(); - } - m_brem_TrackParameters.push_back(0); - Amg::Vector3D nullPos(0.0,0.0,0.0); - return nullPos; -} - -const Trk::Surface* Trk::BremFind::ClosestSurface(double, double, double, const Trk::TrackParameters& trackparameter) -{ - const Trk::Layer* associatedLayer = m_trackingGeometry->closestMaterialLayer<const Trk::TrackParameters>(trackparameter).object; - if (associatedLayer) { - m_brem_layers.push_back(associatedLayer); - const Trk::Surface* associatedSurface = &(associatedLayer->surfaceRepresentation()); - return associatedSurface; - } - else { - m_brem_layers.push_back(0); - } - - return 0; -} - - -StatusCode Trk::BremFind::retrieveTrackingGeometry() -{ - // Retrieve the TrackingGeometry from the DetectorStore - StatusCode sc = detStore()->retrieve(m_trackingGeometry, m_trackingGeometryName); - if (sc.isFailure()){ - msg(MSG::FATAL) << "Could not retrieve TrackingGeometry from DetectorStore!" << endmsg; - } - return sc; - -} - -double Trk::BremFind::UniqueAngle(double phi) -{ - if (phi > TMath::Pi()) { - return UniqueAngle(phi - TMath::Pi()); - } - else if (phi < 0.0) { - return UniqueAngle(phi + TMath::Pi()); - } - return phi; -} - -int Trk::BremFind::GetNBrems() -{ - return m_nBrems; -} - -void Trk::BremFind::MakeTrackStateOnSurfaces () -{ - - for (int make_counter(0); make_counter < m_nBrems; make_counter++) { - - std::bitset<TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> typePattern; - typePattern.set(TrackStateOnSurface::BremPoint); - const Trk::TrackStateOnSurface* BremTrackStateOnSurface = new Trk::TrackStateOnSurface(0,m_brem_TrackParameters[make_counter],0,m_EstimatedBremOnTrack[make_counter],typePattern); - - if (!m_Z_mode) - m_brem_trackStateOnSurface.push_back(BremTrackStateOnSurface); - else - delete BremTrackStateOnSurface; - - } - -} - -const Trk::TrackStateOnSurface* Trk::BremFind::GetEstimatedBremOnTrack(int n) -{ - return m_brem_trackStateOnSurface[n]; -} - - -//A function that rates the quality of a bremsstrahlung signal based on the separation quality -//of the forward and smoothed fit. A lower score indicates that the measurements are unlikely to -//be the same value. Therefore a lower score means a better fit. - -void Trk::BremFind::SeparationQuality(std::vector<double> *backwardkink, std::vector<double> *forwardkink) -{ - int ForwardHit_Counter(0); - int SmoothHit_Counter(1); - std::vector<double> OverlapScore(0); - std::vector<double> OverlapErr(0); - - - for (int kink_counter(0); kink_counter < (int) backwardkink->size(); kink_counter++) { - - OverlapScore.clear(); - OverlapErr.clear(); - - ForwardHit_Counter = 0; - SmoothHit_Counter = 1; - - for (; ForwardHit_Counter < (int) m_forward_1overP->size(); ForwardHit_Counter++,SmoothHit_Counter++) { - - - if ( (*m_forward_value)[ForwardHit_Counter] > (*backwardkink)[kink_counter] && (*m_forward_value)[ForwardHit_Counter] < (*forwardkink)[kink_counter] && (*m_smooth_value)[SmoothHit_Counter] > (*backwardkink)[kink_counter] && (*m_smooth_value)[SmoothHit_Counter] < (*forwardkink)[kink_counter]) { - - std::pair<double,double> probabilitypair(ProbabilityScore((*m_forward_1overP)[ForwardHit_Counter],3*(*m_forward_1overPerr)[ForwardHit_Counter],(*m_smooth_1overP)[SmoothHit_Counter],3*(*m_smooth_1overPerr)[SmoothHit_Counter])); - OverlapScore.push_back(probabilitypair.first); - OverlapErr.push_back(probabilitypair.second); - - } - - } - - //Now combing the multiple measurements into one score - - double sum1(0); - double sum2(0); - double LowestScore(1.0); - double LowestScoreErr(0.0); - - for(int score_counter(0); score_counter < (int) OverlapScore.size(); score_counter++) { - - sum1 += OverlapScore[score_counter]/(pow(OverlapErr[score_counter],2)); - sum2 += 1/(pow(OverlapErr[score_counter],2)); - - if (OverlapScore[score_counter] < LowestScore || score_counter==0) { - LowestScore = OverlapScore[score_counter]; - LowestScoreErr = OverlapErr[score_counter]; - } - } - - if (sum2==0) { - m_KinkSeparationScores->push_back(1.0); - m_KinkSeparationScoresErr->push_back(0.0); - } - else { - m_KinkSeparationScores->push_back(sum1/sum2); - m_KinkSeparationScoresErr->push_back(LowestScoreErr); - //m_KinkSeparationScoresErr->push_back(1/sqrt(sum2)); - } - - } - -} - - -std::pair<double,double> Trk::BremFind::ProbabilityScore(double Gauss1_mean, double Gauss1_var, double Gauss2_mean, double Gauss2_var) -{ - double value(exp(-(Gauss1_mean - Gauss2_mean)*(Gauss1_mean - Gauss2_mean)/(2*(Gauss1_var*Gauss1_var + Gauss2_var*Gauss2_var)))*(1/Gauss1_var*Gauss2_var*2*sqrt(TMath::Pi()))*sqrt(2*Gauss1_var*Gauss1_var*Gauss2_var*Gauss2_var/(Gauss1_var*Gauss1_var + Gauss2_var*Gauss2_var))); - double error(value*(Gauss1_mean - Gauss2_mean)*(Gauss1_var + Gauss2_var)/(Gauss1_var*Gauss1_var + Gauss2_var*Gauss2_var)); - - std::pair<double,double> probabilityscore; - probabilityscore.first = value; - probabilityscore.second = fabs(error); - - return probabilityscore; - -} diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/src/CloseComponentsMultiStateMerger.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/src/CloseComponentsMultiStateMerger.cxx index 8ba081b3e636310e18707a096448294a53f9a4d3..f008ec20a67b48c9073dd3976d85f2df096b404c 100644 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/src/CloseComponentsMultiStateMerger.cxx +++ b/Tracking/TrkFitter/TrkGaussianSumFilter/src/CloseComponentsMultiStateMerger.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ /********************************************************************************* @@ -122,8 +122,10 @@ const Trk::MultiComponentState* Trk::CloseComponentsMultiStateMerger::merge(cons unsigned int numberOfComponents = unmergedState.size(); + //Assembler Cache + IMultiComponentStateAssembler::Cache cache; // Check that the assember is reset - bool isAssemblerReset = m_stateAssembler->reset(); + bool isAssemblerReset = m_stateAssembler->reset(cache); if ( !isAssemblerReset ){ msg(MSG::ERROR) << "Could not reset the state assembler... returning 0" << endmsg; @@ -248,7 +250,7 @@ const Trk::MultiComponentState* Trk::CloseComponentsMultiStateMerger::merge(cons for ( ; mapComponent != unmergedComponentsMap.end(); ++mapComponent){ // Add component to state being prepared for assembly and check that it is valid - bool componentAdded = m_stateAssembler->addComponent(mapComponent->second); + bool componentAdded = m_stateAssembler->addComponent(cache,mapComponent->second); if ( !componentAdded ) msg(MSG::WARNING) << "Component could not be added to the state in the assembler" << endmsg; @@ -263,7 +265,7 @@ const Trk::MultiComponentState* Trk::CloseComponentsMultiStateMerger::merge(cons for ( ; mapComponent != mergedComponentsMap.end(); ++mapComponent){ // Add component to state being prepared for assembly and check that it is valid - bool componentAdded = m_stateAssembler->addComponent(mapComponent->second); + bool componentAdded = m_stateAssembler->addComponent(cache,mapComponent->second); if ( !componentAdded ) msg(MSG::WARNING) << "Component could not be added to the state in the assembler" << endmsg; @@ -273,7 +275,7 @@ const Trk::MultiComponentState* Trk::CloseComponentsMultiStateMerger::merge(cons } - const Trk::MultiComponentState* mergedState = m_stateAssembler->assembledState(); + const Trk::MultiComponentState* mergedState = m_stateAssembler->assembledState(cache); if (msgLvl(MSG::VERBOSE)) msg() << "Number of components in merged state: " << mergedState->size() << endmsg; diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GaussianSumFitter.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GaussianSumFitter.cxx index 0bebf8563fe0a42c2410eb4218b629239a54be40..b7c020558af810a90fa10d0a96760e36e67955d5 100644 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GaussianSumFitter.cxx +++ b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GaussianSumFitter.cxx @@ -18,7 +18,6 @@ decription : Implementation code for Gaussian Sum Fitter class #include "TrkGaussianSumFilter/IMultiStateExtrapolator.h" #include "TrkGaussianSumFilter/IForwardGsfFitter.h" #include "TrkGaussianSumFilter/IGsfSmoother.h" -#include "TrkGaussianSumFilter/IBremsstrahlungFinder.h" #include "TrkEventUtils/MeasurementBaseComparisonFunction.h" #include "TrkEventUtils/PrepRawDataComparisonFunction.h" @@ -61,13 +60,10 @@ Trk::GaussianSumFitter::GaussianSumFitter(const std::string& type, const std::st m_reintegrateOutliers(false), m_makePerigee(true), m_directionToPerigee(Trk::oppositeMomentum), - m_runBremFinder(false), m_refitOnMeasurementBase(true), m_doHitSorting(true), m_trkParametersComparisonFunction(0), m_stateCombiner("Trk::MultiComponentStateCombiner"), - m_BremFind("Trk::BremFind"), - m_BremFind2("Trk::BremFind"), m_chronoSvc("ChronoStatSvc", name), m_inputPreparator(0), m_FitPRD(0), @@ -130,9 +126,6 @@ Trk::GaussianSumFitter::GaussianSumFitter(const std::string& type, const std::st declareProperty("SortingReferencePoint", m_sortingReferencePoint ); declareProperty("StateCombiner", m_stateCombiner ); declareProperty("ValidationMode", m_validationMode ); - declareProperty("BremFind", m_BremFind ); - declareProperty("BremFind2", m_BremFind2 ); - declareProperty("runBremFinder", m_runBremFinder ); declareProperty("GsfSmoother",m_gsfSmoother); declareProperty("ForwardGsfFitter",m_forwardGsfFitter); declareProperty("EventInfoKey", m_readKey="EventInfo"); @@ -169,17 +162,6 @@ StatusCode Trk::GaussianSumFitter::initialize() // Request the state combiner ATH_CHECK ( m_stateCombiner.retrieve() ); - //Request the brem finder - if (m_runBremFinder){ - if ( m_BremFind.retrieve().isFailure() || m_BremFind2.retrieve().isFailure() ) { - msg(MSG::WARNING) << "Request is to retrieve the bremsstrahlung finder failed... turning off brem finding!" << endmsg; - m_runBremFinder = false; - } - } - else { - m_BremFind.disable(); - m_BremFind2.disable(); - } // Request the RIO_OnTrack creator // No need to return if RioOnTrack creator tool, only if PrepRawData is used in fit @@ -573,16 +555,7 @@ Trk::Track* Trk::GaussianSumFitter::fit ( const Trk::PrepRawDataSet& prepRawD } } - //Find bremsstrahlung points and save them - if (m_runBremFinder) { - if (msgLvl(MSG::DEBUG)) msg() << "Entering the BremFind tool" << endmsg; - - //The z mode must be ahead of the r mode to make sure the right TSOS is being pushed into the smoothedTrajectory - m_BremFind2->BremFinder(*forwardTrajectory, *smoothedTrajectory,true); - m_BremFind->BremFinder(*forwardTrajectory, *smoothedTrajectory,false); - - } - + // Delete forward trajectory. New memory was assigned in ForwardGsfFitter. delete forwardTrajectory; @@ -594,15 +567,7 @@ Trk::Track* Trk::GaussianSumFitter::fit ( const Trk::PrepRawDataSet& prepRawD //Reverse the order of the TSOS's to make be order flow from inside to out std::reverse(smoothedTrajectory->begin(), smoothedTrajectory->end()); - //Add brem information to Track - if (m_runBremFinder) { - //Filling in the brem information in the smoothedTrajectory - for (int brem_counter(0); brem_counter < m_BremFind->GetNBrems(); brem_counter++) { - smoothedTrajectory->push_back(m_BremFind->GetEstimatedBremOnTrack(brem_counter)); - } - } - - + // Create new track Trk::TrackInfo info(Trk::TrackInfo::GaussianSumFilter, particleHypothesis); info.setTrackProperties(TrackInfo::BremFit); @@ -753,15 +718,6 @@ Trk::Track* Trk::GaussianSumFitter::fit ( const Trk::MeasurementSet& measurem } } - //Find bremsstrahlung points and save them - if (m_runBremFinder) { - if (msgLvl(MSG::DEBUG)) msg() << "Entering the BremFind tool" << endmsg; - - //The z mode must be ahead of the r mode to make sure the right TSOS is being pushed into the smoothedTrajectory - m_BremFind2->BremFinder(*forwardTrajectory, *smoothedTrajectory,true); - m_BremFind->BremFinder(*forwardTrajectory, *smoothedTrajectory,false); - } - //Delete forward trajectory. New memory was assigned in ForwardGsfFitter. delete forwardTrajectory; @@ -774,14 +730,7 @@ Trk::Track* Trk::GaussianSumFitter::fit ( const Trk::MeasurementSet& measurem //Reverse the order of the TSOS's to make be order flow from inside to out std::reverse(smoothedTrajectory->begin(), smoothedTrajectory->end()); - //Add brem information to the track - if (m_runBremFinder) { - //Filling in the brem information in the smoothedTrajectory - for (int brem_counter(0); brem_counter < m_BremFind->GetNBrems(); brem_counter++) { - smoothedTrajectory->push_back(m_BremFind->GetEstimatedBremOnTrack(brem_counter)); - } - } - + // Create new track Trk::TrackInfo info(Trk::TrackInfo::GaussianSumFilter, particleHypothesis); info.setTrackProperties(TrackInfo::BremFit); diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfMaterialEffectsUpdator.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfMaterialEffectsUpdator.cxx index fad26c45ee0036814d53eb53ccd7362c81131ef3..220415cf2e3fd2229e1feb0b98f3b3243c505c7f 100644 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfMaterialEffectsUpdator.cxx +++ b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfMaterialEffectsUpdator.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ /*********************************************************************************** @@ -55,12 +55,6 @@ StatusCode Trk::GsfMaterialEffectsUpdator::initialize () return StatusCode::FAILURE; } - // Retrieve an instance of the multi-component state assembler service - if ( m_stateAssembler.retrieve().isFailure() ){ - msg(MSG::FATAL) << "Could not retrieve multi-component state assembler tool... Exiting!" << endmsg; - return StatusCode::FAILURE; - } - msg(MSG::INFO) << "Initialisation of " << name() << " was successful" << endmsg; return StatusCode::SUCCESS; @@ -397,16 +391,7 @@ const Trk::MultiComponentState* Trk::GsfMaterialEffectsUpdator::compute ( const // msg(MSG::VERBOSE) << "Computing updated parameters, covariances and weights" << endmsg; Trk::MultiComponentState* computedState = new Trk::MultiComponentState(); - - // Check that the assember is reset - bool isAssemblerReset = m_stateAssembler->reset(); - - if ( !isAssemblerReset ){ - msg(MSG::ERROR) << "Could not reset the state assembler... returning 0" << endmsg; - return 0; - } - - /* Get values for: + /* Get values for: - Change in momentum - Change in covariance of momentum - Weights of new states diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfMaterialMixtureConvolution.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfMaterialMixtureConvolution.cxx index fef1e8f891fc336ba54e09650500dd82e592af05..e2d80e1a540f6bf7e2aeca0c4bedc0c389350751 100644 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfMaterialMixtureConvolution.cxx +++ b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfMaterialMixtureConvolution.cxx @@ -97,9 +97,11 @@ const Trk::MultiComponentState* Trk::GsfMaterialMixtureConvolution::update( cons /* ------------------------------------- Preliminary checks ------------------------------------- */ - + + //Assembler Cache + IMultiComponentStateAssembler::Cache cache; // Reset the assembler and check - bool isAssemblerReset = m_stateAssembler->reset(); + bool isAssemblerReset = m_stateAssembler->reset(cache); if ( !isAssemblerReset ){ msg(MSG::ERROR) << "Could not reset the state assembler... returning clone of original state" << endmsg; @@ -124,7 +126,7 @@ const Trk::MultiComponentState* Trk::GsfMaterialMixtureConvolution::update( cons continue; } - bool componentAdded = m_stateAssembler->addMultiState( *updatedState ); + bool componentAdded = m_stateAssembler->addMultiState( cache,*updatedState ); // New memory allocated in the combiner so it is ok to delete the original state delete updatedState; @@ -134,7 +136,7 @@ const Trk::MultiComponentState* Trk::GsfMaterialMixtureConvolution::update( cons } - const Trk::MultiComponentState* assembledState = m_stateAssembler->assembledState(); + const Trk::MultiComponentState* assembledState = m_stateAssembler->assembledState(cache); if(!assembledState) return 0; @@ -170,9 +172,10 @@ const Trk::MultiComponentState* Trk::GsfMaterialMixtureConvolution::preUpdate( c /* ------------------------------------- Preliminary checks ------------------------------------- */ - + //Assembler Cache + IMultiComponentStateAssembler::Cache cache; // Reset the assembler and check - bool isAssemblerReset = m_stateAssembler->reset(); + bool isAssemblerReset = m_stateAssembler->reset(cache); if ( !isAssemblerReset ){ msg(MSG::ERROR) << "Could not reset the state assembler... returning clone of original state" << endmsg; @@ -197,7 +200,7 @@ const Trk::MultiComponentState* Trk::GsfMaterialMixtureConvolution::preUpdate( c continue; } - bool componentAdded = m_stateAssembler->addMultiState( *updatedState ); + bool componentAdded = m_stateAssembler->addMultiState( cache,*updatedState ); // New memory allocated in the combiner so it is ok to delete the original state delete updatedState; @@ -207,7 +210,7 @@ const Trk::MultiComponentState* Trk::GsfMaterialMixtureConvolution::preUpdate( c } - const Trk::MultiComponentState* assembledState = m_stateAssembler->assembledState(); + const Trk::MultiComponentState* assembledState = m_stateAssembler->assembledState(cache); if(!assembledState) return 0; @@ -244,8 +247,10 @@ const Trk::MultiComponentState* Trk::GsfMaterialMixtureConvolution::postUpdate( Preliminary checks ------------------------------------- */ + //Assembler Cache + IMultiComponentStateAssembler::Cache cache; // Reset the assembler and check - bool isAssemblerReset = m_stateAssembler->reset(); + bool isAssemblerReset = m_stateAssembler->reset(cache); if ( !isAssemblerReset ){ msg(MSG::ERROR) << "Could not reset the state assembler... returning clone of original state" << endmsg; @@ -270,7 +275,7 @@ const Trk::MultiComponentState* Trk::GsfMaterialMixtureConvolution::postUpdate( continue; } - bool componentAdded = m_stateAssembler->addMultiState( *updatedState ); + bool componentAdded = m_stateAssembler->addMultiState( cache,*updatedState ); // New memory allocated in the combiner so it is ok to delete the original state delete updatedState; @@ -280,7 +285,7 @@ const Trk::MultiComponentState* Trk::GsfMaterialMixtureConvolution::postUpdate( } - const Trk::MultiComponentState* assembledState = m_stateAssembler->assembledState(); + const Trk::MultiComponentState* assembledState = m_stateAssembler->assembledState(cache); if(!assembledState) return 0; @@ -310,9 +315,10 @@ const Trk::MultiComponentState* Trk::GsfMaterialMixtureConvolution::simpliedMate /* ------------------------------------- Preliminary checks ------------------------------------- */ - + //Assembler Cache + IMultiComponentStateAssembler::Cache cache; // Reset the assembler and check - bool isAssemblerReset = m_stateAssembler->reset(); + bool isAssemblerReset = m_stateAssembler->reset(cache); if ( !isAssemblerReset ){ msg(MSG::ERROR) << "Could not reset the state assembler... returning clone of original state" << endmsg; @@ -377,7 +383,7 @@ const Trk::MultiComponentState* Trk::GsfMaterialMixtureConvolution::simpliedMate bool componentAdded = false; if ( updatedState ) - componentAdded = m_stateAssembler->addMultiState( *updatedState ); + componentAdded = m_stateAssembler->addMultiState( cache,*updatedState ); if ( !componentAdded ) msg(MSG::WARNING) << "Component could not be added to the state in the assembler" << endmsg; @@ -387,7 +393,7 @@ const Trk::MultiComponentState* Trk::GsfMaterialMixtureConvolution::simpliedMate } // end loop over components - const Trk::MultiComponentState* assembledState = m_stateAssembler->assembledState(); + const Trk::MultiComponentState* assembledState = m_stateAssembler->assembledState(cache); // Renormalise the state const Trk::MultiComponentState* renormalisedState = assembledState->clonedRenormalisedState(); diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfMeasurementUpdator.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfMeasurementUpdator.cxx index 7561b2106fbe2fdc1a1a0edcea03169d3601e6c9..005d4c24940efb98a312ff52cbfcf9a2ed05eed4 100644 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfMeasurementUpdator.cxx +++ b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfMeasurementUpdator.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ /********************************************************************************* @@ -99,24 +99,17 @@ const Trk::MultiComponentState* Trk::GsfMeasurementUpdator::update (const Trk::M rebuildStateWithErrors = rebuildStateWithErrors || invalidComponent( component->first ) ; } - if ( rebuildStateWithErrors ){ - + if (rebuildStateWithErrors){ ATH_MSG_VERBOSE( "Rebuilding state with errors"); - Trk::MultiComponentState* stateWithInsertedErrors = rebuildState( stateBeforeUpdate ); - // Perform the measurement update with the modified state updatedState = calculateFilterStep(*stateWithInsertedErrors, measurement, updator); - delete stateWithInsertedErrors; - if ( !updatedState ) { ATH_MSG_DEBUG("Updated state could not be calculated... Returning 0" ); - return 0; + return nullptr; } - return updatedState; - } // Perform the measurement update @@ -124,7 +117,7 @@ const Trk::MultiComponentState* Trk::GsfMeasurementUpdator::update (const Trk::M if ( !updatedState ) { ATH_MSG_DEBUG("Updated state could not be calculated... Returning 0" ); - return 0; + return nullptr; } return updatedState; @@ -200,8 +193,10 @@ Trk::GsfMeasurementUpdator::calculateFilterStep( const Trk::MultiComponentState& // Start the timer //Chrono chrono( &(*m_chronoSvc), "GsfMeasurementUpdate" ); + //state Assembler cache + IMultiComponentStateAssembler::Cache cache; // Check that the assember is reset - bool isAssemblerReset = m_stateAssembler->reset(); + bool isAssemblerReset = m_stateAssembler->reset(cache); if ( !isAssemblerReset ){ ATH_MSG_DEBUG("Could not reset the state assembler... returning 0"); @@ -264,7 +259,7 @@ Trk::GsfMeasurementUpdator::calculateFilterStep( const Trk::MultiComponentState& Trk::ComponentParameters updatedComponentParameters(updatedTrackParameters, component->second); // Add component to state being prepared for assembly and check that it is valid - bool componentAdded = m_stateAssembler->addComponent(updatedComponentParameters); + bool componentAdded = m_stateAssembler->addComponent(cache,updatedComponentParameters); if ( !componentAdded ) ATH_MSG_DEBUG( "Component could not be added to the state in the assembler"); @@ -275,24 +270,23 @@ Trk::GsfMeasurementUpdator::calculateFilterStep( const Trk::MultiComponentState& delete stateWithNewWeights; - const Trk::MultiComponentState* assembledUpdatedState = m_stateAssembler->assembledState(); + const Trk::MultiComponentState* assembledUpdatedState = m_stateAssembler->assembledState(cache); - if(!assembledUpdatedState) + if(!assembledUpdatedState){ return 0; + } // Renormalise state const Trk::MultiComponentState* renormalisedUpdatedState = assembledUpdatedState->clonedRenormalisedState(); // Clean up memory delete assembledUpdatedState; - - + ATH_MSG_VERBOSE( "Successful calculation of filter step"); return renormalisedUpdatedState; - } @@ -361,8 +355,10 @@ Trk::GsfMeasurementUpdator::calculateFilterStep( const Trk::MultiComponentState& // Start the timer //Chrono chrono( &(*m_chronoSvc), "GsfMeasurementUpdate" ); + //state Assembler cache + IMultiComponentStateAssembler::Cache cache; // Check that the assember is reset - bool isAssemblerReset = m_stateAssembler->reset(); + bool isAssemblerReset = m_stateAssembler->reset(cache); if ( !isAssemblerReset ){ ATH_MSG_ERROR("Could not reset the state assembler... returning 0"); @@ -455,7 +451,7 @@ Trk::GsfMeasurementUpdator::calculateFilterStep( const Trk::MultiComponentState& Trk::ComponentParameters updatedComponentParameters(updatedTrackParameters, component->second); // Add component to state being prepared for assembly and check that it is valid - bool componentAdded = m_stateAssembler->addComponent(updatedComponentParameters); + bool componentAdded = m_stateAssembler->addComponent(cache,updatedComponentParameters); if ( !componentAdded ) ATH_MSG_DEBUG( "Component could not be added to the state in the assembler"); @@ -466,7 +462,7 @@ Trk::GsfMeasurementUpdator::calculateFilterStep( const Trk::MultiComponentState& delete stateWithNewWeights; - const Trk::MultiComponentState* assembledUpdatedState = m_stateAssembler->assembledState(); + const Trk::MultiComponentState* assembledUpdatedState = m_stateAssembler->assembledState(cache); if(!assembledUpdatedState) return 0; diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/src/LargestWeightsMultiStateMerger.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/src/LargestWeightsMultiStateMerger.cxx index fdfb6184d81f1297ffbf397854bec6efd7844aff..6697551091149795bf1cd4e7f6b09cd4ce446efe 100644 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/src/LargestWeightsMultiStateMerger.cxx +++ b/Tracking/TrkFitter/TrkGaussianSumFilter/src/LargestWeightsMultiStateMerger.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ /*********************************************************************************** @@ -68,8 +68,10 @@ const Trk::MultiComponentState* Trk::LargestWeightsMultiStateMerger::merge(const if (m_outputlevel < 0) msg(MSG::VERBOSE) << "Merging state with " << multiComponentState.size() << " components" << endmsg; + //state Assembler cache + IMultiComponentStateAssembler::Cache cache; // Check that the assember is reset - bool isAssemblerReset = m_stateAssembler->reset(); + bool isAssemblerReset = m_stateAssembler->reset(cache); if ( !isAssemblerReset ){ msg(MSG::ERROR) << "Could not reset the state assembler... returning 0" << endmsg; @@ -109,7 +111,7 @@ const Trk::MultiComponentState* Trk::LargestWeightsMultiStateMerger::merge(const if (numberOfComponents < m_maximumNumberOfComponents){ // Add component to state being prepared for assembly and check that it is valid - bool componentAdded = m_stateAssembler->addComponent(*component); + bool componentAdded = m_stateAssembler->addComponent(cache,*component); if ( !componentAdded ) msg(MSG::WARNING) << "Component could not be added to the state in the assembler" << endmsg; @@ -130,7 +132,7 @@ const Trk::MultiComponentState* Trk::LargestWeightsMultiStateMerger::merge(const delete componentsForCollapse; // Add component to state being prepared for assembly and check that it is valid - bool componentAdded = m_stateAssembler->addComponent(*collapsedComponent); + bool componentAdded = m_stateAssembler->addComponent(cache,*collapsedComponent); // Memory clean-up delete collapsedComponent->first; @@ -139,10 +141,8 @@ const Trk::MultiComponentState* Trk::LargestWeightsMultiStateMerger::merge(const if ( !componentAdded ) msg(MSG::WARNING) << "Component could not be added to the state in the assembler" << endmsg; - const Trk::MultiComponentState* assembledState = m_stateAssembler->assembledState(1.); - + const Trk::MultiComponentState* assembledState = m_stateAssembler->assembledState(cache,1.); delete unmergedState; return assembledState; - } diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/src/MultiComponentStateAssembler.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/src/MultiComponentStateAssembler.cxx index d1db64f2fe43b1c8dc7ca3ed527dc50a71a39f5b..c5070058c1ea6a56604443981a7ba995be13057a 100755 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/src/MultiComponentStateAssembler.cxx +++ b/Tracking/TrkFitter/TrkGaussianSumFilter/src/MultiComponentStateAssembler.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ /********************************************************************************* @@ -16,23 +16,12 @@ description : Implementation code for MultiComponentStateAssembler #include "TrkGaussianSumFilter/SortingClasses.h" #include "TrkParameters/TrackParameters.h" -Trk::MultiComponentStateAssembler::MultiComponentStateAssembler (const std::string& type, const std::string& name, const IInterface* parent) - : - AthAlgTool(type, name, parent), - m_outputlevel(0), - m_assemblyDone(false), - m_minimumFractionalWeight(1.e-9), - m_minimumValidFraction(0.01), - m_validWeightSum(0.), - m_invalidWeightSum(0.), - m_multiComponentState( new Trk::MultiComponentState() ) -{ - +Trk::MultiComponentStateAssembler::MultiComponentStateAssembler (const std::string& type, + const std::string& name, + const IInterface* parent) + : AthAlgTool(type, name, parent) +{ declareInterface<IMultiComponentStateAssembler>(this); - - declareProperty("minimumFractionalWeight", m_minimumFractionalWeight); - declareProperty("minimumValidFraction", m_minimumValidFraction); - } Trk::MultiComponentStateAssembler::~MultiComponentStateAssembler () @@ -40,125 +29,92 @@ Trk::MultiComponentStateAssembler::~MultiComponentStateAssembler () StatusCode Trk::MultiComponentStateAssembler::initialize(){ - m_outputlevel = msg().level()-MSG::DEBUG; // save the threshold for debug printout in private member - - if (m_outputlevel < 0) - msg(MSG::VERBOSE) << "Initialisation of " << name() << " successful" << endmsg; - + ATH_MSG_DEBUG("Initialisation of " << name() << " successful \n"); return StatusCode::SUCCESS; } StatusCode Trk::MultiComponentStateAssembler::finalize(){ - delete m_multiComponentState; - - if (m_outputlevel < 0) - msg(MSG::VERBOSE) << "Finalisation of " << name() << " successful" << endmsg; - + ATH_MSG_DEBUG ("Finalisation of " << name() << " successful \n"); return StatusCode::SUCCESS; - } -bool Trk::MultiComponentStateAssembler::reset() +bool Trk::MultiComponentStateAssembler::reset(Cache& cache) const { - if (m_outputlevel < 0) - msg(MSG::VERBOSE) << "Resetting the MultiComponentStateAssembler: " << name() << endmsg; - - m_assemblyDone = false; - - if ( !m_multiComponentState->empty() ){ - - Trk::MultiComponentState::const_iterator component = m_multiComponentState->begin(); - - for ( ; component != m_multiComponentState->end(); ++component ) + ATH_MSG_VERBOSE("Resetting the MultiComponentStateAssembler: " << name()<<"\n"); + cache.assemblyDone = false; + if (cache.multiComponentState.get()!=nullptr && !cache.multiComponentState->empty() ){ + Trk::MultiComponentState::const_iterator component = cache.multiComponentState->begin(); + for ( ; component != cache.multiComponentState->end(); ++component ){ delete component->first; - - m_multiComponentState->clear(); - + } + cache.multiComponentState->clear(); } - - m_validWeightSum = 0.; - m_invalidWeightSum = 0.; - + cache.validWeightSum = 0.; + cache.invalidWeightSum = 0.; return true; - } -void Trk::MultiComponentStateAssembler::status() const +void Trk::MultiComponentStateAssembler::status(const Cache& cache) const { - - if (m_outputlevel <= 0) { - std::cout << "**************** Current status of assembler: " << name() << " ****************" << std::endl; - std::cout << "Number of components in cached state: " << m_multiComponentState->size() << std::endl; - std::cout << "Assembly done? (Bool): " << m_assemblyDone << std::endl; - std::cout << "Total valid weight: " << m_validWeightSum << std::endl; - std::cout << "Total invalid weight: " << m_invalidWeightSum << std::endl; - std::cout << "**************** End assembler status ****************" << std::endl; - } - + ATH_MSG_DEBUG( "**************** Current status of assembler: " << name() << " **************** \n " + << "Number of components in cached state: " << cache.multiComponentState->size() << "\n" + << "Assembly done? (Bool): " << cache.assemblyDone << "\n" + << "Total valid weight: " << cache.validWeightSum << "\n" + << "Total invalid weight: " << cache.invalidWeightSum << "\n" + << "**************** End assembler status **************** \n"); } -bool Trk::MultiComponentStateAssembler::addComponent (const ComponentParameters& componentParameters){ +bool Trk::MultiComponentStateAssembler::addComponent (Cache& cache, const ComponentParameters& componentParameters) const{ - if (m_outputlevel < 0) - msg(MSG::VERBOSE) << "Adding single component to mixture" << endmsg; - - if ( m_assemblyDone ){ - msg(MSG::WARNING) << "Trying to add state after assembly... returning false" << endmsg; + ATH_MSG_VERBOSE ( "Adding single component to mixture \n"); + if ( cache.assemblyDone ){ + ATH_MSG_WARNING("Trying to add state after assembly... returning false \n"); return false; - } - - const Trk::ComponentParameters* clonedComponentParameters = new Trk::ComponentParameters( (componentParameters.first)->clone(), componentParameters.second); + } + const Trk::ComponentParameters* clonedComponentParameters = + new Trk::ComponentParameters( (componentParameters.first)->clone(), componentParameters.second); - if (m_outputlevel < 0) - msg(MSG::VERBOSE) << "Creating multiple component state from single component. Weight of state is: " << componentParameters.second << endmsg; + ATH_MSG_VERBOSE("Creating multiple component state from single component. Weight of state is: " + << componentParameters.second << "\n"); Trk::MultiComponentState* singleComponentList = new Trk::MultiComponentState(*clonedComponentParameters); - this->addComponentsList(singleComponentList); + this->addComponentsList(cache,singleComponentList); delete clonedComponentParameters; singleComponentList->clear(); delete singleComponentList; - return true; } -bool Trk::MultiComponentStateAssembler::addMultiState (const MultiComponentState& multiComponentState){ +bool Trk::MultiComponentStateAssembler::addMultiState (Cache& cache, const MultiComponentState& multiComponentState) const{ - if (m_outputlevel < 0) - msg(MSG::VERBOSE) << "Adding multiple component state to mixture" << endmsg; - - if ( m_assemblyDone ){ - msg(MSG::WARNING) << "Trying to add state after assembly... returning false" << endmsg; + ATH_MSG_VERBOSE("Adding multiple component state to mixture \n"); + if (cache.assemblyDone ){ + ATH_MSG_WARNING("Trying to add state after assembly... returning false \n"); return false; } - + Trk::MultiComponentState* clonedMultiComponentState = const_cast<Trk::MultiComponentState*>( multiComponentState.clone() ); - this->addComponentsList(clonedMultiComponentState); + this->addComponentsList(cache,clonedMultiComponentState); clonedMultiComponentState->clear(); delete clonedMultiComponentState; return true; } -bool Trk::MultiComponentStateAssembler::addInvalidComponentWeight (const double& invalidComponentWeight){ +bool Trk::MultiComponentStateAssembler::addInvalidComponentWeight (Cache& cache, const double invalidComponentWeight) const { - if (m_outputlevel < 0) - msg(MSG::VERBOSE) << "Adding the weight of an invalid state to the mixture" << endmsg; - - m_invalidWeightSum += invalidComponentWeight; - + ATH_MSG_VERBOSE( "Adding the weight of an invalid state to the mixture \n"); + cache.invalidWeightSum += invalidComponentWeight; return true; - } -void Trk::MultiComponentStateAssembler::addComponentsList (const MultiComponentState* multiComponentState){ +void Trk::MultiComponentStateAssembler::addComponentsList (Cache& cache, const MultiComponentState* multiComponentState) const{ - if (m_outputlevel < 0) - msg(MSG::VERBOSE) << "Add multiple component state to exisiting mixture" << endmsg; - - if ( m_assemblyDone ){ - msg(MSG::WARNING) << "Trying to add state after assembly" << endmsg; + ATH_MSG_VERBOSE ("Add multiple component state to exisiting mixture \n"); + if ( cache.assemblyDone ){ + ATH_MSG_WARNING( "Trying to add state after assembly \n"); return; } @@ -169,159 +125,140 @@ void Trk::MultiComponentStateAssembler::addComponentsList (const MultiComponentS sumW += (*component).second; - m_multiComponentState->insert( m_multiComponentState->end(), multiComponentState->begin(), multiComponentState->end() ); + cache.multiComponentState->insert(cache.multiComponentState->end(), multiComponentState->begin(), multiComponentState->end() ); - m_validWeightSum += sumW; + cache.validWeightSum += sumW; - if (m_outputlevel < 0) - msg(MSG::VERBOSE) << "Successfully inserted state" << endmsg; + ATH_MSG_VERBOSE( "Successfully inserted state \n"); } -bool Trk::MultiComponentStateAssembler::prepareStateForAssembly (){ +bool Trk::MultiComponentStateAssembler::prepareStateForAssembly (Cache& cache) const{ - if (m_outputlevel < 0) - msg(MSG::VERBOSE) << "Preparing state for assembly" << endmsg; + ATH_MSG_VERBOSE( "Preparing state for assembly \n"); // Protect against empty state - if ( !isStateValid () ){ - if (m_outputlevel <= 0) - msg(MSG::DEBUG) << "State is not valid... returning false" << endmsg; + if ( !isStateValid (cache) ){ + ATH_MSG_DEBUG("State is not valid... returning false \n"); return false; } // Check for minimum fraction of valid states - double validWeightFraction = m_validWeightSum / ( m_validWeightSum + m_invalidWeightSum ); + double validWeightFraction = cache.validWeightSum / ( cache.validWeightSum + cache.invalidWeightSum ); - if (m_invalidWeightSum > 0. && validWeightFraction < m_minimumValidFraction){ - if (m_outputlevel <= 0) - msg(MSG::DEBUG) << "Insufficient valid states in the state... returning false" << endmsg; + if (cache.invalidWeightSum > 0. && validWeightFraction < m_minimumValidFraction){ + ATH_MSG_DEBUG( "Insufficient valid states in the state... returning false \n"); return false; } - // Check to see assembly has not already been done - if ( m_assemblyDone ){ - if (m_outputlevel < 0) - msg(MSG::VERBOSE) << "Assembly of state already complete... returning true" << endmsg; + if ( cache.assemblyDone ){ + ATH_MSG_VERBOSE("Assembly of state already complete... returning true \n"); return true; } // Remove components with negligable weights - removeSmallWeights (); + removeSmallWeights (cache); // Now recheck to make sure the state is now still valid - if ( !isStateValid () ){ - if (m_outputlevel <= 0) - msg(MSG::DEBUG) << "After removal of small weights, state is invalid... returning false" << endmsg; + if ( !isStateValid (cache) ){ + ATH_MSG_DEBUG("After removal of small weights, state is invalid... returning false \n"); return false; } // Sort Multi-Component State by weights - m_multiComponentState->sort( SortByLargerComponentWeight() ); + cache.multiComponentState->sort( SortByLargerComponentWeight() ); // Set assembly flag - m_assemblyDone = true; + cache.assemblyDone = true; - if (m_outputlevel < 0) - msg(MSG::VERBOSE) << "State is prepared for assembly... returning true" << endmsg; + ATH_MSG_VERBOSE ("State is prepared for assembly... returning true \n"); return true; } const Trk::MultiComponentState* -Trk::MultiComponentStateAssembler::assembledState () { +Trk::MultiComponentStateAssembler::assembledState (Cache& cache) const{ - if (m_outputlevel < 0) - msg(MSG::VERBOSE) << "Finalising assembly... no specified reweighting" << endmsg; + ATH_MSG_VERBOSE( "Finalising assembly... no specified reweighting \n"); - if ( !prepareStateForAssembly() ) { - if (m_outputlevel <= 0) - msg(MSG::DEBUG) << "Unable to prepare state for assembly... returning 0" << endmsg; + if ( !prepareStateForAssembly(cache) ) { + ATH_MSG_DEBUG ("Unable to prepare state for assembly... returning 0 \n"); return 0; } - if (m_outputlevel < 0) - msg(MSG::VERBOSE) << "Successful preparation for assembly" << endmsg; + ATH_MSG_VERBOSE("Successful preparation for assembly \n"); - if ( m_invalidWeightSum > 0. || m_validWeightSum <= 0.) { - if (m_outputlevel < 0) - msg(MSG::VERBOSE) << "Assembling state with invalid weight components" << endmsg; - double totalWeight = m_validWeightSum + m_invalidWeightSum; - const Trk::MultiComponentState* stateAssembly = doStateAssembly(totalWeight); + if ( cache.invalidWeightSum > 0. || cache.validWeightSum <= 0.) { + ATH_MSG_VERBOSE("Assembling state with invalid weight components \n"); + double totalWeight = cache.validWeightSum + cache.invalidWeightSum; + const Trk::MultiComponentState* stateAssembly = doStateAssembly(cache,totalWeight); return stateAssembly; } - const Trk::MultiComponentState* multiComponentState = m_multiComponentState->clone(); - + const Trk::MultiComponentState* multiComponentState = cache.multiComponentState->clone(); // Reset state cache before leaving - this->reset(); - + this->reset(cache); + return multiComponentState; } const Trk::MultiComponentState* -Trk::MultiComponentStateAssembler::assembledState (const double& newWeight) { +Trk::MultiComponentStateAssembler::assembledState (Cache& cache, const double newWeight) const{ - if (m_outputlevel < 0) - msg(MSG::VERBOSE) << "Finalising assembly with reweighting of components" << endmsg; + ATH_MSG_VERBOSE( "Finalising assembly with reweighting of components \n"); - if ( !prepareStateForAssembly() ) { - if (m_outputlevel <= 0) - msg(MSG::DEBUG) << "Unable to prepare state for assembly... returing 0" << endmsg; + if ( !prepareStateForAssembly(cache) ) { + ATH_MSG_DEBUG("Unable to prepare state for assembly... returing 0 \n"); return 0; } - const Trk::MultiComponentState* stateAssembly = doStateAssembly(newWeight); + const Trk::MultiComponentState* stateAssembly = doStateAssembly(cache,newWeight); return stateAssembly; } const Trk::MultiComponentState* -Trk::MultiComponentStateAssembler::doStateAssembly (const double& newWeight) { +Trk::MultiComponentStateAssembler::doStateAssembly (Cache& cache, const double newWeight) const{ - if (m_outputlevel < 0) - msg(MSG::VERBOSE) << "Do state assembly" << endmsg; + ATH_MSG_VERBOSE( "Do state assembly \n"); - if ( !isStateValid() ) { - if (m_outputlevel < 0) - msg(MSG::VERBOSE) << "Cached state is empty... returning 0" << endmsg; + if ( !isStateValid(cache) ) { + ATH_MSG_VERBOSE( "Cached state is empty... returning 0 \n"); return 0; } - if (m_validWeightSum <= 0.) { - if (!m_multiComponentState->empty()) { - double fixedWeights = 1. / (double) m_multiComponentState->size(); - Trk::MultiComponentState::iterator component = m_multiComponentState->begin(); - for ( ; component != m_multiComponentState->end() ; ++component ){ + if (cache.validWeightSum <= 0.) { + if (!cache.multiComponentState->empty()) { + double fixedWeights = 1. / (double) cache.multiComponentState->size(); + Trk::MultiComponentState::iterator component = cache.multiComponentState->begin(); + for ( ; component != cache.multiComponentState->end() ; ++component ){ component->second = fixedWeights; } } - const Trk::MultiComponentState* assembledState = m_multiComponentState->clone(); + const Trk::MultiComponentState* assembledState = cache.multiComponentState->clone(); // Reset the cache before leaving - this->reset(); + this->reset(cache); return assembledState; } - double scalingFactor = m_validWeightSum > 0. ? newWeight / m_validWeightSum : 1. ; - const Trk::MultiComponentState* assembledState = m_multiComponentState->cloneWithWeightScaling( scalingFactor ); + double scalingFactor = cache.validWeightSum > 0. ? newWeight / cache.validWeightSum : 1. ; + const Trk::MultiComponentState* assembledState = cache.multiComponentState->cloneWithWeightScaling( scalingFactor ); // Reset the cashe before leaving - this->reset(); + this->reset(cache); return assembledState; } -void Trk::MultiComponentStateAssembler::removeSmallWeights () { +void Trk::MultiComponentStateAssembler::removeSmallWeights (Cache& cache) const{ - if (m_outputlevel < 0) - msg(MSG::VERBOSE) << "Removing small weights" << endmsg; + ATH_MSG_VERBOSE("Removing small weights \n"); - double totalWeight( m_validWeightSum + m_invalidWeightSum ); + double totalWeight( cache.validWeightSum + cache.invalidWeightSum ); if ( totalWeight == 0. ) { - if (m_outputlevel <= 0) - msg(MSG::DEBUG) << "Total weight of state is zero... exiting" << endmsg; + ATH_MSG_VERBOSE("Total weight of state is zero... exiting \n"); return; } @@ -331,18 +268,16 @@ void Trk::MultiComponentStateAssembler::removeSmallWeights () { do { continueToRemoveComponents = false; MultiComponentState::iterator component; - for ( component = m_multiComponentState->begin() ; - component != m_multiComponentState->end() ; + for ( component = cache.multiComponentState->begin() ; + component != cache.multiComponentState->end() ; ++component ) { if ( (*component).second / totalWeight < m_minimumFractionalWeight ) { delete component->first; - m_multiComponentState->erase(component); - if (m_outputlevel <= 0) - msg(MSG::DEBUG) << "State with weight " << (*component).second << " has been removed from mixture" << endmsg; + cache.multiComponentState->erase(component); + ATH_MSG_DEBUG("State with weight " << (*component).second << " has been removed from mixture"); continueToRemoveComponents = true; break; } // end if } // end for } while ( continueToRemoveComponents ); - } diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/src/MultiComponentStateModeCalculator.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/src/MultiComponentStateModeCalculator.cxx index 8646712a909a4f14117b6e2c7a33cbb4e11dc3c4..6feba1f8876e81113bb7223af3d61d6d3f70ff51 100755 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/src/MultiComponentStateModeCalculator.cxx +++ b/Tracking/TrkFitter/TrkGaussianSumFilter/src/MultiComponentStateModeCalculator.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ /**************************************************************************************** @@ -17,8 +17,6 @@ description : Implementation code for MultiComponentStateModeCalculator //#include "EventPrimitives/AmgMatrixPlugin.h" #include "TrkParameters/TrackParameters.h" - - #include <map> Trk::MultiComponentStateModeCalculator::MultiComponentStateModeCalculator( const std::string& type, const std::string& name, const IInterface* parent ) @@ -70,7 +68,7 @@ StatusCode Trk::MultiComponentStateModeCalculator::finalize() } -Amg::VectorX Trk::MultiComponentStateModeCalculator::calculateMode( const Trk::MultiComponentState& multiComponentState ) const +Amg::VectorX Trk::MultiComponentStateModeCalculator::calculateMode(const Trk::MultiComponentState& multiComponentState ) const { ++m_NumberOfCalls; @@ -83,63 +81,65 @@ Amg::VectorX Trk::MultiComponentStateModeCalculator::calculateMode( const Trk::M ++m_NoErrorMatrix; return modes; } - - fillMixture( multiComponentState ); - + std::array<std::vector< Mixture >,5> mixtureArray{}; + fillMixture( mixtureArray,multiComponentState ); + + int tmp_MixtureSizeZero{0}; for (int i=0 ; i<5 ; i++){ std::multimap< double, double, std::greater<double> > para_startMap; - - // Loop over the mixture and find the starting point - std::vector<Mixture>::const_iterator component = m_mixture[i].begin(); + // Loop over the mixtureArray and find the starting point + std::vector<Mixture>::const_iterator component = mixtureArray[i].begin(); - if (m_mixture[i].size() == 0) ++m_MixtureSizeZero; + if (mixtureArray[i].size() == 0) { + ++tmp_MixtureSizeZero; + } - for( ; component != m_mixture[i].end() ; ++component ) - para_startMap.insert( std::pair<double, double>( pdf( component->mean, i), component->mean ) ); - + for( ; component != mixtureArray[i].end() ; ++component ){ + para_startMap.insert( std::pair<double, double>( pdf( mixtureArray,component->mean, i), component->mean ) ); + } + double para_start = para_startMap.begin()->second; - - modes[i] = findMode( para_start, i ) ; + modes[i] = findMode( mixtureArray,para_start, i ) ; // Calculate the FWHM and return this back so that it can be used to correct the covariance matrix if( para_start != modes[i] ){ // mode calculation was successful now calulate FWHM - double currentWidth = width(i); + double currentWidth = width(mixtureArray,i); modes[i+5] = -1; // Failure is flagged with a value less than 0; - double pdfVal = pdf( modes[i], i ); + double pdfVal = pdf( mixtureArray,modes[i], i ); double highX(0); double lowX(0); double upperbound =modes[i] + 1.5 * currentWidth; while(true){ - if( pdf( upperbound, i ) > pdfVal*0.5 ){ + if( pdf( mixtureArray,upperbound, i ) > pdfVal*0.5 ){ upperbound += currentWidth; } else { break; } } - ATH_MSG_VERBOSE ( "HighX PDFval, high val, low val [ " << pdfVal << ", " << pdf( modes[i], i ) << ", " << pdf( upperbound, i ) << "]") ; + ATH_MSG_VERBOSE ( "HighX PDFval, high val, low val [ " << pdfVal << ", " << pdf( mixtureArray,modes[i], i ) << ", " << pdf( mixtureArray,upperbound, i ) << "]") ; - bool highXFound = findRoot( highX, modes[i], upperbound, pdfVal*0.5, i); + bool highXFound = findRoot( mixtureArray,highX, modes[i], upperbound, pdfVal*0.5, i); double lowerbound =modes[i] - 1.5 * currentWidth; while(true){ - if( pdf( lowerbound, i ) > pdfVal*0.5 ){ + if( pdf( mixtureArray,lowerbound, i ) > pdfVal*0.5 ){ lowerbound -= currentWidth; } else { break; } } - ATH_MSG_VERBOSE ( "LowX PDFval, high val, low val [ " << pdfVal << ", " << pdf( lowerbound, i ) << ", " << pdf( modes[i], i ) << "]") ; + ATH_MSG_VERBOSE ( "LowX PDFval, high val, low val [ " << pdfVal << ", " << pdf( mixtureArray,lowerbound, i ) << ", " << pdf( mixtureArray,modes[i], i ) << "]") ; - bool lowXFound = findRoot( lowX , lowerbound, modes[i], pdfVal*0.5, i); + bool lowXFound = findRoot( mixtureArray,lowX , lowerbound, modes[i], pdfVal*0.5, i); if (highXFound && lowXFound ){ double FWHM = highX - lowX; - ATH_MSG_DEBUG ( "PDFval, high val, low val [ " << pdfVal << ", " << pdf( highX, i ) << ", " << pdf( lowX, i ) << "]") ; + ATH_MSG_DEBUG ( "PDFval, high val, low val [ " << pdfVal << ", " << pdf( mixtureArray,highX, i ) << ", " << pdf( mixtureArray,lowX, i ) << "]") ; if( FWHM <= 0 ) { ATH_MSG_DEBUG(i << " Width is neagtive? " << highX << " " << lowX << " " << modes[i] ); @@ -161,19 +161,19 @@ Amg::VectorX Trk::MultiComponentStateModeCalculator::calculateMode( const Trk::M } } } - - para_startMap.clear(); } + m_MixtureSizeZero+=tmp_MixtureSizeZero; return modes; } -void Trk::MultiComponentStateModeCalculator::fillMixture( const Trk::MultiComponentState& multiComponentState ) const +void Trk::MultiComponentStateModeCalculator::fillMixture( std::array<std::vector< Mixture >,5>& mixtureArray, + const Trk::MultiComponentState& multiComponentState ) const { for (int i=0; i<5; i++){ - m_mixture[i].clear(); + mixtureArray[i].clear(); } // Loop over all the components in the multi-component state @@ -205,11 +205,8 @@ void Trk::MultiComponentStateModeCalculator::fillMixture( const Trk::MultiCompon } } - - - Mixture mixture(weight, mean, sigma ); - - m_mixture[i].push_back( mixture ); + Mixture newmixture(weight, mean, sigma ); + mixtureArray[i].push_back( newmixture); } } @@ -217,7 +214,8 @@ void Trk::MultiComponentStateModeCalculator::fillMixture( const Trk::MultiCompon } -double Trk::MultiComponentStateModeCalculator::findMode( double xStart, int i ) const +double Trk::MultiComponentStateModeCalculator::findMode( const std::array<std::vector< Mixture >,5>& mixtureArray, + double xStart, int i ) const { int iteration(0); @@ -230,16 +228,17 @@ double Trk::MultiComponentStateModeCalculator::findMode( double xStart, int i ) double previousMode(mode); - if (d2pdf( previousMode, i) != 0.0) { - mode = previousMode - d1pdf( previousMode, i ) / d2pdf( previousMode, i ); + if (d2pdf( mixtureArray,previousMode, i) != 0.0) { + mode = previousMode - d1pdf(mixtureArray,previousMode, i ) / d2pdf( mixtureArray,previousMode, i ); } else { ATH_MSG_DEBUG( "Second derivative is zero ... Returning the original value" ); return xStart; } - if ( ( pdf(mode, i) + pdf(previousMode, i)) != 0.0 ) { - tolerance = fabs( pdf(mode, i) - pdf(previousMode, i) ) / ( pdf(mode, i) + pdf(previousMode, i) ); + if ( ( pdf(mixtureArray,mode, i) + pdf(mixtureArray,previousMode, i)) != 0.0 ) { + tolerance = fabs( pdf(mixtureArray,mode, i) - pdf(mixtureArray,previousMode, i) ) + / ( pdf(mixtureArray,mode, i) + pdf(mixtureArray,previousMode, i) ); } else { ATH_MSG_DEBUG( "Dividing by zero ... Returning the original value" ); @@ -260,7 +259,8 @@ double Trk::MultiComponentStateModeCalculator::findMode( double xStart, int i ) } -double Trk::MultiComponentStateModeCalculator::findModeGlobal(double mean,int i) const +double Trk::MultiComponentStateModeCalculator::findModeGlobal( const std::array<std::vector< Mixture >,5>& mixtureArray, + double mean,int i) const { double start(-1); @@ -279,7 +279,7 @@ double Trk::MultiComponentStateModeCalculator::findModeGlobal(double mean,int i) double iterate(fabs(mean/1000)); for (double counter(start); counter < end; counter+=iterate) { - double value(pdf(counter,i)); + double value(pdf(mixtureArray,counter,i)); if (value > maximum) { maximum = value; mode = counter; @@ -288,28 +288,30 @@ double Trk::MultiComponentStateModeCalculator::findModeGlobal(double mean,int i) return mode; } -double Trk::MultiComponentStateModeCalculator::pdf( double x, int i ) const +double Trk::MultiComponentStateModeCalculator::pdf( const std::array<std::vector< Mixture >,5>& mixtureArray, + double x, int i ) const { double pdf(0.); - std::vector< Mixture >::const_iterator component = m_mixture[i].begin(); + std::vector< Mixture >::const_iterator component = mixtureArray[i].begin(); - for ( ; component != m_mixture[i].end() ; ++component ) + for ( ; component != mixtureArray[i].end() ; ++component ) pdf += component->weight * gaus( x, component->mean, component->sigma ); return pdf; } -double Trk::MultiComponentStateModeCalculator::d1pdf( double x, int i ) const +double Trk::MultiComponentStateModeCalculator::d1pdf( const std::array<std::vector< Mixture >,5>& mixtureArray, + double x, int i ) const { double result(0.); - std::vector< Mixture >::const_iterator component = m_mixture[i].begin(); + std::vector< Mixture >::const_iterator component = mixtureArray[i].begin(); - for( ; component != m_mixture[i].end() ; ++component ){ + for( ; component != mixtureArray[i].end() ; ++component ){ double z = ( x - component->mean ) / component->sigma; @@ -321,15 +323,16 @@ double Trk::MultiComponentStateModeCalculator::d1pdf( double x, int i ) const } -double Trk::MultiComponentStateModeCalculator::d2pdf( double x, int i ) const +double Trk::MultiComponentStateModeCalculator::d2pdf( const std::array<std::vector< Mixture >,5>& mixtureArray, + double x, int i ) const { double result(0.); - std::vector< Mixture >::const_iterator component = m_mixture[i].begin(); + std::vector< Mixture >::const_iterator component = mixtureArray[i].begin(); - for( ; component != m_mixture[i].end() ; ++component ){ + for( ; component != mixtureArray[i].end() ; ++component ){ double z = ( x - component->mean ) / component->sigma; @@ -356,14 +359,15 @@ double Trk::MultiComponentStateModeCalculator::gaus( double x, double mean, doub } -double Trk::MultiComponentStateModeCalculator::width( int i ) const +double Trk::MultiComponentStateModeCalculator::width( const std::array<std::vector< Mixture >,5>& mixtureArray , + int i ) const { double pdf(0.); - std::vector< Mixture >::const_iterator component = m_mixture[i].begin(); + std::vector< Mixture >::const_iterator component = mixtureArray[i].begin(); - for ( ; component != m_mixture[i].end() ; ++component ) + for ( ; component != mixtureArray[i].end() ; ++component ) pdf += component->weight * component->sigma; return pdf; @@ -372,7 +376,10 @@ double Trk::MultiComponentStateModeCalculator::width( int i ) const -double Trk::MultiComponentStateModeCalculator::findRoot(double &result, double xlo, double xhi, double value, double i) const +double Trk::MultiComponentStateModeCalculator::findRoot(const std::array<std::vector< Mixture >,5>& mixtureArray, + double &result, double xlo, + double xhi, double value, + double i) const { // Do the root finding using the Brent-Decker method. Returns a boolean status and // loads 'result' with our best guess at the root if true. @@ -381,8 +388,8 @@ double Trk::MultiComponentStateModeCalculator::findRoot(double &result, double x double a(xlo),b(xhi); - double fa= pdf(a, i) - value; - double fb= pdf(b, i) - value; + double fa= pdf(mixtureArray,a,i) - value; + double fb= pdf(mixtureArray,b,i) - value; if(fb*fa > 0) { ATH_MSG_DEBUG( "BrentRootFinder::findRoot: initial interval does not bracket a root: (" @@ -479,7 +486,7 @@ double Trk::MultiComponentStateModeCalculator::findRoot(double &result, double x else { b += (m > 0 ? +tol : -tol); } - fb= pdf(b, i) - value; + fb= pdf(mixtureArray,b, i) - value; } // Return our best guess if we run out of iterations diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/src/QoverPBremFit.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/src/QoverPBremFit.cxx deleted file mode 100644 index af6df4cb5a43b0db0cde733317a51dd37f47b7dd..0000000000000000000000000000000000000000 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/src/QoverPBremFit.cxx +++ /dev/null @@ -1,711 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -/******************************************************************************** - QoverPBremFit.cxx * description - -completed : Tuesday 18th November 2008 -author : Tony Shao -email : Qi.Tao.Shao@cern.ch -description : Class called by BremFind to fit 1overp vs R plots using a sum of Tanh graphs -**********************************************************************************/ -#include "QoverPBremFit.h" - -#include "TrkGaussianSumFilter/IMultiComponentStateCombiner.h" -#include "TrkMultiComponentStateOnSurface/MultiComponentStateOnSurface.h" -#include "TrkParameters/TrackParameters.h" -#include "TrkTrack/Track.h" -#include "TrkFitterUtils/FitterTypes.h" - -#include <math.h> -#include <algorithm> -#include "TMath.h" - - - -Trk::QoverPBremFit::QoverPBremFit(int type, bool Z_mode): - m_stateCombiner("Trk::MultiComponentStateCombiner") -{ - m_potentialvalue = new std::vector<double>; - m_potentialwidth = new std::vector<double>; - m_1overPvalue = new std::vector<double>; - m_1overPvalueerror = new std::vector<double>; - m_PhiValue = new std::vector<double>; - m_PhiValueerror = new std::vector<double>; - m_ThetaValue = new std::vector<double>; - m_ThetaValueerror = new std::vector<double>; - m_RadiusValue = new std::vector<double>; - m_Zvalue = new std::vector<double>; - m_FitValue = new std::vector<double>; - m_trackParameters = new std::vector<const Trk::TrackParameters*>; - m_type = type; - m_Z_mode = Z_mode; - m_surfaceCounter = 0; - m_charge =0; -} - -StatusCode Trk::QoverPBremFit::initialize() -{ - // Request the state combiner - if ( m_stateCombiner.retrieve().isFailure() ){ - printf("Failed to retrieve m_stateCombiner"); - return StatusCode::FAILURE; - } - return StatusCode::SUCCESS; -} - - -Trk::QoverPBremFit::~QoverPBremFit() -{ - for (unsigned int d(0);d < m_trackParameters->size(); d++) { - delete (*m_trackParameters)[d]; - } - - delete m_potentialvalue; - delete m_potentialwidth; - delete m_1overPvalue; - delete m_1overPvalueerror; - delete m_PhiValue; - delete m_PhiValueerror; - delete m_ThetaValue; - delete m_ThetaValueerror; - delete m_RadiusValue; - delete m_Zvalue; - delete m_FitValue; - delete m_trackParameters; -} - - - -Trk::GraphParameter Trk::QoverPBremFit::GetParameters(const DataVector <const Trk::TrackStateOnSurface>& Trajectory) -{ - FillVariables(Trajectory); - - for (int copy_counter(0); (int) copy_counter < GetNMeasurements(); copy_counter++) { - if (m_Z_mode) - m_FitValue->push_back(fabs((*m_Zvalue)[copy_counter])); - else - m_FitValue->push_back((*m_RadiusValue)[copy_counter]); - } - - - FindPotentials(); - - m_graphparameter=FindParameters(); - - m_mergedparameter = MergeParameters(m_graphparameter); - - - return m_mergedparameter; -} - - -void -Trk::QoverPBremFit::FillVariables(const DataVector <const Trk::TrackStateOnSurface>& Trajectory) { - //iterators will be constructed as NULL - DataVector<const Trk::TrackStateOnSurface>::const_iterator trackStateOnSurface; - DataVector<const Trk::TrackStateOnSurface>::const_iterator Trajectory_end; - - - if (m_type==1) { - trackStateOnSurface = Trajectory.begin(); - Trajectory_end = Trajectory.end(); - } else if (m_type==-1) { - trackStateOnSurface = Trajectory.end(); - trackStateOnSurface--; - Trajectory_end = Trajectory.begin(); - Trajectory_end--; - } else { - //trackStateOnSurface and Trajectory_end will be NULL in this case, as constructed - return; - } - - - m_surfaceCounter=0; - - - for ( ; trackStateOnSurface != Trajectory_end; ) { - const Trk::MultiComponentState *TrajectoryMultiState=0; - const Trk::MultiComponentStateOnSurface *TrajectoryMultiStateOnSurface = dynamic_cast<const Trk::MultiComponentStateOnSurface*>(*trackStateOnSurface); - if (m_surfaceCounter < TRKFGSF_VALSURFACES) { - if (!TrajectoryMultiStateOnSurface) { - // Create new multiComponentState from a single state - Trk::ComponentParameters componentParameters( (*trackStateOnSurface)->trackParameters(), 1.0); - TrajectoryMultiState = new Trk::MultiComponentState(componentParameters); - } else { - TrajectoryMultiState = TrajectoryMultiStateOnSurface->components(); - } - - const Amg::Vector3D posOnSurf = TrajectoryMultiStateOnSurface->trackParameters()->position(); - - - //Fill the radius values - m_RadiusValue->push_back( posOnSurf.perp() ); - m_Zvalue->push_back( posOnSurf.z() ); - - //Specify in joboptions whether to use mode or mean - const Trk::TrackParameters* CombinedMultiState = m_stateCombiner->combine(*TrajectoryMultiState,true); - - if (CombinedMultiState->parameters()[Trk::qOverP] > 0.0) m_charge = 1.0; - else m_charge = -1.0; - - //Fill the 1overPvalues in GeV - m_trackParameters->push_back( CombinedMultiState ); - m_1overPvalue->push_back( 1000.0*fabs(CombinedMultiState->parameters()[Trk::qOverP]) ); - m_PhiValue->push_back( CombinedMultiState->parameters()[Trk::phi] ); - m_ThetaValue->push_back( CombinedMultiState->parameters()[Trk::theta] ); - - const AmgSymMatrix(5)* measuredCov = CombinedMultiState->covariance(); - - if (measuredCov) { - m_1overPvalueerror->push_back( 1000.0*sqrt((*measuredCov)(Trk::qOverP,Trk::qOverP))); - m_PhiValueerror->push_back( sqrt((*measuredCov)(Trk::phi,Trk::phi))); - m_ThetaValueerror->push_back( sqrt((*measuredCov)(Trk::theta,Trk::theta))); - } - else { - m_1overPvalueerror->push_back( 1000.0*fabs(CombinedMultiState->parameters()[Trk::qOverP]) ); - m_PhiValueerror->push_back( fabs(CombinedMultiState->parameters()[Trk::phi]) ); - m_ThetaValueerror->push_back( fabs(CombinedMultiState->parameters()[Trk::theta]) ); - } - } - - if (!TrajectoryMultiStateOnSurface) { - delete TrajectoryMultiState; - } - m_surfaceCounter++; - if (m_type==1) { - trackStateOnSurface++; - } - else if (m_type==-1) { - trackStateOnSurface--; - } - }//end of for loop -} - - -void Trk::QoverPBremFit::FindPotentials() -{ - double width; - double oneoverPgradient; - - //Search for potential brem locations - for (int datapoint=0; datapoint < m_surfaceCounter-1; datapoint++) { - //Calculates gradient between adajacent points - oneoverPgradient=(1 - (*m_1overPvalue)[datapoint]/(*m_1overPvalue)[datapoint+1])/((*m_FitValue)[datapoint+1]-(*m_FitValue)[datapoint]); - - if (oneoverPgradient > POTENTIAL_BREM_THRESHOLD) { - - m_potentialvalue->push_back(((*m_FitValue)[datapoint+1]+(*m_FitValue)[datapoint])/2); - width=((*m_FitValue)[datapoint+1]-(*m_FitValue)[datapoint])/2; - - if (width < 20) { - width=20; - } - - m_potentialwidth->push_back(width); - - } - } -} - - -Trk::GraphParameter Trk::QoverPBremFit::FindParameters() -{ - - GraphParameter graphparameter; - int nparameters = (int) m_potentialvalue->size() + 1; - int totalparameters = nparameters; - int nsurfaces = m_1overPvalue->size(); - - - std::vector<Element> elements; - elements.clear(); - Element thePoint; - - //Fill in the elements - for (int elementfill=0; elementfill < totalparameters-1; elementfill++) { - - thePoint.value=(*m_potentialvalue)[elementfill]; - thePoint.width=(*m_potentialwidth)[elementfill]; - thePoint.sign=true; - elements.push_back(thePoint); - } - - while (true) { - //printf("Starting the matrix iterations\n"); - Amg::VectorX theta(nparameters); theta.setZero(); - Amg::VectorX ymatrix(nsurfaces); ymatrix.setZero(); - Amg::MatrixX Amatrix (nsurfaces,nparameters); Amatrix.setZero(); - Amg::MatrixX Gy (nsurfaces,nsurfaces); Gy.setZero(); - - //temporary matrices to store the operations - Amg::MatrixX ATranspose(nparameters,nsurfaces); ATranspose.setZero(); - Amg::MatrixX AGA(nparameters,nparameters); AGA.setZero(); - Amg::MatrixX AGAinverse(nparameters,nparameters); AGAinverse.setZero(); - - //printf("nparameters=%i\n",nparameters); - - - //Filling each of the matrices --- y matrix first - for (int yfill=0; yfill < nsurfaces; yfill++) { - ymatrix[yfill]=(*m_1overPvalue)[yfill]; - } - - - //Filling the A matrix. - for (int afill=0; afill < nsurfaces; afill++) { - - int afill3(0); - - //afill2 starts at -1 because we want the elements vector to start at zero. - //The first iteration is taken away by the constant parameters. - for (int afill2=-1; afill2 < totalparameters-1; afill2++) { - - //First column of the A matrix is a constant - if (afill3==0){ - Amatrix(afill,afill3)=1; - afill3++; - } - - //Only the terms with positive coefficients are kept - else if (elements[afill2].sign) { - - Amatrix(afill,afill3)=TMath::TanH((*m_FitValue)[afill]/elements[afill2].width-elements[afill2].value/elements[afill2].width); - afill3++; - } - - } - } - - - //Fill the Gy matrix (the error matrix) - for (int gfill(0); gfill < nsurfaces; gfill++) { - - for (int gfill2(0); gfill2 < nsurfaces; gfill2++) { - - if (gfill==gfill2) { - Gy(gfill,gfill2)=1/(*m_1overPvalueerror)[gfill]; - } - else { - Gy(gfill,gfill2)=0; - } - } - } - - - - //int inv; - ATranspose=Amatrix.transpose(); - AGA=ATranspose*(Gy*(Amatrix)); - AGAinverse=AGA.inverse(); - //printf("Inv=%i\n",inv); - - theta=AGAinverse*(ATranspose*(Gy*ymatrix)); - - - //Check the signs of the calculated coefficients. Negative coefficients will be taken away - //on the next iteration until all coefficients are >= 0 - - int nNegative(0); - - int signcheck2(1); //Iterations start at 1 because the constant parameter doesn't matter - for (int signcheck(0); signcheck < totalparameters-1; signcheck++) { - - if (!elements[signcheck].sign) { //if the term is already taken away, then ignore it - continue; - } - else if (theta[signcheck2] < 0) { //checks to the sign of the calculated coefficient - elements[signcheck].sign=false; - nNegative++; //counts the number of negative coefficients - signcheck2++; - } - else { - signcheck2++; - } - } - - if (nNegative==0) {//Ends the iterations because all terms are positive - - int graphfill2(0); - for(int graphfill(-1); graphfill < totalparameters-1; graphfill++) { - if (graphfill2==0) { //Fills the constant with the corresponding theta element - graphparameter.constant=theta[graphfill2]; - if (isnan(graphparameter.constant)) - graphparameter.constant=0.0; - graphfill2++; - } - - else if (!elements[graphfill].sign) { - //if the parameter is negative then its coefficient is assigned zero - graphparameter.value.push_back(elements[graphfill].value); - graphparameter.coefficient.push_back(0.0); - graphparameter.width.push_back(20.0); - } - - else { - //fills the graphparameter with the coefficients, radii and width - if (isnan(theta[graphfill2])) { - graphparameter.coefficient.push_back(0.0); - graphparameter.value.push_back(elements[graphfill].value); - graphparameter.width.push_back(elements[graphfill].width); - } - else { - graphparameter.value.push_back(elements[graphfill].value); - graphparameter.coefficient.push_back(theta[graphfill2]); - graphparameter.width.push_back(elements[graphfill].width); - } - graphfill2++; - } - } - - break; - - } - else { - nparameters-=nNegative; //resets the matrices with less degrees of freedom - } - } - - return graphparameter; -} - - -Trk::GraphParameter Trk::QoverPBremFit::MergeParameters(GraphParameter graphparameter) -{ - GraphParameter MergedParameters; - MergedParameters.constant=graphparameter.constant; - - double joinscore(0); - std::vector<int> nonzero_coefficients; //contains the coefficient numbers that are non-zero - - - for (int coeff_test(0); coeff_test < (int) graphparameter.coefficient.size(); coeff_test++) { - if ( graphparameter.coefficient[coeff_test] != 0) { - nonzero_coefficients.push_back(coeff_test); - } - } - - //Returns the singular case - if ( (int) nonzero_coefficients.size() == 1 ) { - MergedParameters.coefficient.push_back(graphparameter.coefficient[nonzero_coefficients[0]]); - MergedParameters.value.push_back(graphparameter.value[nonzero_coefficients[0]]); - MergedParameters.width.push_back(graphparameter.width[nonzero_coefficients[0]]); - return MergedParameters; - } - - std::vector<bool> joinboolean ((int) nonzero_coefficients.size()-1,false); - double kinkdistance; //distance between adjacent kinks - double maxmeasure; //the maximum distance between measurements between the adjacent kinks - //int npotential; //number of potential brem points between kinks - int nmeasurement; //number of measurements between kinks - double regionbias; //takes into account the joining bias of the region based on value - - //The first element of the joinboolean array will represent whether - //kink #1 and kink#2 should be joined - - for (int join_counter(0); join_counter < (int) nonzero_coefficients.size()-1; join_counter++) { - - joinscore=0; - - kinkdistance = graphparameter.value[nonzero_coefficients[join_counter+1]] - graphparameter.value[nonzero_coefficients[join_counter]]; - maxmeasure = maxvalue(graphparameter.value[nonzero_coefficients[join_counter]],graphparameter.value[nonzero_coefficients[join_counter+1]]); - //npotential = npotentials(graphparameter.value[nonzero_coefficients[join_counter]],graphparameter.value[nonzero_coefficients[join_counter+1]]); - nmeasurement = nmeasurements(graphparameter.value[nonzero_coefficients[join_counter]],graphparameter.value[nonzero_coefficients[join_counter+1]]); - regionbias = (LastFitMeasurement()/2-graphparameter.value[nonzero_coefficients[join_counter+1]]+LastFitMeasurement()/2-graphparameter.value[nonzero_coefficients[join_counter]])/5; - - joinscore+= -10*nmeasurement; - joinscore+= 2*maxmeasure; - joinscore+= 50-kinkdistance; - joinscore+= m_type*regionbias; - //joinscore+= 20*npotential; - - //printf("Join Score%i=%f\n",join_counter,joinscore); - - //Scoring system thresholds - if (kinkdistance > 350) { - joinboolean[join_counter] = false; - continue; - } - - if (joinscore > 0) { - joinboolean[join_counter] = true; - } - - else { - joinboolean[join_counter] = false; - } - - } - - //Use the joinboolean array to join multiple smaller kinks into one larger one - - int nkinks_merged(0); - - std::vector<double> coefficient_vector; - std::vector<double> width_vector; - std::vector<double> value_vector; - - for (int merge_counter(0); merge_counter < (int) nonzero_coefficients.size(); merge_counter++) { - - if (merge_counter < (int) nonzero_coefficients.size()-1) { - - if (joinboolean[merge_counter]) { - coefficient_vector.push_back(graphparameter.coefficient[nonzero_coefficients[merge_counter]]); - width_vector.push_back(graphparameter.width[nonzero_coefficients[merge_counter]]); - value_vector.push_back(graphparameter.value[nonzero_coefficients[merge_counter]]); - nkinks_merged++; - } - - else if (!joinboolean[merge_counter]) { - coefficient_vector.push_back(graphparameter.coefficient[nonzero_coefficients[merge_counter]]); - value_vector.push_back(graphparameter.value[nonzero_coefficients[merge_counter]]); - width_vector.push_back(graphparameter.width[nonzero_coefficients[merge_counter]]); - MergedParameters.coefficient.push_back(coefficient_sum(coefficient_vector)); - MergedParameters.value.push_back(value_sum(value_vector,coefficient_vector)); - MergedParameters.width.push_back(width_sum(width_vector,coefficient_vector,value_vector)); - coefficient_vector.clear(); - value_vector.clear(); - width_vector.clear(); - nkinks_merged=0; - } - } - - else { - coefficient_vector.push_back(graphparameter.coefficient[nonzero_coefficients[merge_counter]]); - value_vector.push_back(graphparameter.value[nonzero_coefficients[merge_counter]]); - width_vector.push_back(graphparameter.width[nonzero_coefficients[merge_counter]]); - MergedParameters.coefficient.push_back(coefficient_sum(coefficient_vector)); - MergedParameters.value.push_back(value_sum(value_vector,coefficient_vector)); - MergedParameters.width.push_back(width_sum(width_vector,coefficient_vector,value_vector)); - } - - } - - return MergedParameters; -} - - -//This function calculates the number of measurements between kinks -int Trk::QoverPBremFit::nmeasurements (double start, double end) -{ - int npoints(0); - for (int i=0; i < (int) m_FitValue->size(); i++) { - if ((*m_FitValue)[i] > start && (*m_FitValue)[i] < end) { - npoints++; - } - } - - return npoints; -} - -//This function calculates the number of potential brem points between kinks -int Trk::QoverPBremFit::npotentials(double start, double end) -{ - int potentialcount(0); - for (int i=0; i < (int) m_potentialvalue->size(); i++) { - if ( (*m_potentialvalue)[i] > start && (*m_potentialvalue)[i] < end) { - potentialcount++; - } - - } - return potentialcount; -} - - -//This function calculates the maximum distance between measurements within adjacent kinks -//Note: the measured points considered can be outside the radii of the kinks, hence the use -//of "if" conditions #2 and #4 below. -double Trk::QoverPBremFit::maxvalue(double start, double end) -{ - double max(-1); - double max2(-1); - int endcounter(0); - for (int value_counter(0); value_counter < (int) m_FitValue->size(); value_counter++) { - - if ((*m_FitValue)[value_counter] < start) { - continue; - } - - if ((*m_FitValue)[value_counter] > end && endcounter > 0) { - continue; - } - - //A measurement outside the value of the kink will counter if it is the first and only one - else if ((*m_FitValue)[value_counter] > end && endcounter==0) { - max2 = (*m_FitValue)[value_counter] - (*m_FitValue)[value_counter - 1]; - endcounter++; - } - - else { - max2 = (*m_FitValue)[value_counter] - (*m_FitValue)[value_counter - 1]; - } - - if (max2 > max) { - max = max2; - } - - } - return max; - -} - - -double Trk::QoverPBremFit::coefficient_sum (std::vector<double> coefficients) -{ - double sum(0); - for (int sum_counter(0); sum_counter < (int) coefficients.size(); sum_counter++) { - sum+=coefficients[sum_counter]; - } - - return sum; - -} - -double Trk::QoverPBremFit::value_sum (std::vector<double> radii, std::vector<double> coefficients) -{ - double value(0); - double mod_squared(0); - for (int value_counter(0); value_counter < (int) radii.size(); value_counter++) { - value+=coefficients[value_counter]*coefficients[value_counter]*radii[value_counter]; - mod_squared+=coefficients[value_counter]*coefficients[value_counter]; - } - value/=mod_squared; - return value; -} - -double Trk::QoverPBremFit::width_sum (std::vector<double> widths, std::vector<double> coefficients, std::vector<double> radii) -{ - double width(0); - double coefficient_average(0); - double mod_squared(0); - - //singular case - if ( (int)coefficients.size() == 1) - { - return widths[0]; - } - - - for (int coefficient_counter(0); coefficient_counter < (int)coefficients.size(); coefficient_counter++) { - coefficient_average+=coefficients[coefficient_counter]/coefficients.size(); - mod_squared+=coefficients[coefficient_counter]*coefficients[coefficient_counter]; - } - - for (int width_counter(0); width_counter < (int) widths.size()-1 ; width_counter++) { - width+=std::min(coefficients[width_counter]*coefficients[width_counter]*(radii[width_counter+1]-radii[width_counter]),coefficients[width_counter+1]*coefficients[width_counter+1]*(radii[width_counter+1]-radii[width_counter])); - } - width/=mod_squared; - - for (int width_counter2(0); width_counter2 < (int) widths.size(); width_counter2++) { - width+=coefficients[width_counter2]*coefficients[width_counter2]*widths[width_counter2]/(coefficients[width_counter2]*coefficients[width_counter2]+coefficient_average*coefficient_average); - } - - return width; -} - -double Trk::QoverPBremFit::GetPerigee_1overP() -{ - return (*m_1overPvalue)[0]; -} - -double Trk::QoverPBremFit::GetPerigee_Phi() -{ - return (*m_PhiValue)[0]; -} - -double Trk::QoverPBremFit::GetPerigee_Theta() -{ - return (*m_ThetaValue)[0]; -} - -double Trk::QoverPBremFit::GetPerigee_d0() -{ - return (*m_RadiusValue)[0]; -} - -double Trk::QoverPBremFit::GetPerigee_z0() -{ - return (*m_Zvalue)[0]; -} - -double Trk::QoverPBremFit::Get1overP(int n) -{ - return (*m_1overPvalue)[n]; -} - -double Trk::QoverPBremFit::GetPhi(int n) -{ - return (*m_PhiValue)[n]; -} - -double Trk::QoverPBremFit::GetTheta(int n) -{ - return (*m_ThetaValue)[n]; -} - -double Trk::QoverPBremFit::GetRadius(int n) -{ - return (*m_RadiusValue)[n]; -} - -double Trk::QoverPBremFit::GetZ(int n) -{ - return (*m_Zvalue)[n]; -} - -double Trk::QoverPBremFit::Get1overPerror(int n) -{ - return (*m_1overPvalueerror)[n]; -} - -double Trk::QoverPBremFit::GetPhierror(int n) -{ - return (*m_PhiValueerror)[n]; -} - -double Trk::QoverPBremFit::GetThetaerror(int n) -{ - return (*m_ThetaValueerror)[n]; -} - -int Trk::QoverPBremFit::GetNMeasurements() -{ - return (int) (*m_1overPvalue).size(); -} - -double Trk::QoverPBremFit::GetCharge() -{ - return m_charge; -} - -const Trk::TrackParameters* Trk::QoverPBremFit::GetTrackParameters(int n) -{ - return (*m_trackParameters)[n]; -} - -int Trk::QoverPBremFit::GetnSurfaces() -{ - return m_surfaceCounter; -} - -double Trk::QoverPBremFit::GetValue(int n) -{ - return (*m_FitValue)[n]; -} - - -double Trk::QoverPBremFit::LastFitMeasurement() -{ - int lastmeasurement(GetNMeasurements() - 1); - return (*m_FitValue)[lastmeasurement]; -} - -double Trk::QoverPBremFit::FirstFitMeasurement() -{ - if (m_type == 1) - return (*m_FitValue)[0]; - else if (m_type == -1) - return (*m_FitValue)[1]; - return (*m_FitValue)[0]; -} diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/src/QoverPBremFit.h b/Tracking/TrkFitter/TrkGaussianSumFilter/src/QoverPBremFit.h deleted file mode 100644 index 91d187aaf16b3a86b4d0cc4b53213f05123063a9..0000000000000000000000000000000000000000 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/src/QoverPBremFit.h +++ /dev/null @@ -1,129 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -/******************************************************************************** - QoverPBremFit.h * description - - completed : Tuesday 18th November 2008 - author : Tony Shao - email : Qi.Tao.Shao@cern.ch - description : Class called by BremFind to fit QoverP vs R plots using a sum of Tanh graphs - **********************************************************************************/ - -#ifndef Trk_QoverPBremFit_H -#define Trk_QoverPBremFit_H - -#include <vector> - -#include "GaudiKernel/ToolHandle.h" -#include "AthContainers/DataVector.h" -#include "TrkParameters/TrackParameters.h" -#include "TrkGaussianSumFilter/BremFind.h" - -namespace Trk { - - class IMultiComponentStateCombiner; - class MultiComponentStateOnSurface; - class TrackStateOnSurface; - - -#define TRKFGSF_VALSURFACES 100 -#define TRKGSF_VALSTATES 24 -#define POTENTIAL_BREM_THRESHOLD 0.0001 - - - class QoverPBremFit { - - // forbid copying - QoverPBremFit(const QoverPBremFit &) = delete ; - QoverPBremFit &operator=(const QoverPBremFit &) = delete; - - public: - - QoverPBremFit(int, bool); //type=1 for forward fit || type=-1 for backward fit - //bool for Z mode or not. True for Z mode. - - StatusCode initialize(); - - ~QoverPBremFit(); - - GraphParameter GetParameters(const DataVector <const Trk::TrackStateOnSurface>&); - - double GetPerigee_1overP(); - double GetPerigee_Phi(); - double GetPerigee_Theta(); - double GetPerigee_d0(); - double GetPerigee_z0(); - - int GetnSurfaces(); - double Get1overP(int); - double GetPhi(int); - double GetTheta(int); - double GetRadius(int); - double GetZ(int); - double Get1overPerror(int); - double GetPhierror(int); - double GetThetaerror(int); - double GetRadiuserror(int); - double GetZerror(int); - double GetValue(int); - double GetCharge(); - double LastFitMeasurement(); - double FirstFitMeasurement(); - - const Trk::TrackParameters* GetTrackParameters(int); - - int GetNMeasurements(); - - void FillVariables(const DataVector <const Trk::TrackStateOnSurface>&); - - void FindPotentials(); - - GraphParameter FindParameters(); - - GraphParameter MergeParameters(GraphParameter); - - private: - - int nmeasurements (double, double); - - int npotentials (double, double); - - double maxvalue (double, double); - - double coefficient_sum (std::vector<double>); - - double value_sum (std::vector<double>,std::vector<double>); - - double width_sum (std::vector<double>,std::vector<double>,std::vector<double>); - - //defining the tools used in this class - ToolHandle<IMultiComponentStateCombiner> m_stateCombiner; - - int m_surfaceCounter; - int m_type; - bool m_Z_mode; - - mutable std::vector<double> *m_potentialvalue; - mutable std::vector<double> *m_potentialwidth; - - double m_charge; - std::vector<double> *m_1overPvalue; - std::vector<double> *m_1overPvalueerror; - std::vector<double> *m_PhiValue; - std::vector<double> *m_PhiValueerror; - std::vector<double> *m_ThetaValue; - std::vector<double> *m_ThetaValueerror; - std::vector<double> *m_RadiusValue; - std::vector<double> *m_Zvalue; - std::vector<double> *m_FitValue; - std::vector<const Trk::TrackParameters*> *m_trackParameters; - - GraphParameter m_graphparameter; - GraphParameter m_mergedparameter; - - }; - -} -#endif diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/src/QuickCloseComponentsMultiStateMerger.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/src/QuickCloseComponentsMultiStateMerger.cxx index f5cd0349f946d88cf427995f5d57bb375f0cd09d..c7373c2c2b571410223329f7ad7ab31e96040e54 100644 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/src/QuickCloseComponentsMultiStateMerger.cxx +++ b/Tracking/TrkFitter/TrkGaussianSumFilter/src/QuickCloseComponentsMultiStateMerger.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ /********************************************************************************* @@ -132,9 +132,10 @@ const Trk::MultiComponentState* Trk::QuickCloseComponentsMultiStateMerger::merge ATH_MSG_VERBOSE( "Merging state with " << unmergedState.size() << " components" ); unsigned int numberOfComponents = unmergedState.size(); - + //Assembler Cache + IMultiComponentStateAssembler::Cache cache; // Check that the assember is reset - bool isAssemblerReset = m_stateAssembler->reset(); + bool isAssemblerReset = m_stateAssembler->reset(cache); if (unmergedState.size() <= m_maximumNumberOfComponents){ ATH_MSG_VERBOSE( "State is already sufficiently small... no component reduction required" ); @@ -175,10 +176,10 @@ const Trk::MultiComponentState* Trk::QuickCloseComponentsMultiStateMerger::merge // Options to use full KL distance-based algorithm. if (m_useFullDistanceCalcArray) { delete combinedState; - return mergeFullDistArray(unmergedState); + return mergeFullDistArray(cache,unmergedState); } else if(m_useFullDistanceCalcVector){ delete combinedState; - return mergeFullDistVector(unmergedState); + return mergeFullDistVector(cache,unmergedState); } @@ -300,7 +301,7 @@ const Trk::MultiComponentState* Trk::QuickCloseComponentsMultiStateMerger::merge for ( ; mapComponent != unmergedComponentsMap.end(); ++mapComponent) { // Add component to state being prepared for assembly and check that it is valid - bool componentAdded = m_stateAssembler->addComponent(mapComponent->second); + bool componentAdded = m_stateAssembler->addComponent(cache,mapComponent->second); if ( !componentAdded ) ATH_MSG_WARNING( "Component could not be added to the state in the assembler" ); @@ -310,7 +311,7 @@ const Trk::MultiComponentState* Trk::QuickCloseComponentsMultiStateMerger::merge } - const Trk::MultiComponentState* mergedState = m_stateAssembler->assembledState(); + const Trk::MultiComponentState* mergedState = m_stateAssembler->assembledState(cache); ATH_MSG_VERBOSE( "Number of components in merged state: " << mergedState->size() ); @@ -582,7 +583,8 @@ void Trk::QuickCloseComponentsMultiStateMerger::mergeStateComponents (std::vecto // Method to take an input MCS and minimize it from 'X' components to // 'm_maximumNumberOfComponents' components. -const Trk::MultiComponentState* Trk::QuickCloseComponentsMultiStateMerger::mergeFullDistVector(const Trk::MultiComponentState& mcs) const +const Trk::MultiComponentState* Trk::QuickCloseComponentsMultiStateMerger::mergeFullDistVector(IMultiComponentStateAssembler::Cache& cache, + const Trk::MultiComponentState& mcs) const { m_chronoSvc->chronoStart("QCCM::mergeFullDist"); @@ -628,7 +630,7 @@ const Trk::MultiComponentState* Trk::QuickCloseComponentsMultiStateMerger::merge for ( ; mcsIter != tempComponents.end(); ++mcsIter){ // Add component to state being prepared for assembly and check that it is valid - bool componentAdded = m_stateAssembler->addComponent(*(*mcsIter)); + bool componentAdded = m_stateAssembler->addComponent(cache,*(*mcsIter)); if ( !componentAdded ) msg(MSG::WARNING) << "Component could not be added to the state in the assembler" << endmsg; @@ -637,7 +639,7 @@ const Trk::MultiComponentState* Trk::QuickCloseComponentsMultiStateMerger::merge ATH_MSG_VERBOSE("Got states, doing final assembly of merged state"); - const Trk::MultiComponentState* mergedState = m_stateAssembler->assembledState(); + const Trk::MultiComponentState* mergedState = m_stateAssembler->assembledState(cache); // Memory clean up. Gotta also clean up those pesky track parameters. // for (unsigned int ic(0); ic < clonedUnmergedState->size(); ic++) @@ -651,7 +653,7 @@ const Trk::MultiComponentState* Trk::QuickCloseComponentsMultiStateMerger::merge for (unsigned int it(0); it < tempComponents.size(); it++) { if (tempComponents[it]) { if (tempComponents[it]->first) - delete tempComponents[it]->first; + delete tempComponents[it]->first; delete tempComponents[it]; } } @@ -693,7 +695,8 @@ void Trk::QuickCloseComponentsMultiStateMerger::deleteStoredDistances(int i1, in } -const Trk::MultiComponentState* Trk::QuickCloseComponentsMultiStateMerger::mergeFullDistArray(const Trk::MultiComponentState& mcs) const +const Trk::MultiComponentState* Trk::QuickCloseComponentsMultiStateMerger::mergeFullDistArray(IMultiComponentStateAssembler::Cache& cache, + const Trk::MultiComponentState& mcs) const { //m_chronoSvc->chronoStart("QCCM::mergeFullDistArray"); @@ -866,13 +869,13 @@ const Trk::MultiComponentState* Trk::QuickCloseComponentsMultiStateMerger::merge if(state == 0) continue; // Add component to state being prepared for assembly and check that it is valid - bool componentAdded = m_stateAssembler->addComponent( *state ); + bool componentAdded = m_stateAssembler->addComponent( cache,*state ); if ( !componentAdded ) ATH_MSG_WARNING( "Component could not be added to the state in the assembler" ); } - const Trk::MultiComponentState* mergedState = m_stateAssembler->assembledState(); + const Trk::MultiComponentState* mergedState = m_stateAssembler->assembledState(cache); ATH_MSG_VERBOSE( "Number of components in merged state: " << mergedState->size() ); diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/src/components/TrkGaussianSumFilter_entries.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/src/components/TrkGaussianSumFilter_entries.cxx index faae31bfe1fa7ace7af3455acd4ba8309f373bfc..4b91eb5328b6f7e3808198fb996358344c1e995e 100644 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/src/components/TrkGaussianSumFilter_entries.cxx +++ b/Tracking/TrkFitter/TrkGaussianSumFilter/src/components/TrkGaussianSumFilter_entries.cxx @@ -20,8 +20,6 @@ #include "TrkGaussianSumFilter/GsfOutlierLogic.h" #include "TrkGaussianSumFilter/GsfExtrapolator.h" #include "TrkGaussianSumFilter/GsfSmoother.h" -#include "TrkGaussianSumFilter/BremFind.h" -//#include "TrkDetDescrInterfaces/ITrackingGeometrySvc.h" DECLARE_COMPONENT( Trk::QuickCloseComponentsMultiStateMerger ) DECLARE_COMPONENT( Trk::MultiComponentStateModeCalculator ) @@ -45,5 +43,4 @@ DECLARE_COMPONENT( Trk::ForwardGsfFitter ) DECLARE_COMPONENT( Trk::GsfOutlierLogic ) DECLARE_COMPONENT( Trk::GsfExtrapolator ) DECLARE_COMPONENT( Trk::GsfSmoother ) -DECLARE_COMPONENT( Trk::BremFind ) diff --git a/Trigger/TrigAlgorithms/TrigEgammaRec/src/TrigEgammaRec.cxx b/Trigger/TrigAlgorithms/TrigEgammaRec/src/TrigEgammaRec.cxx index 0677b8af109ac027e520c576476cf8c65af5ab11..8a4027494f17dc3618fefb0bd0403a81ce229e5a 100755 --- a/Trigger/TrigAlgorithms/TrigEgammaRec/src/TrigEgammaRec.cxx +++ b/Trigger/TrigAlgorithms/TrigEgammaRec/src/TrigEgammaRec.cxx @@ -469,58 +469,59 @@ HLT::ErrorCode TrigEgammaRec::hltInitialize() { if (runIsoType.find(flavName) == runIsoType.end()) runIsoType.insert(flavName); } - /** @brief Retrieve IsolationTools based on IsoTypes configured */ - if(m_doTrackIsolation){ - if (!m_trackIsolationTool.empty() && runIsoType.find("ptcone") != runIsoType.end()){ - ATH_MSG_DEBUG("Retrieve TrackIsolationTool"); - - if(m_trackIsolationTool.retrieve().isFailure()){ - ATH_MSG_ERROR("Unable to retrieve " << m_trackIsolationTool); - return HLT::BAD_JOB_SETUP; - } - else { - ATH_MSG_DEBUG("Retrieved Tool "<<m_trackIsolationTool); - if (timerSvc()) m_timerIsoTool1 = addTimer("TrackIsolationTool"); - } - } - } else { + // /** @brief Retrieve IsolationTools based on IsoTypes configured */ + // // BROKEN! WORTH FIXING, OR IS THIS FILE NOW OBSOLETE + // if(m_doTrackIsolation){ + // if (!m_trackIsolationTool.empty() && runIsoType.find("ptcone") != runIsoType.end()){ + // ATH_MSG_DEBUG("Retrieve TrackIsolationTool"); + + // if(m_trackIsolationTool.retrieve().isFailure()){ + // ATH_MSG_ERROR("Unable to retrieve " << m_trackIsolationTool); + // return HLT::BAD_JOB_SETUP; + // } + // else { + // ATH_MSG_DEBUG("Retrieved Tool "<<m_trackIsolationTool); + // if (timerSvc()) m_timerIsoTool1 = addTimer("TrackIsolationTool"); + // } + // } + // } else { m_trackIsolationTool.disable(); - } - - if(m_doCaloCellIsolation){ - if (!m_caloCellIsolationTool.empty() && runIsoType.find("etcone") != runIsoType.end()) { - ATH_MSG_DEBUG("Retrieve CaloIsolationTool is empty"); - if(m_caloCellIsolationTool.retrieve().isFailure()){ - ATH_MSG_ERROR("Unable to retrieve " << m_caloCellIsolationTool); - return HLT::BAD_JOB_SETUP; - } - else { - ATH_MSG_DEBUG("Retrieved Tool "<<m_caloCellIsolationTool); - if (timerSvc()) m_timerIsoTool2 = addTimer("CaloCellIsolationTool"); - } - } else { - m_caloCellIsolationTool.disable(); - } - } else { + // } + + // if(m_doCaloCellIsolation){ + // if (!m_caloCellIsolationTool.empty() && runIsoType.find("etcone") != runIsoType.end()) { + // ATH_MSG_DEBUG("Retrieve CaloIsolationTool is empty"); + // if(m_caloCellIsolationTool.retrieve().isFailure()){ + // ATH_MSG_ERROR("Unable to retrieve " << m_caloCellIsolationTool); + // return HLT::BAD_JOB_SETUP; + // } + // else { + // ATH_MSG_DEBUG("Retrieved Tool "<<m_caloCellIsolationTool); + // if (timerSvc()) m_timerIsoTool2 = addTimer("CaloCellIsolationTool"); + // } + // } else { + // m_caloCellIsolationTool.disable(); + // } + // } else { m_caloCellIsolationTool.disable(); - } - if(m_doTopoIsolation){ - if (!m_topoIsolationTool.empty() && runIsoType.find("topoetcone") != runIsoType.end()) { - ATH_MSG_DEBUG("Retrieve TopoIsolationTool is empty"); - if(m_topoIsolationTool.retrieve().isFailure()){ - ATH_MSG_ERROR("Unable to retrieve " << m_topoIsolationTool); - return HLT::BAD_JOB_SETUP; - } - else { - ATH_MSG_DEBUG("Retrieved Tool "<<m_topoIsolationTool); - if (timerSvc()) m_timerIsoTool3 = addTimer("topoIsolationTool"); - } - } else { - m_topoIsolationTool.disable(); - } - } else { + // } + // if(m_doTopoIsolation){ + // if (!m_topoIsolationTool.empty() && runIsoType.find("topoetcone") != runIsoType.end()) { + // ATH_MSG_DEBUG("Retrieve TopoIsolationTool is empty"); + // if(m_topoIsolationTool.retrieve().isFailure()){ + // ATH_MSG_ERROR("Unable to retrieve " << m_topoIsolationTool); + // return HLT::BAD_JOB_SETUP; + // } + // else { + // ATH_MSG_DEBUG("Retrieved Tool "<<m_topoIsolationTool); + // if (timerSvc()) m_timerIsoTool3 = addTimer("topoIsolationTool"); + // } + // } else { + // m_topoIsolationTool.disable(); + // } + // } else { m_topoIsolationTool.disable(); - } + // } //print summary info ATH_MSG_INFO("REGTEST: xAOD Reconstruction for Run2" ); ATH_MSG_INFO("REGTEST: Initialization completed successfully, tools initialized: " ); @@ -631,28 +632,28 @@ HLT::ErrorCode TrigEgammaRec::hltExecute( const HLT::TriggerElement* inputTE, } - bool topoClusTrue = false; - std::vector<const xAOD::CaloClusterContainer*> vectorClusterContainerTopo; - if(m_doTopoIsolation){ - stat = getFeatures(inputTE, vectorClusterContainerTopo,m_topoClusterContName); + // bool topoClusTrue = false; + // std::vector<const xAOD::CaloClusterContainer*> vectorClusterContainerTopo; + // if(m_doTopoIsolation){ + // stat = getFeatures(inputTE, vectorClusterContainerTopo,m_topoClusterContName); - if ( stat!= HLT::OK ) { - ATH_MSG_ERROR(" REGTEST: No CaloTopoClusterContainers retrieved for the trigger element"); - //return HLT::OK; // If you did not get it, it is not a problem, continue! - } + // if ( stat!= HLT::OK ) { + // ATH_MSG_ERROR(" REGTEST: No CaloTopoClusterContainers retrieved for the trigger element"); + // //return HLT::OK; // If you did not get it, it is not a problem, continue! + // } - //debug message - if ( msgLvl() <= MSG::VERBOSE){ - msg() << MSG::VERBOSE << " REGTEST: Got " << vectorClusterContainerTopo.size() - << " CaloCTopoclusterContainers associated to the TE " << endmsg; - } - // Get the last ClusterContainer - if ( !vectorClusterContainerTopo.empty() ) { - const xAOD::CaloClusterContainer* clusContainerTopo = vectorClusterContainerTopo.back(); - if (clusContainerTopo->size() > 0) topoClusTrue = true; - ATH_MSG_DEBUG("REGTEST: Number of topo containers : " << clusContainerTopo->size()); - } // vector of Cluster Container empty?! - } + // //debug message + // if ( msgLvl() <= MSG::VERBOSE){ + // msg() << MSG::VERBOSE << " REGTEST: Got " << vectorClusterContainerTopo.size() + // << " CaloCTopoclusterContainers associated to the TE " << endmsg; + // } + // // Get the last ClusterContainer + // if ( !vectorClusterContainerTopo.empty() ) { + // const xAOD::CaloClusterContainer* clusContainerTopo = vectorClusterContainerTopo.back(); + // if (clusContainerTopo->size() > 0) topoClusTrue = true; + // ATH_MSG_DEBUG("REGTEST: Number of topo containers : " << clusContainerTopo->size()); + // } // vector of Cluster Container empty?! + // } if(msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG @@ -696,7 +697,7 @@ HLT::ErrorCode TrigEgammaRec::hltExecute( const HLT::TriggerElement* inputTE, // Shower Shape & CaloCellContainer const CaloCellContainer* pCaloCellContainer = 0; - const xAOD::CaloClusterContainer* pTopoClusterContainer = 0; + //const xAOD::CaloClusterContainer* pTopoClusterContainer = 0; // Get vector of pointers to all CaloCellContainers from TE std::string clusCollKey=""; @@ -744,7 +745,7 @@ HLT::ErrorCode TrigEgammaRec::hltExecute( const HLT::TriggerElement* inputTE, if ( msgLvl() <= MSG::VERBOSE) msg() << MSG::VERBOSE << "Running m_showerBuilder: " << m_showerBuilder << endmsg; } //pCaloCellContainer } - if(topoClusTrue) pTopoClusterContainer = vectorClusterContainerTopo.back(); + //if(topoClusTrue) pTopoClusterContainer = vectorClusterContainerTopo.back(); } //********************************************************************** @@ -1078,50 +1079,52 @@ HLT::ErrorCode TrigEgammaRec::hltExecute( const HLT::TriggerElement* inputTE, // Isolation // // Calo Isolation types - - if(m_doCaloCellIsolation || m_doTopoIsolation){ - if (timerSvc()) m_timerIsoTool2->start(); //timer - std::map<std::string,CaloIsoHelp>::iterator itc = m_egCaloIso.begin(), itcE = m_egCaloIso.end(); - for (; itc != itcE; itc++) { - CaloIsoHelp isoH = itc->second; - std::string flav = itc->first; - bool bsc = false; - if (flav == "etcone" && pCaloCellContainer) - bsc = m_caloCellIsolationTool->decorateParticle_caloCellIso(*eg, isoH.help.isoTypes, isoH.CorrList, pCaloCellContainer); - /*else if (flav == "topoetcone" ) - // Add check for topoclusters (when available); - //bsc = m_topoIsolationTool->decorateParticle_topoClusterIso(*eg, isoH.help.isoTypes, isoH.CorrList, pTopoClusterContainer);*/ - if (!bsc && flav=="etcone") - ATH_MSG_WARNING("Call to CaloIsolationTool failed for flavour " << flav); - } - ATH_MSG_DEBUG(" REGTEST: etcone20 = " << getIsolation_etcone20(eg)); - ATH_MSG_DEBUG(" REGTEST: etcone30 = " << getIsolation_etcone30(eg)); - ATH_MSG_DEBUG(" REGTEST: etcone40 = " << getIsolation_etcone40(eg)); - if (timerSvc()) m_timerIsoTool2->stop(); //timer - } - if(m_doTrackIsolation){ - ATH_MSG_DEBUG("Running TrackIsolationTool for Electrons"); - - if (timerSvc()) m_timerIsoTool1->start(); //timer - if(m_egTrackIso.size() != 0) { - // Track Isolation types - std::map<std::string,TrackIsoHelp>::iterator itt = m_egTrackIso.begin(), ittE = m_egTrackIso.end(); - for (; itt != ittE; itt++) { - TrackIsoHelp isoH = itt->second; - std::string flav = itt->first; - const std::set<const xAOD::TrackParticle*> tracksToExclude = xAOD::EgammaHelpers::getTrackParticles(eg, m_useBremAssoc); // For GSF this may need to be property - // Need the decorate methods from IsolationTool - bool bsc = m_trackIsolationTool->decorateParticle(*eg, isoH.help.isoTypes, isoH.CorrList, &leadTrkVtx, &tracksToExclude,pTrackParticleContainer); - if (!bsc) - ATH_MSG_WARNING("Call to TrackIsolationTool failed for flavour " << flav); - } - ATH_MSG_DEBUG(" REGTEST: ptcone20 = " << getIsolation_ptcone20(eg)); - ATH_MSG_DEBUG(" REGTEST: ptcone30 = " << getIsolation_ptcone30(eg)); - ATH_MSG_DEBUG(" REGTEST: ptcone40 = " << getIsolation_ptcone40(eg)); - } - if (timerSvc()) m_timerIsoTool1->stop(); //timer - } + // THIS IS NOW BROKEN. IS IT WORTH FIXING, OR WILL THIS BECOME OBSOLETE IN 22.0? + + // if(m_doCaloCellIsolation || m_doTopoIsolation){ + // if (timerSvc()) m_timerIsoTool2->start(); //timer + // std::map<std::string,CaloIsoHelp>::iterator itc = m_egCaloIso.begin(), itcE = m_egCaloIso.end(); + // for (; itc != itcE; itc++) { + // CaloIsoHelp isoH = itc->second; + // std::string flav = itc->first; + // bool bsc = false; + // if (flav == "etcone" && pCaloCellContainer) + // bsc = m_caloCellIsolationTool->decorateParticle_caloCellIso(*eg, isoH.help.isoTypes, isoH.CorrList, pCaloCellContainer); + // /*else if (flav == "topoetcone" ) + // // Add check for topoclusters (when available); + // //bsc = m_topoIsolationTool->decorateParticle_topoClusterIso(*eg, isoH.help.isoTypes, isoH.CorrList, pTopoClusterContainer);*/ + // if (!bsc && flav=="etcone") + // ATH_MSG_WARNING("Call to CaloIsolationTool failed for flavour " << flav); + // } + // ATH_MSG_DEBUG(" REGTEST: etcone20 = " << getIsolation_etcone20(eg)); + // ATH_MSG_DEBUG(" REGTEST: etcone30 = " << getIsolation_etcone30(eg)); + // ATH_MSG_DEBUG(" REGTEST: etcone40 = " << getIsolation_etcone40(eg)); + // if (timerSvc()) m_timerIsoTool2->stop(); //timer + // } + // if(m_doTrackIsolation){ + // ATH_MSG_DEBUG("Running TrackIsolationTool for Electrons"); + + // if (timerSvc()) m_timerIsoTool1->start(); //timer + // if(m_egTrackIso.size() != 0) { + // // Track Isolation types + // std::map<std::string,TrackIsoHelp>::iterator itt = m_egTrackIso.begin(), ittE = m_egTrackIso.end(); + // for (; itt != ittE; itt++) { + // TrackIsoHelp isoH = itt->second; + // std::string flav = itt->first; + // const std::set<const xAOD::TrackParticle*> tracksToExclude = xAOD::EgammaHelpers::getTrackParticles(eg, m_useBremAssoc); // For GSF this may need to be property + // // Need the decorate methods from IsolationTool + // bool bsc = m_trackIsolationTool->decorateParticle(*eg, isoH.help.isoTypes, isoH.CorrList, &leadTrkVtx, &tracksToExclude,pTrackParticleContainer); + // if (!bsc) + // ATH_MSG_WARNING("Call to TrackIsolationTool failed for flavour " << flav); + // } + // ATH_MSG_DEBUG(" REGTEST: ptcone20 = " << getIsolation_ptcone20(eg)); + // ATH_MSG_DEBUG(" REGTEST: ptcone30 = " << getIsolation_ptcone30(eg)); + // ATH_MSG_DEBUG(" REGTEST: ptcone40 = " << getIsolation_ptcone40(eg)); + + // } + // if (timerSvc()) m_timerIsoTool1->stop(); //timer + // } // PID ATH_MSG_DEBUG("about to run execute(eg) for PID"); @@ -1162,34 +1165,35 @@ HLT::ErrorCode TrigEgammaRec::hltExecute( const HLT::TriggerElement* inputTE, if (timerSvc()) m_timerTool5->stop(); //timer // Isolation - - if(m_doCaloCellIsolation || m_doTopoIsolation){ - if (timerSvc()) m_timerIsoTool2->start(); //timer - std::map<std::string,CaloIsoHelp>::iterator itc = m_egCaloIso.begin(), itcE = m_egCaloIso.end(); - for (; itc != itcE; itc++) { - CaloIsoHelp isoH = itc->second; - std::string flav = itc->first; - bool bsc = false; - bool tbsc = false; - if (flav == "etcone" && pCaloCellContainer) - bsc = m_caloCellIsolationTool->decorateParticle_caloCellIso(*eg, isoH.help.isoTypes, isoH.CorrList, pCaloCellContainer); - else if (flav == "topoetcone" && topoClusTrue) - // Add check for topoclusters (when available); - tbsc = m_topoIsolationTool->decorateParticle_topoClusterIso(*eg, isoH.help.isoTypes, isoH.CorrList, pTopoClusterContainer); - if (!bsc && m_doCaloCellIsolation && flav=="etcone") - ATH_MSG_WARNING("Call to CaloIsolationTool failed for flavour " << flav); - if (!tbsc && m_doTopoIsolation && flav =="topoetcone") - ATH_MSG_WARNING("Call to CaloTopoIsolationTool failed for flavour " << flav); - } - ATH_MSG_DEBUG(" REGTEST: etcone20 = " << getIsolation_etcone20(eg)); - ATH_MSG_DEBUG(" REGTEST: etcone30 = " << getIsolation_etcone30(eg)); - ATH_MSG_DEBUG(" REGTEST: etcone40 = " << getIsolation_etcone40(eg)); - ATH_MSG_DEBUG(" REGTEST: topoetcone20 = " << getIsolation_topoetcone20(eg)); - ATH_MSG_DEBUG(" REGTEST: topoetcone30 = " << getIsolation_topoetcone30(eg)); - ATH_MSG_DEBUG(" REGTEST: topoetcone40 = " << getIsolation_topoetcone40(eg)); - - if (timerSvc()) m_timerIsoTool2->stop(); //timer - } + + // BROKEN. WORTH FIXING, OR IS THIS FILE MOVING? + // if(m_doCaloCellIsolation || m_doTopoIsolation){ + // if (timerSvc()) m_timerIsoTool2->start(); //timer + // std::map<std::string,CaloIsoHelp>::iterator itc = m_egCaloIso.begin(), itcE = m_egCaloIso.end(); + // for (; itc != itcE; itc++) { + // CaloIsoHelp isoH = itc->second; + // std::string flav = itc->first; + // bool bsc = false; + // bool tbsc = false; + // if (flav == "etcone" && pCaloCellContainer) + // bsc = m_caloCellIsolationTool->decorateParticle_caloCellIso(*eg, isoH.help.isoTypes, isoH.CorrList, pCaloCellContainer); + // else if (flav == "topoetcone" && topoClusTrue) + // // Add check for topoclusters (when available); + // tbsc = m_topoIsolationTool->decorateParticle_topoClusterIso(*eg, isoH.help.isoTypes, isoH.CorrList, pTopoClusterContainer); + // if (!bsc && m_doCaloCellIsolation && flav=="etcone") + // ATH_MSG_WARNING("Call to CaloIsolationTool failed for flavour " << flav); + // if (!tbsc && m_doTopoIsolation && flav =="topoetcone") + // ATH_MSG_WARNING("Call to CaloTopoIsolationTool failed for flavour " << flav); + // } + // ATH_MSG_DEBUG(" REGTEST: etcone20 = " << getIsolation_etcone20(eg)); + // ATH_MSG_DEBUG(" REGTEST: etcone30 = " << getIsolation_etcone30(eg)); + // ATH_MSG_DEBUG(" REGTEST: etcone40 = " << getIsolation_etcone40(eg)); + // ATH_MSG_DEBUG(" REGTEST: topoetcone20 = " << getIsolation_topoetcone20(eg)); + // ATH_MSG_DEBUG(" REGTEST: topoetcone30 = " << getIsolation_topoetcone30(eg)); + // ATH_MSG_DEBUG(" REGTEST: topoetcone40 = " << getIsolation_topoetcone40(eg)); + + // if (timerSvc()) m_timerIsoTool2->stop(); //timer + // } // Particle ID if (timerSvc()) m_timerPIDTool3->start(); //timer diff --git a/Trigger/TrigAlgorithms/TrigT2CaloCommon/TrigT2CaloCommon/IReAlgToolCalo.h b/Trigger/TrigAlgorithms/TrigT2CaloCommon/TrigT2CaloCommon/IReAlgToolCalo.h index 2794859df67b9995205e60d80febf4889d2f3c2a..b46b331d571bf8f8a0aec207e3fe663edbb6bcbd 100755 --- a/Trigger/TrigAlgorithms/TrigT2CaloCommon/TrigT2CaloCommon/IReAlgToolCalo.h +++ b/Trigger/TrigAlgorithms/TrigT2CaloCommon/TrigT2CaloCommon/IReAlgToolCalo.h @@ -146,7 +146,7 @@ class IReAlgToolCalo: public virtual IAlgTool, It prints out a grid of cells eta and phi positions and energies. Only exist in DEBUG versions of the code. */ void PrintCluster(const double energyFromAlg, const int nCaloType,const int nCaloSamp, - const CaloSampling::CaloSample, const CaloSampling::CaloSample ); + const CaloSampling::CaloSample, const CaloSampling::CaloSample ) const; #endif /** Store All Calorimeter Cells in RoI in an StoreGate Container. */ void storeCells(void); diff --git a/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/IReAlgToolCalo.cxx b/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/IReAlgToolCalo.cxx index f6f43ca28767ef46c42566c9c03b7a45da2b198d..d08330d84d60ddaecb42a51387218fc31e1bd453 100755 --- a/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/IReAlgToolCalo.cxx +++ b/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/IReAlgToolCalo.cxx @@ -108,7 +108,7 @@ void IReAlgToolCalo::PrintCluster(const double ARG(energyFromAlg), const int ARG(nCaloType), const int ARG(nCaloSamp), CaloSampling::CaloSample ARG(SAMP1), - CaloSampling::CaloSample ARG(SAMP2) ) + CaloSampling::CaloSample ARG(SAMP2) ) const #undef ARG { #ifdef EXTRADEBUG diff --git a/Trigger/TrigAlgorithms/TrigT2CaloEgamma/python/TrigT2CaloEgammaConfig.py b/Trigger/TrigAlgorithms/TrigT2CaloEgamma/python/TrigT2CaloEgammaConfig.py index 24652b29726ebace9dfbfdb17951f083a35c3630..257c3cea44e1b8262e8305d112d972b463885c94 100755 --- a/Trigger/TrigAlgorithms/TrigT2CaloEgamma/python/TrigT2CaloEgammaConfig.py +++ b/Trigger/TrigAlgorithms/TrigT2CaloEgamma/python/TrigT2CaloEgammaConfig.py @@ -65,7 +65,15 @@ class EgammaSamp2FexConfig (EgammaSamp2Fex): self.MaxDetaHotCell=0.15 self.MaxDphiHotCell=0.15 -class EgammaSamp2FexNoTimerConfig (EgammaReSamp2Fex): +class EgammaReSamp2FexNoTimerConfig (EgammaReSamp2Fex): + __slots__ = [] + def __init__ (self, name="EgammaReSamp2FexNoTimerConfig"): + super(EgammaReSamp2FexNoTimerConfig, self).__init__(name) + self.MaxDetaHotCell=0.15 + self.MaxDphiHotCell=0.15 + self.TrigTimerSvc="" + +class EgammaSamp2FexNoTimerConfig (EgammaSamp2Fex): __slots__ = [] def __init__ (self, name="EgammaSamp2FexNoTimerConfig"): super(EgammaSamp2FexNoTimerConfig, self).__init__(name) @@ -73,19 +81,37 @@ class EgammaSamp2FexNoTimerConfig (EgammaReSamp2Fex): self.MaxDphiHotCell=0.15 self.TrigTimerSvc="" -class EgammaSamp1FexNoTimerConfig (EgammaReSamp1Fex): +class EgammaReSamp1FexNoTimerConfig (EgammaReSamp1Fex): + __slots__ = [] + def __init__ (self, name="EgammaReSamp1Fex"): + super(EgammaReSamp1FexNoTimerConfig, self).__init__(name) + self.TrigTimerSvc="" + +class EgammaSamp1FexNoTimerConfig (EgammaSamp1Fex): __slots__ = [] def __init__ (self, name="EgammaSamp1Fex"): super(EgammaSamp1FexNoTimerConfig, self).__init__(name) self.TrigTimerSvc="" -class EgammaEmEnFexNoTimerConfig (EgammaReEmEnFex): +class EgammaReEmEnFexNoTimerConfig (EgammaReEmEnFex): + __slots__ = [] + def __init__ (self, name="EgammaReEmEnFex"): + super(EgammaReEmEnFexNoTimerConfig, self).__init__(name) + self.TrigTimerSvc="" + +class EgammaEmEnFexNoTimerConfig (EgammaEmEnFex): __slots__ = [] def __init__ (self, name="EgammaEmEnFex"): super(EgammaEmEnFexNoTimerConfig, self).__init__(name) self.TrigTimerSvc="" -class EgammaHadEnFexNoTimerConfig (EgammaReHadEnFex): +class EgammaReHadEnFexNoTimerConfig (EgammaReHadEnFex): + __slots__ = [] + def __init__ (self, name="EgammaReHadEnFex"): + super(EgammaReHadEnFexNoTimerConfig, self).__init__(name) + self.TrigTimerSvc="" + +class EgammaHadEnFexNoTimerConfig (EgammaHadEnFex): __slots__ = [] def __init__ (self, name="EgammaHadEnFex"): super(EgammaHadEnFexNoTimerConfig, self).__init__(name) @@ -487,16 +513,16 @@ class T2CaloEgamma_ReFastAlgo (T2CaloEgammaReFastAlgo): from AthenaCommon.AppMgr import ServiceMgr as svcMgr from TrigT2CaloCommon.TrigT2CaloCommonConf import TrigCaloDataAccessSvc svcMgr += TrigCaloDataAccessSvc() - samp2 = EgammaSamp2FexNoTimerConfig(name="ReFaAlgoSamp2FexConfig") + samp2 = EgammaReSamp2FexNoTimerConfig(name="ReFaAlgoSamp2FexConfig") samp2.trigDataAccessMT=svcMgr.TrigCaloDataAccessSvc ToolSvc+=samp2 - samp1 = EgammaSamp1FexNoTimerConfig("ReFaAlgoSamp1FexConfig") + samp1 = EgammaReSamp1FexNoTimerConfig("ReFaAlgoSamp1FexConfig") samp1.trigDataAccessMT=svcMgr.TrigCaloDataAccessSvc ToolSvc+=samp1 - sampe = EgammaEmEnFexNoTimerConfig("ReFaAlgoEmEnFexConfig") + sampe = EgammaReEmEnFexNoTimerConfig("ReFaAlgoEmEnFexConfig") sampe.trigDataAccessMT=svcMgr.TrigCaloDataAccessSvc ToolSvc+=sampe - samph = EgammaHadEnFexNoTimerConfig("ReFaAlgoHadEnFexConfig") + samph = EgammaReHadEnFexNoTimerConfig("ReFaAlgoHadEnFexConfig") samph.trigDataAccessMT=svcMgr.TrigCaloDataAccessSvc ToolSvc+=samph #ToolSvc+=RingerFexConfig("RingsMaker") diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/comparitor.cxx b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/comparitor.cxx index a4d2e83d79b7b9095913364b0aa908f209aacfcf..a9221fa7bdd332eeade91b541769da22686b65f1 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/comparitor.cxx +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/comparitor.cxx @@ -59,7 +59,6 @@ bool fulldbg = false; template<typename T=TH1F> T* Get( TFile& f, const std::string& n, const std::string& dir="", std::vector<std::string>* saved=0 ) { - std::string name; size_t pos = n.find("+"); @@ -80,6 +79,8 @@ T* Get( TFile& f, const std::string& n, const std::string& dir="", std::vector<s } } + if ( h ) h->SetDirectory(0); + return h; } diff --git a/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_193270.xml b/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_193270.xml deleted file mode 100644 index 058d573a155b0a65ac2715b3a09b2c0b9dfceb1c..0000000000000000000000000000000000000000 --- a/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_193270.xml +++ /dev/null @@ -1,444 +0,0 @@ -<?xml version="1.0" ?> -<!-- note this was a MINBIAS pbpb run, not an ENHACNED bias one. Hence we don't have any filters--> -<trigger> - <lumivalues> - <lumivalues_data>5.18e+24</lumivalues_data> - <lumivalues_pred>3.7e+27</lumivalues_pred> - <deadtime>0.0</deadtime> - <peak_mu_av>8.5e-6</peak_mu_av> - </lumivalues> - <bunchgroups> - <bunchgroup id="0" name="BCRVeto">3543</bunchgroup> - <bunchgroup id="1" name="Filled">8</bunchgroup> - <bunchgroup id="2" name="CalReq">71</bunchgroup> - <bunchgroup id="3" name="Empty">3363</bunchgroup> - <bunchgroup id="4" name="UnpairedIsolated">2</bunchgroup> - <bunchgroup id="5" name="UnpairedNonisolated">0</bunchgroup> - <bunchgroup id="6" name="EmptyAfterFilled">40</bunchgroup> - <bunchgroup id="7" name="Unpaired">0</bunchgroup> - <bunchgroup id="8" name="BG8">0</bunchgroup> - <bunchgroup id="9" name="BG9">0</bunchgroup> - <bunchgroup id="10" name="BG10">0</bunchgroup> - <bunchgroup id="11" name="BG11">0</bunchgroup> - <bunchgroup id="12" name="BG12">0</bunchgroup> - <bunchgroup id="13" name="BG13">0</bunchgroup> - <bunchgroup id="14" name="BG14">0</bunchgroup> - <bunchgroup id="15" name="BG15">0</bunchgroup> - </bunchgroups> - <lb_list> - <lb id="47">10124</lb> - <lb id="48">10386</lb> - <lb id="49">9979</lb> - <lb id="50">10226</lb> - <lb id="51">9916</lb> - <lb id="52">9818</lb> - <lb id="53">1690</lb> - <lb id="54">3476</lb> - <lb id="55">604</lb> - <lb id="56">9812</lb> - <lb id="57">9833</lb> - <lb id="58">9642</lb> - <lb id="59">9801</lb> - <lb id="60">9663</lb> - <lb id="61">8665</lb> - <lb id="62">9108</lb> - <lb id="63">9328</lb> - <lb id="64">9299</lb> - <lb id="65">9396</lb> - <lb id="66">9195</lb> - <lb id="67">9382</lb> - <lb id="68">9305</lb> - <lb id="69">9021</lb> - <lb id="70">9036</lb> - <lb id="71">9289</lb> - <lb id="72">8987</lb> - <lb id="73">8893</lb> - <lb id="74">8850</lb> - <lb id="75">8804</lb> - <lb id="76">8075</lb> - <lb id="77">8638</lb> - <lb id="78">8626</lb> - <lb id="79">8813</lb> - <lb id="80">8638</lb> - <lb id="81">8270</lb> - <lb id="82">8292</lb> - <lb id="83">8471</lb> - <lb id="84">8393</lb> - <lb id="85">8283</lb> - <lb id="86">8525</lb> - <lb id="87">1511</lb> - <lb id="88">8329</lb> - <lb id="89">8501</lb> - <lb id="90">8176</lb> - <lb id="91">8396</lb> - <lb id="92">8149</lb> - <lb id="93">8163</lb> - <lb id="94">8162</lb> - <lb id="95">8207</lb> - <lb id="96">8049</lb> - <lb id="97">8167</lb> - <lb id="98">7970</lb> - <lb id="99">7869</lb> - <lb id="100">7987</lb> - <lb id="101">6581</lb> - <lb id="102">7742</lb> - <lb id="103">7777</lb> - <lb id="104">7878</lb> - <lb id="105">7620</lb> - <lb id="106">7602</lb> - <lb id="107">7740</lb> - <lb id="108">7508</lb> - <lb id="109">7538</lb> - <lb id="110">7621</lb> - <lb id="111">7567</lb> - <lb id="112">1290</lb> - <lb id="113">9953</lb> - <lb id="114">9884</lb> - <lb id="115">9872</lb> - <lb id="116">9553</lb> - <lb id="117">9802</lb> - <lb id="118">9711</lb> - <lb id="119">9704</lb> - <lb id="120">9732</lb> - <lb id="121">9706</lb> - <lb id="122">9663</lb> - <lb id="123">9432</lb> - <lb id="124">9679</lb> - <lb id="125">9262</lb> - <lb id="126">9362</lb> - <lb id="127">9542</lb> - <lb id="128">9674</lb> - <lb id="129">9579</lb> - <lb id="130">9266</lb> - <lb id="131">9411</lb> - <lb id="132">9315</lb> - <lb id="133">9175</lb> - <lb id="134">9196</lb> - <lb id="135">9110</lb> - <lb id="136">9204</lb> - <lb id="137">9279</lb> - <lb id="138">8933</lb> - <lb id="139">8932</lb> - <lb id="140">9142</lb> - <lb id="141">9033</lb> - <lb id="142">8798</lb> - <lb id="143">9081</lb> - <lb id="144">8944</lb> - <lb id="145">6344</lb> - <lb id="146">8830</lb> - <lb id="147">8800</lb> - <lb id="148">8676</lb> - <lb id="149">8642</lb> - <lb id="150">8599</lb> - <lb id="151">8467</lb> - <lb id="152">8665</lb> - <lb id="153">8600</lb> - <lb id="154">8506</lb> - <lb id="155">8355</lb> - <lb id="156">8332</lb> - <lb id="157">8507</lb> - <lb id="158">8423</lb> - <lb id="159">8500</lb> - <lb id="160">8318</lb> - <lb id="161">8279</lb> - <lb id="162">8405</lb> - <lb id="163">8102</lb> - <lb id="164">8342</lb> - <lb id="165">8300</lb> - <lb id="166">8418</lb> - <lb id="167">7980</lb> - <lb id="168">8212</lb> - <lb id="169">8346</lb> - <lb id="170">8172</lb> - <lb id="171">8289</lb> - <lb id="172">8094</lb> - <lb id="173">8137</lb> - <lb id="174">7880</lb> - <lb id="175">6913</lb> - <lb id="176">6168</lb> - <lb id="177">6144</lb> - <lb id="178">6240</lb> - <lb id="179">6036</lb> - <lb id="180">6088</lb> - <lb id="181">6058</lb> - <lb id="182">6081</lb> - <lb id="183">2369</lb> - <lb id="184">5950</lb> - <lb id="185">6007</lb> - <lb id="186">5872</lb> - <lb id="187">5991</lb> - <lb id="188">5970</lb> - <lb id="189">5900</lb> - <lb id="190">5738</lb> - <lb id="191">5779</lb> - <lb id="192">5822</lb> - <lb id="193">5191</lb> - <lb id="194">5825</lb> - <lb id="195">5778</lb> - <lb id="196">5658</lb> - <lb id="197">5682</lb> - <lb id="198">5768</lb> - <lb id="199">5926</lb> - <lb id="200">5638</lb> - <lb id="201">5681</lb> - <lb id="202">5735</lb> - <lb id="203">5394</lb> - <lb id="204">5751</lb> - <lb id="205">5608</lb> - <lb id="206">5453</lb> - <lb id="207">1502</lb> - <lb id="208">5371</lb> - <lb id="209">5533</lb> - <lb id="210">5436</lb> - <lb id="211">5444</lb> - <lb id="212">5506</lb> - <lb id="213">5280</lb> - <lb id="214">5472</lb> - <lb id="215">5336</lb> - <lb id="216">5417</lb> - <lb id="217">3944</lb> - <lb id="218">5333</lb> - <lb id="219">5252</lb> - <lb id="220">5392</lb> - <lb id="221">5241</lb> - <lb id="222">5301</lb> - <lb id="223">5013</lb> - <lb id="224">5266</lb> - <lb id="225">1140</lb> - <lb id="226">5280</lb> - <lb id="227">5027</lb> - <lb id="228">5092</lb> - <lb id="229">5135</lb> - <lb id="230">5286</lb> - <lb id="231">4972</lb> - <lb id="232">5329</lb> - <lb id="233">5070</lb> - <lb id="234">5033</lb> - <lb id="235">5163</lb> - <lb id="236">5060</lb> - <lb id="237">5096</lb> - <lb id="238">4933</lb> - <lb id="239">4941</lb> - <lb id="240">5149</lb> - <lb id="241">4832</lb> - <lb id="242">5078</lb> - <lb id="243">4978</lb> - <lb id="244">4982</lb> - <lb id="245">4855</lb> - <lb id="246">5045</lb> - <lb id="247">5073</lb> - <lb id="248">4865</lb> - <lb id="249">4989</lb> - <lb id="250">4791</lb> - <lb id="251">4729</lb> - <lb id="252">2546</lb> - <lb id="253">4682</lb> - <lb id="254">4644</lb> - <lb id="255">4792</lb> - <lb id="256">4733</lb> - <lb id="257">4541</lb> - <lb id="258">4713</lb> - <lb id="259">4723</lb> - <lb id="260">4566</lb> - <lb id="261">4880</lb> - <lb id="262">4845</lb> - <lb id="263">4688</lb> - <lb id="264">4711</lb> - <lb id="265">4692</lb> - <lb id="266">4624</lb> - <lb id="267">4698</lb> - <lb id="268">4634</lb> - <lb id="269">4524</lb> - <lb id="270">4613</lb> - <lb id="271">4646</lb> - <lb id="272">4468</lb> - <lb id="273">4616</lb> - <lb id="274">4567</lb> - <lb id="275">4606</lb> - <lb id="276">4366</lb> - <lb id="277">4709</lb> - <lb id="278">4501</lb> - <lb id="279">4625</lb> - <lb id="280">4455</lb> - <lb id="281">4463</lb> - <lb id="282">4281</lb> - <lb id="283">4373</lb> - <lb id="284">4349</lb> - <lb id="285">812</lb> - <lb id="286">735</lb> - <lb id="287">4441</lb> - <lb id="288">1948</lb> - <lb id="289">4404</lb> - <lb id="290">4503</lb> - <lb id="291">4440</lb> - <lb id="292">4275</lb> - <lb id="293">4353</lb> - <lb id="294">4321</lb> - <lb id="295">4178</lb> - <lb id="296">4259</lb> - <lb id="297">4247</lb> - <lb id="298">4315</lb> - <lb id="299">4254</lb> - <lb id="300">4148</lb> - <lb id="301">4212</lb> - <lb id="302">4258</lb> - <lb id="303">4198</lb> - <lb id="304">4179</lb> - <lb id="305">4004</lb> - <lb id="306">4237</lb> - <lb id="307">4192</lb> - <lb id="308">4032</lb> - <lb id="309">4071</lb> - <lb id="310">4127</lb> - <lb id="311">4073</lb> - <lb id="312">4137</lb> - <lb id="313">3968</lb> - <lb id="314">4121</lb> - <lb id="315">4023</lb> - <lb id="316">4092</lb> - <lb id="317">4044</lb> - <lb id="318">3955</lb> - <lb id="319">4059</lb> - <lb id="320">4196</lb> - <lb id="321">3940</lb> - <lb id="322">4049</lb> - <lb id="323">3858</lb> - <lb id="324">3959</lb> - <lb id="325">3943</lb> - <lb id="326">3946</lb> - <lb id="327">4016</lb> - <lb id="328">3991</lb> - <lb id="329">4011</lb> - <lb id="330">3865</lb> - <lb id="331">1988</lb> - <lb id="332">3777</lb> - <lb id="333">3815</lb> - <lb id="334">3823</lb> - <lb id="335">3861</lb> - <lb id="336">3743</lb> - <lb id="337">3765</lb> - <lb id="338">3763</lb> - <lb id="339">3752</lb> - <lb id="340">3827</lb> - <lb id="341">3902</lb> - <lb id="342">3843</lb> - <lb id="343">3683</lb> - <lb id="344">3749</lb> - <lb id="345">3874</lb> - <lb id="346">3773</lb> - <lb id="347">3842</lb> - <lb id="348">3748</lb> - <lb id="349">3765</lb> - <lb id="350">3827</lb> - <lb id="351">3678</lb> - <lb id="352">2745</lb> - <lb id="353">3575</lb> - <lb id="354">3685</lb> - <lb id="355">3740</lb> - <lb id="356">3576</lb> - <lb id="357">3669</lb> - <lb id="358">3656</lb> - <lb id="359">3585</lb> - <lb id="360">3714</lb> - <lb id="361">3529</lb> - <lb id="362">670</lb> - <lb id="363">633</lb> - <lb id="364">3676</lb> - <lb id="365">3593</lb> - <lb id="366">3706</lb> - <lb id="367">3602</lb> - <lb id="368">3519</lb> - <lb id="369">3510</lb> - <lb id="370">3637</lb> - <lb id="371">3564</lb> - <lb id="372">3566</lb> - <lb id="373">3705</lb> - <lb id="374">3366</lb> - <lb id="375">3594</lb> - <lb id="376">3419</lb> - <lb id="377">3383</lb> - <lb id="378">3549</lb> - <lb id="379">3591</lb> - <lb id="380">3449</lb> - <lb id="381">3513</lb> - <lb id="382">3429</lb> - <lb id="383">3471</lb> - <lb id="384">3528</lb> - <lb id="385">3442</lb> - <lb id="386">3442</lb> - <lb id="387">3416</lb> - <lb id="388">3393</lb> - <lb id="389">3478</lb> - <lb id="390">3383</lb> - <lb id="391">3438</lb> - <lb id="392">3363</lb> - <lb id="393">3387</lb> - <lb id="394">3300</lb> - <lb id="395">3412</lb> - <lb id="396">3358</lb> - <lb id="397">3297</lb> - <lb id="398">3343</lb> - <lb id="399">3308</lb> - <lb id="400">3259</lb> - <lb id="401">3237</lb> - <lb id="402">3226</lb> - <lb id="403">3419</lb> - <lb id="404">3382</lb> - <lb id="405">3252</lb> - <lb id="406">3311</lb> - <lb id="407">3295</lb> - <lb id="408">3407</lb> - <lb id="409">3286</lb> - <lb id="410">3262</lb> - <lb id="411">3203</lb> - <lb id="412">3352</lb> - <lb id="413">3217</lb> - <lb id="414">3177</lb> - <lb id="415">3131</lb> - <lb id="416">3149</lb> - <lb id="417">3115</lb> - <lb id="418">3295</lb> - <lb id="419">3195</lb> - <lb id="420">3285</lb> - <lb id="421">3172</lb> - <lb id="422">3256</lb> - <lb id="423">3112</lb> - <lb id="424">3229</lb> - <lb id="425">3114</lb> - <lb id="426">3127</lb> - <lb id="427">3210</lb> - <lb id="428">3170</lb> - <lb id="429">3070</lb> - <lb id="430">3195</lb> - <lb id="431">3081</lb> - <lb id="432">3102</lb> - <lb id="433">3170</lb> - <lb id="434">3086</lb> - <lb id="435">3114</lb> - <lb id="436">3022</lb> - <lb id="437">3114</lb> - <lb id="438">2978</lb> - <lb id="439">3074</lb> - <lb id="440">3073</lb> - <lb id="441">3045</lb> - <lb id="442">3000</lb> - <lb id="443">2876</lb> - <lb id="444">2980</lb> - <lb id="445">3058</lb> - <lb id="446">3005</lb> - <lb id="447">2940</lb> - <lb id="448">2934</lb> - <lb id="449">2862</lb> - <lb id="450">2979</lb> - <lb id="451">2848</lb> - <lb id="452">2917</lb> - <lb id="453">2963</lb> - <lb id="454">2998</lb> - <lb id="455">2912</lb> - <lb id="456">2932</lb> - <lb id="457">2957</lb> - <lb id="458">2848</lb> - <lb id="459">2909</lb> - <lb id="460">718</lb> - </lb_list> -</trigger> diff --git a/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_212967.xml b/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_212967.xml deleted file mode 100644 index 7016d054f875bd49bdf7c7329a4a83d3a7607328..0000000000000000000000000000000000000000 --- a/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_212967.xml +++ /dev/null @@ -1,495 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<trigger> - <lumivalues> - <lumivalues_data>4.36e+33</lumivalues_data> - <lumivalues_pred>2e+24</lumivalues_pred> - <deadtime>0.0</deadtime> - <peak_mu_av>30.6</peak_mu_av> - </lumivalues> - <bunchgroups> - <bunchgroup id="0" name="BCRVeto">3543</bunchgroup> - <bunchgroup id="1" name="Filled">1368</bunchgroup> - <bunchgroup id="2" name="CalReq">70</bunchgroup> - <bunchgroup id="3" name="Empty">390</bunchgroup> - <bunchgroup id="4" name="UnpairedIsolated">6</bunchgroup> - <bunchgroup id="5" name="UnpairedNonisolated">6</bunchgroup> - <bunchgroup id="6" name="EmptyAfterFilled">1520</bunchgroup> - <bunchgroup id="7" name="Unpaired">1254</bunchgroup> - <bunchgroup id="8" name="BG8">0</bunchgroup> - <bunchgroup id="9" name="BG9">0</bunchgroup> - <bunchgroup id="10" name="BG10">0</bunchgroup> - <bunchgroup id="11" name="BG11">0</bunchgroup> - <bunchgroup id="12" name="BG12">0</bunchgroup> - <bunchgroup id="13" name="BG13">0</bunchgroup> - <bunchgroup id="14" name="BG14">0</bunchgroup> - <bunchgroup id="15" name="BG15">0</bunchgroup> - </bunchgroups> - <lb_list> - <lb id="124">4263</lb> - <lb id="125">4407</lb> - <lb id="126">4418</lb> - <lb id="127">3700</lb> - <lb id="128">4229</lb> - <lb id="129">2268</lb> - <lb id="130">4515</lb> - <lb id="131">4587</lb> - <lb id="132">4375</lb> - <lb id="133">4566</lb> - <lb id="134">4475</lb> - <lb id="135">814</lb> - <lb id="136">789</lb> - <lb id="137">4416</lb> - <lb id="138">4470</lb> - <lb id="139">2381</lb> - <lb id="140">4421</lb> - <lb id="141">4433</lb> - <lb id="142">4448</lb> - <lb id="143">4341</lb> - <lb id="144">666</lb> - <lb id="145">5277</lb> - <lb id="146">5267</lb> - <lb id="147">5229</lb> - <lb id="148">3393</lb> - <lb id="149">4196</lb> - <lb id="150">3567</lb> - <lb id="151">4574</lb> - <lb id="152">4608</lb> - <lb id="153">4492</lb> - <lb id="154">4584</lb> - <lb id="155">4516</lb> - <lb id="156">772</lb> - <lb id="157">748</lb> - <lb id="158">4493</lb> - <lb id="159">4547</lb> - <lb id="160">4522</lb> - <lb id="161">4454</lb> - <lb id="162">4490</lb> - <lb id="163">4580</lb> - <lb id="164">4452</lb> - <lb id="165">4474</lb> - <lb id="166">2147</lb> - <lb id="167">46</lb> - <lb id="168">3399</lb> - <lb id="169">4324</lb> - <lb id="170">4145</lb> - <lb id="171">4191</lb> - <lb id="172">4340</lb> - <lb id="173">4217</lb> - <lb id="174">750</lb> - <lb id="175">675</lb> - <lb id="176">4308</lb> - <lb id="177">4326</lb> - <lb id="178">1145</lb> - <lb id="179">4133</lb> - <lb id="180">4121</lb> - <lb id="181">4288</lb> - <lb id="182">4112</lb> - <lb id="183">4137</lb> - <lb id="184">4159</lb> - <lb id="185">1934</lb> - <lb id="186">4067</lb> - <lb id="187">4086</lb> - <lb id="188">4148</lb> - <lb id="189">4130</lb> - <lb id="190">2189</lb> - <lb id="191">0</lb> - <lb id="192">0</lb> - <lb id="193">4070</lb> - <lb id="194">3978</lb> - <lb id="195">4102</lb> - <lb id="196">4096</lb> - <lb id="197">2878</lb> - <lb id="198">3956</lb> - <lb id="199">4226</lb> - <lb id="200">4057</lb> - <lb id="201">227</lb> - <lb id="202">4</lb> - <lb id="203">1</lb> - <lb id="204">4</lb> - <lb id="205">494</lb> - <lb id="206">708</lb> - <lb id="207">4031</lb> - <lb id="208">4047</lb> - <lb id="209">3934</lb> - <lb id="210">3936</lb> - <lb id="211">4132</lb> - <lb id="212">4065</lb> - <lb id="213">4082</lb> - <lb id="214">3980</lb> - <lb id="215">1491</lb> - <lb id="216">3896</lb> - <lb id="217">4041</lb> - <lb id="218">1280</lb> - <lb id="219">3918</lb> - <lb id="220">3907</lb> - <lb id="221">1370</lb> - <lb id="222">3828</lb> - <lb id="223">3886</lb> - <lb id="224">1699</lb> - <lb id="225">3887</lb> - <lb id="226">3819</lb> - <lb id="227">4227</lb> - <lb id="228">4416</lb> - <lb id="229">751</lb> - <lb id="230">4771</lb> - <lb id="231">4248</lb> - <lb id="232">4191</lb> - <lb id="233">4354</lb> - <lb id="234">474</lb> - <lb id="235">1</lb> - <lb id="236">7</lb> - <lb id="237">12</lb> - <lb id="238">3</lb> - <lb id="239">1</lb> - <lb id="240">0</lb> - <lb id="241">0</lb> - <lb id="242">725</lb> - <lb id="243">743</lb> - <lb id="244">795</lb> - <lb id="245">4315</lb> - <lb id="246">4183</lb> - <lb id="247">1617</lb> - <lb id="248">4084</lb> - <lb id="249">4185</lb> - <lb id="250">4236</lb> - <lb id="251">4241</lb> - <lb id="252">1255</lb> - <lb id="253">3253</lb> - <lb id="254">4155</lb> - <lb id="255">4238</lb> - <lb id="256">1306</lb> - <lb id="257">4042</lb> - <lb id="258">4187</lb> - <lb id="259">1428</lb> - <lb id="260">4308</lb> - <lb id="261">4218</lb> - <lb id="262">4104</lb> - <lb id="263">4083</lb> - <lb id="264">4123</lb> - <lb id="265">765</lb> - <lb id="266">727</lb> - <lb id="267">4561</lb> - <lb id="268">777</lb> - <lb id="269">783</lb> - <lb id="270">4231</lb> - <lb id="271">4077</lb> - <lb id="272">4035</lb> - <lb id="273">4048</lb> - <lb id="274">4191</lb> - <lb id="275">854</lb> - <lb id="276">4085</lb> - <lb id="277">4033</lb> - <lb id="278">4104</lb> - <lb id="279">3963</lb> - <lb id="280">3472</lb> - <lb id="281">4025</lb> - <lb id="282">3925</lb> - <lb id="283">4077</lb> - <lb id="284">4078</lb> - <lb id="285">4027</lb> - <lb id="286">3328</lb> - <lb id="287">4022</lb> - <lb id="288">3967</lb> - <lb id="289">4033</lb> - <lb id="290">3971</lb> - <lb id="291">3995</lb> - <lb id="292">3888</lb> - <lb id="293">3852</lb> - <lb id="294">3982</lb> - <lb id="295">3982</lb> - <lb id="296">1188</lb> - <lb id="297">3849</lb> - <lb id="298">3998</lb> - <lb id="299">2307</lb> - <lb id="300">3899</lb> - <lb id="301">3863</lb> - <lb id="302">3881</lb> - <lb id="303">3858</lb> - <lb id="304">1700</lb> - <lb id="305">3770</lb> - <lb id="306">3938</lb> - <lb id="307">3963</lb> - <lb id="308">3924</lb> - <lb id="309">3752</lb> - <lb id="310">3904</lb> - <lb id="311">3758</lb> - <lb id="312">3695</lb> - <lb id="313">3895</lb> - <lb id="314">3903</lb> - <lb id="315">2895</lb> - <lb id="316">3649</lb> - <lb id="317">3891</lb> - <lb id="318">3859</lb> - <lb id="319">3831</lb> - <lb id="320">3635</lb> - <lb id="321">3791</lb> - <lb id="322">3892</lb> - <lb id="323">3956</lb> - <lb id="324">3842</lb> - <lb id="325">1751</lb> - <lb id="326">475</lb> - <lb id="327">3811</lb> - <lb id="328">3812</lb> - <lb id="329">516</lb> - <lb id="330">4216</lb> - <lb id="331">4250</lb> - <lb id="332">4268</lb> - <lb id="333">4281</lb> - <lb id="334">4161</lb> - <lb id="335">4200</lb> - <lb id="336">4294</lb> - <lb id="337">4258</lb> - <lb id="338">3544</lb> - <lb id="339">4220</lb> - <lb id="340">4213</lb> - <lb id="341">4015</lb> - <lb id="342">4219</lb> - <lb id="343">4146</lb> - <lb id="344">738</lb> - <lb id="345">730</lb> - <lb id="346">4229</lb> - <lb id="347">4072</lb> - <lb id="348">4190</lb> - <lb id="349">4010</lb> - <lb id="350">3996</lb> - <lb id="351">4078</lb> - <lb id="352">4146</lb> - <lb id="353">4167</lb> - <lb id="354">4130</lb> - <lb id="355">4129</lb> - <lb id="356">411</lb> - <lb id="357">4083</lb> - <lb id="358">4161</lb> - <lb id="359">4160</lb> - <lb id="360">4068</lb> - <lb id="361">4175</lb> - <lb id="362">3706</lb> - <lb id="363">5068</lb> - <lb id="364">3937</lb> - <lb id="365">4534</lb> - <lb id="366">3381</lb> - <lb id="367">4999</lb> - <lb id="368">4177</lb> - <lb id="369">3968</lb> - <lb id="370">3885</lb> - <lb id="371">3951</lb> - <lb id="372">699</lb> - <lb id="373">705</lb> - <lb id="374">4024</lb> - <lb id="375">4022</lb> - <lb id="376">4022</lb> - <lb id="377">4031</lb> - <lb id="378">4179</lb> - <lb id="379">4079</lb> - <lb id="380">4103</lb> - <lb id="381">3933</lb> - <lb id="382">4061</lb> - <lb id="383">4078</lb> - <lb id="384">4004</lb> - <lb id="385">4018</lb> - <lb id="386">3293</lb> - <lb id="387">4304</lb> - <lb id="388">3982</lb> - <lb id="389">4012</lb> - <lb id="390">3933</lb> - <lb id="391">3809</lb> - <lb id="392">3908</lb> - <lb id="393">3907</lb> - <lb id="394">3887</lb> - <lb id="395">3922</lb> - <lb id="396">3979</lb> - <lb id="397">3978</lb> - <lb id="398">3988</lb> - <lb id="399">3909</lb> - <lb id="400">3908</lb> - <lb id="401">3880</lb> - <lb id="402">3938</lb> - <lb id="403">3911</lb> - <lb id="404">3888</lb> - <lb id="405">3905</lb> - <lb id="406">3902</lb> - <lb id="407">3924</lb> - <lb id="408">3885</lb> - <lb id="409">3826</lb> - <lb id="410">3828</lb> - <lb id="411">3810</lb> - <lb id="412">3919</lb> - <lb id="413">2637</lb> - <lb id="414">6831</lb> - <lb id="415">3273</lb> - <lb id="416">4503</lb> - <lb id="417">4406</lb> - <lb id="418">3803</lb> - <lb id="419">3805</lb> - <lb id="420">1039</lb> - </lb_list> - <filters> - <filter> - <eb_hlt_chains> - <eb_hlt_name>EF_eb_physics</eb_hlt_name> - <lv1_ebtrigs>L1_2EM3_EM12</lv1_ebtrigs> - <lv1_ebtrigs>L1_XS45</lv1_ebtrigs> - <lv1_ebtrigs>L1_J50</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU4_J15</lv1_ebtrigs> - <lv1_ebtrigs>L1_FJ30</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU10</lv1_ebtrigs> - <lv1_ebtrigs>L1_J30</lv1_ebtrigs> - <lv1_ebtrigs>L1_TE500</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM10VH</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM16VH</lv1_ebtrigs> - <lv1_ebtrigs>L1_TE700</lv1_ebtrigs> - <lv1_ebtrigs>L1_XE30</lv1_ebtrigs> - <lv1_ebtrigs>L1_XE20</lv1_ebtrigs> - <lv1_ebtrigs>L1_3J15</lv1_ebtrigs> - <lv1_ebtrigs>L1_TAU20</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU6</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM12</lv1_ebtrigs> - </eb_hlt_chains> - <eb_hlt_chains> - <eb_hlt_name>EF_high_eb_physics</eb_hlt_name> - <lv1_ebtrigs>L1_2MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU4_J30</lv1_ebtrigs> - <lv1_ebtrigs>L1_XS60</lv1_ebtrigs> - <lv1_ebtrigs>L1_FJ50</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM16V_XE20</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU4_J50</lv1_ebtrigs> - <lv1_ebtrigs>L1_2EM6_EM16VH</lv1_ebtrigs> - <lv1_ebtrigs>L1_XS50</lv1_ebtrigs> - <lv1_ebtrigs>L1_2MU4_MU6</lv1_ebtrigs> - <lv1_ebtrigs>L1_2MU4_BARREL</lv1_ebtrigs> - <lv1_ebtrigs>L1_2MU4_2EM3</lv1_ebtrigs> - </eb_hlt_chains> - </filter> - <filter> - <filter_name>EF_eb_physics_noL1PS</filter_name> - <lv1_filter>L1_RD0_FILLED</lv1_filter> - <lv1_filter>L1_RD1_FILLED</lv1_filter> - <lv1_filter>L1_2EM10VH</lv1_filter> - <lv1_filter>L1_2EM12_EM16V</lv1_filter> - <lv1_filter>L1_2EM6_MU6</lv1_filter> - <lv1_filter>L1_2FJ15</lv1_filter> - <lv1_filter>L1_2FJ30</lv1_filter> - <lv1_filter>L1_2MU10</lv1_filter> - <lv1_filter>L1_2MU4_BARRELONLY</lv1_filter> - <lv1_filter>L1_2MU4_MU6_BARREL</lv1_filter> - <lv1_filter>L1_2MU4_XE40</lv1_filter> - <lv1_filter>L1_2MU6</lv1_filter> - <lv1_filter>L1_2TAU11I_EM14VH</lv1_filter> - <lv1_filter>L1_2TAU11I_TAU15</lv1_filter> - <lv1_filter>L1_2TAU11_TAU20_EM14VH</lv1_filter> - <lv1_filter>L1_2TAU20</lv1_filter> - <lv1_filter>L1_2TAU8_TAU11I_EM10VH_FJ15</lv1_filter> - <lv1_filter>L1_2TAU8_TAU11I_EM10VH_J15CF</lv1_filter> - <lv1_filter>L1_2TAU8_TAU15_FJ15</lv1_filter> - <lv1_filter>L1_2TAU8_TAU15_J15CF</lv1_filter> - <lv1_filter>L1_3EM6_EM14VH</lv1_filter> - <lv1_filter>L1_3J15_FJ15</lv1_filter> - <lv1_filter>L1_3J15_J50</lv1_filter> - <lv1_filter>L1_3MU4</lv1_filter> - <lv1_filter>L1_3MU6</lv1_filter> - <lv1_filter>L1_4J15</lv1_filter> - <lv1_filter>L1_EM10VH_MU6</lv1_filter> - <lv1_filter>L1_EM14VH_FJ15</lv1_filter> - <lv1_filter>L1_EM14VH_J15CF</lv1_filter> - <lv1_filter>L1_EM16VH_MU4</lv1_filter> - <lv1_filter>L1_EM18VH</lv1_filter> - <lv1_filter>L1_EM30</lv1_filter> - <lv1_filter>L1_EM6_2MU6</lv1_filter> - <lv1_filter>L1_EM6_XS55</lv1_filter> - <lv1_filter>L1_FJ75</lv1_filter> - <lv1_filter>L1_J30_XE40</lv1_filter> - <lv1_filter>L1_J30_XE50</lv1_filter> - <lv1_filter>L1_J350</lv1_filter> - <lv1_filter>L1_J50_XE35</lv1_filter> - <lv1_filter>L1_J50_XE40</lv1_filter> - <lv1_filter>L1_J75</lv1_filter> - <lv1_filter>L1_MU10_FJ15</lv1_filter> - <lv1_filter>L1_MU10_J15CF</lv1_filter> - <lv1_filter>L1_MU10_J20</lv1_filter> - <lv1_filter>L1_MU15</lv1_filter> - <lv1_filter>L1_MU20</lv1_filter> - <lv1_filter>L1_MU4_J20_XE35</lv1_filter> - <lv1_filter>L1_MU6_2J20</lv1_filter> - <lv1_filter>L1_TAU11_MU10</lv1_filter> - <lv1_filter>L1_TAU15I_XE35</lv1_filter> - <lv1_filter>L1_TAU15I_XE40</lv1_filter> - <lv1_filter>L1_TAU15_XE35</lv1_filter> - <lv1_filter>L1_TAU15_XE40</lv1_filter> - <lv1_filter>L1_TAU20_XE35</lv1_filter> - <lv1_filter>L1_TAU20_XE40</lv1_filter> - <lv1_filter>L1_TAU40</lv1_filter> - <lv1_filter>L1_TAU8_MU10</lv1_filter> - <lv1_filter>L1_TE800</lv1_filter> - <lv1_filter>L1_XE35_BGRP7</lv1_filter> - <lv1_filter>L1_XE40</lv1_filter> - <lv1_filter>L1_XE40_BGRP7</lv1_filter> - <lv1_filter>L1_XE50</lv1_filter> - <lv1_filter>L1_XE50_BGRP7</lv1_filter> - <lv1_filter>L1_XE60</lv1_filter> - <lv1_filter>L1_XE70</lv1_filter> - </filter> - <filter> - <filter_name>EF_eb_physics_unpaired_iso</filter_name> - <lv1_filter>L1_2MU6_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_EM3_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_FJ30_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_J10_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_J30_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_MU10_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_MU4_J15_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_MU4_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_TAU8_UNPAIRED_ISO</lv1_filter> - </filter> - <filter> - <filter_name>EF_eb_random_unpaired_iso</filter_name> - <lv1_filter>L1_RD0_UNPAIRED_ISO</lv1_filter> - </filter> - <filter> - <filter_name>EF_eb_physics_unpaired_noniso</filter_name> - <filter_type>default</filter_type> - <lv1_filter>L1_2MU6_UNPAIRED_NONISO</lv1_filter> - <lv1_filter>L1_EM3_UNPAIRED_NONISO</lv1_filter> - <lv1_filter>L1_J10_UNPAIRED_NONISO</lv1_filter> - <lv1_filter>L1_J30_UNPAIRED_NONISO</lv1_filter> - <lv1_filter>L1_MU4_UNPAIRED_NONISO</lv1_filter> - <lv1_filter>L1_TAU8_UNPAIRED_NONISO</lv1_filter> - </filter> - <filter> - <filter_name>EF_eb_physics_empty</filter_name> - <lv1_filter>L1_2MU4_EMPTY</lv1_filter> - <lv1_filter>L1_EM3_EMPTY</lv1_filter> - <lv1_filter>L1_EM6_EMPTY</lv1_filter> - <lv1_filter>L1_FJ30_EMPTY</lv1_filter> - <lv1_filter>L1_J10_EMPTY</lv1_filter> - <lv1_filter>L1_J30_EMPTY</lv1_filter> - <lv1_filter>L1_MU10_EMPTY</lv1_filter> - <lv1_filter>L1_MU11_EMPTY</lv1_filter> - <lv1_filter>L1_MU4_EMPTY</lv1_filter> - <lv1_filter>L1_MU4_J15_EMPTY</lv1_filter> - <lv1_filter>L1_TAU8_EMPTY</lv1_filter> - </filter> - <filter> - <filter_name>EF_eb_random_empty</filter_name> - <lv1_filter>L1_RD0_EMPTY</lv1_filter> - <lv1_weight>L1_RD0_EMPTY</lv1_weight> - </filter> - <filter> - <filter_name>EF_eb_physics_firstempty</filter_name> - <filter_type>default</filter_type> - <lv1_filter>L1_2MU4_FIRSTEMPTY</lv1_filter> - <lv1_filter>L1_EM3_FIRSTEMPTY</lv1_filter> - <lv1_filter>L1_FJ30_FIRSTEMPTY</lv1_filter> - <lv1_filter>L1_J10_FIRSTEMPTY</lv1_filter> - <lv1_filter>L1_J30_FIRSTEMPTY</lv1_filter> - <lv1_filter>L1_MU10_FIRSTEMPTY</lv1_filter> - <lv1_filter>L1_MU20_FIRSTEMPTY</lv1_filter> - <lv1_filter>L1_MU4_FIRSTEMPTY</lv1_filter> - <lv1_filter>L1_MU6_FIRSTEMPTY</lv1_filter> - <lv1_filter>L1_TAU8_FIRSTEMPTY</lv1_filter> - </filter> - <filter> - <filter_name>EF_eb_random_firstempty</filter_name> - <lv1_filter>L1_RD0_FIRSTEMPTY</lv1_filter> - </filter> - </filters> -</trigger> diff --git a/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_218048.xml b/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_218048.xml deleted file mode 100644 index 8afc5903084488f016019b968506a7377c2d513f..0000000000000000000000000000000000000000 --- a/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_218048.xml +++ /dev/null @@ -1,621 +0,0 @@ -<?xml version="1.0" ?> -<trigger> - <lumivalues> - <lumivalues_data>0.057e30</lumivalues_data> - <lumivalues_pred>0.06e30</lumivalues_pred> - <deadtime>0.025</deadtime> - <peak_mu_av>0.0012</peak_mu_av> - </lumivalues> - <bunchgroups> - <bunchgroup id="0" name="BCRVeto">3543</bunchgroup> - <bunchgroup id="1" name="Filled">296</bunchgroup> - <bunchgroup id="2" name="CalReq">70</bunchgroup> - <bunchgroup id="3" name="Empty">543</bunchgroup> - <bunchgroup id="4" name="UnpairedIsolated">84</bunchgroup> - <bunchgroup id="5" name="UnpairedNonisolated">42</bunchgroup> - <bunchgroup id="6" name="EmptyAfterFilled">1480</bunchgroup> - <bunchgroup id="7" name="Unpaired">17</bunchgroup> - <bunchgroup id="8" name="BG8">0</bunchgroup> - <bunchgroup id="9" name="BG9">0</bunchgroup> - <bunchgroup id="10" name="BG10">0</bunchgroup> - <bunchgroup id="11" name="BG11">0</bunchgroup> - <bunchgroup id="12" name="BG12">0</bunchgroup> - <bunchgroup id="13" name="BG13">0</bunchgroup> - <bunchgroup id="14" name="BG14">0</bunchgroup> - <bunchgroup id="15" name="BG15">0</bunchgroup> - </bunchgroups> - <lb_list> - <lb id="527" lumi="0.09751" mu="0.00209">0</lb> - <lb id="528" lumi="0.0973" mu="0.00209">0</lb> - <lb id="529" lumi="0.0971" mu="0.00209">255</lb> - <lb id="530" lumi="0.09692" mu="0.00208">1015</lb> - <lb id="531" lumi="0.0966" mu="0.00207">1027</lb> - <lb id="532" lumi="0.09637" mu="0.00207">1011</lb> - <lb id="533" lumi="0.09604" mu="0.00206">997</lb> - <lb id="534" lumi="0.09571" mu="0.00206">995</lb> - <lb id="535" lumi="0.09543" mu="0.00205">995</lb> - <lb id="536" lumi="0.09519" mu="0.00204">994</lb> - <lb id="537" lumi="0.09483" mu="0.00204">988</lb> - <lb id="538" lumi="0.09453" mu="0.00203">986</lb> - <lb id="539" lumi="0.09427" mu="0.00202">1005</lb> - <lb id="540" lumi="0.09392" mu="0.00202">982</lb> - <lb id="541" lumi="0.09367" mu="0.00201">980</lb> - <lb id="542" lumi="0.09333" mu="0.002">978</lb> - <lb id="543" lumi="0.09305" mu="0.002">978</lb> - <lb id="544" lumi="0.09277" mu="0.00199">967</lb> - <lb id="545" lumi="0.09245" mu="0.00199">969</lb> - <lb id="546" lumi="0.09222" mu="0.00198">978</lb> - <lb id="547" lumi="0.09197" mu="0.00198">975</lb> - <lb id="548" lumi="0.09171" mu="0.00197">966</lb> - <lb id="549" lumi="0.09138" mu="0.00196">961</lb> - <lb id="550" lumi="0.09113" mu="0.00196">956</lb> - <lb id="551" lumi="0.09082" mu="0.00195">292</lb> - <lb id="552" lumi="0.09078" mu="0.00195">958</lb> - <lb id="553" lumi="0.09073" mu="0.00195">328</lb> - <lb id="554" lumi="0.09042" mu="0.00194">864</lb> - <lb id="555" lumi="0.09014" mu="0.00194">941</lb> - <lb id="556" lumi="0.08999" mu="0.00193">224</lb> - <lb id="557" lumi="0.08996" mu="0.00193">234</lb> - <lb id="558" lumi="0.08979" mu="0.00193">943</lb> - <lb id="559" lumi="0.08972" mu="0.00193">283</lb> - <lb id="560" lumi="0.0895" mu="0.00192">1405</lb> - <lb id="561" lumi="0.08937" mu="0.00192">347</lb> - <lb id="562" lumi="0.0891" mu="0.00191">853</lb> - <lb id="563" lumi="0.08892" mu="0.00191">882</lb> - <lb id="564" lumi="0.08868" mu="0.0019">908</lb> - <lb id="565" lumi="0.08843" mu="0.0019">1227</lb> - <lb id="566" lumi="0.08819" mu="0.00189">1398</lb> - <lb id="567" lumi="0.08794" mu="0.00189">1396</lb> - <lb id="568" lumi="0.08762" mu="0.00188">1384</lb> - <lb id="569" lumi="0.08732" mu="0.00188">1389</lb> - <lb id="570" lumi="0.08685" mu="0.00187">934</lb> - <lb id="571" lumi="0.08665" mu="0.00186">1391</lb> - <lb id="572" lumi="0.08629" mu="0.00185">1366</lb> - <lb id="573" lumi="0.08596" mu="0.00185">1363</lb> - <lb id="574" lumi="0.08599" mu="0.00185">235</lb> - <lb id="575" lumi="0.08578" mu="0.00184">1364</lb> - <lb id="576" lumi="0.0855" mu="0.00184">1360</lb> - <lb id="577" lumi="0.08577" mu="0.00184">1367</lb> - <lb id="578" lumi="0.08585" mu="0.00184">1362</lb> - <lb id="579" lumi="0.08577" mu="0.00184">1367</lb> - <lb id="580" lumi="0.08559" mu="0.00184">1378</lb> - <lb id="581" lumi="0.08534" mu="0.00183">1351</lb> - <lb id="582" lumi="0.0851" mu="0.00183">1355</lb> - <lb id="583" lumi="0.08489" mu="0.00182">1354</lb> - <lb id="584" lumi="0.08457" mu="0.00182">1349</lb> - <lb id="585" lumi="0.08437" mu="0.00181">1345</lb> - <lb id="586" lumi="0.08408" mu="0.00181">1337</lb> - <lb id="587" lumi="0.08393" mu="0.0018">1340</lb> - <lb id="588" lumi="0.08378" mu="0.0018">1354</lb> - <lb id="589" lumi="0.08367" mu="0.0018">1342</lb> - <lb id="590" lumi="0.08347" mu="0.00179">1321</lb> - <lb id="591" lumi="0.08335" mu="0.00179">1336</lb> - <lb id="592" lumi="0.08319" mu="0.00179">1326</lb> - <lb id="593" lumi="0.08295" mu="0.00178">1327</lb> - <lb id="594" lumi="0.07998" mu="0.00172">1282</lb> - <lb id="595" lumi="0.08117" mu="0.00174">1296</lb> - <lb id="596" lumi="0.08298" mu="0.00178">744</lb> - <lb id="597" lumi="0.08278" mu="0.00178">1323</lb> - <lb id="598" lumi="0.08255" mu="0.00177">1319</lb> - <lb id="599" lumi="0.08239" mu="0.00177">1347</lb> - <lb id="600" lumi="0.08217" mu="0.00177">1314</lb> - <lb id="601" lumi="0.08194" mu="0.00176">1312</lb> - <lb id="602" lumi="0.08176" mu="0.00176">1307</lb> - <lb id="603" lumi="0.08161" mu="0.00175">1306</lb> - <lb id="604" lumi="0.08133" mu="0.00175">1304</lb> - <lb id="605" lumi="0.08114" mu="0.00174">1298</lb> - <lb id="606" lumi="0.08093" mu="0.00174">1320</lb> - <lb id="607" lumi="0.08076" mu="0.00173">1301</lb> - <lb id="608" lumi="0.08053" mu="0.00173">1305</lb> - <lb id="609" lumi="0.08036" mu="0.00173">1292</lb> - <lb id="610" lumi="0.08015" mu="0.00172">1287</lb> - <lb id="611" lumi="0.07997" mu="0.00172">636</lb> - <lb id="612" lumi="0.07992" mu="0.00172">1290</lb> - <lb id="613" lumi="0.07972" mu="0.00171">1282</lb> - <lb id="614" lumi="0.07949" mu="0.00171">1277</lb> - <lb id="615" lumi="0.07932" mu="0.0017">1305</lb> - <lb id="616" lumi="0.07909" mu="0.0017">1275</lb> - <lb id="617" lumi="0.07905" mu="0.0017">227</lb> - <lb id="618" lumi="0.07898" mu="0.0017">242</lb> - <lb id="619" lumi="0.07885" mu="0.00169">199</lb> - <lb id="620" lumi="0.07876" mu="0.00169">1584</lb> - <lb id="621" lumi="0.07854" mu="0.00169">1600</lb> - <lb id="622" lumi="0.07839" mu="0.00168">1595</lb> - <lb id="623" lumi="0.07826" mu="0.00168">1571</lb> - <lb id="624" lumi="0.07796" mu="0.00167">1569</lb> - <lb id="625" lumi="0.07779" mu="0.00167">1566</lb> - <lb id="626" lumi="0.0776" mu="0.00167">1561</lb> - <lb id="627" lumi="0.07745" mu="0.00166">1558</lb> - <lb id="628" lumi="0.07722" mu="0.00166">1556</lb> - <lb id="629" lumi="0.07703" mu="0.00165">402</lb> - <lb id="630" lumi="0.07699" mu="0.00165">1533</lb> - <lb id="631" lumi="0.07684" mu="0.00165">1552</lb> - <lb id="632" lumi="0.07664" mu="0.00165">1548</lb> - <lb id="633" lumi="0.07644" mu="0.00164">1579</lb> - <lb id="634" lumi="0.07628" mu="0.00164">1537</lb> - <lb id="635" lumi="0.07614" mu="0.00164">274</lb> - <lb id="636" lumi="0.07611" mu="0.00163">274</lb> - <lb id="637" lumi="0.07604" mu="0.00163">1533</lb> - <lb id="638" lumi="0.07589" mu="0.00163">748</lb> - <lb id="639" lumi="0.07576" mu="0.00163">1519</lb> - <lb id="640" lumi="0.07562" mu="0.00162">1523</lb> - <lb id="641" lumi="0.07544" mu="0.00162">1539</lb> - <lb id="642" lumi="0.07522" mu="0.00162">1522</lb> - <lb id="643" lumi="0.07508" mu="0.00161">1512</lb> - <lb id="644" lumi="0.07482" mu="0.00161">1513</lb> - <lb id="645" lumi="0.07472" mu="0.0016">1433</lb> - <lb id="646" lumi="0.07452" mu="0.0016">1490</lb> - <lb id="647" lumi="0.07437" mu="0.0016">1508</lb> - <lb id="648" lumi="0.07418" mu="0.00159">1503</lb> - <lb id="649" lumi="0.07404" mu="0.00159">1503</lb> - <lb id="650" lumi="0.07385" mu="0.00159">1489</lb> - <lb id="651" lumi="0.0737" mu="0.00158">1494</lb> - <lb id="652" lumi="0.07352" mu="0.00158">1490</lb> - <lb id="653" lumi="0.0733" mu="0.00157">197</lb> - <lb id="654" lumi="0.07324" mu="0.00157">1021</lb> - <lb id="655" lumi="0.07306" mu="0.00157">1084</lb> - <lb id="656" lumi="0.07291" mu="0.00157">1482</lb> - <lb id="657" lumi="0.07269" mu="0.00156">1482</lb> - <lb id="658" lumi="0.07263" mu="0.00156">1410</lb> - <lb id="659" lumi="0.07244" mu="0.00156">1485</lb> - <lb id="660" lumi="0.07232" mu="0.00155">1456</lb> - <lb id="661" lumi="0.07216" mu="0.00155">516</lb> - <lb id="662" lumi="0.07204" mu="0.00155">1540</lb> - <lb id="663" lumi="0.07186" mu="0.00154">485</lb> - <lb id="664" lumi="0.07178" mu="0.00154">1470</lb> - <lb id="665" lumi="0.07167" mu="0.00154">1073</lb> - <lb id="666" lumi="0.07149" mu="0.00154">1472</lb> - <lb id="667" lumi="0.07136" mu="0.00153">1455</lb> - <lb id="668" lumi="0.07116" mu="0.00153">1451</lb> - <lb id="669" lumi="0.07102" mu="0.00153">1450</lb> - <lb id="670" lumi="0.07085" mu="0.00152">777</lb> - <lb id="671" lumi="0.07072" mu="0.00152">1455</lb> - <lb id="672" lumi="0.07054" mu="0.00152">278</lb> - <lb id="673" lumi="0.0706" mu="0.00152">1436</lb> - <lb id="674" lumi="0.07038" mu="0.00151">1438</lb> - <lb id="675" lumi="0.07024" mu="0.00151">1430</lb> - <lb id="676" lumi="0.07011" mu="0.00151">1431</lb> - <lb id="677" lumi="0.06999" mu="0.0015">802</lb> - <lb id="678" lumi="0.06984" mu="0.0015">1449</lb> - <lb id="679" lumi="0.06975" mu="0.0015">444</lb> - <lb id="680" lumi="0.06964" mu="0.0015">1433</lb> - <lb id="681" lumi="0.06944" mu="0.00149">1418</lb> - <lb id="682" lumi="0.06945" mu="0.00149">253</lb> - <lb id="683" lumi="0.06932" mu="0.00149">1414</lb> - <lb id="684" lumi="0.06914" mu="0.00149">1435</lb> - <lb id="685" lumi="0.069" mu="0.00148">1422</lb> - <lb id="686" lumi="0.06879" mu="0.00148">1409</lb> - <lb id="687" lumi="0.06865" mu="0.00147">1125</lb> - <lb id="688" lumi="0.06851" mu="0.00147">1405</lb> - <lb id="689" lumi="0.06836" mu="0.00147">1399</lb> - <lb id="690" lumi="0.06825" mu="0.00147">1384</lb> - <lb id="691" lumi="0.06807" mu="0.00146">1393</lb> - <lb id="692" lumi="0.06795" mu="0.00146">1249</lb> - <lb id="693" lumi="0.06774" mu="0.00146">1032</lb> - <lb id="694" lumi="0.06759" mu="0.00145">1309</lb> - <lb id="695" lumi="0.06748" mu="0.00145">1402</lb> - <lb id="696" lumi="0.06731" mu="0.00145">1378</lb> - <lb id="697" lumi="0.06723" mu="0.00144">634</lb> - <lb id="698" lumi="0.06709" mu="0.00144">980</lb> - <lb id="699" lumi="0.06695" mu="0.00144">801</lb> - <lb id="700" lumi="0.06678" mu="0.00143">1255</lb> - <lb id="701" lumi="0.06666" mu="0.00143">1308</lb> - <lb id="702" lumi="0.06648" mu="0.00143">1156</lb> - <lb id="703" lumi="0.06656" mu="0.00143">146</lb> - <lb id="704" lumi="0.06632" mu="0.00142">152</lb> - <lb id="705" lumi="0.06632" mu="0.00142">687</lb> - <lb id="706" lumi="0.06629" mu="0.00142">255</lb> - <lb id="707" lumi="0.06614" mu="0.00142">753</lb> - <lb id="708" lumi="0.06603" mu="0.00142">1101</lb> - <lb id="709" lumi="0.0658" mu="0.00141">1349</lb> - <lb id="710" lumi="0.06571" mu="0.00141">1350</lb> - <lb id="711" lumi="0.0656" mu="0.00141">1341</lb> - <lb id="712" lumi="0.06536" mu="0.0014">1347</lb> - <lb id="713" lumi="0.06526" mu="0.0014">1339</lb> - <lb id="714" lumi="0.06509" mu="0.0014">1338</lb> - <lb id="715" lumi="0.06498" mu="0.0014">1338</lb> - <lb id="716" lumi="0.06478" mu="0.00139">1352</lb> - <lb id="717" lumi="0.06464" mu="0.00139">1325</lb> - <lb id="718" lumi="0.06454" mu="0.00139">1329</lb> - <lb id="719" lumi="0.0644" mu="0.00138">1144</lb> - <lb id="720" lumi="0.06426" mu="0.00138">1317</lb> - <lb id="721" lumi="0.06418" mu="0.00138">1322</lb> - <lb id="722" lumi="0.06404" mu="0.00138">1323</lb> - <lb id="723" lumi="0.06387" mu="0.00137">460</lb> - <lb id="724" lumi="0.06376" mu="0.00137">1377</lb> - <lb id="725" lumi="0.06372" mu="0.00137">1315</lb> - <lb id="726" lumi="0.06348" mu="0.00136">1311</lb> - <lb id="727" lumi="0.06346" mu="0.00136">1333</lb> - <lb id="728" lumi="0.06334" mu="0.00136">826</lb> - <lb id="729" lumi="0.06321" mu="0.00136">1319</lb> - <lb id="730" lumi="0.06307" mu="0.00135">1303</lb> - <lb id="731" lumi="0.06294" mu="0.00135">1301</lb> - <lb id="732" lumi="0.06288" mu="0.00135">315</lb> - <lb id="733" lumi="0.06277" mu="0.00135">1297</lb> - <lb id="734" lumi="0.06265" mu="0.00135">1305</lb> - <lb id="735" lumi="0.06249" mu="0.00134">1298</lb> - <lb id="736" lumi="0.06236" mu="0.00134">1291</lb> - <lb id="737" lumi="0.06228" mu="0.00134">1287</lb> - <lb id="738" lumi="0.06215" mu="0.00133">1282</lb> - <lb id="739" lumi="0.06202" mu="0.00133">1278</lb> - <lb id="740" lumi="0.06188" mu="0.00133">1281</lb> - <lb id="741" lumi="0.06174" mu="0.00133">410</lb> - <lb id="742" lumi="0.06165" mu="0.00132">1279</lb> - <lb id="743" lumi="0.06157" mu="0.00132">1308</lb> - <lb id="744" lumi="0.06146" mu="0.00132">1274</lb> - <lb id="745" lumi="0.06126" mu="0.00132">1271</lb> - <lb id="746" lumi="0.06118" mu="0.00131">1263</lb> - <lb id="747" lumi="0.06109" mu="0.00131">225</lb> - <lb id="748" lumi="0.06103" mu="0.00131">223</lb> - <lb id="749" lumi="0.06096" mu="0.00131">1261</lb> - <lb id="750" lumi="0.0609" mu="0.00131">1250</lb> - <lb id="751" lumi="0.06079" mu="0.00131">1292</lb> - <lb id="752" lumi="0.06061" mu="0.0013">426</lb> - <lb id="753" lumi="0.06051" mu="0.0013">1655</lb> - <lb id="754" lumi="0.06044" mu="0.0013">1031</lb> - <lb id="755" lumi="0.06038" mu="0.0013">1661</lb> - <lb id="756" lumi="0.06022" mu="0.00129">1660</lb> - <lb id="757" lumi="0.06013" mu="0.00129">983</lb> - <lb id="758" lumi="0.06003" mu="0.00129">1663</lb> - <lb id="759" lumi="0.05993" mu="0.00129">1650</lb> - <lb id="760" lumi="0.05983" mu="0.00129">1647</lb> - <lb id="761" lumi="0.05966" mu="0.00128">1645</lb> - <lb id="762" lumi="0.05955" mu="0.00128">1639</lb> - <lb id="763" lumi="0.05947" mu="0.00128">1633</lb> - <lb id="764" lumi="0.0593" mu="0.00127">1634</lb> - <lb id="765" lumi="0.05925" mu="0.00127">1104</lb> - <lb id="766" lumi="0.0592" mu="0.00127">305</lb> - <lb id="767" lumi="0.05917" mu="0.00127">1619</lb> - <lb id="768" lumi="0.05903" mu="0.00127">1624</lb> - <lb id="769" lumi="0.05886" mu="0.00126">1623</lb> - <lb id="770" lumi="0.05876" mu="0.00126">1621</lb> - <lb id="771" lumi="0.05861" mu="0.00126">1616</lb> - <lb id="772" lumi="0.05853" mu="0.00126">1610</lb> - <lb id="773" lumi="0.05836" mu="0.00125">1614</lb> - <lb id="774" lumi="0.05827" mu="0.00125">1608</lb> - <lb id="775" lumi="0.05816" mu="0.00125">1628</lb> - <lb id="776" lumi="0.05806" mu="0.00125">1606</lb> - <lb id="777" lumi="0.05796" mu="0.00124">1602</lb> - <lb id="778" lumi="0.05783" mu="0.00124">1601</lb> - <lb id="779" lumi="0.05778" mu="0.00124">1593</lb> - <lb id="780" lumi="0.05762" mu="0.00124">1579</lb> - <lb id="781" lumi="0.05752" mu="0.00124">1588</lb> - <lb id="782" lumi="0.05736" mu="0.00123">1584</lb> - <lb id="783" lumi="0.0573" mu="0.00123">1585</lb> - <lb id="784" lumi="0.0572" mu="0.00123">1585</lb> - <lb id="785" lumi="0.05703" mu="0.00123">1608</lb> - <lb id="786" lumi="0.05691" mu="0.00122">1570</lb> - <lb id="787" lumi="0.0568" mu="0.00122">1573</lb> - <lb id="788" lumi="0.05674" mu="0.00122">1572</lb> - <lb id="789" lumi="0.05656" mu="0.00122">1564</lb> - <lb id="790" lumi="0.05646" mu="0.00121">1563</lb> - <lb id="791" lumi="0.05636" mu="0.00121">1555</lb> - <lb id="792" lumi="0.05624" mu="0.00121">1558</lb> - <lb id="793" lumi="0.05617" mu="0.00121">1559</lb> - <lb id="794" lumi="0.05606" mu="0.0012">1583</lb> - <lb id="795" lumi="0.05595" mu="0.0012">1544</lb> - <lb id="796" lumi="0.05587" mu="0.0012">1551</lb> - <lb id="797" lumi="0.05573" mu="0.0012">1234</lb> - <lb id="798" lumi="0.05563" mu="0.0012">1547</lb> - <lb id="799" lumi="0.05548" mu="0.00119">1283</lb> - <lb id="800" lumi="0.05539" mu="0.00119">963</lb> - <lb id="801" lumi="0.05531" mu="0.00119">1486</lb> - <lb id="802" lumi="0.05523" mu="0.00119">1534</lb> - <lb id="803" lumi="0.05511" mu="0.00118">1527</lb> - <lb id="804" lumi="0.05503" mu="0.00118">1527</lb> - <lb id="805" lumi="0.05492" mu="0.00118">951</lb> - <lb id="806" lumi="0.05483" mu="0.00118">1528</lb> - <lb id="807" lumi="0.05473" mu="0.00118">1552</lb> - <lb id="808" lumi="0.0546" mu="0.00117">1530</lb> - <lb id="809" lumi="0.05453" mu="0.00117">1514</lb> - <lb id="810" lumi="0.05443" mu="0.00117">1502</lb> - <lb id="811" lumi="0.05434" mu="0.00117">1506</lb> - <lb id="812" lumi="0.05423" mu="0.00116">1505</lb> - <lb id="813" lumi="0.05409" mu="0.00116">1508</lb> - <lb id="814" lumi="0.05406" mu="0.00116">1503</lb> - <lb id="815" lumi="0.05396" mu="0.00116">1549</lb> - <lb id="816" lumi="0.05384" mu="0.00116">1501</lb> - <lb id="817" lumi="0.05376" mu="0.00115">1498</lb> - <lb id="818" lumi="0.05363" mu="0.00115">1496</lb> - <lb id="819" lumi="0.0535" mu="0.00115">1490</lb> - <lb id="820" lumi="0.05342" mu="0.00115">1487</lb> - <lb id="821" lumi="0.05334" mu="0.00115">1486</lb> - <lb id="822" lumi="0.05326" mu="0.00114">1480</lb> - <lb id="823" lumi="0.05314" mu="0.00114">1521</lb> - <lb id="824" lumi="0.05302" mu="0.00114">1480</lb> - <lb id="825" lumi="0.05293" mu="0.00114">1477</lb> - <lb id="826" lumi="0.05281" mu="0.00113">1474</lb> - <lb id="827" lumi="0.05276" mu="0.00113">1471</lb> - <lb id="828" lumi="0.05265" mu="0.00113">1469</lb> - <lb id="829" lumi="0.05256" mu="0.00113">1463</lb> - <lb id="830" lumi="0.05248" mu="0.00113">1463</lb> - <lb id="831" lumi="0.05237" mu="0.00112">1499</lb> - <lb id="832" lumi="0.05229" mu="0.00112">1461</lb> - <lb id="833" lumi="0.05218" mu="0.00112">1459</lb> - <lb id="834" lumi="0.05214" mu="0.00112">1457</lb> - <lb id="835" lumi="0.05203" mu="0.00112">1453</lb> - <lb id="836" lumi="0.0519" mu="0.00111">1449</lb> - <lb id="837" lumi="0.05184" mu="0.00111">1449</lb> - <lb id="838" lumi="0.05174" mu="0.00111">1447</lb> - <lb id="839" lumi="0.05166" mu="0.00111">1482</lb> - <lb id="840" lumi="0.05151" mu="0.00111">1434</lb> - <lb id="841" lumi="0.05145" mu="0.00111">1440</lb> - <lb id="842" lumi="0.05136" mu="0.0011">1437</lb> - <lb id="843" lumi="0.05123" mu="0.0011">1435</lb> - <lb id="844" lumi="0.0511" mu="0.0011">1426</lb> - <lb id="845" lumi="0.05106" mu="0.0011">1430</lb> - <lb id="846" lumi="0.05097" mu="0.00109">1425</lb> - <lb id="847" lumi="0.05086" mu="0.00109">1422</lb> - <lb id="848" lumi="0.05078" mu="0.00109">1439</lb> - <lb id="849" lumi="0.05066" mu="0.00109">1418</lb> - <lb id="850" lumi="0.05059" mu="0.00109">1416</lb> - <lb id="851" lumi="0.05053" mu="0.00109">1415</lb> - <lb id="852" lumi="0.05038" mu="0.00108">1409</lb> - <lb id="853" lumi="0.05032" mu="0.00108">1410</lb> - <lb id="854" lumi="0.05028" mu="0.00108">1408</lb> - <lb id="855" lumi="0.05015" mu="0.00108">1403</lb> - <lb id="856" lumi="0.05008" mu="0.00108">1405</lb> - <lb id="857" lumi="0.04999" mu="0.00107">1425</lb> - <lb id="858" lumi="0.04986" mu="0.00107">1390</lb> - <lb id="859" lumi="0.04981" mu="0.00107">1398</lb> - <lb id="860" lumi="0.04971" mu="0.00107">1392</lb> - <lb id="861" lumi="0.04958" mu="0.00107">1387</lb> - <lb id="862" lumi="0.04953" mu="0.00106">245</lb> - <lb id="863" lumi="0.04946" mu="0.00106">1385</lb> - <lb id="864" lumi="0.04941" mu="0.00106">1386</lb> - <lb id="865" lumi="0.04934" mu="0.00106">1386</lb> - <lb id="866" lumi="0.04928" mu="0.00106">1407</lb> - <lb id="867" lumi="0.04913" mu="0.00106">1042</lb> - <lb id="868" lumi="0.0491" mu="0.00105">1386</lb> - <lb id="869" lumi="0.04898" mu="0.00105">1404</lb> - <lb id="870" lumi="0.04889" mu="0.00105">1354</lb> - <lb id="871" lumi="0.04881" mu="0.00105">1373</lb> - <lb id="872" lumi="0.04874" mu="0.00105">1370</lb> - <lb id="873" lumi="0.04868" mu="0.00105">1274</lb> - <lb id="874" lumi="0.04862" mu="0.00104">1637</lb> - <lb id="875" lumi="0.04848" mu="0.00104">1637</lb> - <lb id="876" lumi="0.04843" mu="0.00104">1640</lb> - <lb id="877" lumi="0.04836" mu="0.00104">1633</lb> - <lb id="878" lumi="0.04829" mu="0.00104">1630</lb> - <lb id="879" lumi="0.04819" mu="0.00104">1631</lb> - <lb id="880" lumi="0.04814" mu="0.00103">1622</lb> - <lb id="881" lumi="0.04801" mu="0.00103">1666</lb> - <lb id="882" lumi="0.04791" mu="0.00103">297</lb> - <lb id="883" lumi="0.04793" mu="0.00103">1620</lb> - <lb id="884" lumi="0.04785" mu="0.00103">1620</lb> - <lb id="885" lumi="0.04775" mu="0.00103">1609</lb> - <lb id="886" lumi="0.04765" mu="0.00102">1610</lb> - <lb id="887" lumi="0.04758" mu="0.00102">1379</lb> - <lb id="888" lumi="0.04752" mu="0.00102">1637</lb> - <lb id="889" lumi="0.04742" mu="0.00102">1609</lb> - <lb id="890" lumi="0.04732" mu="0.00102">1605</lb> - <lb id="891" lumi="0.04728" mu="0.00102">1598</lb> - <lb id="892" lumi="0.04717" mu="0.00101">1591</lb> - <lb id="893" lumi="0.04709" mu="0.00101">1593</lb> - <lb id="894" lumi="0.04699" mu="0.00101">1591</lb> - <lb id="895" lumi="0.04691" mu="0.00101">1590</lb> - <lb id="896" lumi="0.04684" mu="0.00101">1625</lb> - <lb id="897" lumi="0.04677" mu="0.001">291</lb> - <lb id="898" lumi="0.04679" mu="0.00101">1610</lb> - <lb id="899" lumi="0.04674" mu="0.001">1584</lb> - <lb id="900" lumi="0.04668" mu="0.001">1567</lb> - <lb id="901" lumi="0.04657" mu="0.001">1578</lb> - <lb id="902" lumi="0.04651" mu="0.000999">1420</lb> - <lb id="903" lumi="0.04642" mu="0.000997">1574</lb> - <lb id="904" lumi="0.04631" mu="0.000995">1570</lb> - <lb id="905" lumi="0.04624" mu="0.000993">1565</lb> - <lb id="906" lumi="0.04618" mu="0.000992">1565</lb> - <lb id="907" lumi="0.04607" mu="0.00099">1564</lb> - <lb id="908" lumi="0.04601" mu="0.000988">1562</lb> - <lb id="909" lumi="0.04593" mu="0.000987">1582</lb> - <lb id="910" lumi="0.04581" mu="0.000984">1554</lb> - <lb id="911" lumi="0.04574" mu="0.000982">1552</lb> - <lb id="912" lumi="0.04569" mu="0.000981">1553</lb> - <lb id="913" lumi="0.04564" mu="0.00098">1549</lb> - <lb id="914" lumi="0.04551" mu="0.000978">1543</lb> - <lb id="915" lumi="0.04547" mu="0.000977">1541</lb> - <lb id="916" lumi="0.04537" mu="0.000974">1543</lb> - <lb id="917" lumi="0.04529" mu="0.000973">1537</lb> - <lb id="918" lumi="0.04524" mu="0.000972">1319</lb> - <lb id="919" lumi="0.04519" mu="0.000971">1532</lb> - <lb id="920" lumi="0.04511" mu="0.000969">1532</lb> - <lb id="921" lumi="0.04504" mu="0.000967">1528</lb> - <lb id="922" lumi="0.04495" mu="0.000966">1528</lb> - <lb id="923" lumi="0.04487" mu="0.000964">1524</lb> - <lb id="924" lumi="0.04486" mu="0.000964">1524</lb> - <lb id="925" lumi="0.04474" mu="0.000961">1541</lb> - <lb id="926" lumi="0.04469" mu="0.00096">1527</lb> - <lb id="927" lumi="0.0446" mu="0.000958">1529</lb> - <lb id="928" lumi="0.04453" mu="0.000956">1516</lb> - <lb id="929" lumi="0.04445" mu="0.000955">1512</lb> - <lb id="930" lumi="0.04438" mu="0.000953">1495</lb> - <lb id="931" lumi="0.04433" mu="0.000952">1509</lb> - <lb id="932" lumi="0.04424" mu="0.00095">1502</lb> - <lb id="933" lumi="0.04413" mu="0.000948">1502</lb> - <lb id="934" lumi="0.04408" mu="0.000947">1515</lb> - <lb id="935" lumi="0.04402" mu="0.000946">1500</lb> - <lb id="936" lumi="0.04394" mu="0.000944">1496</lb> - <lb id="937" lumi="0.04386" mu="0.000942">1497</lb> - <lb id="938" lumi="0.04379" mu="0.000941">1492</lb> - <lb id="939" lumi="0.04369" mu="0.000939">1484</lb> - <lb id="940" lumi="0.04361" mu="0.000937">1486</lb> - <lb id="941" lumi="0.04355" mu="0.000935">1486</lb> - <lb id="942" lumi="0.0435" mu="0.000934">1483</lb> - <lb id="943" lumi="0.04344" mu="0.000933">1506</lb> - <lb id="944" lumi="0.04338" mu="0.000932">1469</lb> - <lb id="945" lumi="0.04328" mu="0.00093">1475</lb> - <lb id="946" lumi="0.04322" mu="0.000928">1470</lb> - <lb id="947" lumi="0.04318" mu="0.000927">1472</lb> - <lb id="948" lumi="0.04308" mu="0.000925">1467</lb> - <lb id="949" lumi="0.04299" mu="0.000923">1464</lb> - <lb id="950" lumi="0.04286" mu="0.000921">1462</lb> - <lb id="951" lumi="0.04284" mu="0.00092">1462</lb> - <lb id="952" lumi="0.04275" mu="0.000918">1475</lb> - <lb id="953" lumi="0.0427" mu="0.000917">1453</lb> - <lb id="954" lumi="0.0426" mu="0.000915">1452</lb> - <lb id="955" lumi="0.04251" mu="0.000913">1452</lb> - <lb id="956" lumi="0.04245" mu="0.000912">1449</lb> - <lb id="957" lumi="0.04239" mu="0.000911">1447</lb> - <lb id="958" lumi="0.04233" mu="0.000909">1439</lb> - <lb id="959" lumi="0.0423" mu="0.000909">1447</lb> - <lb id="960" lumi="0.04219" mu="0.000906">1428</lb> - <lb id="961" lumi="0.04216" mu="0.000906">1467</lb> - <lb id="962" lumi="0.04204" mu="0.000903">1427</lb> - <lb id="963" lumi="0.04203" mu="0.000903">1437</lb> - <lb id="964" lumi="0.04196" mu="0.000901">1430</lb> - <lb id="965" lumi="0.04189" mu="0.0009">1433</lb> - <lb id="966" lumi="0.04181" mu="0.000898">1425</lb> - <lb id="967" lumi="0.04173" mu="0.000896">1427</lb> - <lb id="968" lumi="0.04169" mu="0.000895">1427</lb> - <lb id="969" lumi="0.04159" mu="0.000893">1423</lb> - <lb id="970" lumi="0.04151" mu="0.000892">1421</lb> - <lb id="971" lumi="0.04146" mu="0.000891">1421</lb> - <lb id="972" lumi="0.0414" mu="0.000889">1428</lb> - <lb id="973" lumi="0.04132" mu="0.000888">1411</lb> - <lb id="974" lumi="0.04128" mu="0.000887">1411</lb> - <lb id="975" lumi="0.04116" mu="0.000884">1409</lb> - <lb id="976" lumi="0.04113" mu="0.000883">1404</lb> - <lb id="977" lumi="0.04105" mu="0.000882">1402</lb> - <lb id="978" lumi="0.04096" mu="0.00088">1401</lb> - <lb id="979" lumi="0.04089" mu="0.000878">1400</lb> - <lb id="980" lumi="0.04084" mu="0.000877">1413</lb> - <lb id="981" lumi="0.04073" mu="0.000875">1395</lb> - <lb id="982" lumi="0.04069" mu="0.000874">1394</lb> - <lb id="983" lumi="0.04065" mu="0.000873">1393</lb> - <lb id="984" lumi="0.04058" mu="0.000872">1388</lb> - <lb id="985" lumi="0.04049" mu="0.00087">1386</lb> - <lb id="986" lumi="0.04045" mu="0.000869">1387</lb> - <lb id="987" lumi="0.0404" mu="0.000868">1383</lb> - <lb id="988" lumi="0.04032" mu="0.000866">1381</lb> - <lb id="989" lumi="0.04028" mu="0.000865">1390</lb> - <lb id="990" lumi="0.04017" mu="0.000863">1364</lb> - <lb id="991" lumi="0.04013" mu="0.000862">1375</lb> - <lb id="992" lumi="0.04006" mu="0.00086">1373</lb> - <lb id="993" lumi="0.04005" mu="0.00086">245</lb> - <lb id="994" lumi="0.03997" mu="0.000859">1371</lb> - <lb id="995" lumi="0.03994" mu="0.000858">1368</lb> - <lb id="996" lumi="0.03984" mu="0.000856">1365</lb> - <lb id="997" lumi="0.03977" mu="0.000854">1378</lb> - <lb id="998" lumi="0.03972" mu="0.000853">1315</lb> - <lb id="999" lumi="0.03975" mu="0.000854">254</lb> - <lb id="1000" lumi="0.03968" mu="0.000852">1362</lb> - <lb id="1001" lumi="0.03963" mu="0.000851">1361</lb> - <lb id="1002" lumi="0.03958" mu="0.00085">1357</lb> - <lb id="1003" lumi="0.03954" mu="0.000849">1353</lb> - <lb id="1004" lumi="0.03942" mu="0.000847">1352</lb> - <lb id="1005" lumi="0.03935" mu="0.000845">1349</lb> - <lb id="1006" lumi="0.03929" mu="0.000844">1349</lb> - <lb id="1007" lumi="0.03918" mu="0.000842">1346</lb> - <lb id="1008" lumi="0.03912" mu="0.00084">1368</lb> - <lb id="1009" lumi="0.03906" mu="0.000839">1336</lb> - <lb id="1010" lumi="0.03899" mu="0.000838">1338</lb> - <lb id="1011" lumi="0.03895" mu="0.000837">1338</lb> - <lb id="1012" lumi="0.0389" mu="0.000836">1342</lb> - <lb id="1013" lumi="0.03884" mu="0.000834">1334</lb> - <lb id="1014" lumi="0.03876" mu="0.000832">1334</lb> - <lb id="1015" lumi="0.0387" mu="0.000831">826</lb> - <lb id="1016" lumi="0.03863" mu="0.00083">1648</lb> - <lb id="1017" lumi="0.03857" mu="0.000829">1662</lb> - <lb id="1018" lumi="0.03851" mu="0.000827">1690</lb> - <lb id="1019" lumi="0.03847" mu="0.000826">1668</lb> - <lb id="1020" lumi="0.03845" mu="0.000826">1638</lb> - <lb id="1021" lumi="0.03837" mu="0.000824">1653</lb> - <lb id="1022" lumi="0.03836" mu="0.000824">1647</lb> - <lb id="1023" lumi="0.03827" mu="0.000822">1643</lb> - <lb id="1024" lumi="0.03825" mu="0.000822">1647</lb> - <lb id="1025" lumi="0.03816" mu="0.00082">1646</lb> - <lb id="1026" lumi="0.03808" mu="0.000818">1667</lb> - <lb id="1027" lumi="0.03802" mu="0.000817">1632</lb> - <lb id="1028" lumi="0.03794" mu="0.000815">1636</lb> - <lb id="1029" lumi="0.03788" mu="0.000814">1635</lb> - <lb id="1030" lumi="0.03782" mu="0.000812">1633</lb> - <lb id="1031" lumi="0.03772" mu="0.00081">1625</lb> - <lb id="1032" lumi="0.03768" mu="0.000809">1622</lb> - <lb id="1033" lumi="0.03764" mu="0.000808">1620</lb> - <lb id="1034" lumi="0.03761" mu="0.000808">1624</lb> - <lb id="1035" lumi="0.03754" mu="0.000806">1619</lb> - <lb id="1036" lumi="0.03743" mu="0.000804">1632</lb> - <lb id="1037" lumi="0.03742" mu="0.000804">1622</lb> - <lb id="1038" lumi="0.03735" mu="0.000802">1610</lb> - <lb id="1039" lumi="0.03729" mu="0.000801">1611</lb> - <lb id="1040" lumi="0.03723" mu="0.0008">1605</lb> - <lb id="1041" lumi="0.03717" mu="0.000798">1602</lb> - <lb id="1042" lumi="0.03714" mu="0.000798">1605</lb> - <lb id="1043" lumi="0.03712" mu="0.000797">1599</lb> - <lb id="1044" lumi="0.03705" mu="0.000796">1601</lb> - <lb id="1045" lumi="0.03695" mu="0.000794">1610</lb> - <lb id="1046" lumi="0.03693" mu="0.000793">1599</lb> - <lb id="1047" lumi="0.03686" mu="0.000792">1590</lb> - <lb id="1048" lumi="0.03677" mu="0.00079">1587</lb> - <lb id="1049" lumi="0.03673" mu="0.000789">1587</lb> - <lb id="1050" lumi="0.03668" mu="0.000788">1568</lb> - <lb id="1051" lumi="0.0366" mu="0.000786">1579</lb> - <lb id="1052" lumi="0.03657" mu="0.000786">1580</lb> - <lb id="1053" lumi="0.03651" mu="0.000784">1580</lb> - <lb id="1054" lumi="0.03644" mu="0.000783">1585</lb> - <lb id="1055" lumi="0.03641" mu="0.000782">1575</lb> - <lb id="1056" lumi="0.03636" mu="0.000781">1569</lb> - <lb id="1057" lumi="0.0363" mu="0.00078">1572</lb> - <lb id="1058" lumi="0.03625" mu="0.000779">1561</lb> - <lb id="1059" lumi="0.03616" mu="0.000777">1561</lb> - <lb id="1060" lumi="0.03611" mu="0.000776">1564</lb> - <lb id="1061" lumi="0.03604" mu="0.000774">1555</lb> - <lb id="1062" lumi="0.03598" mu="0.000773">1571</lb> - <lb id="1063" lumi="0.03591" mu="0.000771">1554</lb> - <lb id="1064" lumi="0.03591" mu="0.000771">1549</lb> - <lb id="1065" lumi="0.03583" mu="0.00077">1542</lb> - <lb id="1066" lumi="0.03578" mu="0.000768">1547</lb> - <lb id="1067" lumi="0.03571" mu="0.000767">1539</lb> - <lb id="1068" lumi="0.03564" mu="0.000765">1535</lb> - <lb id="1069" lumi="0.03561" mu="0.000765">1537</lb> - <lb id="1070" lumi="0.03555" mu="0.000764">1534</lb> - <lb id="1071" lumi="0.03549" mu="0.000762">1567</lb> - <lb id="1072" lumi="0.03543" mu="0.000761">1537</lb> - <lb id="1073" lumi="0.03537" mu="0.00076">1530</lb> - <lb id="1074" lumi="0.03539" mu="0.00076">270</lb> - <lb id="1075" lumi="0.0353" mu="0.000758">1520</lb> - <lb id="1076" lumi="0.03525" mu="0.000757">1523</lb> - <lb id="1077" lumi="0.03519" mu="0.000756">1520</lb> - <lb id="1078" lumi="0.03517" mu="0.000755">1523</lb> - <lb id="1079" lumi="0.03516" mu="0.000755">1241</lb> - <lb id="1080" lumi="0.03505" mu="0.000753">1504</lb> - <lb id="1081" lumi="0.035" mu="0.000752">1536</lb> - <lb id="1082" lumi="0.03496" mu="0.000751">1508</lb> - <lb id="1083" lumi="0.03487" mu="0.000749">1510</lb> - <lb id="1084" lumi="0.0348" mu="0.000747">1502</lb> - <lb id="1085" lumi="0.03475" mu="0.000746">1505</lb> - <lb id="1086" lumi="0.03468" mu="0.000745">1501</lb> - <lb id="1087" lumi="0.03458" mu="0.000743">1495</lb> - <lb id="1088" lumi="0.03452" mu="0.000741">1497</lb> - <lb id="1089" lumi="0.03444" mu="0.00074">1492</lb> - <lb id="1090" lumi="0.0344" mu="0.000739">1515</lb> - <lb id="1091" lumi="0.0343" mu="0.000737">1480</lb> - <lb id="1092" lumi="0.03426" mu="0.000736">1486</lb> - <lb id="1093" lumi="0.03422" mu="0.000735">1486</lb> - <lb id="1094" lumi="0.03415" mu="0.000734">1479</lb> - <lb id="1095" lumi="0.03405" mu="0.000731">1472</lb> - <lb id="1096" lumi="0.03405" mu="0.000731">1473</lb> - <lb id="1097" lumi="0.03397" mu="0.00073">1476</lb> - <lb id="1098" lumi="0.03394" mu="0.000729">1472</lb> - <lb id="1099" lumi="0.0339" mu="0.000728">1469</lb> - <lb id="1100" lumi="0.03387" mu="0.000728">1487</lb> - <lb id="1101" lumi="0.03381" mu="0.000726">1467</lb> - <lb id="1102" lumi="0.0337" mu="0.000724">1464</lb> - <lb id="1103" lumi="0.03369" mu="0.000724">1464</lb> - <lb id="1104" lumi="0.03362" mu="0.000722">1459</lb> - <lb id="1105" lumi="0.03359" mu="0.000721">1457</lb> - <lb id="1106" lumi="0.03351" mu="0.00072">1454</lb> - <lb id="1107" lumi="0.03348" mu="0.000719">1453</lb> - <lb id="1108" lumi="0.03339" mu="0.000717">1479</lb> - <lb id="1109" lumi="0.03335" mu="0.000716">1462</lb> - <lb id="1110" lumi="0.03327" mu="0.000715">1428</lb> - <lb id="1111" lumi="0.03322" mu="0.000713">1441</lb> - <lb id="1112" lumi="0.03096" mu="0.000665">1302</lb> - </lb_list> - <filters> - <filter> - <filter_name>L1_MBTS_1_1_OVERLAY</filter_name> - <lv1_filter>L1_MBTS_1_1_OVERLAY</lv1_filter> - </filter> - </filters> -</trigger> diff --git a/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_266904.xml b/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_266904.xml deleted file mode 100644 index 2223f4c6962f47ec5e04df8cdabaabbba2533a84..0000000000000000000000000000000000000000 --- a/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_266904.xml +++ /dev/null @@ -1,277 +0,0 @@ -<?xml version="1.0" ?> -<trigger> - <lumivalues> - <lumivalues_data>3e30</lumivalues_data> - <lumivalues_pred>2e+34</lumivalues_pred> - <deadtime>0.0</deadtime> - <peak_mu_av>15.5</peak_mu_av> - </lumivalues> - <bunchgroups> - <bunchgroup id="0" name="BCRVeto">3543</bunchgroup> - <bunchgroup id="1" name="Paired">2</bunchgroup> - <bunchgroup id="2" name="CalReq">70</bunchgroup> - <bunchgroup id="3" name="Empty">3416</bunchgroup> - <bunchgroup id="4" name="IsolatedUnpaired">2</bunchgroup> - <bunchgroup id="5" name="NonIsolatedUnpaired">2</bunchgroup> - <bunchgroup id="6" name="EmptyAfterPaired">10</bunchgroup> - <bunchgroup id="7" name="InTrain">6</bunchgroup> - <bunchgroup id="8" name="AbortGapNotCalReq">29</bunchgroup> - <bunchgroup id="9" name="AfterGlow">145</bunchgroup> - <bunchgroup id="10" name="ALFA">4</bunchgroup> - <bunchgroup id="11" name="EmptyBeforePaired">2</bunchgroup> - <bunchgroup id="12" name="BG12">0</bunchgroup> - <bunchgroup id="13" name="BG13">0</bunchgroup> - <bunchgroup id="14" name="BG14">0</bunchgroup> - <bunchgroup id="15" name="BG15">0</bunchgroup> - </bunchgroups> - <lb_list> - <lb id="397">6444</lb> - <lb id="398">6289</lb> - <lb id="399">4915</lb> - <lb id="400">8287</lb> - <lb id="401">1407</lb> - <lb id="402">7859</lb> - <lb id="403">3136</lb> - <lb id="404">6122</lb> - <lb id="405">3177</lb> - <lb id="406">0</lb> - <lb id="407">5351</lb> - <lb id="408">8403</lb> - <lb id="409">8282</lb> - <lb id="410">8453</lb> - <lb id="411">8316</lb> - <lb id="412">8282</lb> - <lb id="413">8126</lb> - <lb id="414">8425</lb> - <lb id="415">8525</lb> - <lb id="416">8324</lb> - <lb id="417">8414</lb> - <lb id="418">8389</lb> - <lb id="419">8304</lb> - <lb id="420">8469</lb> - <lb id="421">8415</lb> - <lb id="422">8439</lb> - <lb id="423">8458</lb> - <lb id="424">8348</lb> - <lb id="425">8301</lb> - <lb id="426">8345</lb> - <lb id="427">8454</lb> - <lb id="428">8547</lb> - <lb id="429">8664</lb> - <lb id="430">8500</lb> - <lb id="431">2044</lb> - <lb id="432">8492</lb> - <lb id="433">8588</lb> - <lb id="434">8573</lb> - <lb id="435">8669</lb> - <lb id="436">8415</lb> - <lb id="437">8567</lb> - <lb id="438">8649</lb> - <lb id="439">8583</lb> - <lb id="440">8567</lb> - <lb id="441">8449</lb> - <lb id="442">8477</lb> - <lb id="443">8542</lb> - <lb id="444">8463</lb> - <lb id="445">8638</lb> - <lb id="446">8587</lb> - <lb id="447">8512</lb> - <lb id="448">8648</lb> - <lb id="449">8482</lb> - <lb id="450">8514</lb> - <lb id="451">8591</lb> - <lb id="452">8609</lb> - <lb id="453">8675</lb> - <lb id="454">8535</lb> - <lb id="455">8533</lb> - <lb id="456">8770</lb> - <lb id="457">8611</lb> - <lb id="458">8528</lb> - <lb id="459">8490</lb> - <lb id="460">8586</lb> - <lb id="461">8660</lb> - <lb id="462">8488</lb> - <lb id="463">8601</lb> - <lb id="464">8537</lb> - <lb id="465">8521</lb> - <lb id="466">8563</lb> - <lb id="467">8495</lb> - <lb id="468">8403</lb> - <lb id="469">8531</lb> - <lb id="470">8372</lb> - <lb id="471">8380</lb> - <lb id="472">8456</lb> - <lb id="473">8402</lb> - <lb id="474">8348</lb> - <lb id="475">8349</lb> - <lb id="476">8298</lb> - <lb id="477">8400</lb> - <lb id="478">8501</lb> - <lb id="479">8343</lb> - <lb id="480">8383</lb> - <lb id="481">8380</lb> - <lb id="482">8127</lb> - <lb id="483">8248</lb> - <lb id="484">8351</lb> - <lb id="485">8077</lb> - <lb id="486">8255</lb> - <lb id="487">8196</lb> - <lb id="488">8103</lb> - <lb id="489">7984</lb> - <lb id="490">8236</lb> - <lb id="491">8204</lb> - <lb id="492">8110</lb> - <lb id="493">8054</lb> - <lb id="494">8111</lb> - <lb id="495">8169</lb> - <lb id="496">8055</lb> - <lb id="497">8125</lb> - <lb id="498">8048</lb> - <lb id="499">7973</lb> - <lb id="500">8112</lb> - <lb id="501">8133</lb> - <lb id="502">7881</lb> - <lb id="503">7997</lb> - <lb id="504">7839</lb> - <lb id="505">7903</lb> - <lb id="506">7830</lb> - <lb id="507">7761</lb> - <lb id="508">7858</lb> - <lb id="509">7824</lb> - <lb id="510">7841</lb> - <lb id="511">7957</lb> - <lb id="512">7751</lb> - <lb id="513">7964</lb> - <lb id="514">7899</lb> - <lb id="515">7867</lb> - <lb id="516">7606</lb> - <lb id="517">7673</lb> - <lb id="518">7676</lb> - <lb id="519">7941</lb> - <lb id="520">8108</lb> - <lb id="521">7991</lb> - <lb id="522">8150</lb> - <lb id="523">8141</lb> - <lb id="524">8546</lb> - <lb id="525">8428</lb> - <lb id="526">8331</lb> - <lb id="527">8338</lb> - <lb id="528">8430</lb> - <lb id="529">8435</lb> - <lb id="530">8433</lb> - <lb id="531">6865</lb> - <lb id="532">0</lb> - <lb id="533">0</lb> - <lb id="534">0</lb> - <lb id="535">0</lb> - <lb id="536">0</lb> - <lb id="537">8197</lb> - <lb id="538">8496</lb> - <lb id="539">8483</lb> - <lb id="540">8360</lb> - <lb id="541">8362</lb> - <lb id="542">5219</lb> - </lb_list> - <filters> - <filter> - <eb_hlt_chains> - <eb_hlt_name>HLT_eb_low_L1RD2_FILLED</eb_hlt_name> - <lv1_ebtrigs>L1_MU6</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM10VH</lv1_ebtrigs> - <lv1_ebtrigs>L1_J30.0ETA49_2J20.0ETA49</lv1_ebtrigs> - <lv1_ebtrigs>L1_TAU12</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU4_J12</lv1_ebtrigs> - <lv1_ebtrigs>L1_2EM7</lv1_ebtrigs> - <lv1_ebtrigs>L1_J15</lv1_ebtrigs> - </eb_hlt_chains> - <eb_hlt_chains> - <eb_hlt_name>HLT_eb_high_L1RD2_FILLED</eb_hlt_name> - <lv1_ebtrigs>L1_3J15</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM18VH</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM20VHI</lv1_ebtrigs> - <lv1_ebtrigs>L1_J50</lv1_ebtrigs> - <lv1_ebtrigs>L1_TAU30</lv1_ebtrigs> - <lv1_ebtrigs>L1_2MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_XS30</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU15</lv1_ebtrigs> - <lv1_ebtrigs>L1_TAU20_2TAU12</lv1_ebtrigs> - <lv1_ebtrigs>L1_XE35</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU6_2MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU6_J20</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM7_MU10</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM15_MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM15VH_3EM7</lv1_ebtrigs> - </eb_hlt_chains> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1PhysicsLow_noPS</filter_name> - <lv1_filter>L1_2EM15</lv1_filter> - <lv1_filter>L1_2EM8VH_MU10</lv1_filter> - <lv1_filter>L1_2J15_XE55</lv1_filter> - <lv1_filter>L1_2MU6</lv1_filter> - <lv1_filter>L1_3J40</lv1_filter> - <lv1_filter>L1_3MU4</lv1_filter> - <lv1_filter>L1_4J15</lv1_filter> - <lv1_filter>L1_EM15HI_2TAU12IM_J25_3J12</lv1_filter> - <lv1_filter>L1_EM15HI_2TAU12IM_XE35</lv1_filter> - <lv1_filter>L1_EM15HI_TAU40_2TAU15</lv1_filter> - <lv1_filter>L1_EM15VH_3EM7</lv1_filter> - <lv1_filter>L1_EM15VH_MU10</lv1_filter> - <lv1_filter>L1_EM22VHI</lv1_filter> - <lv1_filter>L1_J75</lv1_filter> - <lv1_filter>L1_MU10_TAU12IM_J25_2J12</lv1_filter> - <lv1_filter>L1_MU10_TAU12IM_XE35</lv1_filter> - <lv1_filter>L1_MU10_TAU20</lv1_filter> - <lv1_filter>L1_MU20</lv1_filter> - <lv1_filter>L1_MU4_3J15</lv1_filter> - <lv1_filter>L1_TAU20IM_2J20_XE45</lv1_filter> - <lv1_filter>L1_TAU20IM_2TAU12IM_J25_2J20_3J12</lv1_filter> - <lv1_filter>L1_TAU20IM_2TAU12IM_XE35</lv1_filter> - <lv1_filter>L1_TAU20_2TAU12_XE35</lv1_filter> - <lv1_filter>L1_TAU60</lv1_filter> - <lv1_filter>L1_XE50</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1PhysicsHigh_noPS</filter_name> - <lv1_filter>L1_3MU6</lv1_filter> - <lv1_filter>L1_J100.32ETA49</lv1_filter> - <lv1_filter>L1_J400</lv1_filter> - <lv1_filter>L1_XE80</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1EMPTY_noPS</filter_name> - <lv1_filter>L1_J12_EMPTY</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1FIRSTEMPTY_noPS</filter_name> - <lv1_filter>L1_J12_FIRSTEMPTY</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1UNPAIRED_ISO_noPS</filter_name> - <lv1_filter>L1_BCM_AC_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_BCM_CA_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_BCM_Wide_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_J12_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_J30.32ETA49_UNPAIRED_ISO</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1UNPAIRED_NONISO_noPS</filter_name> - <lv1_filter>L1_BCM_AC_UNPAIRED_NONISO</lv1_filter> - <lv1_filter>L1_BCM_CA_UNPAIRED_NONISO</lv1_filter> - <lv1_filter>L1_BCM_Wide_UNPAIRED_NONISO</lv1_filter> - <lv1_filter>L1_J12_UNPAIRED_NONISO</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1ABORTGAPNOTCALIB_noPS</filter_name> - <lv1_filter>L1_J12_ABORTGAPNOTCALIB</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1RD3_FILLED</filter_name> - <lv1_filter>L1_RD3_FILLED</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1RD3_EMPTY</filter_name> - <lv1_filter>L1_RD3_EMPTY</lv1_filter> - </filter> - </filters> -</trigger> diff --git a/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_267638.xml b/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_267638.xml deleted file mode 100644 index 179045c0a3b0a920300b1b0106cc902b3105cf67..0000000000000000000000000000000000000000 --- a/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_267638.xml +++ /dev/null @@ -1,176 +0,0 @@ -<?xml version="1.0" ?> -<trigger> - <lumivalues> - <lumivalues_data>12e+31</lumivalues_data> - <lumivalues_pred>2e+34</lumivalues_pred> - <deadtime>0.0</deadtime> - <peak_mu_av>23.6</peak_mu_av> - </lumivalues> - <bunchgroups> - <bunchgroup id="0" name="BCRVeto">3543</bunchgroup> - <bunchgroup id="1" name="Paired">38</bunchgroup> - <bunchgroup id="2" name="CalReq">70</bunchgroup> - <bunchgroup id="3" name="Empty">3278</bunchgroup> - <bunchgroup id="4" name="IsolatedUnpaired">0</bunchgroup> - <bunchgroup id="5" name="NonIsolatedUnpaired">24</bunchgroup> - <bunchgroup id="6" name="EmptyAfterPaired">70</bunchgroup> - <bunchgroup id="7" name="InTrain">24</bunchgroup> - <bunchgroup id="8" name="AbortGapNotCalReq">29</bunchgroup> - <bunchgroup id="9" name="AfterGlow">62</bunchgroup> - <bunchgroup id="10" name="ALFA">4</bunchgroup> - <bunchgroup id="11" name="EmptyBeforePaired">38</bunchgroup> - <bunchgroup id="12" name="BG12">0</bunchgroup> - <bunchgroup id="13" name="BG13">0</bunchgroup> - <bunchgroup id="14" name="BG14">0</bunchgroup> - <bunchgroup id="15" name="BG15">0</bunchgroup> - </bunchgroups> - <lb_list> - <lb id="384">47203</lb> - <lb id="385">47158</lb> - <lb id="386">46777</lb> - <lb id="387">40719</lb> - <lb id="388">15609</lb> - <lb id="389">15968</lb> - <lb id="390">2633</lb> - <lb id="391">20187</lb> - <lb id="392">20433</lb> - <lb id="393">20448</lb> - <lb id="394">21612</lb> - <lb id="395">21269</lb> - <lb id="396">22522</lb> - <lb id="397">22114</lb> - <lb id="398">22643</lb> - <lb id="399">22059</lb> - <lb id="400">21315</lb> - <lb id="401">22781</lb> - <lb id="402">22887</lb> - <lb id="403">20079</lb> - <lb id="404">37451</lb> - <lb id="405">37692</lb> - <lb id="406">37178</lb> - <lb id="407">22321</lb> - <lb id="408">23261</lb> - <lb id="409">17305</lb> - <lb id="410">21098</lb> - <lb id="411">20750</lb> - <lb id="412">14277</lb> - <lb id="413">22364</lb> - <lb id="414">22882</lb> - <lb id="415">22599</lb> - <lb id="416">25221</lb> - <lb id="417">22446</lb> - <lb id="418">22473</lb> - <lb id="419">22415</lb> - <lb id="420">22643</lb> - <lb id="421">21120</lb> - <lb id="422">22744</lb> - <lb id="423">22850</lb> - <lb id="424">22422</lb> - <lb id="425">22360</lb> - <lb id="426">22015</lb> - <lb id="427">21933</lb> - <lb id="428">9606</lb> - </lb_list> - <filters> - <filter> - <eb_hlt_chains> - <eb_hlt_name>HLT_eb_low_L1RD2_FILLED</eb_hlt_name> - <lv1_ebtrigs>L1_MU6</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM10VH</lv1_ebtrigs> - <lv1_ebtrigs>L1_J30.0ETA49_2J20.0ETA49</lv1_ebtrigs> - <lv1_ebtrigs>L1_TAU12</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU4_J12</lv1_ebtrigs> - <lv1_ebtrigs>L1_2EM7</lv1_ebtrigs> - <lv1_ebtrigs>L1_J15</lv1_ebtrigs> - </eb_hlt_chains> - <eb_hlt_chains> - <eb_hlt_name>HLT_eb_high_L1RD2_FILLED</eb_hlt_name> - <lv1_ebtrigs>L1_3J15</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM18VH</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM20VHI</lv1_ebtrigs> - <lv1_ebtrigs>L1_J50</lv1_ebtrigs> - <lv1_ebtrigs>L1_TAU30</lv1_ebtrigs> - <lv1_ebtrigs>L1_2MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_XS30</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU15</lv1_ebtrigs> - <lv1_ebtrigs>L1_TAU20_2TAU12</lv1_ebtrigs> - <lv1_ebtrigs>L1_XE35</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU6_2MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU6_J20</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM7_MU10</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM15_MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM15VH_3EM7</lv1_ebtrigs> - </eb_hlt_chains> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1PhysicsLow_noPS</filter_name> - <lv1_filter>L1_2EM15</lv1_filter> - <lv1_filter>L1_2EM8VH_MU10</lv1_filter> - <lv1_filter>L1_2J15_XE55</lv1_filter> - <lv1_filter>L1_2MU6</lv1_filter> - <lv1_filter>L1_3J40</lv1_filter> - <lv1_filter>L1_3MU4</lv1_filter> - <lv1_filter>L1_4J15</lv1_filter> - <lv1_filter>L1_EM15HI_2TAU12IM_J25_3J12</lv1_filter> - <lv1_filter>L1_EM15HI_2TAU12IM_XE35</lv1_filter> - <lv1_filter>L1_EM15HI_TAU40_2TAU15</lv1_filter> - <lv1_filter>L1_EM15VH_3EM7</lv1_filter> - <lv1_filter>L1_EM15VH_MU10</lv1_filter> - <lv1_filter>L1_EM22VHI</lv1_filter> - <lv1_filter>L1_J75</lv1_filter> - <lv1_filter>L1_MU10_TAU12IM_J25_2J12</lv1_filter> - <lv1_filter>L1_MU10_TAU12IM_XE35</lv1_filter> - <lv1_filter>L1_MU10_TAU20</lv1_filter> - <lv1_filter>L1_MU20</lv1_filter> - <lv1_filter>L1_MU4_3J15</lv1_filter> - <lv1_filter>L1_TAU20IM_2J20_XE45</lv1_filter> - <lv1_filter>L1_TAU20IM_2TAU12IM_J25_2J20_3J12</lv1_filter> - <lv1_filter>L1_TAU20IM_2TAU12IM_XE35</lv1_filter> - <lv1_filter>L1_TAU20_2TAU12_XE35</lv1_filter> - <lv1_filter>L1_TAU60</lv1_filter> - <lv1_filter>L1_XE50</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1PhysicsHigh_noPS</filter_name> - <lv1_filter>L1_3MU6</lv1_filter> - <lv1_filter>L1_J100.32ETA49</lv1_filter> - <lv1_filter>L1_J400</lv1_filter> - <!-- <lv1_filter>L1_XE80</lv1_filter> TAKEN OUT DUE TO ONLINE PS BY MISTAKE --> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1EMPTY_noPS</filter_name> - <lv1_filter>L1_J12_EMPTY</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1FIRSTEMPTY_noPS</filter_name> - <lv1_filter>L1_J12_FIRSTEMPTY</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1UNPAIRED_ISO_noPS</filter_name> - <lv1_filter>L1_BCM_AC_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_BCM_CA_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_BCM_Wide_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_J12_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_J30.32ETA49_UNPAIRED_ISO</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1UNPAIRED_NONISO_noPS</filter_name> - <lv1_filter>L1_BCM_AC_UNPAIRED_NONISO</lv1_filter> - <lv1_filter>L1_BCM_CA_UNPAIRED_NONISO</lv1_filter> - <lv1_filter>L1_BCM_Wide_UNPAIRED_NONISO</lv1_filter> - <lv1_filter>L1_J12_UNPAIRED_NONISO</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1ABORTGAPNOTCALIB_noPS</filter_name> - <lv1_filter>L1_J12_ABORTGAPNOTCALIB</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1RD3_FILLED</filter_name> - <lv1_filter>L1_RD3_FILLED</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1RD3_EMPTY</filter_name> - <lv1_filter>L1_RD3_EMPTY</lv1_filter> - </filter> - </filters> -</trigger> diff --git a/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_271421.xml b/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_271421.xml deleted file mode 100644 index 7c41d84d4d8c2cdf54f10fe8ae2d13f3b13789a2..0000000000000000000000000000000000000000 --- a/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_271421.xml +++ /dev/null @@ -1,240 +0,0 @@ -<?xml version="1.0" ?> -<trigger> - <lumivalues> - <lumivalues_data>755e+30</lumivalues_data> - <lumivalues_pred>2e+34</lumivalues_pred> - <deadtime>0.0</deadtime> - <peak_mu_av>26.5</peak_mu_av> - </lumivalues> - <bunchgroups> - <bunchgroup id="0" name="BCRVeto">3543</bunchgroup> - <bunchgroup id="1" name="Paired">254</bunchgroup> - <bunchgroup id="2" name="CalReq">70</bunchgroup> - <bunchgroup id="3" name="Empty">2759</bunchgroup> - <bunchgroup id="4" name="IsolatedUnpaired">12</bunchgroup> - <bunchgroup id="5" name="NonIsolatedUnpaired">72</bunchgroup> - <bunchgroup id="6" name="EmptyAfterPaired">290</bunchgroup> - <bunchgroup id="7" name="InTrain">27</bunchgroup> - <bunchgroup id="8" name="AbortGapNotCalReq">29</bunchgroup> - <bunchgroup id="9" name="AfterGlow">63</bunchgroup> - <bunchgroup id="10" name="ALFA">4</bunchgroup> - <bunchgroup id="11" name="EmptyBeforePaired">254</bunchgroup> - <bunchgroup id="12" name="BG12">0</bunchgroup> - <bunchgroup id="13" name="BG13">0</bunchgroup> - <bunchgroup id="14" name="BG14">0</bunchgroup> - <bunchgroup id="15" name="BG15">0</bunchgroup> - </bunchgroups> - <lb_list> - <lb id="278">12561</lb> - <lb id="279">12749</lb> - <lb id="280">10291</lb> - <lb id="281">14361</lb> - <lb id="282">14398</lb> - <lb id="283">13505</lb> - <lb id="284">12859</lb> - <lb id="285">12615</lb> - <lb id="286">12726</lb> - <lb id="287">13314</lb> - <lb id="288" flag="bad">2467</lb> - <lb id="289">13374</lb> - <lb id="290">13278</lb> - <lb id="291">13060</lb> - <lb id="292">13060</lb> - <lb id="293">12858</lb> - <lb id="294">12809</lb> - <lb id="295">12655</lb> - <lb id="296">12750</lb> - <lb id="297">12940</lb> - <lb id="298">12753</lb> - <lb id="299">12614</lb> - <lb id="300">12817</lb> - <lb id="301" flag="bad">35421</lb> - <lb id="302" flag="bad">54460</lb> - <lb id="303" flag="bad">59523</lb> - <lb id="304">12588</lb> - <lb id="305">12751</lb> - <lb id="306">12683</lb> - <lb id="307">12710</lb> - <lb id="308">12869</lb> - <lb id="309">12637</lb> - <lb id="310">12715</lb> - <lb id="311">12757</lb> - <lb id="312">12694</lb> - <lb id="313">12771</lb> - <lb id="314">12712</lb> - <lb id="315">12679</lb> - <lb id="316">12317</lb> - <lb id="317">12400</lb> - <lb id="318">12528</lb> - <lb id="319">12805</lb> - <lb id="320">12727</lb> - <lb id="321">12094</lb> - <lb id="322" flag="bad">22</lb> - <lb id="323" flag="bad">1</lb> - <lb id="324">11767</lb> - <lb id="325">12792</lb> - <lb id="326">12165</lb> - <lb id="327">12717</lb> - <lb id="328">12636</lb> - <lb id="329">12548</lb> - <lb id="330">12483</lb> - <lb id="331">12620</lb> - <lb id="332">12677</lb> - <lb id="333">12475</lb> - <lb id="334">12531</lb> - <lb id="335" flag="bad">945</lb> - <lb id="336" flag="bad">0</lb> - <lb id="337">11882</lb> - <lb id="338" flag="bad">3730</lb> - <lb id="339" flag="bad">1440</lb> - <lb id="340" flag="bad">32</lb> - <lb id="341" flag="bad">0</lb> - <lb id="342" flag="bad">1375</lb> - <lb id="343">12471</lb> - <lb id="344">12437</lb> - <lb id="345">12324</lb> - <lb id="346">12232</lb> - <lb id="347">12328</lb> - <lb id="348">12569</lb> - <lb id="349">12461</lb> - <lb id="350">12105</lb> - <lb id="351">11682</lb> - <lb id="352">12679</lb> - <lb id="353">12343</lb> - <lb id="354">12426</lb> - <lb id="355">12246</lb> - <lb id="356">12370</lb> - <lb id="357">12492</lb> - <lb id="358">12244</lb> - <lb id="359">12315</lb> - <lb id="360">12452</lb> - <lb id="361">12284</lb> - <lb id="362">12279</lb> - <lb id="363">12236</lb> - <lb id="364">12197</lb> - <lb id="365">12240</lb> - <lb id="366">12039</lb> - <lb id="367">12216</lb> - <lb id="368">12097</lb> - <lb id="369">12065</lb> - <lb id="370">12405</lb> - <lb id="371">11852</lb> - <lb id="372">12127</lb> - <lb id="373">12254</lb> - <lb id="374">12106</lb> - <lb id="375">12397</lb> - <lb id="376">12152</lb> - <lb id="377">12155</lb> - <lb id="378">12202</lb> - <lb id="379">12204</lb> - <lb id="380">12123</lb> - <lb id="381" flag="bad">6135</lb> - <lb id="382">10303</lb> - <lb id="383" flag="bad">7416</lb> - <lb id="384" flag="bad">8766</lb> - <lb id="385">12247</lb> - <lb id="386" flag="bad">7287</lb> - </lb_list> - <filters> - <filter> - <eb_hlt_chains> - <eb_hlt_name>HLT_eb_low_L1RD2_FILLED</eb_hlt_name> - <lv1_ebtrigs>L1_MU6</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM10VH</lv1_ebtrigs> - <lv1_ebtrigs>L1_J30.0ETA49_2J20.0ETA49</lv1_ebtrigs> - <lv1_ebtrigs>L1_TAU12</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU4_J12</lv1_ebtrigs> - <lv1_ebtrigs>L1_2EM7</lv1_ebtrigs> - <lv1_ebtrigs>L1_J15</lv1_ebtrigs> - </eb_hlt_chains> - <eb_hlt_chains> - <eb_hlt_name>HLT_eb_high_L1RD2_FILLED</eb_hlt_name> - <lv1_ebtrigs>L1_3J15</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM18VH</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM20VHI</lv1_ebtrigs> - <lv1_ebtrigs>L1_J50</lv1_ebtrigs> - <lv1_ebtrigs>L1_TAU30</lv1_ebtrigs> - <lv1_ebtrigs>L1_2MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_XS30</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU15</lv1_ebtrigs> - <lv1_ebtrigs>L1_TAU20_2TAU12</lv1_ebtrigs> - <lv1_ebtrigs>L1_XE35</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU6_2MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU6_J20</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM7_MU10</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM15_MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM15VH_3EM7</lv1_ebtrigs> - </eb_hlt_chains> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1PhysicsLow_noPS</filter_name> - <lv1_filter>L1_2EM15</lv1_filter> - <lv1_filter>L1_2EM8VH_MU10</lv1_filter> - <lv1_filter>L1_2J15_XE55</lv1_filter> - <lv1_filter>L1_2MU6</lv1_filter> - <lv1_filter>L1_3J40</lv1_filter> - <lv1_filter>L1_3MU4</lv1_filter> - <lv1_filter>L1_4J15</lv1_filter> - <lv1_filter>L1_EM15HI_2TAU12IM_J25_3J12</lv1_filter> - <lv1_filter>L1_EM15HI_2TAU12IM_XE35</lv1_filter> - <lv1_filter>L1_EM15HI_TAU40_2TAU15</lv1_filter> - <lv1_filter>L1_EM15VH_3EM7</lv1_filter> - <lv1_filter>L1_EM15VH_MU10</lv1_filter> - <lv1_filter>L1_EM22VHI</lv1_filter> - <lv1_filter>L1_J75</lv1_filter> - <lv1_filter>L1_MU10_TAU12IM_J25_2J12</lv1_filter> - <lv1_filter>L1_MU10_TAU12IM_XE35</lv1_filter> - <lv1_filter>L1_MU10_TAU20</lv1_filter> - <lv1_filter>L1_MU20</lv1_filter> - <lv1_filter>L1_MU4_3J15</lv1_filter> - <lv1_filter>L1_TAU20IM_2J20_XE45</lv1_filter> - <lv1_filter>L1_TAU20IM_2TAU12IM_J25_2J20_3J12</lv1_filter> - <lv1_filter>L1_TAU20IM_2TAU12IM_XE35</lv1_filter> - <lv1_filter>L1_TAU20_2TAU12_XE35</lv1_filter> - <lv1_filter>L1_TAU60</lv1_filter> - <lv1_filter>L1_XE50</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1PhysicsHigh_noPS</filter_name> - <lv1_filter>L1_3MU6</lv1_filter> - <!--<lv1_filter>L1_J100.32ETA49</lv1_filter> name had changed in menu --> - <lv1_filter>L1_J400</lv1_filter> - <lv1_filter>L1_XE80</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1EMPTY_noPS</filter_name> - <lv1_filter>L1_J12_EMPTY</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1FIRSTEMPTY_noPS</filter_name> - <lv1_filter>L1_J12_FIRSTEMPTY</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1UNPAIRED_ISO_noPS</filter_name> - <lv1_filter>L1_BCM_AC_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_BCM_CA_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_BCM_Wide_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_J12_UNPAIRED_ISO</lv1_filter> - <!--<lv1_filter>L1_J30.32ETA49_UNPAIRED_ISO</lv1_filter> name had changed in menu --> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1UNPAIRED_NONISO_noPS</filter_name> - <lv1_filter>L1_BCM_AC_UNPAIRED_NONISO</lv1_filter> - <lv1_filter>L1_BCM_CA_UNPAIRED_NONISO</lv1_filter> - <lv1_filter>L1_BCM_Wide_UNPAIRED_NONISO</lv1_filter> - <lv1_filter>L1_J12_UNPAIRED_NONISO</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1ABORTGAPNOTCALIB_noPS</filter_name> - <lv1_filter>L1_J12_ABORTGAPNOTCALIB</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1RD3_FILLED</filter_name> - <lv1_filter>L1_RD3_FILLED</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1RD3_EMPTY</filter_name> - <lv1_filter>L1_RD3_EMPTY</lv1_filter> - </filter> - </filters> -</trigger> diff --git a/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_276952.xml b/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_276952.xml deleted file mode 100644 index a008d914e9e03f5f0db9481adfc3ed7d44578844..0000000000000000000000000000000000000000 --- a/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_276952.xml +++ /dev/null @@ -1,204 +0,0 @@ -<?xml version="1.0" ?> -<trigger> - <lumivalues> - <lumivalues_data>9.6e+32</lumivalues_data> - <lumivalues_pred>2e+34</lumivalues_pred> - <deadtime>0.11</deadtime> - <peak_mu_av>14.3</peak_mu_av> - </lumivalues> - <bunchgroups> - <bunchgroup id="0" name="BCRVeto">3543</bunchgroup> - <bunchgroup id="1" name="Paired">446</bunchgroup> - <bunchgroup id="2" name="CalReq">70</bunchgroup> - <bunchgroup id="3" name="Empty">2863</bunchgroup> - <bunchgroup id="4" name="IsolatedUnpaired">24</bunchgroup> - <bunchgroup id="5" name="NonIsolatedUnpaired">0</bunchgroup> - <bunchgroup id="6" name="EmptyBeforeAfterPaired">120</bunchgroup> - <bunchgroup id="7" name="InTrain">384</bunchgroup> - <bunchgroup id="8" name="AbortGapNotCalReq">29</bunchgroup> - <bunchgroup id="9" name="AfterGlow">0</bunchgroup> - <bunchgroup id="10" name="ALFA">4</bunchgroup> - <bunchgroup id="11" name="EmptyBeforePaired">12</bunchgroup> - <bunchgroup id="12" name="BG12">0</bunchgroup> - <bunchgroup id="13" name="BG13">0</bunchgroup> - <bunchgroup id="14" name="BG14">0</bunchgroup> - <bunchgroup id="15" name="BG15">0</bunchgroup> - </bunchgroups> - <lb_list> - <lb id="89">3525</lb> - <lb id="90">16962</lb> - <lb id="91">15205</lb> - <lb id="92">17180</lb> - <lb id="93">16824</lb> - <lb id="94">12884</lb> - <lb id="95">2712</lb> - <lb id="96">16647</lb> - <lb id="97">18411</lb> - <lb id="98">16737</lb> - <lb id="99">16544</lb> - <lb id="100">16406</lb> - <lb id="101">16821</lb> - <lb id="102">16532</lb> - <lb id="103">16536</lb> - <lb id="104">16516</lb> - <lb id="105">16409</lb> - <lb id="106">16428</lb> - <lb id="107">16783</lb> - <lb id="108">16597</lb> - <lb id="109">16607</lb> - <lb id="110">16544</lb> - <lb id="111">16721</lb> - <lb id="112">15191</lb> - <lb id="113" flag="bad">289</lb> - <lb id="114" flag="bad">1140</lb> - <lb id="115">16436</lb> - <lb id="116">16366</lb> - <lb id="117">16611</lb> - <lb id="118">16525</lb> - <lb id="119">16303</lb> - <lb id="120">16340</lb> - <lb id="121">16581</lb> - <lb id="122">16493</lb> - <lb id="123">16481</lb> - <lb id="124">16276</lb> - <lb id="125">16425</lb> - <lb id="126">16166</lb> - <lb id="127">16429</lb> - <lb id="128">16342</lb> - <lb id="129">16259</lb> - <lb id="130">16193</lb> - <lb id="131">16318</lb> - <lb id="132">16311</lb> - <lb id="133">16299</lb> - <lb id="134">16406</lb> - <lb id="135">16383</lb> - <lb id="136">16210</lb> - <lb id="137">16251</lb> - <lb id="138">16344</lb> - <lb id="139">16243</lb> - <lb id="140">16322</lb> - <lb id="141">16165</lb> - <lb id="142">16107</lb> - <lb id="143">16180</lb> - <lb id="144">17974</lb> - <lb id="145">17014</lb> - <lb id="146">16322</lb> - <lb id="147">16240</lb> - <lb id="148">16182</lb> - <lb id="149">15990</lb> - <lb id="150">16175</lb> - <lb id="151">16084</lb> - <lb id="152">16176</lb> - <lb id="153">16119</lb> - <lb id="154">16130</lb> - <lb id="155">16105</lb> - <lb id="156">16085</lb> - <lb id="157">16097</lb> - <lb id="158">16213</lb> - <lb id="159">15946</lb> - <lb id="160">10243</lb> - </lb_list> - <filters> - <filter> - <eb_hlt_chains> - <eb_hlt_name>HLT_eb_low_L1RD2_FILLED</eb_hlt_name> - <lv1_ebtrigs>L1_MU6</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM10VH</lv1_ebtrigs> - <lv1_ebtrigs>L1_J30.0ETA49_2J20.0ETA49</lv1_ebtrigs> - <lv1_ebtrigs>L1_TAU12</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU4_J12</lv1_ebtrigs> - <lv1_ebtrigs>L1_2EM7</lv1_ebtrigs> - <lv1_ebtrigs>L1_J15</lv1_ebtrigs> - </eb_hlt_chains> - <eb_hlt_chains> - <eb_hlt_name>HLT_eb_high_L1RD2_FILLED</eb_hlt_name> - <lv1_ebtrigs>L1_3J15</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM18VH</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM20VHI</lv1_ebtrigs> - <lv1_ebtrigs>L1_2EM10VH</lv1_ebtrigs> - <lv1_ebtrigs>L1_J50</lv1_ebtrigs> - <lv1_ebtrigs>L1_TAU30</lv1_ebtrigs> - <lv1_ebtrigs>L1_2MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_XS30</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU15</lv1_ebtrigs> - <lv1_ebtrigs>L1_TAU20_2TAU12</lv1_ebtrigs> - <lv1_ebtrigs>L1_XE35</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU6_2MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU6_J20</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM7_MU10</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM15_MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM15VH_3EM7</lv1_ebtrigs> - </eb_hlt_chains> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1PhysicsLow_noPS</filter_name> - <lv1_filter>L1_2EM15</lv1_filter> - <lv1_filter>L1_2EM8VH_MU10</lv1_filter> - <lv1_filter>L1_2J15_XE55</lv1_filter> - <lv1_filter>L1_2MU6</lv1_filter> - <lv1_filter>L1_3J40</lv1_filter> - <lv1_filter>L1_3MU4</lv1_filter> - <lv1_filter>L1_4J15</lv1_filter> - <lv1_filter>L1_EM15HI_2TAU12IM_J25_3J12</lv1_filter> - <lv1_filter>L1_EM15HI_2TAU12IM_XE35</lv1_filter> - <lv1_filter>L1_EM15HI_TAU40_2TAU15</lv1_filter> - <lv1_filter>L1_EM15VH_3EM7</lv1_filter> - <lv1_filter>L1_EM15VH_MU10</lv1_filter> - <lv1_filter>L1_EM22VHI</lv1_filter> - <lv1_filter>L1_J75</lv1_filter> - <lv1_filter>L1_MU10_TAU12IM_J25_2J12</lv1_filter> - <lv1_filter>L1_MU10_TAU12IM_XE35</lv1_filter> - <lv1_filter>L1_MU10_TAU20</lv1_filter> - <lv1_filter>L1_MU20</lv1_filter> - <lv1_filter>L1_MU4_3J15</lv1_filter> - <lv1_filter>L1_TAU20IM_2J20_XE45</lv1_filter> - <lv1_filter>L1_TAU20IM_2TAU12IM_J25_2J20_3J12</lv1_filter> - <lv1_filter>L1_TAU20IM_2TAU12IM_XE35</lv1_filter> - <lv1_filter>L1_TAU20_2TAU12_XE35</lv1_filter> - <lv1_filter>L1_TAU60</lv1_filter> - <lv1_filter>L1_XE50</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1PhysicsHigh_noPS</filter_name> - <lv1_filter>L1_3MU6</lv1_filter> - <lv1_filter>L1_J100.31ETA49</lv1_filter> - <lv1_filter>L1_J400</lv1_filter> - <lv1_filter>L1_XE80</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1EMPTY_noPS</filter_name> - <lv1_filter>L1_J12_EMPTY</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1FIRSTEMPTY_noPS</filter_name> - <lv1_filter>L1_J12_FIRSTEMPTY</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1UNPAIRED_ISO_noPS</filter_name> - <lv1_filter>L1_BCM_AC_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_BCM_CA_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_BCM_Wide_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_J12_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_J30.31ETA49_UNPAIRED_ISO</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1UNPAIRED_NONISO_noPS</filter_name> - <lv1_filter>L1_BCM_AC_UNPAIRED_NONISO</lv1_filter> - <lv1_filter>L1_BCM_CA_UNPAIRED_NONISO</lv1_filter> - <lv1_filter>L1_BCM_Wide_UNPAIRED_NONISO</lv1_filter> - <lv1_filter>L1_J12_UNPAIRED_NONISO</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1ABORTGAPNOTCALIB_noPS</filter_name> - <lv1_filter>L1_J12_ABORTGAPNOTCALIB</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1RD3_FILLED</filter_name> - <lv1_filter>L1_RD3_FILLED</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1RD3_EMPTY</filter_name> - <lv1_filter>L1_RD3_EMPTY</lv1_filter> - </filter> - </filters> -</trigger> diff --git a/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_280500.xml b/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_280500.xml deleted file mode 100644 index 2cf2ab9a6118a8a22b213342a26a6602ee2321b5..0000000000000000000000000000000000000000 --- a/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_280500.xml +++ /dev/null @@ -1,200 +0,0 @@ -<?xml version="1.0" ?> -<trigger> - <lumivalues> - <lumivalues_data>2.037e+33</lumivalues_data> - <lumivalues_pred>2e+34</lumivalues_pred> - <deadtime>0.04</deadtime> - <peak_mu_av>14.71</peak_mu_av> - </lumivalues> - <bunchgroups> - <bunchgroup id="0" name="BCRVeto">3543</bunchgroup> - <bunchgroup id="1" name="Paired">881</bunchgroup> - <bunchgroup id="2" name="CalReq">70</bunchgroup> - <bunchgroup id="3" name="Empty">2368</bunchgroup> - <bunchgroup id="4" name="IsolatedUnpaired">24</bunchgroup> - <bunchgroup id="5" name="NonIsolatedUnpaired">0</bunchgroup> - <bunchgroup id="6" name="EmptyBeforeAfterPaired">190</bunchgroup> - <bunchgroup id="7" name="InTrain">798</bunchgroup> - <bunchgroup id="8" name="AbortGapNotCalReq">29</bunchgroup> - <bunchgroup id="9" name="AfterGlow">10</bunchgroup> - <bunchgroup id="10" name="ALFA">4</bunchgroup> - <bunchgroup id="11" name="EmptyBeforePaired">18</bunchgroup> - <bunchgroup id="12" name="AllWithoutCalreq">3473</bunchgroup> - <bunchgroup id="13" name="BG13">0</bunchgroup> - <bunchgroup id="14" name="BG14">0</bunchgroup> - <bunchgroup id="15" name="BG15">0</bunchgroup> - </bunchgroups> - <lb_list> - <lb id="122">16741</lb> - <lb id="123">17116</lb> - <lb id="124">16923</lb> - <lb id="125">16976</lb> - <lb id="126">16799</lb> - <lb id="127">16734</lb> - <lb id="128">16326</lb> - <lb id="129">16875</lb> - <lb id="130">16899</lb> - <lb id="131">16860</lb> - <lb id="132">16616</lb> - <lb id="133">16814</lb> - <lb id="134">16670</lb> - <lb id="135">16830</lb> - <lb id="136">16195</lb> - <lb id="137">16750</lb> - <lb id="138">16746</lb> - <lb id="139">17068</lb> - <lb id="140">6482</lb> - <lb id="141">16718</lb> - <lb id="142">8333</lb> - <lb id="143">17083</lb> - <lb id="144">16808</lb> - <lb id="145">16864</lb> - <lb id="146">16189</lb> - <lb id="147">16851</lb> - <lb id="148">16685</lb> - <lb id="149">16363</lb> - <lb id="150">16484</lb> - <lb id="151">16548</lb> - <lb id="152">16540</lb> - <lb id="153">16860</lb> - <lb id="154">16531</lb> - <lb id="155">16429</lb> - <lb id="156" flag="bad">4308</lb> - <lb id="157" flag="bad">178</lb> - <lb id="158">16596</lb> - <lb id="159">16329</lb> - <lb id="160">15758</lb> - <lb id="161">17242</lb> - <lb id="162">17396</lb> - <lb id="163">17561</lb> - <lb id="164">17623</lb> - <lb id="165">17509</lb> - <lb id="166">17463</lb> - <lb id="167">17813</lb> - <lb id="168">17393</lb> - <lb id="169">17443</lb> - <lb id="170">17700</lb> - <lb id="171">17497</lb> - <lb id="172">2973</lb> - <lb id="173">4166</lb> - <lb id="174">17517</lb> - <lb id="175">17365</lb> - <lb id="176">17563</lb> - <lb id="177" flag="bad">9919</lb> - <lb id="178" flag="bad">13733</lb> - <lb id="179" flag="bad">1258</lb> - <lb id="180">17426</lb> - <lb id="181">17637</lb> - <lb id="182">17576</lb> - <lb id="183">17344</lb> - <lb id="184">17235</lb> - <lb id="185">17422</lb> - <lb id="186">17118</lb> - <lb id="187">17312</lb> - <lb id="188">17292</lb> - <lb id="189">17386</lb> - <lb id="190">2975</lb> - </lb_list> - <filters> - <filter> - <eb_hlt_chains> - <eb_hlt_name>HLT_eb_low_L1RD2_FILLED</eb_hlt_name> - <lv1_ebtrigs>L1_MU6</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM10VH</lv1_ebtrigs> - <lv1_ebtrigs>L1_J30.0ETA49_2J20.0ETA49</lv1_ebtrigs> - <lv1_ebtrigs>L1_TAU12</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU4_J12</lv1_ebtrigs> - <lv1_ebtrigs>L1_2EM7</lv1_ebtrigs> - <lv1_ebtrigs>L1_J15</lv1_ebtrigs> - </eb_hlt_chains> - <eb_hlt_chains> - <eb_hlt_name>HLT_eb_high_L1RD2_FILLED</eb_hlt_name> - <lv1_ebtrigs>L1_3J15</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM18VH</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM20VHI</lv1_ebtrigs> - <lv1_ebtrigs>L1_2EM10VH</lv1_ebtrigs> - <lv1_ebtrigs>L1_J50</lv1_ebtrigs> - <lv1_ebtrigs>L1_TAU30</lv1_ebtrigs> - <lv1_ebtrigs>L1_2MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_XS30</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU15</lv1_ebtrigs> - <lv1_ebtrigs>L1_TAU20_2TAU12</lv1_ebtrigs> - <lv1_ebtrigs>L1_XE35</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU6_2MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU6_J20</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM7_MU10</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM15VH_3EM7</lv1_ebtrigs> - </eb_hlt_chains> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1PhysicsLow_noPS</filter_name> - <lv1_filter>L1_2EM15</lv1_filter> - <lv1_filter>L1_2EM8VH_MU10</lv1_filter> - <lv1_filter>L1_2J15_XE55</lv1_filter> - <lv1_filter>L1_2MU6</lv1_filter> - <lv1_filter>L1_3J40</lv1_filter> - <lv1_filter>L1_3MU4</lv1_filter> - <lv1_filter>L1_4J15</lv1_filter> - <lv1_filter>L1_EM15HI_2TAU12IM_J25_3J12</lv1_filter> - <lv1_filter>L1_EM15HI_2TAU12IM_XE35</lv1_filter> - <lv1_filter>L1_EM15HI_TAU40_2TAU15</lv1_filter> - <lv1_filter>L1_EM15VH_3EM7</lv1_filter> - <lv1_filter>L1_EM15VH_MU10</lv1_filter> - <lv1_filter>L1_EM22VHI</lv1_filter> - <lv1_filter>L1_J75</lv1_filter> - <lv1_filter>L1_MU10_TAU12IM_J25_2J12</lv1_filter> - <lv1_filter>L1_MU10_TAU12IM_XE35</lv1_filter> - <lv1_filter>L1_MU10_TAU20</lv1_filter> - <lv1_filter>L1_MU20</lv1_filter> - <lv1_filter>L1_MU4_3J15</lv1_filter> - <lv1_filter>L1_TAU20IM_2J20_XE45</lv1_filter> - <lv1_filter>L1_TAU20IM_2TAU12IM_J25_2J20_3J12</lv1_filter> - <lv1_filter>L1_TAU20IM_2TAU12IM_XE35</lv1_filter> - <lv1_filter>L1_TAU20_2TAU12_XE35</lv1_filter> - <lv1_filter>L1_TAU60</lv1_filter> - <lv1_filter>L1_XE50</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1PhysicsHigh_noPS</filter_name> - <lv1_filter>L1_3MU6</lv1_filter> - <lv1_filter>L1_J100.31ETA49</lv1_filter> - <lv1_filter>L1_J400</lv1_filter> - <lv1_filter>L1_XE80</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1EMPTY_noPS</filter_name> - <lv1_filter>L1_J12_EMPTY</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1FIRSTEMPTY_noPS</filter_name> - <lv1_filter>L1_J12_FIRSTEMPTY</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1UNPAIRED_ISO_noPS</filter_name> - <lv1_filter>L1_BCM_AC_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_BCM_CA_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_BCM_Wide_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_J12_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_J30.31ETA49_UNPAIRED_ISO</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1UNPAIRED_NONISO_noPS</filter_name> - <lv1_filter>L1_BCM_AC_UNPAIRED_NONISO</lv1_filter> - <lv1_filter>L1_BCM_CA_UNPAIRED_NONISO</lv1_filter> - <lv1_filter>L1_BCM_Wide_UNPAIRED_NONISO</lv1_filter> - <lv1_filter>L1_J12_UNPAIRED_NONISO</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1ABORTGAPNOTCALIB_noPS</filter_name> - <lv1_filter>L1_J12_ABORTGAPNOTCALIB</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1RD3_FILLED</filter_name> - <lv1_filter>L1_RD3_FILLED</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1RD3_EMPTY</filter_name> - <lv1_filter>L1_RD3_EMPTY</lv1_filter> - </filter> - </filters> -</trigger> diff --git a/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_286665.xml b/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_286665.xml deleted file mode 100644 index 893d0d01419a50a96ae5a5f92b6cde7d404ae546..0000000000000000000000000000000000000000 --- a/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_286665.xml +++ /dev/null @@ -1,138 +0,0 @@ -<?xml version="1.0" ?> -<!-- Please note this was first stable 13 TeV HeavyIon data, it contains a mu scan and MBTS voltage was too low. Lumi value data is estimated --> -<trigger> - <lumivalues> - <lumivalues_data>3.24e+24</lumivalues_data> - <lumivalues_pred>2e+27</lumivalues_pred> - <deadtime>0.00</deadtime> - <peak_mu_av>0.01819</peak_mu_av> - </lumivalues> - <bunchgroups> - <bunchgroup id="0" name="BCRVeto">3543</bunchgroup> - <bunchgroup id="1" name="Paired">5</bunchgroup> - <bunchgroup id="2" name="CalReq">70</bunchgroup> - <bunchgroup id="3" name="Empty">3308</bunchgroup> - <bunchgroup id="4" name="IsolatedUnpaired">10</bunchgroup> - <bunchgroup id="5" name="NonIsolatedUnpaired">0</bunchgroup> - <bunchgroup id="6" name="EmptyBeforeAfterPaired">50</bunchgroup> - <bunchgroup id="7" name="InTrain">0</bunchgroup> - <bunchgroup id="8" name="AbortGapNotCalReq">29</bunchgroup> - <bunchgroup id="9" name="AfterGlow">126</bunchgroup> - <bunchgroup id="10" name="ALFA">4</bunchgroup> - <bunchgroup id="11" name="EmptyBeforePaired">18</bunchgroup> - <bunchgroup id="12" name="AllWithoutCalreq">3473</bunchgroup> - <bunchgroup id="13" name="BG13">0</bunchgroup> - <bunchgroup id="14" name="BG14">0</bunchgroup> - <bunchgroup id="15" name="BG15">0</bunchgroup> - </bunchgroups> - <lb_list> - <lb id="156">3511</lb> - <lb id="157">4382</lb> - <lb id="158">4089</lb> - <lb id="159">4219</lb> - <lb id="160">2787</lb> - <lb id="161" flag="bad">16</lb> - <lb id="162" flag="bad">294</lb> - <lb id="163">1822</lb> - <lb id="164">3850</lb> - <lb id="165">2705</lb> - <lb id="166" flag="bad">642</lb> - <lb id="167" flag="bad">749</lb> - <lb id="168">4079</lb> - <lb id="169">4004</lb> - <lb id="170">1628</lb> - <lb id="171" flag="bad">634</lb> - <lb id="172">2227</lb> - <lb id="173">3749</lb> - <lb id="174">2727</lb> - <lb id="175" flag="bad">978</lb> - <lb id="176" flag="bad">410</lb> - <lb id="177">3928</lb> - <lb id="178">3833</lb> - <lb id="179">3789</lb> - <lb id="180">3765</lb> - <lb id="181">3819</lb> - <lb id="182">3791</lb> - <lb id="183">3679</lb> - <lb id="184">3708</lb> - <lb id="185">3602</lb> - <lb id="186">3618</lb> - <lb id="187">3659</lb> - <lb id="188">3597</lb> - <lb id="189">3644</lb> - <lb id="190">3529</lb> - <lb id="191">3611</lb> - <lb id="192">3642</lb> - <lb id="193">3566</lb> - <lb id="194">3507</lb> - <lb id="195">3530</lb> - <lb id="196">1465</lb> - <lb id="197">3456</lb> - <lb id="198">3430</lb> - <lb id="199">3550</lb> - <lb id="200" flag="bad">783</lb> - <lb id="201">3455</lb> - <lb id="202">3434</lb> - <lb id="203">1756</lb> - <lb id="204">3460</lb> - <lb id="205">3323</lb> - <lb id="206">3282</lb> - <lb id="207">3324</lb> - <lb id="208">3212</lb> - <lb id="209">3229</lb> - <lb id="210">3270</lb> - <lb id="211">3205</lb> - <lb id="212">3361</lb> - <lb id="213">3212</lb> - <lb id="214">3157</lb> - <lb id="215">3131</lb> - <lb id="216">3219</lb> - <lb id="217">3056</lb> - <lb id="218">3104</lb> - <lb id="219">3086</lb> - <lb id="220">3205</lb> - <lb id="221">3072</lb> - <lb id="222">3075</lb> - <lb id="223">2931</lb> - <lb id="224">3046</lb> - <lb id="225">3148</lb> - <lb id="226">3057</lb> - <lb id="227">3103</lb> - <lb id="228">3103</lb> - <lb id="229">3037</lb> - <lb id="230">2992</lb> - <lb id="231">3055</lb> - <lb id="232">2989</lb> - <lb id="233">2906</lb> - <lb id="234">2870</lb> - <lb id="235">2872</lb> - <lb id="236">2864</lb> - <lb id="237">2883</lb> - <lb id="238">2823</lb> - <lb id="239">2853</lb> - <lb id="240">2796</lb> - <lb id="241">2300</lb> - </lb_list> - <filters> - <filter> - <filter_name>HLT_noalg_eb_L1ZDC_A_C</filter_name> - <lv1_filter>L1_ZDC_A_C</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1ZDC_AND</filter_name> - <lv1_filter>L1_ZDC_AND</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1MBTS_1_1</filter_name> - <lv1_filter>L1_MBTS_1_1</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1ZDC_XOR</filter_name> - <lv1_filter>L1_ZDC_XOR</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1ZDC_XOR_TE5_VTE200</filter_name> - <lv1_filter>L1_ZDC_XOR_TE5_VTE200</lv1_filter> - </filter> - </filters> -</trigger> diff --git a/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_286717.xml b/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_286717.xml deleted file mode 100644 index fb35ca4603f2d23131a323fcd47db751c2ba1e09..0000000000000000000000000000000000000000 --- a/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_286717.xml +++ /dev/null @@ -1,150 +0,0 @@ -<?xml version="1.0" ?> -<!-- Please note this is Heavy Ion data --> -<trigger> - <lumivalues> - <lumivalues_data>6.37e+25</lumivalues_data> - <lumivalues_pred>2e+27</lumivalues_pred> - <deadtime>0.04</deadtime> - <peak_mu_av>1.2e-5</peak_mu_av> - </lumivalues> - <bunchgroups> - <bunchgroup id="0" name="BCRVeto">3543</bunchgroup> - <bunchgroup id="1" name="Paired">33</bunchgroup> - <bunchgroup id="2" name="CalReq">70</bunchgroup> - <bunchgroup id="3" name="Empty">3013</bunchgroup> - <bunchgroup id="4" name="IsolatedUnpaired">36</bunchgroup> - <bunchgroup id="5" name="NonIsolatedUnpaired">0</bunchgroup> - <bunchgroup id="6" name="EmptyBeforeAfterPaired">189</bunchgroup> - <bunchgroup id="7" name="InTrain">0</bunchgroup> - <bunchgroup id="8" name="AbortGapNotCalReq">29</bunchgroup> - <bunchgroup id="9" name="AfterGlow">62</bunchgroup> - <bunchgroup id="10" name="ALFA">4</bunchgroup> - <bunchgroup id="11" name="EmptyBeforePaired">33</bunchgroup> - <bunchgroup id="12" name="AllWithoutCalreq">3473</bunchgroup> - <bunchgroup id="13" name="BG13">0</bunchgroup> - <bunchgroup id="14" name="BG14">0</bunchgroup> - <bunchgroup id="15" name="BG15">0</bunchgroup> - </bunchgroups> - <lb_list> - <lb id="380">10486</lb> - <lb id="381">10411</lb> - <lb id="382">10313</lb> - <lb id="383">10419</lb> - <lb id="384">10402</lb> - <lb id="385">10323</lb> - <lb id="386">10136</lb> - <lb id="387">10322</lb> - <lb id="388">9991</lb> - <lb id="389">9927</lb> - <lb id="390">10096</lb> - <lb id="391">10076</lb> - <lb id="392">10235</lb> - <lb id="393">9756</lb> - <lb id="394">9980</lb> - <lb id="395">9735</lb> - <lb id="396">9826</lb> - <lb id="397">9768</lb> - <lb id="398">9791</lb> - <lb id="399">9676</lb> - <lb id="400">9782</lb> - <lb id="401">9715</lb> - <lb id="402">9683</lb> - <lb id="403">9553</lb> - <lb id="404">9690</lb> - <lb id="405">9453</lb> - <lb id="406">9597</lb> - <lb id="407">9768</lb> - <lb id="408">9203</lb> - <lb id="409">9260</lb> - <lb id="410">9537</lb> - <lb id="411">9465</lb> - <lb id="412">9573</lb> - <lb id="413">9328</lb> - <lb id="414">9215</lb> - <lb id="415">9496</lb> - <lb id="416">9213</lb> - <lb id="417">9071</lb> - <lb id="418">9065</lb> - <lb id="419">9260</lb> - <lb id="420">8947</lb> - <lb id="421">9075</lb> - <lb id="422">9172</lb> - <lb id="423">8987</lb> - <lb id="424">9009</lb> - <lb id="425">9022</lb> - <lb id="426">9029</lb> - <lb id="427">9109</lb> - <lb id="428">9002</lb> - <lb id="429">8933</lb> - <lb id="430">8943</lb> - <lb id="431">8940</lb> - <lb id="432">8880</lb> - <lb id="433">8965</lb> - <lb id="434">8650</lb> - <lb id="435">8881</lb> - <lb id="436">8804</lb> - <lb id="437">8885</lb> - <lb id="438">8692</lb> - <lb id="439">8529</lb> - <lb id="440">8859</lb> - <lb id="441">8597</lb> - <lb id="442">8576</lb> - <lb id="443">8457</lb> - <lb id="444">8500</lb> - <lb id="445">8421</lb> - <lb id="446">8604</lb> - <lb id="447">8425</lb> - <lb id="448">8458</lb> - <lb id="449">8438</lb> - <lb id="450">8261</lb> - <lb id="451">8411</lb> - <lb id="452">8324</lb> - <lb id="453">8406</lb> - <lb id="454">8263</lb> - <lb id="455">8073</lb> - <lb id="456">8246</lb> - <lb id="457">8291</lb> - <lb id="458">8190</lb> - <lb id="459">8165</lb> - <lb id="460">8280</lb> - <lb id="461">8123</lb> - <lb id="462">8043</lb> - <lb id="463">8242</lb> - <lb id="464">8088</lb> - <lb id="465">8069</lb> - <lb id="466">8020</lb> - <lb id="467">7944</lb> - <lb id="468">8092</lb> - <lb id="469">8084</lb> - <lb id="470">8104</lb> - <lb id="471">7903</lb> - <lb id="472">7895</lb> - <lb id="473">7738</lb> - <lb id="474">7709</lb> - <lb id="475" flag="bad">2937</lb> - <lb id="476" flag="bad">30184</lb> - <lb id="477">6011</lb> - </lb_list> - <filters> - <filter> - <filter_name>HLT_noalg_eb_L1ZDC_A_C</filter_name> - <lv1_filter>L1_ZDC_A_C</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1ZDC_AND</filter_name> - <lv1_filter>L1_ZDC_AND</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1MBTS_1_1</filter_name> - <lv1_filter>L1_MBTS_1_1</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1ZDC_XOR</filter_name> - <lv1_filter>L1_ZDC_XOR</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1ZDC_XOR_TE5_VTE200</filter_name> - <lv1_filter>L1_ZDC_XOR_TE5_VTE200</lv1_filter> - </filter> - </filters> -</trigger> diff --git a/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_287843.xml b/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_287843.xml deleted file mode 100644 index 2259e31eb796fd1d940384eb717f88f887bbd022..0000000000000000000000000000000000000000 --- a/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_287843.xml +++ /dev/null @@ -1,197 +0,0 @@ -<?xml version="1.0" ?> -<!-- Please note this is Heavy Ion data --> -<trigger> - <lumivalues> - <lumivalues_data>1.57e+027</lumivalues_data> - <lumivalues_pred>2e+27</lumivalues_pred> - <deadtime>0.04</deadtime> - <peak_mu_av>2.0e-5</peak_mu_av> - </lumivalues> - <bunchgroups> - <bunchgroup id="0" name="BCRVeto">3543</bunchgroup> - <bunchgroup id="1" name="Paired">492</bunchgroup> - <bunchgroup id="2" name="CalReq">70</bunchgroup> - <bunchgroup id="3" name="Empty">770</bunchgroup> - <bunchgroup id="4" name="IsolatedUnpaired">1</bunchgroup> - <bunchgroup id="5" name="NonIsolatedUnpaired">49</bunchgroup> - <bunchgroup id="6" name="EmptyBeforeAfterPaired">2073</bunchgroup> - <bunchgroup id="7" name="InTrain">0</bunchgroup> - <bunchgroup id="8" name="AbortGapNotCalReq">29</bunchgroup> - <bunchgroup id="9" name="AfterGlow">0</bunchgroup> - <bunchgroup id="10" name="ALFA">4</bunchgroup> - <bunchgroup id="11" name="EmptyBeforePaired">492</bunchgroup> - <bunchgroup id="12" name="AllWithoutCalreq">3473</bunchgroup> - <bunchgroup id="13" name="BG13">0</bunchgroup> - <bunchgroup id="14" name="BG14">0</bunchgroup> - <bunchgroup id="15" name="BG15">0</bunchgroup> - </bunchgroups> - <lb_list> - <lb id="224">2112</lb> - <lb id="225">7001</lb> - <lb id="226">7017</lb> - <lb id="227">6841</lb> - <lb id="228">6940</lb> - <lb id="229">6715</lb> - <lb id="230">6908</lb> - <lb id="231">6702</lb> - <lb id="232">6781</lb> - <lb id="233">6621</lb> - <lb id="234">6616</lb> - <lb id="235">6680</lb> - <lb id="236">6556</lb> - <lb id="237">5307</lb> - <lb id="238">1720</lb> - <lb id="239">8594</lb> - <lb id="240">8351</lb> - <lb id="241">8506</lb> - <lb id="242">8451</lb> - <lb id="243">8459</lb> - <lb id="244">8492</lb> - <lb id="245">8298</lb> - <lb id="246">8316</lb> - <lb id="247">8273</lb> - <lb id="248">8260</lb> - <lb id="249">8205</lb> - <lb id="250">3906</lb> - <lb id="251">8352</lb> - <lb id="252">8095</lb> - <lb id="253">5491</lb> - <lb id="254">2553</lb> - <lb id="255">8090</lb> - <lb id="256">8005</lb> - <lb id="257">8005</lb> - <lb id="258">7995</lb> - <lb id="259">8007</lb> - <lb id="260">8126</lb> - <lb id="261">8031</lb> - <lb id="262">8010</lb> - <lb id="263">7832</lb> - <lb id="264">7895</lb> - <lb id="265">7851</lb> - <lb id="266">7792</lb> - <lb id="267">7706</lb> - <lb id="268">7636</lb> - <lb id="269">7685</lb> - <lb id="270">7563</lb> - <lb id="271">7590</lb> - <lb id="272">7755</lb> - <lb id="273">7609</lb> - <lb id="274">7544</lb> - <lb id="275">7497</lb> - <lb id="276">7415</lb> - <lb id="277">7459</lb> - <lb id="278">7273</lb> - <lb id="279">7307</lb> - <lb id="280">7438</lb> - <lb id="281">7338</lb> - <lb id="282">7387</lb> - <lb id="283">7323</lb> - <lb id="284">7299</lb> - <lb id="285">7263</lb> - <lb id="286">7133</lb> - <lb id="287">7118</lb> - <lb id="288">7123</lb> - <lb id="289">7018</lb> - <lb id="290">1392</lb> - <lb id="291">2298</lb> - <lb id="292">7286</lb> - <lb id="293">6986</lb> - <lb id="294">7062</lb> - <lb id="295">7148</lb> - <lb id="296">7143</lb> - <lb id="297">6945</lb> - <lb id="298">6983</lb> - <lb id="299">6866</lb> - <lb id="300">6874</lb> - <lb id="301">6876</lb> - <lb id="302">6998</lb> - <lb id="303">3357</lb> - <lb id="304">7185</lb> - <lb id="305">7020</lb> - <lb id="306">7009</lb> - <lb id="307">6878</lb> - <lb id="308">6842</lb> - <lb id="309">6850</lb> - <lb id="310">6769</lb> - <lb id="311">7031</lb> - <lb id="312">6592</lb> - <lb id="313">6694</lb> - <lb id="314">6821</lb> - <lb id="315">6526</lb> - <lb id="316">6557</lb> - <lb id="317">6577</lb> - <lb id="318">6474</lb> - <lb id="319">2683</lb> - <lb id="320">13058</lb> - <lb id="321">2164</lb> - <lb id="322">12648</lb> - <lb id="323">12843</lb> - <lb id="324">12802</lb> - <lb id="325">12743</lb> - <lb id="326">12591</lb> - <lb id="327">12615</lb> - <lb id="328">12781</lb> - <lb id="329">12753</lb> - <lb id="330">12340</lb> - <lb id="331">12805</lb> - <lb id="332">12515</lb> - <lb id="333">12520</lb> - <lb id="334">12466</lb> - <lb id="335">12183</lb> - <lb id="336">12137</lb> - <lb id="337">12151</lb> - <lb id="338">12311</lb> - <lb id="339">12161</lb> - <lb id="340">12201</lb> - <lb id="341">12059</lb> - <lb id="342">12121</lb> - <lb id="343">12128</lb> - <lb id="344">12053</lb> - <lb id="345">12041</lb> - <lb id="346">12007</lb> - <lb id="347">11929</lb> - <lb id="348">11923</lb> - <lb id="349">11908</lb> - <lb id="350">10285</lb> - <lb id="351">10217</lb> - <lb id="352">10357</lb> - </lb_list> - <filters> - <filter> - <filter_name>HLT_noalg_eb_L1ZDC_A_C_VTE50</filter_name> - <lv1_filter>L1_ZDC_A_C_VTE50</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1TE5_VTE200</filter_name> - <lv1_filter>L1_TE5_VTE200</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1MBTS_1_1</filter_name> - <lv1_filter>L1_MBTS_1_1</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1ZDC_XOR_TE5_VTE200</filter_name> - <lv1_filter>L1_ZDC_XOR_TE5_VTE200</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1MU0_VTE50</filter_name> - <lv1_filter>L1_MU0_VTE50</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1EM12</filter_name> - <lv1_filter>L1_EM12</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1MU4</filter_name> - <lv1_filter>L1_MU4</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1TE50</filter_name> - <lv1_filter>L1_TE50</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1TE12000</filter_name> - <lv1_filter>L1_TE12000</lv1_filter> - </filter> - </filters> -</trigger> diff --git a/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_296939.xml b/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_296939.xml deleted file mode 100644 index 572be97f48fd87260869c03bba70b603ef3a7bc7..0000000000000000000000000000000000000000 --- a/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_296939.xml +++ /dev/null @@ -1,245 +0,0 @@ -<?xml version="1.0" ?> -<trigger> - <lumivalues> - <lumivalues_data>4.830e+30</lumivalues_data> - <lumivalues_pred>2e+34</lumivalues_pred> - <deadtime>0.06</deadtime> - <peak_mu_av>15.36</peak_mu_av> - </lumivalues> - <bunchgroups> - <bunchgroup id="0" name="BCRVeto">3543</bunchgroup> - <bunchgroup id="1" name="Paired">2</bunchgroup> - <bunchgroup id="2" name="CalReq">70</bunchgroup> - <bunchgroup id="3" name="Empty">3438</bunchgroup> - <bunchgroup id="4" name="IsolatedUnpaired">2</bunchgroup> - <bunchgroup id="5" name="NonIsolatedUnpaired">2</bunchgroup> - <bunchgroup id="6" name="EmptyBeforeAfterPaired">19</bunchgroup> - <bunchgroup id="7" name="InTrain">0</bunchgroup> - <bunchgroup id="8" name="AbortGapNotCalReq">29</bunchgroup> - <bunchgroup id="9" name="AfterGlow">125</bunchgroup> - <bunchgroup id="10" name="ALFA">64</bunchgroup> - <bunchgroup id="11" name="EmptyBeforePaired">2</bunchgroup> - <bunchgroup id="12" name="AllWithoutCalreq">3473</bunchgroup> - <bunchgroup id="13" name="BG13">0</bunchgroup> - <bunchgroup id="14" name="BG14">0</bunchgroup> - <bunchgroup id="15" name="BG15">0</bunchgroup> - </bunchgroups> - <lb_list> - <lb id="108">12496</lb> - <lb id="109" flag="bad">6998</lb> - <lb id="110">0</lb> - <lb id="111">0</lb> - <lb id="112">12341</lb> - <lb id="113">12090</lb> - <lb id="114">12327</lb> - <lb id="115">12307</lb> - <lb id="116">12134</lb> - <lb id="117">12244</lb> - <lb id="118">12144</lb> - <lb id="119">12363</lb> - <lb id="120">1835 </lb> - <lb id="121">11931</lb> - <lb id="122">12252</lb> - <lb id="123">12128</lb> - <lb id="124">12151</lb> - <lb id="125">12201</lb> - <lb id="126">11430</lb> - <lb id="127">12064</lb> - <lb id="128">12144</lb> - <lb id="129">976</lb> - <lb id="130">12030</lb> - <lb id="131">11783</lb> - <lb id="132">12040</lb> - <lb id="133">12099</lb> - <lb id="134">12125</lb> - <lb id="135">12203</lb> - <lb id="136">11314</lb> - <lb id="137">12075</lb> - <lb id="138">2023</lb> - <lb id="139">11983</lb> - <lb id="140">11997</lb> - <lb id="141">12069</lb> - <lb id="142">11287</lb> - <lb id="143">11969</lb> - <lb id="144">11864</lb> - <lb id="145">11986</lb> - <lb id="146">11928</lb> - <lb id="147">11407</lb> - <lb id="148">12083</lb> - <lb id="149">11867</lb> - <lb id="150">1781</lb> - <lb id="151">11898</lb> - <lb id="152">11583</lb> - <lb id="153">12036</lb> - <lb id="154">11881</lb> - <lb id="155">11852</lb> - <lb id="156">11849</lb> - <lb id="157">11131</lb> - <lb id="158">12014</lb> - <lb id="159">11939</lb> - <lb id="160">11898</lb> - <lb id="161">12049</lb> - <lb id="162">11328</lb> - <lb id="163">11696</lb> - <lb id="164">11923</lb> - <lb id="165">11808</lb> - <lb id="166">11703</lb> - <lb id="167">11222</lb> - <lb id="168">11681</lb> - <lb id="169">11960</lb> - <lb id="170">11676</lb> - <lb id="171">11643</lb> - <lb id="172">11283</lb> - <lb id="173">11726</lb> - <lb id="174">11764</lb> - <lb id="175">11885</lb> - <lb id="176">11709</lb> - <lb id="177">11111</lb> - <lb id="178">11785</lb> - <lb id="179">11874</lb> - <lb id="180">1715</lb> - <lb id="181">11830</lb> - <lb id="182">11676</lb> - <lb id="183">11597</lb> - <lb id="184">11807</lb> - <lb id="185">11778</lb> - <lb id="186">11495</lb> - <lb id="187">11591</lb> - <lb id="188">11681</lb> - <lb id="189">11606</lb> - <lb id="190">11870</lb> - <lb id="191">11820</lb> - <lb id="192">11612</lb> - <lb id="193">11555</lb> - <lb id="194">11628</lb> - <lb id="195">11736</lb> - <lb id="196">11657</lb> - <lb id="197">11632</lb> - <lb id="198">11574</lb> - <lb id="199">11880</lb> - <lb id="200">11731</lb> - <lb id="201">11765</lb> - <lb id="202">11771</lb> - <lb id="203">11655</lb> - <lb id="204">11682</lb> - <lb id="205">11510</lb> - <lb id="206">3537</lb> - </lb_list> - <filters> - <filter> - <eb_hlt_chains> - <eb_hlt_name>HLT_eb_low_L1RD2_FILLED</eb_hlt_name> - <lv1_ebtrigs>L1_MU6</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM10VH</lv1_ebtrigs> - <lv1_ebtrigs>L1_J30.0ETA49_2J20.0ETA49</lv1_ebtrigs> - <lv1_ebtrigs>L1_TAU12</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU4_J12</lv1_ebtrigs> - <lv1_ebtrigs>L1_2EM7</lv1_ebtrigs> - <lv1_ebtrigs>L1_2MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_J15</lv1_ebtrigs> - <lv1_ebtrigs>L1_XS30</lv1_ebtrigs> - </eb_hlt_chains> - <eb_hlt_chains> - <eb_hlt_name>HLT_eb_high_L1RD2_FILLED</eb_hlt_name> - <lv1_ebtrigs>L1_3J15</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM18VH</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM20VHI</lv1_ebtrigs> - <lv1_ebtrigs>L1_2EM10VH</lv1_ebtrigs> - <lv1_ebtrigs>L1_J50</lv1_ebtrigs> - <lv1_ebtrigs>L1_TAU30</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU15</lv1_ebtrigs> - <lv1_ebtrigs>L1_TAU20_2TAU12</lv1_ebtrigs> - <lv1_ebtrigs>L1_XE35</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU6_2MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU6_J20</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM7_MU10</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM15VH_3EM7</lv1_ebtrigs> - </eb_hlt_chains> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1PhysicsLow_noPS</filter_name> - <lv1_filter>L1_2EM15</lv1_filter> - <lv1_filter>L1_2EM8VH_MU10</lv1_filter> - <lv1_filter>L1_2J15_XE55</lv1_filter> - <lv1_filter>L1_2MU6</lv1_filter> - <lv1_filter>L1_3J40</lv1_filter> - <lv1_filter>L1_3MU4</lv1_filter> - <lv1_filter>L1_4J15</lv1_filter> - <lv1_filter>L1_EM15HI_2TAU12IM_J25_3J12</lv1_filter> - <lv1_filter>L1_EM15HI_2TAU12IM_XE35</lv1_filter> - <lv1_filter>L1_EM15HI_TAU40_2TAU15</lv1_filter> - <lv1_filter>L1_EM15VH_3EM7</lv1_filter> - <lv1_filter>L1_EM15VH_MU10</lv1_filter> - <lv1_filter>L1_EM22VHI</lv1_filter> - <lv1_filter>L1_J75</lv1_filter> - <lv1_filter>L1_MU10_TAU12IM_J25_2J12</lv1_filter> - <lv1_filter>L1_MU10_TAU12IM_XE35</lv1_filter> - <lv1_filter>L1_MU10_TAU20IM</lv1_filter> - <lv1_filter>L1_MU20</lv1_filter> - <lv1_filter>L1_MU6_J30.0ETA49_2J20.0ETA49</lv1_filter> - <lv1_filter>L1_TAU20IM_2J20_XE45</lv1_filter> - <lv1_filter>L1_TAU20IM_2TAU12IM_J25_2J20_3J12</lv1_filter> - <lv1_filter>L1_TAU20IM_2TAU12IM_XE35</lv1_filter> - <lv1_filter>L1_TAU20_2TAU12_XE35</lv1_filter> - <lv1_filter>L1_TAU60</lv1_filter> - <lv1_filter>L1_XE50</lv1_filter> - <lv1_filter>L1_MU10_3J20</lv1_filter> - <lv1_filter>L1_MU6_J40</lv1_filter> - <lv1_filter>L1_J40.0ETA25_2J15.31ETA49</lv1_filter> - <lv1_filter>L1_EM15I_MU4</lv1_filter> - <lv1_filter>L1_3MU6</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1PhysicsHigh_noPS</filter_name> - <lv1_filter>L1_J100.31ETA49</lv1_filter> - <lv1_filter>L1_J400</lv1_filter> - <lv1_filter>L1_XE80</lv1_filter> - <lv1_filter>L1_XE300</lv1_filter> - <lv1_filter>L1_6J15</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1EMPTY_noPS</filter_name> - <lv1_filter>L1_J12_EMPTY</lv1_filter> - <lv1_filter>L1_MU11_EMPTY</lv1_filter> - <lv1_filter>L1_TAU8_EMPTY</lv1_filter> - <lv1_filter>L1_EM7_EMPTY</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1FIRSTEMPTY_noPS</filter_name> - <lv1_filter>L1_J12_FIRSTEMPTY</lv1_filter> - <lv1_filter>L1_MU20_FIRSTEMPTY</lv1_filter> - <lv1_filter>L1_TAU8_FIRSTEMPTY</lv1_filter> - <lv1_filter>L1_EM7_FIRSTEMPTY</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1UNPAIRED_ISO_noPS</filter_name> - <lv1_filter>L1_BCM_AC_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_BCM_CA_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_BCM_Wide_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_J12_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_J30.31ETA49_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_MU4_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_EM7_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_TAU8_UNPAIRED_ISO</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1UNPAIRED_NONISO_noPS</filter_name> - <lv1_filter>L1_BCM_AC_UNPAIRED_NONISO</lv1_filter> - <lv1_filter>L1_BCM_CA_UNPAIRED_NONISO</lv1_filter> - <lv1_filter>L1_BCM_Wide_UNPAIRED_NONISO</lv1_filter> - <lv1_filter>L1_J12_UNPAIRED_NONISO</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1ABORTGAPNOTCALIB_noPS</filter_name> - <lv1_filter>L1_J12_ABORTGAPNOTCALIB</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1RD3_FILLED</filter_name> - <lv1_filter>L1_RD3_FILLED</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1RD3_EMPTY</filter_name> - <lv1_filter>L1_RD3_EMPTY</lv1_filter> - </filter> - </filters> -</trigger> diff --git a/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_298967.xml b/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_298967.xml deleted file mode 100644 index 66b2a430aaf42ce5e1ae28ccc503b4a4ab93864e..0000000000000000000000000000000000000000 --- a/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_298967.xml +++ /dev/null @@ -1,210 +0,0 @@ -<?xml version="1.0" ?> -<trigger> - <lumivalues> - <lumivalues_data>2.07e+33</lumivalues_data> - <lumivalues_pred>2e+34</lumivalues_pred> - <deadtime>0.04</deadtime> - <peak_mu_av>22.3</peak_mu_av> - </lumivalues> - <bunchgroups> - <bunchgroup id="0" name="BCRVeto">3543</bunchgroup> - <bunchgroup id="1" name="Paired">589</bunchgroup> - <bunchgroup id="2" name="CalReq">70</bunchgroup> - <bunchgroup id="3" name="Empty">2741</bunchgroup> - <bunchgroup id="4" name="IsolatedUnpaired">24</bunchgroup> - <bunchgroup id="5" name="NonIsolatedUnpaired">0</bunchgroup> - <bunchgroup id="6" name="EmptyBeforeAfterPaired">99</bunchgroup> - <bunchgroup id="7" name="InTrain">534</bunchgroup> - <bunchgroup id="8" name="AbortGapNotCalReq">29</bunchgroup> - <bunchgroup id="9" name="AfterGlow">0</bunchgroup> - <bunchgroup id="10" name="ALFA">4</bunchgroup> - <bunchgroup id="11" name="EmptyBeforePaired">10</bunchgroup> - <bunchgroup id="12" name="AllWithoutCalreq">3473</bunchgroup> - <bunchgroup id="13" name="BG13">0</bunchgroup> - <bunchgroup id="14" name="BG14">0</bunchgroup> - <bunchgroup id="15" name="BG15">0</bunchgroup> - </bunchgroups> - <lb_list> - <lb id="142" lumi="2051" mu="22.1">21973</lb> - <lb id="143" lumi="2051" mu="22.1">22717</lb> - <lb id="144" lumi="2053" mu="22.2">22984</lb> - <lb id="145" lumi="2051" mu="22.1">22653</lb> - <lb id="146" lumi="1927" mu="20.8">22141</lb> - <lb id="147" lumi="1987" mu="21.5">22489</lb> - <lb id="148" lumi="2016" mu="21.8">21301</lb> - <lb id="149" lumi="2111" mu="22.8">18918</lb> - <lb id="150" lumi="2110" mu="22.8" flag="bad">145</lb> - <lb id="151" lumi="2111" mu="22.8">23012</lb> - <lb id="152" lumi="2110" mu="22.8">20774</lb> - <lb id="153" lumi="2107" mu="22.7" flag="bad">4103</lb> - <lb id="154" lumi="2106" mu="22.7">18301</lb> - <lb id="155" lumi="2105" mu="22.7">18409</lb> - <lb id="156" lumi="2102" mu="22.7">18088</lb> - <lb id="157" lumi="2100" mu="22.7">18629</lb> - <lb id="158" lumi="2099" mu="22.7">18641</lb> - <lb id="159" lumi="2100" mu="22.7">18309</lb> - <lb id="160" lumi="2098" mu="22.7">14690</lb> - <lb id="161" lumi="2098" mu="22.6">18538</lb> - <lb id="162" lumi="2094" mu="22.6">13262</lb> - <lb id="163" lumi="2093" mu="22.6">18418</lb> - <lb id="164" lumi="2091" mu="22.6">17900</lb> - <lb id="165" lumi="2090" mu="22.6">18460</lb> - <lb id="166" lumi="2089" mu="22.5">18882</lb> - <lb id="167" lumi="2088" mu="22.5">17617</lb> - <lb id="168" lumi="2085" mu="22.5">18220</lb> - <lb id="169" lumi="2085" mu="22.5">18324</lb> - <lb id="170" lumi="2082" mu="22.5">18531</lb> - <lb id="171" lumi="2081" mu="22.5">18362</lb> - <lb id="172" lumi="2079" mu="22.4">18620</lb> - <lb id="173" lumi="2078" mu="22.4">18616</lb> - <lb id="174" lumi="2075" mu="22.4">18458</lb> - <lb id="175" lumi="2074" mu="22.4">18177</lb> - <lb id="176" lumi="2072" mu="22.4">18386</lb> - <lb id="177" lumi="2070" mu="22.3">8032</lb> - <lb id="178" lumi="2070" mu="22.4">19462</lb> - <lb id="179" lumi="2068" mu="22.3">18334</lb> - <lb id="180" lumi="2068" mu="22.3">2803</lb> - <lb id="181" lumi="2066" mu="22.3">18170</lb> - <lb id="182" lumi="2065" mu="22.3">18284</lb> - <lb id="183" lumi="2063" mu="22.3">18493</lb> - <lb id="184" lumi="2061" mu="22.2">18369</lb> - <lb id="185" lumi="2061" mu="22.2">18130</lb> - <lb id="186" lumi="2060" mu="22.2">18363</lb> - <lb id="187" lumi="2058" mu="22.2">18263</lb> - <lb id="188" lumi="2056" mu="22.2">18160</lb> - <lb id="189" lumi="2054" mu="22.2">18175</lb> - <lb id="190" lumi="2052" mu="22.2">18054</lb> - <lb id="191" lumi="2050" mu="22.1">18364</lb> - <lb id="192" lumi="2049" mu="22.1">18111</lb> - <lb id="193" lumi="2047" mu="22.1">18137</lb> - <lb id="194" lumi="2046" mu="22.1">18164</lb> - <lb id="195" lumi="2045" mu="22.1">18228</lb> - <lb id="196" lumi="2044" mu="22.1">18261</lb> - <lb id="197" lumi="2043" mu="22.1">18418</lb> - <lb id="198" lumi="2041" mu="22">18270</lb> - <lb id="199" lumi="2040" mu="22">18123</lb> - <lb id="200" lumi="2037" mu="22">18562</lb> - <lb id="201" lumi="2035" mu="22">18232</lb> - <lb id="202" lumi="2034" mu="22">18029</lb> - <lb id="203" lumi="2033" mu="21.9">18464</lb> - <lb id="204" lumi="2032" mu="21.9">18386</lb> - <lb id="205" lumi="2032" mu="21.9">8469</lb> - </lb_list> - <filters> - <filter> - <eb_hlt_chains> - <eb_hlt_name>HLT_eb_low_L1RD2_FILLED</eb_hlt_name> - <lv1_ebtrigs>L1_MU6</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM10VH</lv1_ebtrigs> - <lv1_ebtrigs>L1_J30.0ETA49_2J20.0ETA49</lv1_ebtrigs> - <lv1_ebtrigs>L1_TAU12</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU4_J12</lv1_ebtrigs> - <lv1_ebtrigs>L1_2EM7</lv1_ebtrigs> - <lv1_ebtrigs>L1_2MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_J15</lv1_ebtrigs> - <lv1_ebtrigs>L1_XS30</lv1_ebtrigs> - </eb_hlt_chains> - <eb_hlt_chains> - <eb_hlt_name>HLT_eb_high_L1RD2_FILLED</eb_hlt_name> - <lv1_ebtrigs>L1_3J15</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM18VH</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM20VHI</lv1_ebtrigs> - <lv1_ebtrigs>L1_2EM10VH</lv1_ebtrigs> - <lv1_ebtrigs>L1_J50</lv1_ebtrigs> - <lv1_ebtrigs>L1_TAU30</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU15</lv1_ebtrigs> - <lv1_ebtrigs>L1_TAU20_2TAU12</lv1_ebtrigs> - <lv1_ebtrigs>L1_XE35</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU6_2MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU6_J20</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM7_MU10</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM15VH_3EM7</lv1_ebtrigs> - </eb_hlt_chains> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1PhysicsLow_noPS</filter_name> - <lv1_filter>L1_2EM15</lv1_filter> - <lv1_filter>L1_2EM8VH_MU10</lv1_filter> - <lv1_filter>L1_2J15_XE55</lv1_filter> - <lv1_filter>L1_2MU6</lv1_filter> - <lv1_filter>L1_3J40</lv1_filter> - <lv1_filter>L1_3MU4</lv1_filter> - <lv1_filter>L1_4J15</lv1_filter> - <lv1_filter>L1_EM15HI_2TAU12IM_J25_3J12</lv1_filter> - <lv1_filter>L1_EM15HI_2TAU12IM_XE35</lv1_filter> - <lv1_filter>L1_EM15HI_TAU40_2TAU15</lv1_filter> - <lv1_filter>L1_EM15VH_3EM7</lv1_filter> - <lv1_filter>L1_EM15VH_MU10</lv1_filter> - <lv1_filter>L1_EM22VHI</lv1_filter> - <lv1_filter>L1_J75</lv1_filter> - <lv1_filter>L1_MU10_TAU12IM_J25_2J12</lv1_filter> - <lv1_filter>L1_MU10_TAU12IM_XE35</lv1_filter> - <lv1_filter>L1_MU10_TAU20IM</lv1_filter> - <lv1_filter>L1_MU20</lv1_filter> - <lv1_filter>L1_MU6_J30.0ETA49_2J20.0ETA49</lv1_filter> - <lv1_filter>L1_TAU20IM_2J20_XE45</lv1_filter> - <lv1_filter>L1_TAU20IM_2TAU12IM_J25_2J20_3J12</lv1_filter> - <lv1_filter>L1_TAU20IM_2TAU12IM_XE35</lv1_filter> - <lv1_filter>L1_TAU20_2TAU12_XE35</lv1_filter> - <lv1_filter>L1_TAU60</lv1_filter> - <lv1_filter>L1_XE50</lv1_filter> - <lv1_filter>L1_MU10_3J20</lv1_filter> - <lv1_filter>L1_MU6_J40</lv1_filter> - <lv1_filter>L1_J40.0ETA25_2J15.31ETA49</lv1_filter> - <lv1_filter>L1_EM15I_MU4</lv1_filter> - <lv1_filter>L1_3MU6</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1PhysicsHigh_noPS</filter_name> - <lv1_filter>L1_J100.31ETA49</lv1_filter> - <lv1_filter>L1_J400</lv1_filter> - <lv1_filter>L1_XE80</lv1_filter> - <lv1_filter>L1_XE300</lv1_filter> - <lv1_filter>L1_6J15</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1EMPTY_noPS</filter_name> - <lv1_filter>L1_J12_EMPTY</lv1_filter> - <lv1_filter>L1_MU11_EMPTY</lv1_filter> - <lv1_filter>L1_TAU8_EMPTY</lv1_filter> - <lv1_filter>L1_EM7_EMPTY</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1FIRSTEMPTY_noPS</filter_name> - <lv1_filter>L1_J12_FIRSTEMPTY</lv1_filter> - <lv1_filter>L1_MU20_FIRSTEMPTY</lv1_filter> - <lv1_filter>L1_TAU8_FIRSTEMPTY</lv1_filter> - <lv1_filter>L1_EM7_FIRSTEMPTY</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1UNPAIRED_ISO_noPS</filter_name> - <lv1_filter>L1_BCM_AC_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_BCM_CA_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_BCM_Wide_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_J12_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_J30.31ETA49_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_MU4_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_EM7_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_TAU8_UNPAIRED_ISO</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1UNPAIRED_NONISO_noPS</filter_name> - <lv1_filter>L1_BCM_AC_UNPAIRED_NONISO</lv1_filter> - <lv1_filter>L1_BCM_CA_UNPAIRED_NONISO</lv1_filter> - <lv1_filter>L1_BCM_Wide_UNPAIRED_NONISO</lv1_filter> - <lv1_filter>L1_J12_UNPAIRED_NONISO</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1ABORTGAPNOTCALIB_noPS</filter_name> - <lv1_filter>L1_J12_ABORTGAPNOTCALIB</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1RD3_FILLED</filter_name> - <lv1_filter>L1_RD3_FILLED</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1RD3_EMPTY</filter_name> - <lv1_filter>L1_RD3_EMPTY</lv1_filter> - </filter> - </filters> -</trigger> diff --git a/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_302956.xml b/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_302956.xml deleted file mode 100644 index 5aa38087f75bcb1af6d6064882ff09ef1da363a7..0000000000000000000000000000000000000000 --- a/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_302956.xml +++ /dev/null @@ -1,204 +0,0 @@ -<?xml version="1.0" ?> -<trigger> - <lumivalues> - <lumivalues_data>9.237e+33</lumivalues_data> - <lumivalues_pred>1e+34</lumivalues_pred> - <deadtime>0.0624</deadtime> - <peak_mu_av>28.5</peak_mu_av> - </lumivalues> - <bunchgroups> - <bunchgroup id="0" name="BCRVeto">3543</bunchgroup> - <bunchgroup id="1" name="Paired">2064</bunchgroup> - <bunchgroup id="2" name="CalReq">70</bunchgroup> - <bunchgroup id="3" name="Empty">966</bunchgroup> - <bunchgroup id="4" name="IsolatedUnpaired">10</bunchgroup> - <bunchgroup id="5" name="NonIsolatedUnpaired">14</bunchgroup> - <bunchgroup id="6" name="EmptyBeforeAfterPaired">409</bunchgroup> - <bunchgroup id="7" name="InTrain">1806</bunchgroup> - <bunchgroup id="8" name="AbortGapNotCalReq">29</bunchgroup> - <bunchgroup id="9" name="AfterGlow">0</bunchgroup> - <bunchgroup id="10" name="ALFA">4</bunchgroup> - <bunchgroup id="11" name="EmptyBeforePaired">43</bunchgroup> - <bunchgroup id="12" name="AllWithoutCalreq">3473</bunchgroup> - <bunchgroup id="13" name="BG13">0</bunchgroup> - <bunchgroup id="14" name="BG14">0</bunchgroup> - <bunchgroup id="15" name="BG15">0</bunchgroup> - </bunchgroups> - <lb_list> - <lb id="253" lumi="9517" mu="29.3">41905</lb> - <lb id="254" lumi="9488" mu="29.2">41722</lb> - <lb id="255" lumi="9497" mu="29.3">42210</lb> - <lb id="256" lumi="9477" mu="29.2">42238</lb> - <lb id="257" lumi="9472" mu="29.2">41127</lb> - <lb id="258" lumi="9458" mu="29.1">42192</lb> - <lb id="259" lumi="9434" mu="29.1">41943</lb> - <lb id="260" lumi="9425" mu="29.0">42065</lb> - <lb id="261" lumi="9407" mu="29.0">42040</lb> - <lb id="262" lumi="9412" mu="29.0">41906</lb> - <lb id="263" lumi="9378" mu="28.9">41917</lb> - <lb id="264" lumi="9354" mu="28.8">41988</lb> - <lb id="265" lumi="9342" mu="28.8">25969</lb> - <lb id="266" lumi="9346" mu="28.8">41965</lb> - <lb id="267" lumi="9329" mu="28.7">41830</lb> - <lb id="268" lumi="9323" mu="28.7">41457</lb> - <lb id="269" lumi="9298" mu="28.6">41598</lb> - <lb id="270" lumi="9284" mu="28.6">41184</lb> - <lb id="271" lumi="9251" mu="28.5">41287</lb> - <lb id="272" lumi="9250" mu="28.5">41483</lb> - <lb id="273" lumi="9239" mu="28.5">41709</lb> - <lb id="274" lumi="9244" mu="28.5">41295</lb> - <lb id="275" lumi="9197" mu="28.3">41154</lb> - <lb id="276" lumi="9214" mu="28.4">41068</lb> - <lb id="277" lumi="9174" mu="28.3">40900</lb> - <lb id="278" lumi="9191" mu="28.3">41498</lb> - <lb id="279" lumi="9156" mu="28.2">41150</lb> - <lb id="280" lumi="9151" mu="28.2">40992</lb> - <lb id="281" lumi="9142" mu="28.2">41080</lb> - <lb id="282" lumi="9143" mu="28.2">40799</lb> - <lb id="283" lumi="9118" mu="28.1">25137</lb> - <lb id="284" lumi="9068" mu="27.9">26023</lb> - <lb id="285" lumi="9071" mu="27.9">40544</lb> - <lb id="286" lumi="9080" mu="28.0">40850</lb> - <lb id="287" lumi="9062" mu="27.9">40928</lb> - <lb id="288" lumi="9056" mu="27.9">41480</lb> - <lb id="289" lumi="9044" mu="27.9">41004</lb> - <lb id="290" lumi="9043" mu="27.9">40951</lb> - <lb id="291" lumi="9006" mu="27.7">40921</lb> - <lb id="292" lumi="9020" mu="27.8">24587</lb> - <lb id="293" lumi="8994" mu="27.7" flag="bad">642</lb> - <lb id="294" lumi="9041" mu="27.9">40181</lb> - <lb id="295" lumi="9007" mu="27.7">13841</lb> - </lb_list> - <filters> - <filter> - <eb_hlt_chains> - <eb_hlt_name>HLT_eb_low_L1RD2_FILLED</eb_hlt_name> - <lv1_ebtrigs>L1_MU6</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM10VH</lv1_ebtrigs> - <lv1_ebtrigs>L1_J30.0ETA49_2J20.0ETA49</lv1_ebtrigs> - <lv1_ebtrigs>L1_TAU12</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU4_J12</lv1_ebtrigs> - <lv1_ebtrigs>L1_2EM7</lv1_ebtrigs> - <lv1_ebtrigs>L1_J15</lv1_ebtrigs> - <lv1_ebtrigs>L1_2MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_XS30</lv1_ebtrigs> - <lv1_ebtrigs>L1_ZB</lv1_ebtrigs> - <lv1_ebtrigs>L1_DETA-JJ</lv1_ebtrigs> - </eb_hlt_chains> - <eb_hlt_chains> - <eb_hlt_name>HLT_eb_high_L1RD2_FILLED</eb_hlt_name> - <lv1_ebtrigs>L1_3J15</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM18VH</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM20VHI</lv1_ebtrigs> - <lv1_ebtrigs>L1_2EM10VH</lv1_ebtrigs> - <lv1_ebtrigs>L1_J50</lv1_ebtrigs> - <lv1_ebtrigs>L1_TAU30</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU15</lv1_ebtrigs> - <lv1_ebtrigs>L1_TAU20_2TAU12</lv1_ebtrigs> - <lv1_ebtrigs>L1_XE35</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU6_2MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU6_J20</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM7_MU10</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM15VH_3EM7</lv1_ebtrigs> - <lv1_ebtrigs>L1_3MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_2EM15</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM15I_MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_J75</lv1_ebtrigs> - <lv1_ebtrigs>L1_TAU20_2TAU12_XE35</lv1_ebtrigs> - <lv1_ebtrigs>L1_DR-TAU20ITAU12I</lv1_ebtrigs> - <lv1_ebtrigs>L1_DY-BOX-2MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_DY-DR-2MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_2CMU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_2MU4-B</lv1_ebtrigs> - <lv1_ebtrigs>L1_BTAG-MU4J15</lv1_ebtrigs> - <lv1_ebtrigs>L1_MJJ-100</lv1_ebtrigs> - <lv1_ebtrigs>L1_J4-MATCH</lv1_ebtrigs> - <lv1_ebtrigs>L1_HT190-J15.ETA21</lv1_ebtrigs> - </eb_hlt_chains> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1PhysicsLow_noPS</filter_name> - <lv1_filter>L1_MU6_3MU4</lv1_filter> - <lv1_filter>L1_3J40</lv1_filter> - <lv1_filter>L1_MU6_J40</lv1_filter> - <lv1_filter>L1_2EM8VH_MU10</lv1_filter> - <lv1_filter>L1_2J15_XE55</lv1_filter> - <lv1_filter>L1_2MU6</lv1_filter> - <lv1_filter>L1_4J15</lv1_filter> - <lv1_filter>L1_EM15HI_2TAU12IM_J25_3J12</lv1_filter> - <lv1_filter>L1_EM15HI_2TAU12IM_XE35</lv1_filter> - <lv1_filter>L1_EM15HI_TAU40_2TAU15</lv1_filter> - <lv1_filter>L1_EM15VH_3EM7</lv1_filter> - <lv1_filter>L1_EM15VH_MU10</lv1_filter> - <lv1_filter>L1_EM22VHI</lv1_filter> - <lv1_filter>L1_MU10_TAU12IM_J25_2J12</lv1_filter> - <lv1_filter>L1_MU10_TAU12IM_XE35</lv1_filter> - <lv1_filter>L1_MU10_TAU20IM</lv1_filter> - <lv1_filter>L1_MU20</lv1_filter> - <lv1_filter>L1_MU6_J30.0ETA49_2J20.0ETA49</lv1_filter> - <lv1_filter>L1_TAU20IM_2J20_XE45</lv1_filter> - <lv1_filter>L1_TAU20IM_2TAU12IM_J25_2J20_3J12</lv1_filter> - <lv1_filter>L1_TAU20IM_2TAU12IM_XE35</lv1_filter> - <lv1_filter>L1_TAU60</lv1_filter> - <lv1_filter>L1_XE50</lv1_filter> - <lv1_filter>L1_MU10_3J20</lv1_filter> - <lv1_filter>L1_J40.0ETA25_2J15.31ETA49</lv1_filter> - <lv1_filter>L1_EM15I_MU4</lv1_filter> - <lv1_filter>L1_3MU6</lv1_filter> - <lv1_filter>L1_MU10_2J15_J20</lv1_filter> - <lv1_filter>L1_J40.0ETA25_2J25_J20.31ETA49</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1PhysicsHigh_noPS</filter_name> - <lv1_filter>L1_J100.31ETA49</lv1_filter> - <lv1_filter>L1_J400</lv1_filter> - <lv1_filter>L1_XE80</lv1_filter> - <lv1_filter>L1_XE300</lv1_filter> - <lv1_filter>L1_6J15</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1EMPTY_noPS</filter_name> - <lv1_filter>L1_J12_EMPTY</lv1_filter> - <lv1_filter>L1_MU11_EMPTY</lv1_filter> - <lv1_filter>L1_TAU8_EMPTY</lv1_filter> - <lv1_filter>L1_EM7_EMPTY</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1FIRSTEMPTY_noPS</filter_name> - <lv1_filter>L1_J12_FIRSTEMPTY</lv1_filter> - <lv1_filter>L1_MU20_FIRSTEMPTY</lv1_filter> - <lv1_filter>L1_TAU8_FIRSTEMPTY</lv1_filter> - <lv1_filter>L1_EM7_FIRSTEMPTY</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1UNPAIRED_ISO_noPS</filter_name> - <lv1_filter>L1_BCM_AC_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_BCM_CA_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_BCM_Wide_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_J12_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_J15.31ETA49_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_MU4_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_EM7_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_TAU8_UNPAIRED_ISO</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1UNPAIRED_NONISO_noPS</filter_name> - <lv1_filter>L1_BCM_AC_UNPAIRED_NONISO</lv1_filter> - <lv1_filter>L1_BCM_CA_UNPAIRED_NONISO</lv1_filter> - <lv1_filter>L1_BCM_Wide_UNPAIRED_NONISO</lv1_filter> - <lv1_filter>L1_J12_UNPAIRED_NONISO</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1ABORTGAPNOTCALIB_noPS</filter_name> - <lv1_filter>L1_J12_ABORTGAPNOTCALIB</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1RD3_FILLED</filter_name> - <lv1_filter>L1_RD3_FILLED</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1RD3_EMPTY</filter_name> - <lv1_filter>L1_RD3_EMPTY</lv1_filter> - </filter> - </filters> -</trigger> diff --git a/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_307126.xml b/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_307126.xml deleted file mode 100644 index 4dddd23e5a4571e600582c924ff61d70ff7bde75..0000000000000000000000000000000000000000 --- a/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_307126.xml +++ /dev/null @@ -1,217 +0,0 @@ -<?xml version="1.0" ?> -<trigger> - <lumivalues> - <lumivalues_data>2.681e+33</lumivalues_data> - <lumivalues_pred>1e+34</lumivalues_pred> - <deadtime>0.035</deadtime> - <peak_mu_av>29.5</peak_mu_av> - </lumivalues> - <bunchgroups> - <bunchgroup id="0" name="BCRVeto">3543</bunchgroup> - <bunchgroup id="1" name="Paired">578</bunchgroup> - <bunchgroup id="2" name="CalReq">70</bunchgroup> - <bunchgroup id="3" name="Empty">2726</bunchgroup> - <bunchgroup id="4" name="IsolatedUnpaired">10</bunchgroup> - <bunchgroup id="5" name="NonIsolatedUnpaired">14</bunchgroup> - <bunchgroup id="6" name="EmptyBeforeAfterPaired">136</bunchgroup> - <bunchgroup id="7" name="InTrain">504</bunchgroup> - <bunchgroup id="8" name="AbortGapNotCalReq">29</bunchgroup> - <bunchgroup id="9" name="AfterGlow">0</bunchgroup> - <bunchgroup id="10" name="ALFA">4</bunchgroup> - <bunchgroup id="11" name="EmptyBeforePaired">14</bunchgroup> - <bunchgroup id="12" name="AllWithoutCalreq">3473</bunchgroup> - <bunchgroup id="13" name="BG13">0</bunchgroup> - <bunchgroup id="14" name="BG14">0</bunchgroup> - <bunchgroup id="15" name="BG15">0</bunchgroup> - </bunchgroups> - <lb_list> - <lb id="143" lumi="2792" mu="30.7">18038</lb> - <lb id="144" lumi="2793" mu="30.7">17933</lb> - <lb id="145" lumi="2783" mu="30.6">17813</lb> - <lb id="146" lumi="2780" mu="30.6">17686</lb> - <lb id="147" lumi="2774" mu="30.5">18240</lb> - <lb id="148" lumi="2766" mu="30.4">17754</lb> - <lb id="149" lumi="2765" mu="30.4">17824</lb> - <lb id="150" lumi="2760" mu="30.4">17846</lb> - <lb id="151" lumi="2749" mu="30.2">17786</lb> - <lb id="152" lumi="2752" mu="30.3">17862</lb> - <lb id="153" lumi="2749" mu="30.2">16858</lb> - <lb id="154" lumi="2743" mu="30.2">17757</lb> - <lb id="155" lumi="2744" mu="30.2">17953</lb> - <lb id="156" lumi="2734" mu="30.1">18067</lb> - <lb id="157" lumi="2729" mu="30.0">17783</lb> - <lb id="158" lumi="2731" mu="30.0">17429</lb> - <lb id="159" lumi="2720" mu="29.9">17621</lb> - <lb id="160" lumi="2719" mu="29.9">17537</lb> - <lb id="161" lumi="2717" mu="29.9">17205</lb> - <lb id="162" lumi="2723" mu="30.0">17420</lb> - <lb id="163" lumi="2718" mu="29.9">17396</lb> - <lb id="164" lumi="2716" mu="29.9">17493</lb> - <lb id="165" lumi="2712" mu="29.8">17317</lb> - <lb id="166" lumi="2709" mu="29.8">17411</lb> - <lb id="167" lumi="2706" mu="29.8">17608</lb> - <lb id="168" lumi="2705" mu="29.8">17320</lb> - <lb id="169" lumi="2700" mu="29.7">17491</lb> - <lb id="170" lumi="2699" mu="29.7">17274</lb> - <lb id="171" lumi="2695" mu="29.6">17292</lb> - <lb id="172" lumi="2691" mu="29.6">17305</lb> - <lb id="173" lumi="2690" mu="29.6">17268</lb> - <lb id="174" lumi="2688" mu="29.6">17166</lb> - <lb id="175" lumi="2684" mu="29.5">17099</lb> - <lb id="176" lumi="2681" mu="29.5">17167</lb> - <lb id="177" lumi="2682" mu="29.5">17370</lb> - <lb id="178" lumi="2675" mu="29.4">17295</lb> - <lb id="179" lumi="2669" mu="29.4">17274</lb> - <lb id="180" lumi="2654" mu="29.2">16973</lb> - <lb id="181" lumi="2650" mu="29.1">17064</lb> - <lb id="182" lumi="2645" mu="29.1">16976</lb> - <lb id="183" lumi="2642" mu="29.1">17054</lb> - <lb id="184" lumi="2638" mu="29.0">16946</lb> - <lb id="185" lumi="2635" mu="29.0">16975</lb> - <lb id="186" lumi="2630" mu="28.9">16740</lb> - <lb id="187" lumi="2624" mu="28.9">16798</lb> - <lb id="188" lumi="2619" mu="28.8">16674</lb> - <lb id="189" lumi="2615" mu="28.8">17051</lb> - <lb id="190" lumi="2615" mu="28.8">16816</lb> - <lb id="191" lumi="2606" mu="28.7">16614</lb> - <lb id="192" lumi="2606" mu="28.7">17080</lb> - <lb id="193" lumi="2604" mu="28.6">16916</lb> - <lb id="194" lumi="2603" mu="28.6">16624</lb> - <lb id="195" lumi="2603" mu="28.6">16748</lb> - <lb id="196" lumi="2603" mu="28.6">16824</lb> - <lb id="197" lumi="2602" mu="28.6">16731</lb> - <lb id="198" lumi="2600" mu="28.6">16537</lb> - <lb id="199" lumi="2596" mu="28.6">16469</lb> - <lb id="200" lumi="2596" mu="28.6">16634</lb> - <lb id="201" lumi="2590" mu="28.5">16505</lb> - <lb id="202" lumi="2587" mu="28.5">16583</lb> - <lb id="203" lumi="2585" mu="28.4">9624</lb> - </lb_list> - <filters> - <filter> - <eb_hlt_chains> - <eb_hlt_name>HLT_eb_low_L1RD2_FILLED</eb_hlt_name> - <lv1_ebtrigs>L1_MU6</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM10VH</lv1_ebtrigs> - <lv1_ebtrigs>L1_J30.0ETA49_2J20.0ETA49</lv1_ebtrigs> - <lv1_ebtrigs>L1_TAU12</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU4_J12</lv1_ebtrigs> - <lv1_ebtrigs>L1_2EM7</lv1_ebtrigs> - <lv1_ebtrigs>L1_J15</lv1_ebtrigs> - <lv1_ebtrigs>L1_2MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_XS30</lv1_ebtrigs> - <lv1_ebtrigs>L1_ZB</lv1_ebtrigs> - <lv1_ebtrigs>L1_DETA-JJ</lv1_ebtrigs> - </eb_hlt_chains> - <eb_hlt_chains> - <eb_hlt_name>HLT_eb_high_L1RD2_FILLED</eb_hlt_name> - <lv1_ebtrigs>L1_3J15</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM18VH</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM20VHI</lv1_ebtrigs> - <lv1_ebtrigs>L1_2EM10VH</lv1_ebtrigs> - <lv1_ebtrigs>L1_J50</lv1_ebtrigs> - <lv1_ebtrigs>L1_TAU30</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU15</lv1_ebtrigs> - <lv1_ebtrigs>L1_TAU20_2TAU12</lv1_ebtrigs> - <lv1_ebtrigs>L1_XE35</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU6_2MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU6_J20</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM7_MU10</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM15VH_3EM7</lv1_ebtrigs> - <lv1_ebtrigs>L1_3MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_2EM15</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM15I_MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_TAU20_2TAU12_XE35</lv1_ebtrigs> - <lv1_ebtrigs>L1_DR-TAU20ITAU12I</lv1_ebtrigs> - <lv1_ebtrigs>L1_DY-BOX-2MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_DY-DR-2MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_2MU4-B</lv1_ebtrigs> - <lv1_ebtrigs>L1_BTAG-MU4J15</lv1_ebtrigs> - <lv1_ebtrigs>L1_MJJ-100</lv1_ebtrigs> - <lv1_ebtrigs>L1_J4-MATCH</lv1_ebtrigs> - <lv1_ebtrigs>L1_HT190-J15.ETA21</lv1_ebtrigs> - <lv1_ebtrigs>L1_2MU6</lv1_ebtrigs> - </eb_hlt_chains> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1PhysicsLow_noPS</filter_name> - <lv1_filter>L1_MU6_3MU4</lv1_filter> - <lv1_filter>L1_2EM8VH_MU10</lv1_filter> - <lv1_filter>L1_2J15_XE55</lv1_filter> - <lv1_filter>L1_4J15</lv1_filter> - <lv1_filter>L1_EM15HI_2TAU12IM_J25_3J12</lv1_filter> - <lv1_filter>L1_EM15HI_2TAU12IM_XE35</lv1_filter> - <lv1_filter>L1_EM15HI_TAU40_2TAU15</lv1_filter> - <lv1_filter>L1_EM15VH_3EM7</lv1_filter> - <lv1_filter>L1_EM15VH_MU10</lv1_filter> - <lv1_filter>L1_EM22VHI</lv1_filter> - <lv1_filter>L1_MU10_TAU12IM_J25_2J12</lv1_filter> - <lv1_filter>L1_MU10_TAU12IM_XE35</lv1_filter> - <lv1_filter>L1_MU10_TAU20IM</lv1_filter> - <lv1_filter>L1_MU20</lv1_filter> - <lv1_filter>L1_MU6_J30.0ETA49_2J20.0ETA49</lv1_filter> - <lv1_filter>L1_TAU20IM_2J20_XE45</lv1_filter> - <lv1_filter>L1_TAU20IM_2TAU12IM_J25_2J20_3J12</lv1_filter> - <lv1_filter>L1_TAU20IM_2TAU12IM_XE35</lv1_filter> - <lv1_filter>L1_TAU60</lv1_filter> - <lv1_filter>L1_XE50</lv1_filter> - <lv1_filter>L1_MU10_3J20</lv1_filter> - <lv1_filter>L1_J40.0ETA25_2J15.31ETA49</lv1_filter> - <lv1_filter>L1_EM15I_MU4</lv1_filter> - <lv1_filter>L1_3MU6</lv1_filter> - <lv1_filter>L1_MU10_2J15_J20</lv1_filter> - <lv1_filter>L1_J40.0ETA25_2J25_J20.31ETA49</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1PhysicsHigh_noPS</filter_name> - <lv1_filter>L1_J100.31ETA49</lv1_filter> - <lv1_filter>L1_J400</lv1_filter> - <lv1_filter>L1_XE80</lv1_filter> - <lv1_filter>L1_6J15</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1EMPTY_noPS</filter_name> - <lv1_filter>L1_J12_EMPTY</lv1_filter> - <lv1_filter>L1_MU11_EMPTY</lv1_filter> - <lv1_filter>L1_TAU8_EMPTY</lv1_filter> - <lv1_filter>L1_EM7_EMPTY</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1FIRSTEMPTY_noPS</filter_name> - <lv1_filter>L1_J12_FIRSTEMPTY</lv1_filter> - <lv1_filter>L1_MU20_FIRSTEMPTY</lv1_filter> - <lv1_filter>L1_TAU8_FIRSTEMPTY</lv1_filter> - <lv1_filter>L1_EM7_FIRSTEMPTY</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1UNPAIRED_ISO_noPS</filter_name> - <lv1_filter>L1_BCM_AC_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_BCM_CA_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_BCM_Wide_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_J12_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_J15.31ETA49_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_MU4_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_EM7_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_TAU8_UNPAIRED_ISO</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1UNPAIRED_NONISO_noPS</filter_name> - <lv1_filter>L1_BCM_AC_UNPAIRED_NONISO</lv1_filter> - <lv1_filter>L1_BCM_CA_UNPAIRED_NONISO</lv1_filter> - <lv1_filter>L1_BCM_Wide_UNPAIRED_NONISO</lv1_filter> - <lv1_filter>L1_J12_UNPAIRED_NONISO</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1ABORTGAPNOTCALIB_noPS</filter_name> - <lv1_filter>L1_J12_ABORTGAPNOTCALIB</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1RD3_FILLED</filter_name> - <lv1_filter>L1_RD3_FILLED</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1RD3_EMPTY</filter_name> - <lv1_filter>L1_RD3_EMPTY</lv1_filter> - </filter> - </filters> -</trigger> diff --git a/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_309640.xml b/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_309640.xml deleted file mode 100644 index cec80f06882507d29982f29b4e7f64c288ccc07a..0000000000000000000000000000000000000000 --- a/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_309640.xml +++ /dev/null @@ -1,264 +0,0 @@ -<?xml version="1.0" ?> -<trigger> - <lumivalues> - <lumivalues_data>11e+33</lumivalues_data> - <lumivalues_pred>11e+33</lumivalues_pred> - <deadtime>0.046</deadtime> - <peak_mu_av>31.66</peak_mu_av> - </lumivalues> - <bunchgroups> - <bunchgroup id="0" name="BCRVeto">3543</bunchgroup> - <bunchgroup id="1" name="Paired">2208</bunchgroup> - <bunchgroup id="2" name="CalReq">70</bunchgroup> - <bunchgroup id="3" name="Empty">818</bunchgroup> - <bunchgroup id="4" name="IsolatedUnpaired">10</bunchgroup> - <bunchgroup id="5" name="NonIsolatedUnpaired">14</bunchgroup> - <bunchgroup id="6" name="EmptyBeforeAfterPaired">414</bunchgroup> - <bunchgroup id="7" name="InTrain">1932</bunchgroup> - <bunchgroup id="8" name="AbortGapNotCalReq">29</bunchgroup> - <bunchgroup id="9" name="AfterGlow">0</bunchgroup> - <bunchgroup id="10" name="ALFA">4</bunchgroup> - <bunchgroup id="11" name="EmptyBeforePaired">46</bunchgroup> - <bunchgroup id="12" name="AllWithoutCalreq">3473</bunchgroup> - <bunchgroup id="13" name="BG13">0</bunchgroup> - <bunchgroup id="14" name="BG14">0</bunchgroup> - <bunchgroup id="15" name="BG15">0</bunchgroup> - </bunchgroups> - <lb_list> - <lb id="600" lumi="12260" mu="35.3" flag="bad">19161</lb> - <lb id="601" lumi="12240" mu="35.2" flag="bad">21243</lb> - <lb id="602" lumi="12200" mu="35.1" flag="bad">0</lb> - <lb id="603" lumi="12170" mu="35.1" flag="bad">0</lb> - <lb id="604" lumi="12130" mu="34.9" flag="bad">0</lb> - <lb id="605" lumi="12110" mu="34.9" flag="bad">0</lb> - <lb id="606" lumi="12090" mu="34.8" flag="bad">0</lb> - <lb id="607" lumi="12050" mu="34.7" flag="bad">0</lb> - <lb id="608" lumi="12020" mu="34.6" flag="bad">0</lb> - <lb id="609" lumi="0" mu="0" flag="bad">0</lb> - <lb id="610" lumi="0" mu="0" flag="bad">0</lb> - <lb id="611" lumi="11950" mu="34.4" flag="bad">0</lb> - <lb id="612" lumi="11940" mu="34.4" flag="bad">0</lb> - <lb id="613" lumi="11930" mu="34.3" flag="bad">0</lb> - <lb id="614" lumi="11890" mu="34.2" flag="bad">0</lb> - <lb id="615" lumi="11870" mu="34.2" flag="bad">0</lb> - <lb id="616" lumi="11840" mu="34.1" flag="bad">0</lb> - <lb id="617" lumi="11810" mu="34.0" flag="bad">0</lb> - <lb id="618" lumi="11780" mu="33.9" flag="bad">0</lb> - <lb id="619" lumi="11750" mu="33.8" flag="bad">0</lb> - <lb id="620" lumi="11730" mu="33.8" flag="bad">0</lb> - <lb id="621" lumi="11690" mu="33.7" flag="bad">0</lb> - <lb id="622" lumi="11660" mu="33.6" flag="bad">0</lb> - <lb id="623" lumi="11650" mu="33.6" flag="bad">0</lb> - <lb id="624" lumi="11640" mu="33.5" flag="bad">0</lb> - <lb id="625" lumi="11320" mu="32.6" flag="bad">0</lb> - <lb id="626" lumi="11380" mu="32.8" flag="bad">0</lb> - <lb id="627" lumi="11020" mu="31.7">21150</lb> - <lb id="628" lumi="11670" mu="33.6">22133</lb> - <lb id="629" lumi="11690" mu="33.7">22416</lb> - <lb id="630" lumi="11670" mu="33.6">21936</lb> - <lb id="631" lumi="11650" mu="33.5">22371</lb> - <lb id="632" lumi="11630" mu="33.5">21997</lb> - <lb id="633" lumi="11600" mu="33.4">21726</lb> - <lb id="634" lumi="11590" mu="33.4">3625</lb> - <lb id="635" lumi="11590" mu="33.4">21410</lb> - <lb id="636" lumi="11570" mu="33.3">21967</lb> - <lb id="637" lumi="11540" mu="33.2">22101</lb> - <lb id="638" lumi="11520" mu="33.2">22512</lb> - <lb id="639" lumi="11500" mu="33.1" flag="bad">3615</lb> - <lb id="640" lumi="11490" mu="33.1">21911</lb> - <lb id="641" lumi="11470" mu="33.0">21611</lb> - <lb id="642" lumi="0" mu="0" flag="bad">21479</lb> - <lb id="643" lumi="0" mu="0" flag="bad">3728</lb> - <lb id="644" lumi="11420" mu="32.9">21395</lb> - <lb id="645" lumi="11400" mu="32.8">22022</lb> - <lb id="646" lumi="11390" mu="32.8" flag="bad">12681</lb> - <lb id="647" lumi="11370" mu="32.7">21760</lb> - <lb id="648" lumi="11340" mu="32.7">21861</lb> - <lb id="649" lumi="11330" mu="32.6">21823</lb> - <lb id="650" lumi="11310" mu="32.6">21235</lb> - <lb id="651" lumi="11300" mu="32.5">21311</lb> - <lb id="652" lumi="11280" mu="32.5">21432</lb> - <lb id="653" lumi="11260" mu="32.4">21379</lb> - <lb id="654" lumi="11240" mu="32.4">21266</lb> - <lb id="655" lumi="11220" mu="32.3">21425</lb> - <lb id="656" lumi="11200" mu="32.2">21269</lb> - <lb id="657" lumi="11180" mu="32.2">21345</lb> - <lb id="658" lumi="11160" mu="32.1">21398</lb> - <lb id="659" lumi="11150" mu="32.1">21362</lb> - <lb id="660" lumi="11130" mu="32.0">20829</lb> - <lb id="661" lumi="11110" mu="32.0" flag="bad">13418</lb> - <lb id="662" lumi="11080" mu="31.9">21065</lb> - <lb id="663" lumi="11070" mu="31.9">21027</lb> - <lb id="664" lumi="11050" mu="31.8">20936</lb> - <lb id="665" lumi="11040" mu="31.8">21153</lb> - <lb id="666" lumi="11010" mu="31.7">21366</lb> - <lb id="667" lumi="0" mu="0" flag="bad">14674</lb> - <lb id="668" lumi="0" mu="0" flag="bad">0</lb> - <lb id="669" lumi="10980" mu="31.6" flag="bad">0</lb> - <lb id="670" lumi="10990" mu="31.6">3393</lb> - <lb id="671" lumi="10970" mu="31.6">20343</lb> - <lb id="672" lumi="10950" mu="31.5">20906</lb> - <lb id="673" lumi="10920" mu="31.5">20475</lb> - <lb id="674" lumi="10900" mu="31.4">20586</lb> - <lb id="675" lumi="10890" mu="31.4">20583</lb> - <lb id="676" lumi="10830" mu="31.2">20484</lb> - <lb id="677" lumi="10820" mu="31.2">20532</lb> - <lb id="678" lumi="10780" mu="31.1" flag="bad">37368</lb> - <lb id="679" lumi="10760" mu="31.0">20510</lb> - <lb id="680" lumi="10750" mu="31.0">20830</lb> - <lb id="681" lumi="10710" mu="30.8">20296</lb> - <lb id="682" lumi="10710" mu="30.8">20708</lb> - <lb id="683" lumi="10690" mu="30.8">20363</lb> - <lb id="684" lumi="10660" mu="30.7">20350</lb> - <lb id="685" lumi="10650" mu="30.7">20425</lb> - <lb id="686" lumi="10630" mu="30.6">20438</lb> - <lb id="687" lumi="10630" mu="30.6">20357</lb> - <lb id="688" lumi="10610" mu="30.6">20360</lb> - <lb id="689" lumi="10590" mu="30.5">20243</lb> - <lb id="690" lumi="10590" mu="30.5">19797</lb> - <lb id="691" lumi="10550" mu="30.4">19819</lb> - <lb id="692" lumi="10530" mu="30.3">19969</lb> - <lb id="693" lumi="10520" mu="30.3">20032</lb> - <lb id="694" lumi="10480" mu="30.2">19555</lb> - <lb id="695" lumi="10490" mu="30.2">19663</lb> - <lb id="696" lumi="10470" mu="30.1">19653</lb> - <lb id="697" lumi="10460" mu="30.1">19844</lb> - <lb id="698" lumi="10440" mu="30.1">19887</lb> - <lb id="699" lumi="0" mu="0" flag="bad">20223</lb> - <lb id="700" lumi="0" mu="0" flag="bad">3341</lb> - <lb id="701" lumi="10400" mu="30.0">19532</lb> - <lb id="702" lumi="10380" mu="29.9">19837</lb> - <lb id="703" lumi="10100" mu="29.1">19290</lb> - <lb id="704" lumi="9857 " mu="28.4">19141</lb> - <lb id="705" lumi="10430" mu="30.0">19769</lb> - <lb id="706" lumi="10420" mu="30.0">13217</lb> - </lb_list> - <filters> - <filter> - <eb_hlt_chains> - <eb_hlt_name>HLT_eb_low_L1RD2_FILLED</eb_hlt_name> - <lv1_ebtrigs>L1_MU6</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM10VH</lv1_ebtrigs> - <lv1_ebtrigs>L1_J30.0ETA49_2J20.0ETA49</lv1_ebtrigs> - <lv1_ebtrigs>L1_TAU12</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU4_J12</lv1_ebtrigs> - <lv1_ebtrigs>L1_2EM7</lv1_ebtrigs> - <lv1_ebtrigs>L1_J15</lv1_ebtrigs> - <lv1_ebtrigs>L1_2MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_XS30</lv1_ebtrigs> - <lv1_ebtrigs>L1_ZB</lv1_ebtrigs> - <lv1_ebtrigs>L1_DETA-JJ</lv1_ebtrigs> - </eb_hlt_chains> - <eb_hlt_chains> - <eb_hlt_name>HLT_eb_high_L1RD2_FILLED</eb_hlt_name> - <lv1_ebtrigs>L1_3J15</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM18VH</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM20VHI</lv1_ebtrigs> - <lv1_ebtrigs>L1_2EM10VH</lv1_ebtrigs> - <lv1_ebtrigs>L1_J50</lv1_ebtrigs> - <lv1_ebtrigs>L1_TAU30</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU15</lv1_ebtrigs> - <lv1_ebtrigs>L1_TAU20_2TAU12</lv1_ebtrigs> - <lv1_ebtrigs>L1_XE35</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU6_2MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU6_J20</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM7_MU10</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM15VH_3EM7</lv1_ebtrigs> - <lv1_ebtrigs>L1_3MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_2EM15</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM15I_MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_TAU20_2TAU12_XE35</lv1_ebtrigs> - <lv1_ebtrigs>L1_DR-TAU20ITAU12I</lv1_ebtrigs> - <lv1_ebtrigs>L1_DY-BOX-2MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_DY-DR-2MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_2MU4-B</lv1_ebtrigs> - <lv1_ebtrigs>L1_2MU4-BO</lv1_ebtrigs> - <lv1_ebtrigs>L1_BTAG-MU4J15</lv1_ebtrigs> - <lv1_ebtrigs>L1_MJJ-100</lv1_ebtrigs> - <lv1_ebtrigs>L1_J4-MATCH</lv1_ebtrigs> - <lv1_ebtrigs>L1_HT190-J15.ETA21</lv1_ebtrigs> - <lv1_ebtrigs>L1_2MU6</lv1_ebtrigs> - </eb_hlt_chains> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1PhysicsLow_noPS</filter_name> - <lv1_filter>L1_MU6_3MU4</lv1_filter> - <lv1_filter>L1_2EM8VH_MU10</lv1_filter> - <lv1_filter>L1_2J15_XE55</lv1_filter> - <lv1_filter>L1_4J15</lv1_filter> - <lv1_filter>L1_EM15HI_2TAU12IM_J25_3J12</lv1_filter> - <lv1_filter>L1_EM15HI_2TAU12IM_XE35</lv1_filter> - <lv1_filter>L1_EM15HI_TAU40_2TAU15</lv1_filter> - <lv1_filter>L1_EM15VH_MU10</lv1_filter> - <lv1_filter>L1_EM22VHI</lv1_filter> - <lv1_filter>L1_MU10_TAU12IM_J25_2J12</lv1_filter> - <lv1_filter>L1_MU10_TAU12IM_XE35</lv1_filter> - <lv1_filter>L1_MU10_TAU20IM</lv1_filter> - <lv1_filter>L1_MU20</lv1_filter> - <lv1_filter>L1_MU6_J30.0ETA49_2J20.0ETA49</lv1_filter> - <lv1_filter>L1_TAU20IM_2J20_XE45</lv1_filter> - <lv1_filter>L1_TAU20IM_2TAU12IM_J25_2J20_3J12</lv1_filter> - <lv1_filter>L1_TAU20IM_2TAU12IM_XE35</lv1_filter> - <lv1_filter>L1_TAU60</lv1_filter> - <lv1_filter>L1_XE50</lv1_filter> - <lv1_filter>L1_MU10_3J20</lv1_filter> - <lv1_filter>L1_J40.0ETA25_2J15.31ETA49</lv1_filter> - <lv1_filter>L1_3MU6</lv1_filter> - <lv1_filter>L1_MU10_2J15_J20</lv1_filter> - <lv1_filter>L1_J40.0ETA25_2J25_J20.31ETA49</lv1_filter> - <lv1_filter>L1_2MU6_3MU4</lv1_filter> - <lv1_filter>L1_MU11_2MU6</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1PhysicsHigh_noPS</filter_name> - <lv1_filter>L1_J100.31ETA49</lv1_filter> - <lv1_filter>L1_J400</lv1_filter> - <lv1_filter>L1_XE80</lv1_filter> - <lv1_filter>L1_6J15</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1EMPTY_noPS</filter_name> - <lv1_filter>L1_J12_EMPTY</lv1_filter> - <lv1_filter>L1_MU11_EMPTY</lv1_filter> - <lv1_filter>L1_TAU8_EMPTY</lv1_filter> - <lv1_filter>L1_EM7_EMPTY</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1FIRSTEMPTY_noPS</filter_name> - <lv1_filter>L1_J12_FIRSTEMPTY</lv1_filter> - <lv1_filter>L1_MU20_FIRSTEMPTY</lv1_filter> - <lv1_filter>L1_TAU8_FIRSTEMPTY</lv1_filter> - <lv1_filter>L1_EM7_FIRSTEMPTY</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1UNPAIRED_ISO_noPS</filter_name> - <lv1_filter>L1_BCM_AC_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_BCM_CA_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_BCM_Wide_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_J12_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_J15.31ETA49_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_MU4_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_EM7_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_TAU8_UNPAIRED_ISO</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1UNPAIRED_NONISO_noPS</filter_name> - <lv1_filter>L1_BCM_AC_UNPAIRED_NONISO</lv1_filter> - <lv1_filter>L1_BCM_CA_UNPAIRED_NONISO</lv1_filter> - <lv1_filter>L1_BCM_Wide_UNPAIRED_NONISO</lv1_filter> - <lv1_filter>L1_J12_UNPAIRED_NONISO</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1ABORTGAPNOTCALIB_noPS</filter_name> - <lv1_filter>L1_J12_ABORTGAPNOTCALIB</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1RD3_FILLED</filter_name> - <lv1_filter>L1_RD3_FILLED</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1RD3_EMPTY</filter_name> - <lv1_filter>L1_RD3_EMPTY</lv1_filter> - </filter> - </filters> -</trigger> diff --git a/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_310574.xml b/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_310574.xml deleted file mode 100644 index 19292d6752b602daca54a739f9f1ec446b909450..0000000000000000000000000000000000000000 --- a/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_310574.xml +++ /dev/null @@ -1,196 +0,0 @@ -<?xml version="1.0" ?> -<trigger> - <lumivalues> - <lumivalues_data>660e+30</lumivalues_data> - <lumivalues_pred>1.5e+34</lumivalues_pred> - <deadtime>0.041</deadtime> - <peak_mu_av>42.41</peak_mu_av> - </lumivalues> - <bunchgroups> - <bunchgroup id="0" name="BCRVeto">3543</bunchgroup> - <bunchgroup id="1" name="Paired">99</bunchgroup> - <bunchgroup id="2" name="CalReq">70</bunchgroup> - <bunchgroup id="3" name="Empty">3302</bunchgroup> - <bunchgroup id="4" name="IsolatedUnpaired">2</bunchgroup> - <bunchgroup id="5" name="NonIsolatedUnpaired">0</bunchgroup> - <bunchgroup id="6" name="EmptyBeforeAfterPaired">50</bunchgroup> - <bunchgroup id="7" name="InTrain">84</bunchgroup> - <bunchgroup id="8" name="AbortGapNotCalReq">29</bunchgroup> - <bunchgroup id="9" name="AfterGlow">11</bunchgroup> - <bunchgroup id="10" name="ALFA">4</bunchgroup> - <bunchgroup id="11" name="EmptyBeforePaired">5</bunchgroup> - <bunchgroup id="12" name="AllWithoutCalreq">3473</bunchgroup> - <bunchgroup id="13" name="BG13">0</bunchgroup> - <bunchgroup id="14" name="BG14">0</bunchgroup> - <bunchgroup id="15" name="BG15">0</bunchgroup> - </bunchgroups> - <lb_list> - <lb id="114" lumi="696.8" mu="44.8">42894</lb> - <lb id="115" lumi="694.8" mu="44.6">42857</lb> - <lb id="116" lumi="692.3" mu="44.5">42563</lb> - <lb id="117" lumi="690.1" mu="44.3">42248</lb> - <lb id="118" lumi="688.0" mu="44.2">42065</lb> - <lb id="119" lumi="685.8" mu="44.0">41565</lb> - <lb id="120" lumi="683.7" mu="43.9">41120</lb> - <lb id="121" lumi="681.5" mu="43.8">41342</lb> - <lb id="122" lumi="679.7" mu="43.7">20964</lb> - <lb id="123" lumi="678.2" mu="43.6">40788</lb> - <lb id="124" lumi="676.6" mu="43.5">39934</lb> - <lb id="125" lumi="674.5" mu="43.3">40223</lb> - <lb id="126" lumi="672.3" mu="43.2">40005</lb> - <lb id="127" lumi="670.3" mu="43.0">39552</lb> - <lb id="128" lumi="668.5" mu="42.9">39453</lb> - <lb id="129" lumi="666.6" mu="42.8">40170</lb> - <lb id="130" lumi="664.6" mu="42.7">39230</lb> - <lb id="131" lumi="662.6" mu="42.6">39157</lb> - <lb id="132" lumi="660.9" mu="42.4">39269</lb> - <lb id="133" lumi="659.7" mu="42.4">39181</lb> - <lb id="134" lumi="658.3" mu="42.3">39011</lb> - <lb id="135" lumi="657.1" mu="42.2">38626</lb> - <lb id="136" lumi="655.1" mu="42.1">38488</lb> - <lb id="137" lumi="653.5" mu="42.0">38215</lb> - <lb id="138" lumi="651.1" mu="41.8">37893</lb> - <lb id="139" lumi="649.4" mu="41.7">37847</lb> - <lb id="140" lumi="647.9" mu="41.6">37339</lb> - <lb id="141" lumi="645.9" mu="41.5">37441</lb> - <lb id="142" lumi="644.5" mu="41.4">37299</lb> - <lb id="143" lumi="642.2" mu="41.2">36979</lb> - <lb id="144" lumi="640.6" mu="41.1">37018</lb> - <lb id="145" lumi="639.1" mu="41.0">36817</lb> - <lb id="146" lumi="637.2" mu="40.9">36376</lb> - <lb id="147" lumi="635.3" mu="40.8">35834</lb> - <lb id="148" lumi="633.6" mu="40.7">36130</lb> - <lb id="149" lumi="632.2" mu="40.6">36673</lb> - <lb id="150" lumi="630.4" mu="40.5">35560</lb> - <lb id="151" lumi="629.1" mu="40.4">35360</lb> - <lb id="152" lumi="627.7" mu="40.3">26736</lb> - </lb_list> - <filters> - <filter> - <eb_hlt_chains> - <eb_hlt_name>HLT_eb_low_L1RD2_FILLED</eb_hlt_name> - <lv1_ebtrigs>L1_MU6</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM10VH</lv1_ebtrigs> - <lv1_ebtrigs>L1_J30.0ETA49_2J20.0ETA49</lv1_ebtrigs> - <lv1_ebtrigs>L1_TAU12</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU4_J12</lv1_ebtrigs> - <lv1_ebtrigs>L1_2EM7</lv1_ebtrigs> - <lv1_ebtrigs>L1_J15</lv1_ebtrigs> - <lv1_ebtrigs>L1_2MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_XS30</lv1_ebtrigs> - <lv1_ebtrigs>L1_ZB</lv1_ebtrigs> - <lv1_ebtrigs>L1_DETA-JJ</lv1_ebtrigs> - </eb_hlt_chains> - <eb_hlt_chains> - <eb_hlt_name>HLT_eb_high_L1RD2_FILLED</eb_hlt_name> - <lv1_ebtrigs>L1_3J15</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM18VH</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM20VHI</lv1_ebtrigs> - <lv1_ebtrigs>L1_2EM10VH</lv1_ebtrigs> - <lv1_ebtrigs>L1_J50</lv1_ebtrigs> - <lv1_ebtrigs>L1_TAU30</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU15</lv1_ebtrigs> - <lv1_ebtrigs>L1_TAU20_2TAU12</lv1_ebtrigs> - <lv1_ebtrigs>L1_XE35</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU6_2MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU6_J20</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM7_MU10</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM15VH_3EM7</lv1_ebtrigs> - <lv1_ebtrigs>L1_3MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_2EM15</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM15I_MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_TAU20_2TAU12_XE35</lv1_ebtrigs> - <lv1_ebtrigs>L1_DR-TAU20ITAU12I</lv1_ebtrigs> - <lv1_ebtrigs>L1_DY-BOX-2MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_DY-DR-2MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_2MU4-B</lv1_ebtrigs> - <lv1_ebtrigs>L1_2MU4-BO</lv1_ebtrigs> - <lv1_ebtrigs>L1_BTAG-MU4J15</lv1_ebtrigs> - <lv1_ebtrigs>L1_MJJ-100</lv1_ebtrigs> - <lv1_ebtrigs>L1_J4-MATCH</lv1_ebtrigs> - <lv1_ebtrigs>L1_HT190-J15.ETA21</lv1_ebtrigs> - <lv1_ebtrigs>L1_2MU6</lv1_ebtrigs> - </eb_hlt_chains> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1PhysicsLow_noPS</filter_name> - <lv1_filter>L1_MU6_3MU4</lv1_filter> - <lv1_filter>L1_2EM8VH_MU10</lv1_filter> - <lv1_filter>L1_2J15_XE55</lv1_filter> - <lv1_filter>L1_4J15</lv1_filter> - <lv1_filter>L1_EM15HI_2TAU12IM_J25_3J12</lv1_filter> - <lv1_filter>L1_EM15HI_2TAU12IM_XE35</lv1_filter> - <lv1_filter>L1_EM15HI_TAU40_2TAU15</lv1_filter> - <lv1_filter>L1_EM15VH_MU10</lv1_filter> - <lv1_filter>L1_EM22VHI</lv1_filter> - <lv1_filter>L1_MU10_TAU12IM_J25_2J12</lv1_filter> - <lv1_filter>L1_MU10_TAU12IM_XE35</lv1_filter> - <lv1_filter>L1_MU10_TAU20IM</lv1_filter> - <lv1_filter>L1_MU20</lv1_filter> - <lv1_filter>L1_MU6_J30.0ETA49_2J20.0ETA49</lv1_filter> - <lv1_filter>L1_TAU20IM_2J20_XE45</lv1_filter> - <lv1_filter>L1_TAU20IM_2TAU12IM_J25_2J20_3J12</lv1_filter> - <lv1_filter>L1_TAU20IM_2TAU12IM_XE35</lv1_filter> - <lv1_filter>L1_TAU60</lv1_filter> - <lv1_filter>L1_XE50</lv1_filter> - <lv1_filter>L1_MU10_3J20</lv1_filter> - <lv1_filter>L1_J40.0ETA25_2J15.31ETA49</lv1_filter> - <lv1_filter>L1_3MU6</lv1_filter> - <lv1_filter>L1_MU10_2J15_J20</lv1_filter> - <lv1_filter>L1_J40.0ETA25_2J25_J20.31ETA49</lv1_filter> - <lv1_filter>L1_2MU6_3MU4</lv1_filter> - <lv1_filter>L1_MU11_2MU6</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1PhysicsHigh_noPS</filter_name> - <lv1_filter>L1_J100.31ETA49</lv1_filter> - <lv1_filter>L1_J400</lv1_filter> - <lv1_filter>L1_XE80</lv1_filter> - <lv1_filter>L1_6J15</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1EMPTY_noPS</filter_name> - <lv1_filter>L1_J12_EMPTY</lv1_filter> - <lv1_filter>L1_MU11_EMPTY</lv1_filter> - <lv1_filter>L1_TAU8_EMPTY</lv1_filter> - <lv1_filter>L1_EM7_EMPTY</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1FIRSTEMPTY_noPS</filter_name> - <lv1_filter>L1_J12_FIRSTEMPTY</lv1_filter> - <lv1_filter>L1_MU20_FIRSTEMPTY</lv1_filter> - <lv1_filter>L1_TAU8_FIRSTEMPTY</lv1_filter> - <lv1_filter>L1_EM7_FIRSTEMPTY</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1UNPAIRED_ISO_noPS</filter_name> - <lv1_filter>L1_BCM_AC_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_BCM_CA_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_BCM_Wide_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_J12_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_J15.31ETA49_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_MU4_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_EM7_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_TAU8_UNPAIRED_ISO</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1UNPAIRED_NONISO_noPS</filter_name> - <lv1_filter>L1_BCM_AC_UNPAIRED_NONISO</lv1_filter> - <lv1_filter>L1_BCM_CA_UNPAIRED_NONISO</lv1_filter> - <lv1_filter>L1_BCM_Wide_UNPAIRED_NONISO</lv1_filter> - <lv1_filter>L1_J12_UNPAIRED_NONISO</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1ABORTGAPNOTCALIB_noPS</filter_name> - <lv1_filter>L1_J12_ABORTGAPNOTCALIB</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1RD3_FILLED</filter_name> - <lv1_filter>L1_RD3_FILLED</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1RD3_EMPTY</filter_name> - <lv1_filter>L1_RD3_EMPTY</lv1_filter> - </filter> - </filters> -</trigger> diff --git a/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_312649.xml b/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_312649.xml deleted file mode 100644 index a2386a578e45760a5a7c5d87a7b845d6adb0453a..0000000000000000000000000000000000000000 --- a/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_312649.xml +++ /dev/null @@ -1,219 +0,0 @@ -<?xml version="1.0" ?> -<trigger> - <lumivalues> - <lumivalues_data>6.45e27</lumivalues_data> - <lumivalues_pred>6.5e+27</lumivalues_pred> - <deadtime>0.054</deadtime> - <peak_mu_av>0.0041</peak_mu_av> - </lumivalues> - <bunchgroups> - <bunchgroup id="0" name="BCRVeto">3543</bunchgroup> - <bunchgroup id="1" name="Paired">10</bunchgroup> - <bunchgroup id="2" name="CalReq">70</bunchgroup> - <bunchgroup id="3" name="Empty">3178</bunchgroup> - <bunchgroup id="4" name="IsolatedUnpaired">10</bunchgroup> - <bunchgroup id="5" name="NonIsolatedUnpaired">10</bunchgroup> - <bunchgroup id="6" name="EmptyBeforeAfterPaired">99</bunchgroup> - <bunchgroup id="7" name="InTrain">0</bunchgroup> - <bunchgroup id="8" name="AbortGapNotCalReq">29</bunchgroup> - <bunchgroup id="9" name="AfterGlow">63</bunchgroup> - <bunchgroup id="10" name="ALFA">4</bunchgroup> - <bunchgroup id="11" name="EmptyBeforePaired">10</bunchgroup> - <bunchgroup id="12" name="AllWithoutCalreq">3473</bunchgroup> - <bunchgroup id="13" name="BG13">0</bunchgroup> - <bunchgroup id="14" name="BG14">0</bunchgroup> - <bunchgroup id="15" name="BG15">0</bunchgroup> - </bunchgroups> - <lb_list> - <lb id="119" lumi="0.006884" mu="0.00438">2134</lb> - <lb id="120" lumi="0.00691" mu="0.00439">2121</lb> - <lb id="121" lumi="0.006734" mu="0.00428">2130</lb> - <lb id="122" lumi="0.006954" mu="0.00442">2266</lb> - <lb id="123" lumi="0.006764" mu="0.0043">2239</lb> - <lb id="124" lumi="0.006728" mu="0.00428">2237</lb> - <lb id="125" lumi="0.00678" mu="0.00431">2158</lb> - <lb id="126" lumi="0.006789" mu="0.00432">2125</lb> - <lb id="127" lumi="0.006884" mu="0.00438">2138</lb> - <lb id="128" lumi="0.006774" mu="0.00431">2139</lb> - <lb id="129" lumi="0.006852" mu="0.00436">2119</lb> - <lb id="130" lumi="0.006673" mu="0.00424">2064</lb> - <lb id="131" lumi="0.006598" mu="0.0042">2083</lb> - <lb id="132" lumi="0.006725" mu="0.00428">2172</lb> - <lb id="133" lumi="0.006774" mu="0.00431">2166</lb> - <lb id="134" lumi="0.006748" mu="0.00429">2154</lb> - <lb id="135" lumi="0.006705" mu="0.00426">2219</lb> - <lb id="136" lumi="0.006612" mu="0.0042">2193</lb> - <lb id="137" lumi="0.006686" mu="0.00425">2170</lb> - <lb id="138" lumi="0.006524" mu="0.00415">2114</lb> - <lb id="139" lumi="0.006526" mu="0.00415">2075</lb> - <lb id="140" lumi="0.006469" mu="0.00411">2043</lb> - <lb id="141" lumi="0.006632" mu="0.00422">2197</lb> - <lb id="142" lumi="0.006533" mu="0.00415">2069</lb> - <lb id="143" lumi="0.006475" mu="0.00412">2066</lb> - <lb id="144" lumi="0.006488" mu="0.00413">2032</lb> - <lb id="145" lumi="0.006726" mu="0.00428">2103</lb> - <lb id="146" lumi="0.006503" mu="0.00413">2022</lb> - <lb id="147" lumi="0.006533" mu="0.00415">2041</lb> - <lb id="148" lumi="0.006575" mu="0.00418">2005</lb> - <lb id="149" lumi="0.006444" mu="0.0041">2084</lb> - <lb id="150" lumi="0.006584" mu="0.00419">2021</lb> - <lb id="151" lumi="0.00649" mu="0.00413">2101</lb> - <lb id="152" lumi="0.006478" mu="0.00412">2047</lb> - <lb id="153" lumi="0.006458" mu="0.00411">2016</lb> - <lb id="154" lumi="0.006467" mu="0.00411">2029</lb> - <lb id="155" lumi="0.006365" mu="0.00405">1992</lb> - <lb id="156" lumi="0.006418" mu="0.00408">2033</lb> - <lb id="157" lumi="0.006447" mu="0.0041">2067</lb> - <lb id="158" lumi="0.006513" mu="0.00414">2048</lb> - <lb id="159" lumi="0.006327" mu="0.00402">2039</lb> - <lb id="160" lumi="0.006502" mu="0.00413">2073</lb> - <lb id="161" lumi="0.006514" mu="0.00414">2027</lb> - <lb id="162" lumi="0.006416" mu="0.00408">2062</lb> - <lb id="163" lumi="0.006314" mu="0.00401" flag="bad">1409</lb> - <lb id="164" lumi="0.006155" mu="0.00391" flag="bad">49</lb> - <lb id="165" lumi="0.006319" mu="0.00402" flag="bad">1571</lb> - <lb id="166" lumi="0.006371" mu="0.00405">1895</lb> - <lb id="167" lumi="0.006467" mu="0.00411">1882</lb> - <lb id="168" lumi="0.00647" mu="0.00411">1911</lb> - <lb id="169" lumi="0.006235" mu="0.00396">1816</lb> - <lb id="170" lumi="0.006393" mu="0.00406">1861</lb> - <lb id="171" lumi="0.006287" mu="0.004">1853</lb> - <lb id="172" lumi="0.006347" mu="0.00404">1855</lb> - <lb id="173" lumi="0.006266" mu="0.00398">1853</lb> - <lb id="174" lumi="0.006183" mu="0.00393">1771</lb> - <lb id="175" lumi="0.006233" mu="0.00396">1748</lb> - <lb id="176" lumi="0.00629" mu="0.004">1836</lb> - <lb id="177" lumi="0.006236" mu="0.00397">2048</lb> - <lb id="178" lumi="0.006234" mu="0.00396">2124</lb> - <lb id="179" lumi="0.006215" mu="0.00395">2012</lb> - <lb id="180" lumi="0.006273" mu="0.00399">1974</lb> - <lb id="181" lumi="0.006238" mu="0.00397">1984</lb> - <lb id="182" lumi="0.006148" mu="0.00391">1906</lb> - <lb id="183" lumi="0.006101" mu="0.00388">1992</lb> - <lb id="184" lumi="0.006235" mu="0.00396">1985</lb> - <lb id="185" lumi="0.006211" mu="0.00395">2007</lb> - <lb id="186" lumi="0.006152" mu="0.00391">1963</lb> - <lb id="187" lumi="0.006234" mu="0.00396">1997</lb> - <lb id="188" lumi="0.006022" mu="0.00383">1095</lb> - <lb id="189" lumi="0.006193" mu="0.00394">1954</lb> - <lb id="190" lumi="0.00598" mu="0.0038">1829</lb> - <lb id="191" lumi="0.00619" mu="0.00394">1965</lb> - <lb id="192" lumi="0.006131" mu="0.0039">1944</lb> - <lb id="193" lumi="0.006024" mu="0.00383">1977</lb> - <lb id="194" lumi="0.006043" mu="0.00384">832 </lb> - </lb_list> - <filters> - <filter> - <filter_name>HLT_noalg_eb_L1ZDC_A</filter_name> - <lv1_filter>L1_ZDC_A</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1ZDC_C</filter_name> - <lv1_filter>L1_ZDC_C</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1MBTS_2</filter_name> - <lv1_filter>L1_MBTS_2</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1TE5</filter_name> - <lv1_filter>L1_TE5</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1TE50</filter_name> - <lv1_filter>L1_TE50</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1TE120</filter_name> - <lv1_filter>L1_TE120</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1TE160</filter_name> - <lv1_filter>L1_TE160</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1TE10.0ETA24</filter_name> - <lv1_filter>L1_TE10.0ETA24</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1TE30.0ETA24</filter_name> - <lv1_filter>L1_TE30.0ETA24</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1MU4</filter_name> - <lv1_filter>L1_MU4</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1MU10</filter_name> - <lv1_filter>L1_MU10</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1EM5</filter_name> - <lv1_filter>L1_EM5</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1EM10</filter_name> - <lv1_filter>L1_EM10</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1J10</filter_name> - <lv1_filter>L1_J10</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1J30</filter_name> - <lv1_filter>L1_J30</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1J5_VZDC_C</filter_name> - <lv1_filter>L1_J5_VZDC_C</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1J5_VZDC_A</filter_name> - <lv1_filter>L1_J5_VZDC_A</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1MU4_VZDC_C</filter_name> - <lv1_filter>L1_MU4_VZDC_C</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1MU4_VZDC_A</filter_name> - <lv1_filter>L1_MU4_VZDC_A</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1TE5_VZDC_A</filter_name> - <lv1_filter>L1_TE5_VZDC_A</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1TE5_VZDC_C</filter_name> - <lv1_filter>L1_TE5_VZDC_C</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1MBTS_2_A_VZDC_C</filter_name> - <lv1_filter>L1_MBTS_2_A_VZDC_C</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1MBTS_2_C_VZDC_A</filter_name> - <lv1_filter>L1_MBTS_2_C_VZDC_A</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1ZDC_A_VZDC_C</filter_name> - <lv1_filter>L1_ZDC_A_VZDC_C</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1ZDC_C_VZDC_A</filter_name> - <lv1_filter>L1_ZDC_C_VZDC_A</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1EM3_VZDC_C</filter_name> - <lv1_filter>L1_EM3_VZDC_C</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1EM3_VZDC_A</filter_name> - <lv1_filter>L1_EM3_VZDC_A</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1RD1_FILLED</filter_name> - <lv1_filter>L1_RD1_FILLED</lv1_filter> - </filter> - </filters> -</trigger> diff --git a/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_312796.xml b/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_312796.xml deleted file mode 100644 index 1490365a99a1f225acf0b460ead7195e4f77951c..0000000000000000000000000000000000000000 --- a/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_312796.xml +++ /dev/null @@ -1,230 +0,0 @@ -<?xml version="1.0" ?> -<trigger> - <lumivalues> - <lumivalues_data>2.98e27</lumivalues_data> - <lumivalues_pred>5e+27</lumivalues_pred> - <deadtime>0.004</deadtime> - <peak_mu_av>0.000234</peak_mu_av> - </lumivalues> - <bunchgroups> - <bunchgroup id="0" name="BCRVeto">3543</bunchgroup> - <bunchgroup id="1" name="Paired">81</bunchgroup> - <bunchgroup id="2" name="CalReq">70</bunchgroup> - <bunchgroup id="3" name="Empty">423</bunchgroup> - <bunchgroup id="4" name="IsolatedUnpaired">29</bunchgroup> - <bunchgroup id="5" name="NonIsolatedUnpaired">1059</bunchgroup> - <bunchgroup id="6" name="EmptyBeforeAfterPaired">342</bunchgroup> - <bunchgroup id="7" name="InTrain">0</bunchgroup> - <bunchgroup id="8" name="AbortGapNotCalReq">29</bunchgroup> - <bunchgroup id="9" name="AfterGlow">0</bunchgroup> - <bunchgroup id="10" name="ALFA">4</bunchgroup> - <bunchgroup id="11" name="EmptyBeforePaired">81</bunchgroup> - <bunchgroup id="12" name="AllWithoutCalreq">3473</bunchgroup> - <bunchgroup id="13" name="BG13">0</bunchgroup> - <bunchgroup id="14" name="BG14">0</bunchgroup> - <bunchgroup id="15" name="BG15">0</bunchgroup> - </bunchgroups> - <lb_list> - <lb id="170" lumi="0.003164" mu="0.000248">15053</lb> - <lb id="171" lumi="0.003165" mu="0.000248">15212</lb> - <lb id="172" lumi="0.003135" mu="0.000246">15127</lb> - <lb id="173" lumi="0.003134" mu="0.000246">14849</lb> - <lb id="174" lumi="0.003135" mu="0.000246">14865</lb> - <lb id="175" lumi="0.003142" mu="0.000247">14723</lb> - <lb id="176" lumi="0.003108" mu="0.000244">14778</lb> - <lb id="177" lumi="0.003111" mu="0.000244">14717</lb> - <lb id="178" lumi="0.003102" mu="0.000243">14445</lb> - <lb id="179" lumi="0.003108" mu="0.000244">14747</lb> - <lb id="180" lumi="0.003102" mu="0.000243">14503</lb> - <lb id="181" lumi="0.003077" mu="0.000242">14527</lb> - <lb id="182" lumi="0.003087" mu="0.000242">14757</lb> - <lb id="183" lumi="0.003087" mu="0.000242">14661</lb> - <lb id="184" lumi="0.003079" mu="0.000242">14663</lb> - <lb id="185" lumi="0.003104" mu="0.000244">14619</lb> - <lb id="186" lumi="0.003074" mu="0.000241">14511</lb> - <lb id="187" lumi="0.003055" mu="0.00024">14432</lb> - <lb id="188" lumi="0.003064" mu="0.000241">14265</lb> - <lb id="189" lumi="0.00305" mu="0.000239">14521</lb> - <lb id="190" lumi="0.003058" mu="0.00024">14619</lb> - <lb id="191" lumi="0.003065" mu="0.000241">14775</lb> - <lb id="192" lumi="0.003046" mu="0.000239">14487</lb> - <lb id="193" lumi="0.003061" mu="0.00024">14790</lb> - <lb id="194" lumi="0.003042" mu="0.000239">12764</lb> - <lb id="195" lumi="0.003052" mu="0.00024">14259</lb> - <lb id="196" lumi="0.003025" mu="0.000237">14170</lb> - <lb id="197" lumi="0.003024" mu="0.000237">14224</lb> - <lb id="198" lumi="0.003005" mu="0.000236">14353</lb> - <lb id="199" lumi="0.003005" mu="0.000236">13982</lb> - <lb id="200" lumi="0.003015" mu="0.000237">14224</lb> - <lb id="201" lumi="0.00301" mu="0.000236">14285</lb> - <lb id="202" lumi="0.003019" mu="0.000237">14171</lb> - <lb id="203" lumi="0.003023" mu="0.000237">14332</lb> - <lb id="204" lumi="0.003009" mu="0.000236">14260</lb> - <lb id="205" lumi="0.002984" mu="0.000234">14095</lb> - <lb id="206" lumi="0.003025" mu="0.000237">14102</lb> - <lb id="207" lumi="0.003009" mu="0.000236">14047</lb> - <lb id="208" lumi="0.002985" mu="0.000234">13923</lb> - <lb id="209" lumi="0.002992" mu="0.000235">14059</lb> - <lb id="210" lumi="0.002983" mu="0.000234">13552</lb> - <lb id="211" lumi="0.002975" mu="0.000234">14433</lb> - <lb id="212" lumi="0.002973" mu="0.000233">14148</lb> - <lb id="213" lumi="0.002985" mu="0.000234">13965</lb> - <lb id="214" lumi="0.002958" mu="0.000232">14016</lb> - <lb id="215" lumi="0.002979" mu="0.000234">13834</lb> - <lb id="216" lumi="0.002982" mu="0.000234">13620</lb> - <lb id="217" lumi="0.002968" mu="0.000233">13842</lb> - <lb id="218" lumi="0.002962" mu="0.000233">13793</lb> - <lb id="219" lumi="0.002957" mu="0.000232">13907</lb> - <lb id="220" lumi="0.00294" mu="0.000231">13932</lb> - <lb id="221" lumi="0.002939" mu="0.000231">13975</lb> - <lb id="222" lumi="0.002939" mu="0.000231">13995</lb> - <lb id="223" lumi="0.002932" mu="0.00023">14011</lb> - <lb id="224" lumi="0.002924" mu="0.000229">13751</lb> - <lb id="225" lumi="0.002928" mu="0.00023">13745</lb> - <lb id="226" lumi="0.002926" mu="0.00023">13563</lb> - <lb id="227" lumi="0.002926" mu="0.00023">13647</lb> - <lb id="228" lumi="0.002918" mu="0.000229">13700</lb> - <lb id="229" lumi="0.002921" mu="0.000229">13359</lb> - <lb id="230" lumi="0.002889" mu="0.000227">13646</lb> - <lb id="231" lumi="0.002891" mu="0.000227">13610</lb> - <lb id="232" lumi="0.002914" mu="0.000229">14011</lb> - <lb id="233" lumi="0.002904" mu="0.000228">14032</lb> - <lb id="234" lumi="0.002905" mu="0.000228">13642</lb> - <lb id="235" lumi="0.0029" mu="0.000228">13691</lb> - <lb id="236" lumi="0.002885" mu="0.000226">13245</lb> - <lb id="237" lumi="0.002878" mu="0.000226">13335</lb> - <lb id="238" lumi="0.002886" mu="0.000227">13284</lb> - <lb id="239" lumi="0.002883" mu="0.000226">13403</lb> - <lb id="240" lumi="0.002887" mu="0.000227">13370</lb> - <lb id="241" lumi="0.002873" mu="0.000226">13285</lb> - <lb id="242" lumi="0.002863" mu="0.000225">13377</lb> - <lb id="243" lumi="0.002866" mu="0.000225">13677</lb> - <lb id="244" lumi="0.002844" mu="0.000223">13448</lb> - <lb id="245" lumi="0.00284" mu="0.000223">13719</lb> - <lb id="246" lumi="0.00285" mu="0.000224">13443</lb> - <lb id="247" lumi="0.002843" mu="0.000223">13549</lb> - <lb id="248" lumi="0.00283" mu="0.000222">13335</lb> - <lb id="249" lumi="0.002846" mu="0.000223">13317</lb> - <lb id="250" lumi="0.00283" mu="0.000222">13077</lb> - <lb id="251" lumi="0.002834" mu="0.000222">13334</lb> - <lb id="252" lumi="0.002831" mu="0.000222">13261</lb> - <lb id="253" lumi="0.002835" mu="0.000223">13437</lb> - <lb id="254" lumi="0.002826" mu="0.000222">13275</lb> - <lb id="255" lumi="0.002825" mu="0.000222">13442</lb> - <lb id="256" lumi="0.002838" mu="0.000223">5902</lb> - </lb_list> - <filters> - <filter> - <filter_name>HLT_noalg_eb_L1ZDC_A</filter_name> - <lv1_filter>L1_ZDC_A</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1ZDC_C</filter_name> - <lv1_filter>L1_ZDC_C</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1MBTS_2</filter_name> - <lv1_filter>L1_MBTS_2</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1TE5</filter_name> - <lv1_filter>L1_TE5</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1TE50</filter_name> - <lv1_filter>L1_TE50</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1TE120</filter_name> - <lv1_filter>L1_TE120</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1TE160</filter_name> - <lv1_filter>L1_TE160</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1TE10.0ETA24</filter_name> - <lv1_filter>L1_TE10.0ETA24</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1TE30.0ETA24</filter_name> - <lv1_filter>L1_TE30.0ETA24</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1MU4</filter_name> - <lv1_filter>L1_MU4</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1MU10</filter_name> - <lv1_filter>L1_MU10</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1EM5</filter_name> - <lv1_filter>L1_EM5</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1EM10</filter_name> - <lv1_filter>L1_EM10</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1J10</filter_name> - <lv1_filter>L1_J10</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1J30</filter_name> - <lv1_filter>L1_J30</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1J5_VZDC_C</filter_name> - <lv1_filter>L1_J5_VZDC_C</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1J5_VZDC_A</filter_name> - <lv1_filter>L1_J5_VZDC_A</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1MU4_VZDC_C</filter_name> - <lv1_filter>L1_MU4_VZDC_C</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1MU4_VZDC_A</filter_name> - <lv1_filter>L1_MU4_VZDC_A</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1TE5_VZDC_A</filter_name> - <lv1_filter>L1_TE5_VZDC_A</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1TE5_VZDC_C</filter_name> - <lv1_filter>L1_TE5_VZDC_C</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1MBTS_2_A_VZDC_C</filter_name> - <lv1_filter>L1_MBTS_2_A_VZDC_C</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1MBTS_2_C_VZDC_A</filter_name> - <lv1_filter>L1_MBTS_2_C_VZDC_A</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1ZDC_A_VZDC_C</filter_name> - <lv1_filter>L1_ZDC_A_VZDC_C</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1ZDC_C_VZDC_A</filter_name> - <lv1_filter>L1_ZDC_C_VZDC_A</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1EM3_VZDC_C</filter_name> - <lv1_filter>L1_EM3_VZDC_C</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1EM3_VZDC_A</filter_name> - <lv1_filter>L1_EM3_VZDC_A</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1RD1_FILLED</filter_name> - <lv1_filter>L1_RD1_FILLED</lv1_filter> - </filter> - </filters> -</trigger> diff --git a/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_312945.xml b/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_312945.xml deleted file mode 100644 index fefb671b5a2c031f8d6b808832de7473fa42687f..0000000000000000000000000000000000000000 --- a/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_312945.xml +++ /dev/null @@ -1,335 +0,0 @@ -<?xml version="1.0" ?> -<trigger> - <lumivalues> - <lumivalues_data>1.53e27</lumivalues_data> - <lumivalues_pred>5e+27</lumivalues_pred> - <deadtime>0.038</deadtime> - <peak_mu_av>0.000135</peak_mu_av> - </lumivalues> - <bunchgroups> - <bunchgroup id="0" name="BCRVeto">3543</bunchgroup> - <bunchgroup id="1" name="Paired">81</bunchgroup> - <bunchgroup id="2" name="CalReq">70</bunchgroup> - <bunchgroup id="3" name="Empty">423</bunchgroup> - <bunchgroup id="4" name="IsolatedUnpaired">29</bunchgroup> - <bunchgroup id="5" name="NonIsolatedUnpaired">1059</bunchgroup> - <bunchgroup id="6" name="EmptyBeforeAfterPaired">342</bunchgroup> - <bunchgroup id="7" name="InTrain">0</bunchgroup> - <bunchgroup id="8" name="AbortGapNotCalReq">29</bunchgroup> - <bunchgroup id="9" name="AfterGlow">0</bunchgroup> - <bunchgroup id="10" name="ALFA">4</bunchgroup> - <bunchgroup id="11" name="EmptyBeforePaired">81</bunchgroup> - <bunchgroup id="12" name="AllWithoutCalreq">3473</bunchgroup> - <bunchgroup id="13" name="BG13">0</bunchgroup> - <bunchgroup id="14" name="BG14">0</bunchgroup> - <bunchgroup id="15" name="BG15">0</bunchgroup> - </bunchgroups> - <lb_list> - <lb id="4" lumi="0.001678" mu="0.000147" flag="bad">5231</lb> - <lb id="5" lumi="0.00167" mu="0.000147" flag="bad">5319</lb> - <lb id="6" lumi="0.001636" mu="0.000144">5521</lb> - <lb id="7" lumi="0.001641" mu="0.000144">11892</lb> - <lb id="8" lumi="0.001648" mu="0.000145">12019</lb> - <lb id="9" lumi="0.001634" mu="0.000144">11948</lb> - <lb id="10" lumi="0.001639" mu="0.000144">11827</lb> - <lb id="11" lumi="0.001649" mu="0.000145">11793</lb> - <lb id="12" lumi="0.001646" mu="0.000145">12146</lb> - <lb id="13" lumi="0.001636" mu="0.000144">12009</lb> - <lb id="14" lumi="0.001634" mu="0.000144">11747</lb> - <lb id="15" lumi="0.001629" mu="0.000143">11861</lb> - <lb id="16" lumi="0.001629" mu="0.000143">12001</lb> - <lb id="17" lumi="0.001637" mu="0.000144">12035</lb> - <lb id="18" lumi="0.001635" mu="0.000144">11995</lb> - <lb id="19" lumi="0.00163" mu="0.000143">11789</lb> - <lb id="20" lumi="0.001622" mu="0.000142">11745</lb> - <lb id="21" lumi="0.001625" mu="0.000143">11959</lb> - <lb id="22" lumi="0.001624" mu="0.000143">11805</lb> - <lb id="23" lumi="0.00162" mu="0.000142">11968</lb> - <lb id="24" lumi="0.001628" mu="0.000143">11846</lb> - <lb id="25" lumi="0.00162" mu="0.000142">12004</lb> - <lb id="26" lumi="0.001621" mu="0.000142">11683</lb> - <lb id="27" lumi="0.001619" mu="0.000142">11954</lb> - <lb id="28" lumi="0.001632" mu="0.000143">11725</lb> - <lb id="29" lumi="0.001601" mu="0.000141">11931</lb> - <lb id="30" lumi="0.001611" mu="0.000141">11614</lb> - <lb id="31" lumi="0.001612" mu="0.000142">11762</lb> - <lb id="32" lumi="0.001611" mu="0.000141">11632</lb> - <lb id="33" lumi="0.001607" mu="0.000141">11586</lb> - <lb id="34" lumi="0.001605" mu="0.000141">11810</lb> - <lb id="35" lumi="0.001603" mu="0.000141">11742</lb> - <lb id="36" lumi="0.001611" mu="0.000142">11827</lb> - <lb id="37" lumi="0.001603" mu="0.000141">11672</lb> - <lb id="38" lumi="0.001602" mu="0.000141">11782</lb> - <lb id="39" lumi="0.001612" mu="0.000142">11983</lb> - <lb id="40" lumi="0.001599" mu="0.00014">11623</lb> - <lb id="41" lumi="0.001603" mu="0.000141">11729</lb> - <lb id="42" lumi="0.001597" mu="0.00014">11517</lb> - <lb id="43" lumi="0.001598" mu="0.00014">11819</lb> - <lb id="44" lumi="0.001583" mu="0.000139">11578</lb> - <lb id="45" lumi="0.001607" mu="0.000141">11704</lb> - <lb id="46" lumi="0.001584" mu="0.000139">11768</lb> - <lb id="47" lumi="0.001594" mu="0.00014">11715</lb> - <lb id="48" lumi="0.001598" mu="0.00014">11548</lb> - <lb id="49" lumi="0.001596" mu="0.00014">11505</lb> - <lb id="50" lumi="0.001587" mu="0.000139">11656</lb> - <lb id="51" lumi="0.001595" mu="0.00014">11610</lb> - <lb id="52" lumi="0.001582" mu="0.000139">11560</lb> - <lb id="53" lumi="0.001594" mu="0.00014">11710</lb> - <lb id="54" lumi="0.001588" mu="0.000139">11500</lb> - <lb id="55" lumi="0.001583" mu="0.000139">11374</lb> - <lb id="56" lumi="0.001581" mu="0.000139">11493</lb> - <lb id="57" lumi="0.001576" mu="0.000138">11356</lb> - <lb id="58" lumi="0.001584" mu="0.000139">11811</lb> - <lb id="59" lumi="0.001581" mu="0.000139">11380</lb> - <lb id="60" lumi="0.001583" mu="0.000139">11346</lb> - <lb id="61" lumi="0.00158" mu="0.000139">11579</lb> - <lb id="62" lumi="0.00158" mu="0.000139">11534</lb> - <lb id="63" lumi="0.00157" mu="0.000138">11440</lb> - <lb id="64" lumi="0.001581" mu="0.000139">11910</lb> - <lb id="65" lumi="0.001575" mu="0.000138">11388</lb> - <lb id="66" lumi="0.001561" mu="0.000137">11172</lb> - <lb id="67" lumi="0.001554" mu="0.000136">11420</lb> - <lb id="68" lumi="0.001569" mu="0.000138">11513</lb> - <lb id="69" lumi="0.001566" mu="0.000138">11426</lb> - <lb id="70" lumi="0.001556" mu="0.000137">11507</lb> - <lb id="71" lumi="0.001552" mu="0.000136">11368</lb> - <lb id="72" lumi="0.001562" mu="0.000137">11277</lb> - <lb id="73" lumi="0.001564" mu="0.000137">11383</lb> - <lb id="74" lumi="0.001545" mu="0.000136">11216</lb> - <lb id="75" lumi="0.001558" mu="0.000137">11494</lb> - <lb id="76" lumi="0.001562" mu="0.000137">11392</lb> - <lb id="77" lumi="0.001554" mu="0.000136">11482</lb> - <lb id="78" lumi="0.001546" mu="0.000136">11252</lb> - <lb id="79" lumi="0.001553" mu="0.000136" flag="bad">9331</lb> - <lb id="80" lumi="0.001552" mu="0.000136" flag="bad">0</lb> - <lb id="81" lumi="0.001548" mu="0.000136" flag="bad">0</lb> - <lb id="82" lumi="0.00155" mu="0.000136" flag="bad">0</lb> - <lb id="83" lumi="0.001548" mu="0.000136" flag="bad">0</lb> - <lb id="84" lumi="0.001555" mu="0.000137">16063</lb> - <lb id="85" lumi="0.001549" mu="0.000136">16033</lb> - <lb id="86" lumi="0.001552" mu="0.000136">15599</lb> - <lb id="87" lumi="0.001539" mu="0.000135">15750</lb> - <lb id="88" lumi="0.001543" mu="0.000135">15740</lb> - <lb id="89" lumi="0.001551" mu="0.000136">16011</lb> - <lb id="90" lumi="0.00153" mu="0.000134">15787</lb> - <lb id="91" lumi="0.00154" mu="0.000135">15922</lb> - <lb id="92" lumi="0.001539" mu="0.000135">15520</lb> - <lb id="93" lumi="0.001524" mu="0.000134">15688</lb> - <lb id="94" lumi="0.001533" mu="0.000135">15765</lb> - <lb id="95" lumi="0.001534" mu="0.000135">15716</lb> - <lb id="96" lumi="0.00153" mu="0.000134">15757</lb> - <lb id="97" lumi="0.00152" mu="0.000134">5438</lb> - <lb id="98" lumi="0.001539" mu="0.000135">19925</lb> - <lb id="99" lumi="0.001531" mu="0.000135">19951</lb> - <lb id="100" lumi="0.001524" mu="0.000134">19994</lb> - <lb id="101" lumi="0.001521" mu="0.000134">19877</lb> - <lb id="102" lumi="0.001529" mu="0.000134">19824</lb> - <lb id="103" lumi="0.001527" mu="0.000134">19713</lb> - <lb id="104" lumi="0.001524" mu="0.000134">19576</lb> - <lb id="105" lumi="0.00152" mu="0.000133">19551</lb> - <lb id="106" lumi="0.001511" mu="0.000133">19686</lb> - <lb id="107" lumi="0.001521" mu="0.000134">19586</lb> - <lb id="108" lumi="0.001508" mu="0.000132">20006</lb> - <lb id="109" lumi="0.00152" mu="0.000134">19791</lb> - <lb id="110" lumi="0.00153" mu="0.000134">19960</lb> - <lb id="111" lumi="0.001525" mu="0.000134">20228</lb> - <lb id="112" lumi="0.001519" mu="0.000133">19286</lb> - <lb id="113" lumi="0.00152" mu="0.000134">19911</lb> - <lb id="114" lumi="0.001519" mu="0.000133">19587</lb> - <lb id="115" lumi="0.001511" mu="0.000133">19785</lb> - <lb id="116" lumi="0.001512" mu="0.000133">19619</lb> - <lb id="117" lumi="0.00152" mu="0.000134">19412</lb> - <lb id="118" lumi="0.001499" mu="0.000132">19760</lb> - <lb id="119" lumi="0.001514" mu="0.000133">20121</lb> - <lb id="120" lumi="0.001512" mu="0.000133">19428</lb> - <lb id="121" lumi="0.001502" mu="0.000132">19753</lb> - <lb id="122" lumi="0.001505" mu="0.000132">19719</lb> - <lb id="123" lumi="0.001492" mu="0.000131">19842</lb> - <lb id="124" lumi="0.001517" mu="0.000133">19617</lb> - <lb id="125" lumi="0.001512" mu="0.000133">19400</lb> - <lb id="126" lumi="0.001493" mu="0.000131">19266</lb> - <lb id="127" lumi="0.001502" mu="0.000132">19507</lb> - <lb id="128" lumi="0.001498" mu="0.000132">19479</lb> - <lb id="129" lumi="0.001494" mu="0.000131">19360</lb> - <lb id="130" lumi="0.001506" mu="0.000132">19748</lb> - <lb id="131" lumi="0.001487" mu="0.000131">19527</lb> - <lb id="132" lumi="0.001485" mu="0.00013">19412</lb> - <lb id="133" lumi="0.001489" mu="0.000131" flag="bad">1831</lb> - <lb id="134" lumi="0.001504" mu="0.000132" flag="bad">0</lb> - <lb id="135" lumi="0.001501" mu="0.000132" flag="bad">0</lb> - <lb id="136" lumi="0.001512" mu="0.000133" flag="bad">0</lb> - <lb id="137" lumi="0.001482" mu="0.00013">14651</lb> - <lb id="138" lumi="0.001478" mu="0.00013">14868</lb> - <lb id="139" lumi="0.00149" mu="0.000131">14702</lb> - <lb id="140" lumi="0.001501" mu="0.000132">14743</lb> - <lb id="141" lumi="0.001476" mu="0.00013">14730</lb> - <lb id="142" lumi="0.001475" mu="0.00013">14620</lb> - <lb id="143" lumi="0.001488" mu="0.000131">14747</lb> - <lb id="144" lumi="0.001487" mu="0.000131">14828</lb> - <lb id="145" lumi="0.001477" mu="0.00013">14676</lb> - <lb id="146" lumi="0.001483" mu="0.00013">14755</lb> - <lb id="147" lumi="0.00147" mu="0.000129">14670</lb> - <lb id="148" lumi="0.001499" mu="0.000132">8730</lb> - <lb id="149" lumi="0.001474" mu="0.000129">17761</lb> - <lb id="150" lumi="0.00148" mu="0.00013">17474</lb> - <lb id="151" lumi="0.001465" mu="0.000129">17722</lb> - <lb id="152" lumi="0.001471" mu="0.000129">18022</lb> - <lb id="153" lumi="0.001463" mu="0.000129">17785</lb> - <lb id="154" lumi="0.00148" mu="0.00013">17817</lb> - <lb id="155" lumi="0.001472" mu="0.000129">17623</lb> - <lb id="156" lumi="0.001473" mu="0.000129">17653</lb> - <lb id="157" lumi="0.001465" mu="0.000129">17667</lb> - <lb id="158" lumi="0.00146" mu="0.000128">9365</lb> - <lb id="159" lumi="0.001485" mu="0.00013">22885</lb> - <lb id="160" lumi="0.001468" mu="0.000129">22887</lb> - <lb id="161" lumi="0.00147" mu="0.000129">22544</lb> - <lb id="162" lumi="0.001457" mu="0.000128">22685</lb> - <lb id="163" lumi="0.001471" mu="0.000129">22508</lb> - <lb id="164" lumi="0.001464" mu="0.000129">22700</lb> - <lb id="165" lumi="0.001463" mu="0.000128">22902</lb> - <lb id="166" lumi="0.001464" mu="0.000129">23039</lb> - <lb id="167" lumi="0.001457" mu="0.000128">22967</lb> - <lb id="168" lumi="0.001455" mu="0.000128">22628</lb> - <lb id="169" lumi="0.001448" mu="0.000127">22803</lb> - <lb id="170" lumi="0.001469" mu="0.000129">22532</lb> - <lb id="171" lumi="0.001445" mu="0.000127">22494</lb> - <lb id="172" lumi="0.001451" mu="0.000127">22501</lb> - <lb id="173" lumi="0.001446" mu="0.000127">22287</lb> - <lb id="174" lumi="0.001455" mu="0.000128">22428</lb> - <lb id="175" lumi="0.001453" mu="0.000128">22331</lb> - <lb id="176" lumi="0.001449" mu="0.000127">22500</lb> - <lb id="177" lumi="0.001453" mu="0.000128">22384</lb> - <lb id="178" lumi="0.001444" mu="0.000127">22931</lb> - <lb id="179" lumi="0.001455" mu="0.000128">22678</lb> - <lb id="180" lumi="0.001447" mu="0.000127">22707</lb> - <lb id="181" lumi="0.001451" mu="0.000127">22947</lb> - <lb id="182" lumi="0.001444" mu="0.000127">22596</lb> - <lb id="183" lumi="0.001446" mu="0.000127">22603</lb> - <lb id="184" lumi="0.001435" mu="0.000126">22377</lb> - <lb id="185" lumi="0.001439" mu="0.000126">22408</lb> - <lb id="186" lumi="0.001443" mu="0.000127">22138</lb> - <lb id="187" lumi="0.001444" mu="0.000127">22280</lb> - <lb id="188" lumi="0.001449" mu="0.000127">22709</lb> - <lb id="189" lumi="0.001435" mu="0.000126">22443</lb> - <lb id="190" lumi="0.00145" mu="0.000127" flag="bad">5953</lb> - <lb id="191" lumi="0.001443" mu="0.000127" flag="bad">0</lb> - <lb id="192" lumi="0.001435" mu="0.000126" flag="bad">0</lb> - <lb id="193" lumi="0.001425" mu="0.000125" flag="bad">0</lb> - <lb id="194" lumi="0.00143" mu="0.000126" flag="bad">12276</lb> - <lb id="195" lumi="0.001435" mu="0.000126" flag="bad">7634</lb> - </lb_list> - <filters> - <filter> - <filter_name>HLT_noalg_eb_L1ZDC_A</filter_name> - <lv1_filter>L1_ZDC_A</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1ZDC_C</filter_name> - <lv1_filter>L1_ZDC_C</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1MBTS_2</filter_name> - <lv1_filter>L1_MBTS_2</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1TE5</filter_name> - <lv1_filter>L1_TE5</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1TE50</filter_name> - <lv1_filter>L1_TE50</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1TE120</filter_name> - <lv1_filter>L1_TE120</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1TE160</filter_name> - <lv1_filter>L1_TE160</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1TE10.0ETA24</filter_name> - <lv1_filter>L1_TE10.0ETA24</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1TE30.0ETA24</filter_name> - <lv1_filter>L1_TE30.0ETA24</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1MU4</filter_name> - <lv1_filter>L1_MU4</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1MU10</filter_name> - <lv1_filter>L1_MU10</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1EM5</filter_name> - <lv1_filter>L1_EM5</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1EM10</filter_name> - <lv1_filter>L1_EM10</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1J10</filter_name> - <lv1_filter>L1_J10</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1J30</filter_name> - <lv1_filter>L1_J30</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1J5_VZDC_C</filter_name> - <lv1_filter>L1_J5_VZDC_C</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1J5_VZDC_A</filter_name> - <lv1_filter>L1_J5_VZDC_A</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1MU4_VZDC_C</filter_name> - <lv1_filter>L1_MU4_VZDC_C</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1MU4_VZDC_A</filter_name> - <lv1_filter>L1_MU4_VZDC_A</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1TE5_VZDC_A</filter_name> - <lv1_filter>L1_TE5_VZDC_A</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1TE5_VZDC_C</filter_name> - <lv1_filter>L1_TE5_VZDC_C</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1MBTS_2_A_VZDC_C</filter_name> - <lv1_filter>L1_MBTS_2_A_VZDC_C</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1MBTS_2_C_VZDC_A</filter_name> - <lv1_filter>L1_MBTS_2_C_VZDC_A</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1ZDC_A_VZDC_C</filter_name> - <lv1_filter>L1_ZDC_A_VZDC_C</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1ZDC_C_VZDC_A</filter_name> - <lv1_filter>L1_ZDC_C_VZDC_A</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1EM3_VZDC_C</filter_name> - <lv1_filter>L1_EM3_VZDC_C</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1EM3_VZDC_A</filter_name> - <lv1_filter>L1_EM3_VZDC_A</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1RD1_FILLED</filter_name> - <lv1_filter>L1_RD1_FILLED</lv1_filter> - </filter> - </filters> -</trigger> diff --git a/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_313063.xml b/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_313063.xml deleted file mode 100644 index 0a07adad7dba543fa1968fc29dfab189bd5d5e37..0000000000000000000000000000000000000000 --- a/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_313063.xml +++ /dev/null @@ -1,222 +0,0 @@ -<?xml version="1.0" ?> -<trigger> - <lumivalues> - <lumivalues_data>1.82e27</lumivalues_data> - <lumivalues_pred>5e+27</lumivalues_pred> - <deadtime>0.005</deadtime> - <peak_mu_av>0.00129</peak_mu_av> - </lumivalues> - <bunchgroups> - <bunchgroup id="0" name="BCRVeto">3543</bunchgroup> - <bunchgroup id="1" name="Paired">10</bunchgroup> - <bunchgroup id="2" name="CalReq">70</bunchgroup> - <bunchgroup id="3" name="Empty">3178</bunchgroup> - <bunchgroup id="4" name="IsolatedUnpaired">10</bunchgroup> - <bunchgroup id="5" name="NonIsolatedUnpaired">10</bunchgroup> - <bunchgroup id="6" name="EmptyBeforeAfterPaired">99</bunchgroup> - <bunchgroup id="7" name="InTrain">0</bunchgroup> - <bunchgroup id="8" name="AbortGapNotCalReq">29</bunchgroup> - <bunchgroup id="9" name="AfterGlow">63</bunchgroup> - <bunchgroup id="10" name="ALFA">4</bunchgroup> - <bunchgroup id="11" name="EmptyBeforePaired">10</bunchgroup> - <bunchgroup id="12" name="AllWithoutCalreq">3473</bunchgroup> - <bunchgroup id="13" name="BG13">0</bunchgroup> - <bunchgroup id="14" name="BG14">0</bunchgroup> - <bunchgroup id="15" name="BG15">0</bunchgroup> - </bunchgroups> - <lb_list> - <lb id="1" lumi="0.001919" mu="0.00137" flag="bad">43</lb> - <lb id="2" lumi="0.001889" mu="0.00134" flag="bad">0</lb> - <lb id="3" lumi="0.001887" mu="0.00134">13185</lb> - <lb id="4" lumi="0.001896" mu="0.00135">13037</lb> - <lb id="5" lumi="0.001886" mu="0.00134">13141</lb> - <lb id="6" lumi="0.001892" mu="0.00135">13065</lb> - <lb id="7" lumi="0.001876" mu="0.00133">12905</lb> - <lb id="8" lumi="0.001901" mu="0.00135">13158</lb> - <lb id="9" lumi="0.001870" mu="0.00133">12962</lb> - <lb id="10" lumi="0.001880" mu="0.00134">12987</lb> - <lb id="11" lumi="0.001892" mu="0.00135">2229 </lb> - <lb id="12" lumi="0.001873" mu="0.00133">16468</lb> - <lb id="13" lumi="0.001874" mu="0.00133">16435</lb> - <lb id="14" lumi="0.001885" mu="0.00134">16466</lb> - <lb id="15" lumi="0.001878" mu="0.00134">16315</lb> - <lb id="16" lumi="0.001865" mu="0.00133">16253</lb> - <lb id="17" lumi="0.001869" mu="0.00133">16427</lb> - <lb id="18" lumi="0.001865" mu="0.00133">16509</lb> - <lb id="19" lumi="0.001852" mu="0.00132">16377</lb> - <lb id="20" lumi="0.001870" mu="0.00133">16414</lb> - <lb id="21" lumi="0.001860" mu="0.00132">16433</lb> - <lb id="22" lumi="0.001854" mu="0.00132">16649</lb> - <lb id="23" lumi="0.001844" mu="0.00131">16426</lb> - <lb id="24" lumi="0.001849" mu="0.00132">16024</lb> - <lb id="25" lumi="0.001853" mu="0.00132">16485</lb> - <lb id="26" lumi="0.001845" mu="0.00131">16033</lb> - <lb id="27" lumi="0.001845" mu="0.00131">15875</lb> - <lb id="28" lumi="0.001849" mu="0.00132">16246</lb> - <lb id="29" lumi="0.001836" mu="0.00131">16234</lb> - <lb id="30" lumi="0.001839" mu="0.00131">16072</lb> - <lb id="31" lumi="0.001842" mu="0.00131">16373</lb> - <lb id="32" lumi="0.001837" mu="0.00131">16161</lb> - <lb id="33" lumi="0.001828" mu="0.00130">16111</lb> - <lb id="34" lumi="0.001829" mu="0.00130">15697</lb> - <lb id="35" lumi="0.001827" mu="0.00130">16233</lb> - <lb id="36" lumi="0.001821" mu="0.00130">15998</lb> - <lb id="37" lumi="0.001829" mu="0.00130">15880</lb> - <lb id="38" lumi="0.001823" mu="0.00130">16101</lb> - <lb id="39" lumi="0.001822" mu="0.00130">16279</lb> - <lb id="40" lumi="0.001811" mu="0.00129">16095</lb> - <lb id="41" lumi="0.001806" mu="0.00129">15754</lb> - <lb id="42" lumi="0.001825" mu="0.00130">16109</lb> - <lb id="43" lumi="0.001811" mu="0.00129">15870</lb> - <lb id="44" lumi="0.001810" mu="0.00129">15693</lb> - <lb id="45" lumi="0.001817" mu="0.00129">15951</lb> - <lb id="46" lumi="0.001817" mu="0.00129">15798</lb> - <lb id="47" lumi="0.001808" mu="0.00129">15941</lb> - <lb id="48" lumi="0.001797" mu="0.00128">15639</lb> - <lb id="49" lumi="0.001798" mu="0.00128">15954</lb> - <lb id="50" lumi="0.001802" mu="0.00128">15677</lb> - <lb id="51" lumi="0.001799" mu="0.00128">15707</lb> - <lb id="52" lumi="0.001793" mu="0.00128">15532</lb> - <lb id="53" lumi="0.001782" mu="0.00127">15784</lb> - <lb id="54" lumi="0.001779" mu="0.00127">15514</lb> - <lb id="55" lumi="0.001775" mu="0.00126">15724</lb> - <lb id="56" lumi="0.001788" mu="0.00127">15836</lb> - <lb id="57" lumi="0.001783" mu="0.00127">15825</lb> - <lb id="58" lumi="0.001778" mu="0.00126">15744</lb> - <lb id="59" lumi="0.001782" mu="0.00127">15770</lb> - <lb id="60" lumi="0.001783" mu="0.00127">15434</lb> - <lb id="61" lumi="0.001780" mu="0.00127">15537</lb> - <lb id="62" lumi="0.001792" mu="0.00127">15661</lb> - <lb id="63" lumi="0.001765" mu="0.00126">15510</lb> - <lb id="64" lumi="0.001763" mu="0.00125">15710</lb> - <lb id="65" lumi="0.001776" mu="0.00126">15304</lb> - <lb id="66" lumi="0.001760" mu="0.00125">15411</lb> - <lb id="67" lumi="0.001766" mu="0.00126">15523</lb> - <lb id="68" lumi="0.001743" mu="0.00124">15147</lb> - <lb id="69" lumi="0.001758" mu="0.00125">15181</lb> - <lb id="70" lumi="0.001747" mu="0.00124">15269</lb> - <lb id="71" lumi="0.001749" mu="0.00124">15118</lb> - <lb id="72" lumi="0.001768" mu="0.00126">15585</lb> - <lb id="73" lumi="0.001734" mu="0.00123">15451</lb> - <lb id="74" lumi="0.001745" mu="0.00124">15349</lb> - <lb id="75" lumi="0.001755" mu="0.00125">15249</lb> - <lb id="76" lumi="0.001750" mu="0.00125">15176</lb> - <lb id="77" lumi="0.001750" mu="0.00124">15545</lb> - <lb id="78" lumi="0.001749" mu="0.00124">15486</lb> - <lb id="79" lumi="0.001737" mu="0.00124">7433 </lb> - </lb_list> - <filters> - <filter> - <filter_name>HLT_noalg_eb_L1ZDC_A</filter_name> - <lv1_filter>L1_ZDC_A</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1ZDC_C</filter_name> - <lv1_filter>L1_ZDC_C</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1MBTS_2</filter_name> - <lv1_filter>L1_MBTS_2</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1TE5</filter_name> - <lv1_filter>L1_TE5</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1TE50</filter_name> - <lv1_filter>L1_TE50</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1TE120</filter_name> - <lv1_filter>L1_TE120</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1TE160</filter_name> - <lv1_filter>L1_TE160</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1TE10.0ETA24</filter_name> - <lv1_filter>L1_TE10.0ETA24</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1TE30.0ETA24</filter_name> - <lv1_filter>L1_TE30.0ETA24</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1MU4</filter_name> - <lv1_filter>L1_MU4</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1MU10</filter_name> - <lv1_filter>L1_MU10</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1EM5</filter_name> - <lv1_filter>L1_EM5</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1EM10</filter_name> - <lv1_filter>L1_EM10</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1J10</filter_name> - <lv1_filter>L1_J10</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1J30</filter_name> - <lv1_filter>L1_J30</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1J5_VZDC_C</filter_name> - <lv1_filter>L1_J5_VZDC_C</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1J5_VZDC_A</filter_name> - <lv1_filter>L1_J5_VZDC_A</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1MU4_VZDC_C</filter_name> - <lv1_filter>L1_MU4_VZDC_C</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1MU4_VZDC_A</filter_name> - <lv1_filter>L1_MU4_VZDC_A</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1TE5_VZDC_A</filter_name> - <lv1_filter>L1_TE5_VZDC_A</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1TE5_VZDC_C</filter_name> - <lv1_filter>L1_TE5_VZDC_C</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1MBTS_2_A_VZDC_C</filter_name> - <lv1_filter>L1_MBTS_2_A_VZDC_C</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1MBTS_2_C_VZDC_A</filter_name> - <lv1_filter>L1_MBTS_2_C_VZDC_A</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1ZDC_A_VZDC_C</filter_name> - <lv1_filter>L1_ZDC_A_VZDC_C</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1ZDC_C_VZDC_A</filter_name> - <lv1_filter>L1_ZDC_C_VZDC_A</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1EM3_VZDC_C</filter_name> - <lv1_filter>L1_EM3_VZDC_C</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1EM3_VZDC_A</filter_name> - <lv1_filter>L1_EM3_VZDC_A</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1RD1_FILLED</filter_name> - <lv1_filter>L1_RD1_FILLED</lv1_filter> - </filter> - </filters> -</trigger> diff --git a/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_327265.xml b/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_327265.xml deleted file mode 100644 index eff96ceaa8052a718da618ef2e97c03648843776..0000000000000000000000000000000000000000 --- a/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_327265.xml +++ /dev/null @@ -1,271 +0,0 @@ -<?xml version="1.0" ?> -<trigger> - <lumivalues> - <lumivalues_data>1e+34</lumivalues_data> - <lumivalues_pred>1e34</lumivalues_pred> - <deadtime>0.063</deadtime> - <peak_mu_av>41.79</peak_mu_av> - </lumivalues> - <bunchgroups> - <bunchgroup id="0" name="BCRVeto">3543</bunchgroup> - <bunchgroup id="1" name="Paired">1729</bunchgroup> - <bunchgroup id="2" name="CalReq">70</bunchgroup> - <bunchgroup id="3" name="Empty">1388</bunchgroup> - <bunchgroup id="4" name="IsolatedUnpaired">10</bunchgroup> - <bunchgroup id="5" name="NonIsolatedUnpaired">14</bunchgroup> - <bunchgroup id="6" name="EmptyBeforeAfterPaired">322</bunchgroup> - <bunchgroup id="7" name="InTrain">1512</bunchgroup> - <bunchgroup id="8" name="AbortGapNotCalReq">29</bunchgroup> - <bunchgroup id="9" name="AfterGlow">8</bunchgroup> - <bunchgroup id="10" name="ALFA">4</bunchgroup> - <bunchgroup id="11" name="EmptyBeforePaired">37</bunchgroup> - <bunchgroup id="12" name="AllWithoutCalreq">3473</bunchgroup> - <bunchgroup id="13" name="BG13">0</bunchgroup> - <bunchgroup id="14" name="BG14">0</bunchgroup> - <bunchgroup id="15" name="BG15">0</bunchgroup> - </bunchgroups> - <lb_list> - <lb id="80" lumi="11000" mu="45.3">5394</lb> - <lb id="81" lumi="10980" mu="45.2">18508</lb> - <lb id="82" lumi="10960" mu="45.1">18540</lb> - <lb id="83" lumi="10920" mu="44.9">18023</lb> - <lb id="84" lumi="10890" mu="44.8">14684</lb> - <lb id="85" lumi="10870" mu="44.7">18333</lb> - <lb id="86" lumi="10850" mu="44.6">13636</lb> - <lb id="87" lumi="10860" mu="44.7">18113</lb> - <lb id="88" lumi="10800" mu="44.4">13558</lb> - <lb id="89" lumi="10820" mu="44.5">18244</lb> - <lb id="90" lumi="10790" mu="44.4">18127</lb> - <lb id="91" lumi="10780" mu="44.4">17255</lb> - <lb id="92" lumi="10730" mu="44.1">17876</lb> - <lb id="93" lumi="10700" mu="44">17724</lb> - <lb id="94" lumi="10670" mu="43.9">18233</lb> - <lb id="95" lumi="10660" mu="43.8">8267</lb> - <lb id="96" lumi="10650" mu="43.8">2768</lb> - <lb id="97" lumi="10640" mu="43.8">18419</lb> - <lb id="98" lumi="10610" mu="43.7">18477</lb> - <lb id="99" lumi="10590" mu="43.6">18702</lb> - <lb id="100" lumi="10590" mu="43.6">4735</lb> - <lb id="101" lumi="10570" mu="43.5">18433</lb> - <lb id="102" lumi="10540" mu="43.4">18621</lb> - <lb id="103" lumi="10520" mu="43.3">18436</lb> - <lb id="104" lumi="10490" mu="43.2">17503</lb> - <lb id="105" lumi="10480" mu="43.1">5948</lb> - <lb id="106" lumi="10460" mu="43">18736</lb> - <lb id="107" lumi="10430" mu="42.9">19140</lb> - <lb id="108" lumi="10410" mu="42.8">18903</lb> - <lb id="109" lumi="10380" mu="42.7">19053</lb> - <lb id="110" lumi="10350" mu="42.6">18872</lb> - <lb id="111" lumi="10330" mu="42.5">18869</lb> - <lb id="112" lumi="10320" mu="42.5">18995</lb> - <lb id="113" lumi="10310" mu="42.4">2033</lb> - <lb id="114" lumi="10310" mu="42.4">3205</lb> - <lb id="115" lumi="10300" mu="42.4">11806</lb> - <lb id="116" lumi="10280" mu="42.3">18845</lb> - <lb id="117" lumi="10270" mu="42.3">18880</lb> - <lb id="118" lumi="10260" mu="42.2">18576</lb> - <lb id="119" lumi="10240" mu="42.1">18456</lb> - <lb id="120" lumi="10220" mu="42.1">18408</lb> - <lb id="121" lumi="10210" mu="42">18679</lb> - <lb id="122" lumi="10180" mu="41.9">18481</lb> - <lb id="123" lumi="10160" mu="41.8">18277</lb> - <lb id="124" lumi="10140" mu="41.7">18494</lb> - <lb id="125" lumi="10110" mu="41.6">18412</lb> - <lb id="126" lumi="10090" mu="41.5">18615</lb> - <lb id="127" lumi="10070" mu="41.4">18093</lb> - <lb id="128" lumi="10040" mu="41.3">17882</lb> - <lb id="129" lumi="10020" mu="41.2">15411</lb> - <lb id="130" lumi="10000" mu="41.2">15790</lb> - <lb id="131" lumi="9978" mu="41.1">18263</lb> - <lb id="132" lumi="9962" mu="41">17958</lb> - <lb id="133" lumi="9934" mu="40.9">18155</lb> - <lb id="134" lumi="9918" mu="40.8">9007</lb> - <lb id="135" lumi="9918" mu="40.8">8534</lb> - <lb id="136" lumi="9900" mu="40.7">19410</lb> - <lb id="137" lumi="9893" mu="40.7">3340</lb> - <lb id="138" lumi="9885" mu="40.7">6510</lb> - <lb id="139" lumi="9880" mu="40.7">17975</lb> - <lb id="140" lumi="9863" mu="40.6">17621</lb> - <lb id="141" lumi="9838" mu="40.5">17870</lb> - <lb id="142" lumi="9837" mu="40.5">18070</lb> - <lb id="143" lumi="9812" mu="40.4">18070</lb> - <lb id="144" lumi="9802" mu="40.3">17795</lb> - <lb id="145" lumi="9779" mu="40.2">17636</lb> - <lb id="146" lumi="9759" mu="40.2">17806</lb> - <lb id="147" lumi="9742" mu="40.1">17679</lb> - <lb id="148" lumi="9741" mu="40.1">17340</lb> - <lb id="149" lumi="9728" mu="40">17673</lb> - <lb id="150" lumi="9714" mu="40">17613</lb> - <lb id="151" lumi="9699" mu="39.9">17652</lb> - <lb id="152" lumi="9683" mu="39.8">17487</lb> - <lb id="153" lumi="9663" mu="39.8">16992</lb> - <lb id="154" lumi="9660" mu="39.7">11598</lb> - <lb id="155" lumi="9633" mu="39.6">17323</lb> - <lb id="156" lumi="9614" mu="39.6">16967</lb> - <lb id="157" lumi="9607" mu="39.5">17357</lb> - <lb id="158" lumi="9600" mu="39.5">17374</lb> - <lb id="159" lumi="9577" mu="39.4">17454</lb> - <lb id="160" lumi="9473" mu="39">17511</lb> - <lb id="161" lumi="9450" mu="38.9">17222</lb> - <lb id="162" lumi="9409" mu="38.7">17175</lb> - <lb id="163" lumi="9403" mu="38.7">17212</lb> - <lb id="164" lumi="9373" mu="38.6">10661</lb> - <lb id="165" lumi="9391" mu="38.6">16919</lb> - <lb id="166" lumi="9361" mu="38.5">16953</lb> - <lb id="167" lumi="9353" mu="38.5">2894</lb> - </lb_list> - <filters> - <filter> - <eb_hlt_chains> - <eb_hlt_name>HLT_eb_low_L1RD2_FILLED</eb_hlt_name> - <lv1_ebtrigs>L1_2EM7</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM10VH</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM12_2EM3</lv1_ebtrigs> - <lv1_ebtrigs>L1_J20.31ETA49</lv1_ebtrigs> - <lv1_ebtrigs>L1_J30</lv1_ebtrigs> - <lv1_ebtrigs>L1_J30.0ETA49_2J20.0ETA49</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU10</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU4_J12</lv1_ebtrigs> - <lv1_ebtrigs>L1_TAU20</lv1_ebtrigs> - <lv1_ebtrigs>L1_ZB</lv1_ebtrigs> - </eb_hlt_chains> - <eb_hlt_chains> - <eb_hlt_name>HLT_eb_high_L1RD2_FILLED</eb_hlt_name> - <lv1_ebtrigs>L1_2EM10VH</lv1_ebtrigs> - <lv1_ebtrigs>L1_2EM15</lv1_ebtrigs> - <lv1_ebtrigs>L1_2MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_2MU4-B</lv1_ebtrigs> - <lv1_ebtrigs>L1_2MU4-BO</lv1_ebtrigs> - <lv1_ebtrigs>L1_2MU6</lv1_ebtrigs> - <lv1_ebtrigs>L1_2MU6-B</lv1_ebtrigs> - <lv1_ebtrigs>L1_2MU6-BO</lv1_ebtrigs> - <lv1_ebtrigs>L1_3EM3_J40_XE50_DPHI-J20s2XE50</lv1_ebtrigs> - <lv1_ebtrigs>L1_3J15</lv1_ebtrigs> - <lv1_ebtrigs>L1_BPH-2M9-2MU6_BPH-2DR15-2MU6</lv1_ebtrigs> - <lv1_ebtrigs>L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_BPH-8M15-2MU6_BPH-0DR22-2MU6</lv1_ebtrigs> - <lv1_ebtrigs>L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_BTAG-MU4J15</lv1_ebtrigs> - <lv1_ebtrigs>L1_DR-TAU20ITAU12I</lv1_ebtrigs> - <lv1_ebtrigs>L1_DY-BOX-2MU6</lv1_ebtrigs> - <lv1_ebtrigs>L1_DY-DR-2MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM15I_MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM15VHI_2TAU12IM_J25_3J12</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM15VH_3EM7</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM15_XS30</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM18VHI</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM20VH</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM7_MU10</lv1_ebtrigs> - <lv1_ebtrigs>L1_HT190-J15.ETA21</lv1_ebtrigs> - <lv1_ebtrigs>L1_J4-MATCH</lv1_ebtrigs> - <lv1_ebtrigs>L1_J40.0ETA25_2J15.31ETA49</lv1_ebtrigs> - <lv1_ebtrigs>L1_J50</lv1_ebtrigs> - <lv1_ebtrigs>L1_LFV-MU6</lv1_ebtrigs> - <lv1_ebtrigs>L1_MJJ-400</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU10_2MU6</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU10_TAU12IM</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU10_TAU12IM_J25_2J12</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU6_2MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU6_J20</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU6_J30.0ETA49_2J20.0ETA49</lv1_ebtrigs> - <lv1_ebtrigs>L1_TAU20IM_2TAU12IM_J25_2J20_3J12</lv1_ebtrigs> - <lv1_ebtrigs>L1_TAU20IM_2TAU12IM_XE35</lv1_ebtrigs> - <lv1_ebtrigs>L1_TAU20_2TAU12</lv1_ebtrigs> - <lv1_ebtrigs>L1_TAU20_2TAU12_XE35</lv1_ebtrigs> - <lv1_ebtrigs>L1_TAU40</lv1_ebtrigs> - <lv1_ebtrigs>L1_XE35</lv1_ebtrigs> - </eb_hlt_chains> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1PhysicsLow_noPS</filter_name> - - <lv1_filter>L1_2EM20VH</lv1_filter> - <lv1_filter>L1_2EM8VH_MU10</lv1_filter> - <lv1_filter>L1_2J15_XE55</lv1_filter> - <lv1_filter>L1_2MU10</lv1_filter> - <lv1_filter>L1_2MU4_J20_XE30_DPHI-J20s2XE30</lv1_filter> - <lv1_filter>L1_2MU6_3MU4</lv1_filter> - <lv1_filter>L1_3J50</lv1_filter> - <lv1_filter>L1_3MU4</lv1_filter> - <lv1_filter>L1_4J15.0ETA25</lv1_filter> - <lv1_filter>L1_4J20</lv1_filter> - <lv1_filter>L1_5J15.0ETA25</lv1_filter> - <lv1_filter>L1_DR-EM15TAU12I-J25</lv1_filter> - <lv1_filter>L1_DR-MU10TAU12I_TAU12I-J25</lv1_filter> - <lv1_filter>L1_DR-TAU20ITAU12I-J25</lv1_filter> - <lv1_filter>L1_EM15VHI_2TAU12IM_XE35</lv1_filter> - <lv1_filter>L1_EM15VHI_TAU40_2TAU15</lv1_filter> - <lv1_filter>L1_EM15VH_MU10</lv1_filter> - <lv1_filter>L1_EM20VH_3EM10VH</lv1_filter> - <lv1_filter>L1_EM24VHI</lv1_filter> - <lv1_filter>L1_HT190-J15s5.ETA21</lv1_filter> - <lv1_filter>L1_J100</lv1_filter> - <lv1_filter>L1_J40.0ETA25_2J25_J20.31ETA49</lv1_filter> - <lv1_filter>L1_J40_XE50_DPHI-J20s2XE50</lv1_filter> - <lv1_filter>L1_J75.31ETA49</lv1_filter> - <lv1_filter>L1_LLP-RO</lv1_filter> - <lv1_filter>L1_MU10_2J20</lv1_filter> - <lv1_filter>L1_MU10_TAU12IM_XE35</lv1_filter> - <lv1_filter>L1_MU11_2MU6</lv1_filter> - <lv1_filter>L1_MU20</lv1_filter> - <lv1_filter>L1_MU4_J30_XE40_DPHI-J20s2XE30</lv1_filter> - <lv1_filter>L1_MU4_J50_XE50_DPHI-J20s2XE30</lv1_filter> - <lv1_filter>L1_MU6_3MU4</lv1_filter> - <lv1_filter>L1_TAU100</lv1_filter> - <lv1_filter>L1_TAU20IM_2J20_XE45</lv1_filter> - <lv1_filter>L1_TAU60_DR-TAU20ITAU12I</lv1_filter> - <lv1_filter>L1_XE60</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1PhysicsHigh_noPS</filter_name> - <lv1_filter>L1_6J15</lv1_filter> - <lv1_filter>L1_J100.31ETA49</lv1_filter> - <lv1_filter>L1_J400</lv1_filter> - <lv1_filter>L1_XE80</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1EMPTY_noPS</filter_name> - <lv1_filter>L1_J12_EMPTY</lv1_filter> - <lv1_filter>L1_MU11_EMPTY</lv1_filter> - <lv1_filter>L1_TAU8_EMPTY</lv1_filter> - <lv1_filter>L1_EM7_EMPTY</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1FIRSTEMPTY_noPS</filter_name> - <lv1_filter>L1_J12_FIRSTEMPTY</lv1_filter> - <lv1_filter>L1_MU20_FIRSTEMPTY</lv1_filter> - <lv1_filter>L1_TAU8_FIRSTEMPTY</lv1_filter> - <lv1_filter>L1_EM7_FIRSTEMPTY</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1UNPAIRED_ISO_noPS</filter_name> - <lv1_filter>L1_BCM_AC_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_BCM_CA_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_BCM_Wide_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_J12_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_J15.31ETA49_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_MU4_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_EM7_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_TAU8_UNPAIRED_ISO</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1UNPAIRED_NONISO_noPS</filter_name> - <lv1_filter>L1_BCM_AC_UNPAIRED_NONISO</lv1_filter> - <lv1_filter>L1_BCM_CA_UNPAIRED_NONISO</lv1_filter> - <lv1_filter>L1_BCM_Wide_UNPAIRED_NONISO</lv1_filter> - <lv1_filter>L1_J12_UNPAIRED_NONISO</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1ABORTGAPNOTCALIB_noPS</filter_name> - <lv1_filter>L1_J12_ABORTGAPNOTCALIB</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1RD3_FILLED</filter_name> - <lv1_filter>L1_RD3_FILLED</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1RD3_EMPTY</filter_name> - <lv1_filter>L1_RD3_EMPTY</lv1_filter> - </filter> - </filters> -</trigger> diff --git a/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_334443.xml b/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_334443.xml deleted file mode 100644 index 5f1323cc04a14afc6f3d6dfb3857ff1ce2aeb82e..0000000000000000000000000000000000000000 --- a/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_334443.xml +++ /dev/null @@ -1,294 +0,0 @@ -<?xml version="1.0" ?> -<trigger> - <lumivalues> - <lumivalues_data>0.8376e+34</lumivalues_data> - <lumivalues_pred>2e34</lumivalues_pred> - <deadtime>0.051</deadtime> - <peak_mu_av>42.2</peak_mu_av> - </lumivalues> - <bunchgroups> - <bunchgroup id="0" name="BCRVeto">3543</bunchgroup> - <bunchgroup id="1" name="Paired">1538</bunchgroup> - <bunchgroup id="2" name="CalReq">70</bunchgroup> - <bunchgroup id="3" name="Empty">1594</bunchgroup> - <bunchgroup id="4" name="IsolatedUnpaired">10</bunchgroup> - <bunchgroup id="5" name="NonIsolatedUnpaired">14</bunchgroup> - <bunchgroup id="6" name="EmptyBeforeAfterPaired">308</bunchgroup> - <bunchgroup id="7" name="InTrain">1344</bunchgroup> - <bunchgroup id="8" name="AbortGapNotCalReq">29</bunchgroup> - <bunchgroup id="9" name="AfterGlow">0</bunchgroup> - <bunchgroup id="10" name="ALFA">4</bunchgroup> - <bunchgroup id="11" name="EmptyBeforePaired">34</bunchgroup> - <bunchgroup id="12" name="AllWithoutCalreq">3473</bunchgroup> - <bunchgroup id="13" name="BG13">0</bunchgroup> - <bunchgroup id="14" name="BG14">0</bunchgroup> - <bunchgroup id="15" name="BG15">0</bunchgroup> - </bunchgroups> - <lb_list> - <lb id="84" lumi="8771" mu="40.6">15416</lb> - <lb id="85" lumi="8696" mu="40.2">18313</lb> - <lb id="86" lumi="8729" mu="40.4">18293</lb> - <lb id="87" lumi="8710" mu="40.3">11424</lb> - <lb id="88" lumi="8695" mu="40.2">18477</lb> - <lb id="89" lumi="8679" mu="40.1">17461</lb> - <lb id="90" lumi="8666" mu="40.1">16657</lb> - <lb id="91" lumi="8643" mu="40">18211</lb> - <lb id="92" lumi="8625" mu="39.9">13543</lb> - <lb id="93" lumi="8605" mu="39.8">18159</lb> - <lb id="94" lumi="8584" mu="39.7">18208</lb> - <lb id="95" lumi="8565" mu="39.6">17723</lb> - <lb id="96" lumi="8544" mu="39.5">18144</lb> - <lb id="97" lumi="8533" mu="39.5">18106</lb> - <lb id="98" lumi="8512" mu="39.4">17996</lb> - <lb id="99" lumi="8502" mu="39.3">9090</lb> - <lb id="100" lumi="8486" mu="39.3">17969</lb> - <lb id="101" lumi="8266" mu="38.2">17625</lb> - <lb id="102" lumi="8012" mu="37.1">17300</lb> - <lb id="103" lumi="8487" mu="39.3">17979</lb> - <lb id="104" lumi="8654" mu="40">18456</lb> - <lb id="105" lumi="8640" mu="40">18081</lb> - <lb id="106" lumi="8629" mu="39.9">18215</lb> - <lb id="107" lumi="8618" mu="39.9">18090</lb> - <lb id="108" lumi="8594" mu="39.8">18115</lb> - <lb id="109" lumi="8581" mu="39.7">18423</lb> - <lb id="110" lumi="8566" mu="39.6">17919</lb> - <lb id="111" lumi="8556" mu="39.6">17987</lb> - <lb id="112" lumi="8543" mu="39.5">17978</lb> - <lb id="113" lumi="8532" mu="39.5">17863</lb> - <lb id="114" lumi="8519" mu="39.4">18171</lb> - <lb id="115" lumi="8508" mu="39.4">17968</lb> - <lb id="116" lumi="8496" mu="39.3">17879</lb> - <lb id="117" lumi="8492" mu="39.3">5566</lb> - <lb id="118" lumi="8483" mu="39.2">17442</lb> - <lb id="119" lumi="8470" mu="39.2">17861</lb> - <lb id="120" lumi="8457" mu="39.1">17815</lb> - <lb id="121" lumi="8442" mu="39.1">17771</lb> - <lb id="122" lumi="8433" mu="39">17922</lb> - <lb id="123" lumi="8419" mu="38.9">17805</lb> - <lb id="124" lumi="8408" mu="38.9">17831</lb> - <lb id="125" lumi="8395" mu="38.8">17809</lb> - <lb id="126" lumi="8384" mu="38.8">17734</lb> - <lb id="127" lumi="8372" mu="38.7">13409</lb> - <lb id="128" lumi="8365" mu="38.7">0</lb> - <lb id="129" lumi="8354" mu="38.6">16698</lb> - <lb id="130" lumi="8348" mu="38.6">0</lb> - <lb id="131" lumi="8342" mu="38.6">16851</lb> - <lb id="132" lumi="8329" mu="38.5">17498</lb> - <lb id="133" lumi="8319" mu="38.5">17256</lb> - <lb id="134" lumi="8306" mu="38.4">17451</lb> - <lb id="135" lumi="8295" mu="38.4">17764</lb> - <lb id="136" lumi="8281" mu="38.3">17553</lb> - <lb id="137" lumi="8267" mu="38.2">17621</lb> - <lb id="138" lumi="8254" mu="38.2">17479</lb> - <lb id="139" lumi="8240" mu="38.1">17588</lb> - <lb id="140" lumi="8227" mu="38.1">17511</lb> - <lb id="141" lumi="8218" mu="38">17431</lb> - <lb id="142" lumi="8209" mu="38">17460</lb> - <lb id="143" lumi="8198" mu="37.9">17592</lb> - <lb id="144" lumi="8187" mu="37.9">17519</lb> - <lb id="145" lumi="8173" mu="37.8">9717</lb> - <lb id="146" lumi="8170" mu="37.8">17447</lb> - <lb id="147" lumi="8152" mu="37.7">17255</lb> - <lb id="148" lumi="8144" mu="37.7">17331</lb> - <lb id="149" lumi="8135" mu="37.6">17332</lb> - <lb id="150" lumi="8124" mu="37.6">15825</lb> - <lb id="151" lumi="8111" mu="37.5">17248</lb> - <lb id="152" lumi="8104" mu="37.5">17206</lb> - <lb id="153" lumi="8089" mu="37.4">15822</lb> - <lb id="154" lumi="8084" mu="37.4">17222</lb> - <lb id="155" lumi="8074" mu="37.3">17282</lb> - <lb id="156" lumi="8058" mu="37.3">17116</lb> - <lb id="157" lumi="8045" mu="37.2">15309</lb> - <lb id="158" lumi="8030" mu="37.1">17097</lb> - <lb id="159" lumi="8017" mu="37.1">17000</lb> - <lb id="160" lumi="8004" mu="37">16908</lb> - <lb id="161" lumi="7998" mu="37">17121</lb> - <lb id="162" lumi="7983" mu="36.9">15403</lb> - </lb_list> - <filters> - <filter> - <eb_hlt_chains> - <eb_hlt_name>HLT_eb_low_L1RD2_FILLED</eb_hlt_name> - <lv1_ebtrigs>L1_2EM7</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM10VH</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM12_2EM3</lv1_ebtrigs> - <lv1_ebtrigs>L1_J20.31ETA49</lv1_ebtrigs> - <lv1_ebtrigs>L1_J30</lv1_ebtrigs> - <lv1_ebtrigs>L1_J30.0ETA49_2J20.0ETA49</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU10</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU4_J12</lv1_ebtrigs> - <lv1_ebtrigs>L1_TAU20</lv1_ebtrigs> - <lv1_ebtrigs>L1_ZB</lv1_ebtrigs> - </eb_hlt_chains> - <eb_hlt_chains> - <eb_hlt_name>HLT_eb_high_L1RD2_FILLED</eb_hlt_name> - <lv1_ebtrigs>L1_2EM10VH</lv1_ebtrigs> - <lv1_ebtrigs>L1_2EM15</lv1_ebtrigs> - <lv1_ebtrigs>L1_2MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_2MU4-B</lv1_ebtrigs> - <lv1_ebtrigs>L1_2MU4-BO</lv1_ebtrigs> - <lv1_ebtrigs>L1_2MU6</lv1_ebtrigs> - <lv1_ebtrigs>L1_2MU6-B</lv1_ebtrigs> - <lv1_ebtrigs>L1_2MU6-BO</lv1_ebtrigs> - <lv1_ebtrigs>L1_3EM3_J40_XE50_DPHI-J20s2XE50</lv1_ebtrigs> - <lv1_ebtrigs>L1_3J15</lv1_ebtrigs> - <lv1_ebtrigs>L1_BPH-2M9-2MU6_BPH-2DR15-2MU6</lv1_ebtrigs> - <lv1_ebtrigs>L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_BPH-8M15-2MU6_BPH-0DR22-2MU6</lv1_ebtrigs> - <lv1_ebtrigs>L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_BTAG-MU4J15</lv1_ebtrigs> - <lv1_ebtrigs>L1_DR-TAU20ITAU12I</lv1_ebtrigs> - <lv1_ebtrigs>L1_DY-BOX-2MU6</lv1_ebtrigs> - <lv1_ebtrigs>L1_DY-DR-2MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM15I_MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM15VHI_2TAU12IM_J25_3J12</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM15VH_3EM7</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM15_XS30</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM18VHI</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM20VH</lv1_ebtrigs> - <lv1_ebtrigs>L1_EM7_MU10</lv1_ebtrigs> - <lv1_ebtrigs>L1_HT190-J15.ETA21</lv1_ebtrigs> - <lv1_ebtrigs>L1_J4-MATCH</lv1_ebtrigs> - <lv1_ebtrigs>L1_J40.0ETA25_2J15.31ETA49</lv1_ebtrigs> - <lv1_ebtrigs>L1_J50</lv1_ebtrigs> - <lv1_ebtrigs>L1_LFV-MU6</lv1_ebtrigs> - <lv1_ebtrigs>L1_MJJ-400</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU10_2MU6</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU10_TAU12IM</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU10_TAU12IM_J25_2J12</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU6_2MU4</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU6_J20</lv1_ebtrigs> - <lv1_ebtrigs>L1_MU6_J30.0ETA49_2J20.0ETA49</lv1_ebtrigs> - <lv1_ebtrigs>L1_TAU20IM_2TAU12IM_J25_2J20_3J12</lv1_ebtrigs> - <lv1_ebtrigs>L1_TAU20IM_2TAU12IM_XE35</lv1_ebtrigs> - <lv1_ebtrigs>L1_TAU20_2TAU12</lv1_ebtrigs> - <lv1_ebtrigs>L1_TAU20_2TAU12_XE35</lv1_ebtrigs> - <lv1_ebtrigs>L1_TAU40</lv1_ebtrigs> - <lv1_ebtrigs>L1_XE35</lv1_ebtrigs> - </eb_hlt_chains> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1PhysicsLow_noPS</filter_name> - <lv1_filter>L1_2EM15VHI</lv1_filter> - <lv1_filter>L1_2EM20VH</lv1_filter> - <lv1_filter>L1_2EM8VH_MU10</lv1_filter> - <lv1_filter>L1_2J15_XE55</lv1_filter> - <lv1_filter>L1_2J50_XE40</lv1_filter> - <lv1_filter>L1_2MU10</lv1_filter> - <lv1_filter>L1_2MU4_J20_XE30_DPHI-J20s2XE30</lv1_filter> - <lv1_filter>L1_2MU4_J40_XE50</lv1_filter> - <lv1_filter>L1_2MU6_3MU4</lv1_filter> - <lv1_filter>L1_3J15.0ETA25_XE40</lv1_filter> - <lv1_filter>L1_3J35.0ETA23</lv1_filter> - <lv1_filter>L1_3J50</lv1_filter> - <lv1_filter>L1_3MU4</lv1_filter> - <lv1_filter>L1_4J15.0ETA25</lv1_filter> - <lv1_filter>L1_4MU4</lv1_filter> - <lv1_filter>L1_4J20</lv1_filter> - <lv1_filter>L1_5J15.0ETA25</lv1_filter> - <lv1_filter>L1_DR-EM15TAU12I-J25</lv1_filter> - <lv1_filter>L1_EM15VHI_2TAU12IM_4J12</lv1_filter> - <lv1_filter>L1_DR-MU10TAU12I_TAU12I-J25</lv1_filter> - <lv1_filter>L1_DR-TAU20ITAU12I-J25</lv1_filter> - <lv1_filter>L1_EM15VHI_2TAU12IM_XE35</lv1_filter> - <lv1_filter>L1_EM15VHI_TAU40_2TAU15</lv1_filter> - <lv1_filter>L1_EM15VH_MU10</lv1_filter> - <lv1_filter>L1_EM18VHI_3J20</lv1_filter> - <lv1_filter>L1_EM18VHI_MJJ-300</lv1_filter> - <lv1_filter>L1_EM20VHI_TAU20IM_2TAU20_J25_3J20</lv1_filter> - <lv1_filter>L1_EM20VH_3EM10VH</lv1_filter> - <lv1_filter>L1_EM22VHI</lv1_filter> - <lv1_filter>L1_EM22VHIM</lv1_filter> - <lv1_filter>L1_EM24VHI</lv1_filter> - <lv1_filter>L1_EM7_MU20</lv1_filter> - <lv1_filter>L1_EM8VH_MU20</lv1_filter> - <lv1_filter>L1_HT150-J20s5.ETA31_MJJ-400-CF</lv1_filter> - <lv1_filter>L1_HT190-J15s5.ETA21</lv1_filter> - <lv1_filter>L1_J100</lv1_filter> - <lv1_filter>L1_J25.0ETA23_2J15.31ETA49</lv1_filter> - <lv1_filter>L1_J40.0ETA25_2J25_J20.31ETA49</lv1_filter> - <lv1_filter>L1_J40_XE50_DPHI-J20s2XE50</lv1_filter> - <lv1_filter>L1_J40_XE60</lv1_filter> - <lv1_filter>L1_J75.31ETA49</lv1_filter> - <lv1_filter>L1_J85_3J30</lv1_filter> - <lv1_filter>L1_LATE-MU10_J50</lv1_filter> - <lv1_filter>L1_LATE-MU10_XE40</lv1_filter> - <lv1_filter>L1_LATE-MU10_XE50</lv1_filter> - <lv1_filter>L1_LLP-NOMATCH</lv1_filter> - <lv1_filter>L1_LLP-RO</lv1_filter> - <lv1_filter>L1_MU10_2J15_J20</lv1_filter> - <lv1_filter>L1_MU10_2J20</lv1_filter> - <lv1_filter>L1_MU10_TAU12IM_3J12</lv1_filter> - <lv1_filter>L1_MU10_TAU12IM_XE35</lv1_filter> - <lv1_filter>L1_MU11_2MU6</lv1_filter> - <lv1_filter>L1_MU20</lv1_filter> - <lv1_filter>L1_MU20_J40</lv1_filter> - <lv1_filter>L1_MU20_XE30</lv1_filter> - <lv1_filter>L1_MU4_J30_XE40_DPHI-J20s2XE30</lv1_filter> - <lv1_filter>L1_MU4_XE60</lv1_filter> - <lv1_filter>L1_MU4_J50_XE50_DPHI-J20s2XE30</lv1_filter> - <lv1_filter>L1_MU6_3MU4</lv1_filter> - <lv1_filter>L1_MU6_J75</lv1_filter> - <lv1_filter>L1_TAU100</lv1_filter> - <lv1_filter>L1_TAU20IM_2TAU12IM_4J12</lv1_filter> - <lv1_filter>L1_TAU40_2TAU12IM_XE40</lv1_filter> - <lv1_filter>L1_TAU60_2TAU40</lv1_filter> - <lv1_filter>L1_TAU20IM_2J20_XE45</lv1_filter> - <lv1_filter>L1_TAU60_DR-TAU20ITAU12I</lv1_filter> - <lv1_filter>L1_XE55</lv1_filter> - <lv1_filter>L1_XE60</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1PhysicsHigh_noPS</filter_name> - <lv1_filter>L1_6J15</lv1_filter> - <lv1_filter>L1_J100.31ETA49</lv1_filter> - <lv1_filter>L1_J400</lv1_filter> - <lv1_filter>L1_XE80</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1EMPTY_noPS</filter_name> - <lv1_filter>L1_J12_EMPTY</lv1_filter> - <lv1_filter>L1_MU11_EMPTY</lv1_filter> - <lv1_filter>L1_TAU8_EMPTY</lv1_filter> - <lv1_filter>L1_EM7_EMPTY</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1FIRSTEMPTY_noPS</filter_name> - <lv1_filter>L1_J12_FIRSTEMPTY</lv1_filter> - <lv1_filter>L1_MU20_FIRSTEMPTY</lv1_filter> - <lv1_filter>L1_TAU8_FIRSTEMPTY</lv1_filter> - <lv1_filter>L1_EM7_FIRSTEMPTY</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1UNPAIRED_ISO_noPS</filter_name> - <lv1_filter>L1_BCM_AC_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_BCM_CA_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_BCM_Wide_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_J12_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_J15.31ETA49_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_MU4_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_EM7_UNPAIRED_ISO</lv1_filter> - <lv1_filter>L1_TAU8_UNPAIRED_ISO</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1UNPAIRED_NONISO_noPS</filter_name> - <lv1_filter>L1_BCM_AC_UNPAIRED_NONISO</lv1_filter> - <lv1_filter>L1_BCM_CA_UNPAIRED_NONISO</lv1_filter> - <lv1_filter>L1_BCM_Wide_UNPAIRED_NONISO</lv1_filter> - <lv1_filter>L1_J12_UNPAIRED_NONISO</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1ABORTGAPNOTCALIB_noPS</filter_name> - <lv1_filter>L1_J12_ABORTGAPNOTCALIB</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1RD3_FILLED</filter_name> - <lv1_filter>L1_RD3_FILLED</lv1_filter> - </filter> - <filter> - <filter_name>HLT_noalg_eb_L1RD3_EMPTY</filter_name> - <lv1_filter>L1_RD3_EMPTY</lv1_filter> - </filter> - </filters> -</trigger> - diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/share/TrigEventAthenaPool_16.0.3.3_test.py b/Trigger/TrigEvent/TrigEventAthenaPool/share/TrigEventAthenaPool_16.0.3.3_test.py index e39ba7e125683b177fa8135644df20cdb0c63141..1a0b7c540e75d53d4f388cf9a011d6d98b3f73e0 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/share/TrigEventAthenaPool_16.0.3.3_test.py +++ b/Trigger/TrigEvent/TrigEventAthenaPool/share/TrigEventAthenaPool_16.0.3.3_test.py @@ -164,7 +164,3 @@ from AthenaCommon.DetFlags import DetFlags DetFlags.detdescr.Calo_setOn() include ('AthenaPoolUtilities/TPCnvTest.py') - -from TileConditions.TileInfoConfigurator import TileInfoConfigurator -tileInfoConfigurator = TileInfoConfigurator() - diff --git a/Trigger/TrigFTK/TrigFTKBankGen/TrigFTKBankGen/FTKBankGenAlgo.h b/Trigger/TrigFTK/TrigFTKBankGen/TrigFTKBankGen/FTKBankGenAlgo.h index 1195677beecd31d07a809cd119bad0070f95a4b2..3ec1b23d8e4b920d375b7a5edfb6ee6c54d8f442 100644 --- a/Trigger/TrigFTK/TrigFTKBankGen/TrigFTKBankGen/FTKBankGenAlgo.h +++ b/Trigger/TrigFTK/TrigFTKBankGen/TrigFTKBankGen/FTKBankGenAlgo.h @@ -259,8 +259,8 @@ private: std::ofstream m_file_recpar; std::ofstream m_file_coverage; - char m_str_gcon_file_name[200]; - char m_str_sector_file_name[200]; + char m_str_gcon_file_name[250]; + char m_str_sector_file_name[250]; std::string m_gcon_path; FTKTrack m_base_trk; diff --git a/Trigger/TrigFTK/TrigFTKBankGen/src/FTKBankGenAlgo.cxx b/Trigger/TrigFTK/TrigFTKBankGen/src/FTKBankGenAlgo.cxx index dbead5b238c446619c993cca591709842df89289..1eb55d22ba664b540fb787d14eb1eaf8fbbfca5c 100644 --- a/Trigger/TrigFTK/TrigFTKBankGen/src/FTKBankGenAlgo.cxx +++ b/Trigger/TrigFTK/TrigFTKBankGen/src/FTKBankGenAlgo.cxx @@ -263,7 +263,7 @@ StatusCode FTKBankGenAlgo::initialize(){ m_tmp_hashID = (int *) calloc(m_nplanes+1,sizeof(int)); for(int ibank=0;ibank<m_nbanks;ibank++){ - sprintf(m_str_sector_file_name,"%s/sectors_raw_%dL_reg%d.patt",m_c_sector_dir_path,m_nplanes,ibank); + snprintf(m_str_sector_file_name,sizeof(m_str_sector_file_name),"%s/sectors_raw_%dL_reg%d.patt",m_c_sector_dir_path,m_nplanes,ibank); ifstream sector_file(m_str_sector_file_name); if(!sector_file){ @@ -312,7 +312,7 @@ StatusCode FTKBankGenAlgo::initialize(){ //setBank function for(int ibank=0;ibank<m_nbanks;ibank++){ - sprintf(m_str_gcon_file_name,"%s/corrgen_raw_%dL_reg%d.gcon",m_c_gcon_dir_path,m_nplanes,ibank); + snprintf(m_str_gcon_file_name,sizeof(m_str_gcon_file_name),"%s/corrgen_raw_%dL_reg%d.gcon",m_c_gcon_dir_path,m_nplanes,ibank); ifstream gcon_file(m_str_gcon_file_name); if(!gcon_file){ log << MSG::FATAL << m_str_gcon_file_name << " not found!!" << endmsg; @@ -356,13 +356,13 @@ StatusCode FTKBankGenAlgo::initialize(){ m_file = new TFile(filename,"recreate"); gROOT->cd(); - char name[5]; - char title[20]; + char name[6]; + char title[21]; for(int i = 0; i < m_nregions; ++i){ - sprintf(name,"am%d",i); - sprintf(title,"Ambank %d para",i); + snprintf(name,sizeof(name),"am%d",i); + snprintf(title,sizeof(title),"Ambank %d para",i); m_tree[i] = new TTree(name, title); } diff --git a/Trigger/TrigSteer/DecisionHandling/DecisionHandling/TrigCompositeUtils.h b/Trigger/TrigSteer/DecisionHandling/DecisionHandling/TrigCompositeUtils.h index fb4d6660b93386f146d0a2004bd7bfe319dc0ff2..b28e3cce3ff7b21dd8e2f4db37a9c4165ec2a568 100644 --- a/Trigger/TrigSteer/DecisionHandling/DecisionHandling/TrigCompositeUtils.h +++ b/Trigger/TrigSteer/DecisionHandling/DecisionHandling/TrigCompositeUtils.h @@ -61,7 +61,7 @@ namespace TrigCompositeUtils { const std::vector<int>& decisionIDs( const Decision* d ); std::vector<int>& decisionIDs( Decision* d ); - + /** * @brief return true if thre is no positive decision stored **/ diff --git a/Trigger/TrigSteer/L1Decoder/src/FakeRoIView.cxx b/Trigger/TrigSteer/L1Decoder/src/FakeRoIView.cxx index 54000cc10d7b4e210ff066498c263532a8deb384..767e7d94ad6e2fcfb83b004e30d30ac76e66ed35 100644 --- a/Trigger/TrigSteer/L1Decoder/src/FakeRoIView.cxx +++ b/Trigger/TrigSteer/L1Decoder/src/FakeRoIView.cxx @@ -127,7 +127,7 @@ namespace AthViews { //Create the view object m_views.record( CxxUtils::make_unique< ViewContainer >() ); - SG::View * newView = new SG::View( m_viewName ); + SG::View * newView = new SG::View( m_viewName, -1 ); m_views->push_back( newView ); diff --git a/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithm.cxx b/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithm.cxx index 42d523722625c6dc047df99055f5bb74289328c1..ae5f341b7757d72c042e5611ec8092dcd5874cec 100644 --- a/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithm.cxx +++ b/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithm.cxx @@ -1,7 +1,7 @@ /* General-purpose view creation algorithm <bwynne@cern.ch> - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #include "EventViewCreatorAlgorithm.h" @@ -15,42 +15,19 @@ EventViewCreatorAlgorithm::EventViewCreatorAlgorithm( const std::string& name, ISvcLocator* pSvcLocator ) : InputMakerBase( name, pSvcLocator ) {} - EventViewCreatorAlgorithm::~EventViewCreatorAlgorithm(){} - -StatusCode EventViewCreatorAlgorithm::initialize() -{ - ATH_MSG_DEBUG("Will produce views="<<m_viewsKey<<" roIs="<<m_inViewRoIs ); - CHECK( m_viewsKey.initialize() ); - CHECK( m_inViewRoIs.initialize() ); - CHECK( m_scheduler.retrieve() ); +StatusCode EventViewCreatorAlgorithm::initialize() { + ATH_MSG_DEBUG("Will produce views=" << m_viewsKey << " roIs=" << m_inViewRoIs ); + ATH_CHECK( m_viewsKey.initialize() ); + ATH_CHECK( m_inViewRoIs.initialize() ); + ATH_CHECK( m_scheduler.retrieve() ); return StatusCode::SUCCESS; } - -StatusCode EventViewCreatorAlgorithm::finalize() { - ATH_MSG_INFO( "Finalizing " << name() << "..." ); - return StatusCode::SUCCESS; -} - - -StatusCode EventViewCreatorAlgorithm::execute_r( const EventContext& context ) const -{ - const EventContext& ctx = getContext(); - - auto outputHandles = decisionOutputs().makeHandles(context); - - size_t validInput=0; - for ( auto inputKey: decisionInputs() ) { - auto inputHandle = SG::makeHandle( inputKey, context ); - ATH_MSG_DEBUG(" "<<inputKey.key()<<(inputHandle.isValid()? "valid": "not valid" ) ); - if (inputHandle.isValid()) validInput++; - } - ATH_MSG_DEBUG( "number of implicit ReadHandles is " << decisionInputs().size() <<", "<< validInput<<" are valid" ); - - - // make the views +StatusCode EventViewCreatorAlgorithm::execute_r( const EventContext& context ) const { + auto outputHandles = decisionOutputs().makeHandles( context ); + // make the views auto viewVector = std::make_unique< ViewContainer >(); auto contexts = std::vector<EventContext>( ); unsigned int viewCounter = 0; @@ -61,151 +38,185 @@ StatusCode EventViewCreatorAlgorithm::execute_r( const EventContext& context ) c // This is used to link the same view to differnt decisions that come from the same RoI std::map <const TrigRoiDescriptor*, int> viewMap; std::map <const TrigRoiDescriptor*, int>::iterator itViewMap; - size_t outputIndex = 0; + int outputIndex = -1; // Loop over all input containers, which are of course TrigComposites, and request their features // this is the same as InputMaker, apart from the view creation. The loop can be splitted in two loops, to have one common part for ( auto inputKey: decisionInputs() ) { + outputIndex++; auto inputHandle = SG::makeHandle( inputKey, context ); if( not inputHandle.isValid() ) { - ATH_MSG_DEBUG( "Got no decisions from input "<< inputKey.key()); - outputIndex++; + ATH_MSG_DEBUG( "Got no decisions from input " << inputKey.key() ); continue; } - if( inputHandle->size() == 0){ // input filtered out + if( inputHandle->size() == 0 ) { // input filtered out ATH_MSG_ERROR( "Got 0 decisions from valid input "<< inputKey.key()<<". Is it expected?"); return StatusCode::FAILURE; } - ATH_MSG_DEBUG( "Got input "<< inputKey.key()<<" with " << inputHandle->size() << " elements" ); + ATH_MSG_DEBUG( "Got input " << inputKey.key() << " with " << inputHandle->size() << " elements" ); // prepare output decisions - auto OutputDecisions = std::make_unique<TrigCompositeUtils::DecisionContainer>(); - auto dec_aux = std::make_unique<TrigCompositeUtils::DecisionAuxContainer>(); - OutputDecisions->setStore( dec_aux.get() ); - - size_t input_counter = 0; - for ( auto Idecision: *inputHandle ) { - //make one TC decision output per input and connect to previous - auto newd = TrigCompositeUtils::newDecisionIn( OutputDecisions.get(), name() ); - TrigCompositeUtils::linkToPrevious( newd, inputKey.key(), input_counter ); - { - //copy decisions ID - TrigCompositeUtils::DecisionIDContainer objDecisions; - TrigCompositeUtils::decisionIDs( Idecision, objDecisions ); - for ( const HLT::Identifier& id: objDecisions ) { - TrigCompositeUtils::addDecisionID( id, newd ); - } - } - + auto outputDecisions = std::make_unique<TrigCompositeUtils::DecisionContainer>(); + auto decAux = std::make_unique<TrigCompositeUtils::DecisionAuxContainer>(); + outputDecisions->setStore( decAux.get() ); + + const TrigRoiDescriptor* prevRoIDescriptor = nullptr; + int inputCounter = -1; + for ( auto inputDecision: *inputHandle ) { + inputCounter++; // pull RoI descriptor - TrigCompositeUtils::LinkInfo<TrigRoiDescriptorCollection> roiELInfo = TrigCompositeUtils::findLink<TrigRoiDescriptorCollection>(Idecision, m_roisLink ); + TrigCompositeUtils::LinkInfo<TrigRoiDescriptorCollection> roiELInfo = TrigCompositeUtils::findLink<TrigRoiDescriptorCollection>(inputDecision, m_roisLink ); ATH_CHECK( roiELInfo.isValid() ); // associate this RoI to output decisions auto roiDescriptor = *roiELInfo.link; ATH_MSG_DEBUG( "Placing TrigRoiDescriptor " << *roiDescriptor ); - newd->setObjectLink( "initialRoI", roiELInfo.link ); + TrigCompositeUtils::Decision* newDecision = nullptr; + if ( prevRoIDescriptor != roiDescriptor ) { + //make one TC decision output per input and connect to previous + newDecision = TrigCompositeUtils::newDecisionIn( outputDecisions.get(), name() ); + TrigCompositeUtils::linkToPrevious( newDecision, inputKey.key(), inputCounter ); + insertDecisions( inputDecision, newDecision ); + newDecision->setObjectLink( "initialRoI", roiELInfo.link ); + prevRoIDescriptor = roiDescriptor; + } else { + newDecision = outputDecisions.get()->back(); + newDecision->setObjectLink( "seedEnd", ElementLink<TrigCompositeUtils::DecisionContainer>( inputHandle.key(), inputCounter ) ); + insertDecisions( inputDecision, newDecision ); + ATH_MSG_DEBUG("No need to create another output decision object, just adding decision IDs"); + } + // search for existing view itViewMap = viewMap.find(roiDescriptor); - if (itViewMap != viewMap.end()){ - int iview=itViewMap->second; - newd->setObjectLink( "view", ElementLink< ViewContainer >(m_viewsKey.key(), iview ));//adding view to TC + if ( itViewMap != viewMap.end() ) { + int iview = itViewMap->second; + newDecision->setObjectLink( "view", ElementLink< ViewContainer >(m_viewsKey.key(), iview ) ); //adding view to TC ATH_MSG_DEBUG( "Adding already mapped view " << iview << " in ViewVector , to new decision"); // need to check if this View has parent views? can we have more than one parent views? - } - else{ + } else { ATH_MSG_DEBUG( "Positive decisions on RoI, preparing view" ); - // fill the RoI output collection - auto oneRoIColl = std::make_unique< ConstDataVector<TrigRoiDescriptorCollection> >(); - oneRoIColl->clear( SG::VIEW_ELEMENTS ); //Don't delete the RoIs - oneRoIColl->push_back( roiDescriptor ); // make the view ATH_MSG_DEBUG( "Making the View" ); - auto newview = ViewHelper::makeView( name()+"_view", viewCounter++, m_viewFallThrough ); //pointer to the view - viewVector->push_back( newview ); - contexts.emplace_back( ctx ); + auto newView = ViewHelper::makeView( name()+"_view", viewCounter++, m_viewFallThrough ); //pointer to the view + viewVector->push_back( newView ); + contexts.emplace_back( context ); contexts.back().setExtension( Atlas::ExtendedEventContext( viewVector->back(), conditionsRun ) ); // link decision to this view - newd->setObjectLink( "view", ElementLink< ViewContainer >(m_viewsKey.key(), viewVector->size()-1 ));//adding view to TC + newDecision->setObjectLink( "view", ElementLink< ViewContainer >(m_viewsKey.key(), viewVector->size()-1 ));//adding view to TC viewMap[roiDescriptor]=viewVector->size()-1; - ATH_MSG_DEBUG( "Adding new view to new decision; storing view in viewVector component "<<viewVector->size()-1); - - // see if there is a view linked to the decision object, if so link it to the view that is just made - TrigCompositeUtils::LinkInfo<ViewContainer> parentViewLinkInfo = TrigCompositeUtils::findLink<ViewContainer>(Idecision, "view" ); - if ( parentViewLinkInfo.isValid() ) { - CHECK( parentViewLinkInfo.link.isValid() ); - auto parentView = *parentViewLinkInfo.link; - viewVector->back()->linkParent( parentView ); - ATH_MSG_DEBUG( "Parent view linked" ); - } else { - if ( m_requireParentView ) { - ATH_MSG_ERROR( "Parent view not linked because it could not be found" ); - ATH_MSG_ERROR( TrigCompositeUtils::dump( Idecision, [](const xAOD::TrigComposite* tc){ - return "TC " + tc->name() + ( tc->hasObjectLink("view") ? " has view " : " has no view " ); - } ) ); - return StatusCode::FAILURE; - } - - } - - //store the RoI in the view - auto handle = SG::makeHandle( m_inViewRoIs, contexts.back() ); - CHECK( handle.setProxyDict( viewVector->back() ) ); - CHECK( handle.record( std::move( oneRoIColl ) ) ); + ATH_MSG_DEBUG( "Adding new view to new decision; storing view in viewVector component " << viewVector->size()-1 ); + + ATH_CHECK( linkViewToParent( inputDecision, viewVector->back() ) ); + ATH_CHECK( placeRoIInView( roiDescriptor, viewVector->back(), contexts.back() ) ); } - input_counter++; } - - ATH_MSG_DEBUG( "Recording output key " << decisionOutputs()[ outputIndex ].key() <<" of size "<<OutputDecisions->size() <<" at index "<< outputIndex); - CHECK( outputHandles[outputIndex].record( std::move( OutputDecisions ), std::move( dec_aux ) ) ); - outputIndex++; + + ATH_MSG_DEBUG( "Recording output key " << decisionOutputs()[ outputIndex ].key() <<" of size "<< outputDecisions->size() <<" at index "<< outputIndex); + ATH_CHECK( outputHandles[outputIndex].record( std::move( outputDecisions ), std::move( decAux ) ) ); } - ATH_MSG_DEBUG( "Launching execution in " << viewVector->size() << " views" ); - CHECK( ViewHelper::ScheduleViews( viewVector.get(), // Vector containing views - m_viewNodeName, // CF node to attach views to - ctx, // Source context - m_scheduler.get() ) ); - + ATH_CHECK( ViewHelper::ScheduleViews( viewVector.get(), // Vector containing views + m_viewNodeName, // CF node to attach views to + context, // Source context + m_scheduler.get() ) ); // store views auto viewsHandle = SG::makeHandle( m_viewsKey ); - CHECK( viewsHandle.record( std::move( viewVector ) ) ); + ATH_CHECK( viewsHandle.record( std::move( viewVector ) ) ); ATH_MSG_DEBUG( "Store "<< viewsHandle->size() <<" Views"); - //debug - the same as inputmaker - size_t validOutput=0; + size_t validInputCount = countInputHandles( context ); + size_t validOutputCount = 0; for ( auto outHandle: outputHandles ) { if( not outHandle.isValid() ) continue; - validOutput++; + validOutputCount++; } - ATH_MSG_DEBUG("Produced "<<validOutput<<" decisions containers"); - if(validInput != validOutput) { - ATH_MSG_ERROR("Found "<<validInput<<" inputs and "<<validOutput<<" outputs"); + + ATH_MSG_DEBUG("Produced " << validOutputCount << " decisions containers"); + if(validInputCount != validOutputCount ) { + ATH_MSG_ERROR("Found " << validInputCount << " inputs and " << validOutputCount << " outputs"); return StatusCode::FAILURE; } + printDecisions( outputHandles ); + return StatusCode::SUCCESS; +} + +size_t EventViewCreatorAlgorithm::countInputHandles( const EventContext& context ) const { + size_t validInputCount=0; + for ( auto inputKey: decisionInputs() ) { + auto inputHandle = SG::makeHandle( inputKey, context ); + ATH_MSG_DEBUG(" " << inputKey.key() << (inputHandle.isValid()? "valid": "not valid" ) ); + if (inputHandle.isValid()) validInputCount++; + } + ATH_MSG_DEBUG( "number of implicit ReadHandles is " << decisionInputs().size() << ", " << validInputCount << " are valid" ); + return validInputCount; +} + + +void EventViewCreatorAlgorithm::printDecisions( const std::vector<SG::WriteHandle<TrigCompositeUtils::DecisionContainer>>& outputHandles ) const { + if ( not msgLvl( MSG::DEBUG ) ) + return; + for ( auto outHandle: outputHandles ) { if( not outHandle.isValid() ) continue; - ATH_MSG_DEBUG(outHandle.key() <<" with "<< outHandle->size() <<" decisions:"); - for (auto outdecision: *outHandle){ + ATH_MSG_DEBUG(outHandle.key() << " with " << outHandle->size() << " decisions:"); + for ( auto outDecision: *outHandle ) { TrigCompositeUtils::DecisionIDContainer objDecisions; - TrigCompositeUtils::decisionIDs( outdecision, objDecisions ); + TrigCompositeUtils::decisionIDs( outDecision, objDecisions ); ATH_MSG_DEBUG("Number of positive decisions for this output: " << objDecisions.size() ); - for ( TrigCompositeUtils::DecisionID id : objDecisions ) { + for ( TrigCompositeUtils::DecisionID id : TrigCompositeUtils::decisionIDs(outDecision) ) { ATH_MSG_DEBUG( " --- decision " << HLT::Identifier( id ) ); } } - } - + } +} - +void EventViewCreatorAlgorithm::insertDecisions( const TrigCompositeUtils::Decision* src, TrigCompositeUtils::Decision* dest ) const { + using namespace TrigCompositeUtils; + DecisionIDContainer ids; + decisionIDs( dest, ids ); + decisionIDs( src, ids ); + decisionIDs( dest ).clear(); + decisionIDs(dest).insert( decisionIDs(dest).end(), ids.begin(), ids.end() ); +} + +StatusCode EventViewCreatorAlgorithm::linkViewToParent( const TrigCompositeUtils::Decision* inputDecision, SG::View* newView ) const { + // see if there is a view linked to the decision object, if so link it to the view that is just made + TrigCompositeUtils::LinkInfo<ViewContainer> parentViewLinkInfo = TrigCompositeUtils::findLink<ViewContainer>(inputDecision, "view" ); + if ( parentViewLinkInfo.isValid() ) { + ATH_CHECK( parentViewLinkInfo.link.isValid() ); + auto parentView = *parentViewLinkInfo.link; + newView->linkParent( parentView ); + ATH_MSG_DEBUG( "Parent view linked" ); + } else { + if ( m_requireParentView ) { + ATH_MSG_ERROR( "Parent view not linked because it could not be found" ); + ATH_MSG_ERROR( TrigCompositeUtils::dump( inputDecision, [](const xAOD::TrigComposite* tc){ + return "TC " + tc->name() + ( tc->hasObjectLink("view") ? " has view " : " has no view " ); + } ) ); + return StatusCode::FAILURE; + } + + } return StatusCode::SUCCESS; } +StatusCode EventViewCreatorAlgorithm::placeRoIInView( const TrigRoiDescriptor* roi, SG::View* view, const EventContext& context ) const { + // fill the RoI output collection + auto oneRoIColl = std::make_unique< ConstDataVector<TrigRoiDescriptorCollection> >(); + oneRoIColl->clear( SG::VIEW_ELEMENTS ); //Don't delete the RoIs + oneRoIColl->push_back( roi ); + + //store the RoI in the view + auto handle = SG::makeHandle( m_inViewRoIs, context ); + ATH_CHECK( handle.setProxyDict( view ) ); + ATH_CHECK( handle.record( std::move( oneRoIColl ) ) ); + return StatusCode::SUCCESS; +} diff --git a/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithm.h b/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithm.h index 4b9412675cd19bc9b9970d4eb5d25c2efc5d60a0..176ee0f287f76602aeadfe6e68ba2777c064d58b 100644 --- a/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithm.h +++ b/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithm.h @@ -1,7 +1,7 @@ /* General-purpose view creation algorithm <bwynne@cern.ch> - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef ViewAlgs_EventViewCreatorAlgorithm_h @@ -33,8 +33,7 @@ class EventViewCreatorAlgorithm : public ::InputMakerBase virtual ~EventViewCreatorAlgorithm(); virtual StatusCode initialize() override; virtual StatusCode execute_r(const EventContext&) const override; - virtual StatusCode finalize() override; - + virtual StatusCode finalize() override { return StatusCode::SUCCESS; } private: EventViewCreatorAlgorithm(); @@ -52,6 +51,16 @@ class EventViewCreatorAlgorithm : public ::InputMakerBase Gaudi::Property< std::string > m_roisLink{ this, "RoIsLink", "Unspecified", "Name of EL to RoI object lined to the decision" }; Gaudi::Property< bool > m_viewFallThrough { this, "ViewFallThrough", false, "Set whether views may accesas StoreGate directly to retrieve data" }; Gaudi::Property< bool > m_requireParentView { this, "RequireParentView", false, "Fail if the parent view can not be found" }; + + + size_t countInputHandles( const EventContext& context ) const; + void printDecisions( const std::vector<SG::WriteHandle<TrigCompositeUtils::DecisionContainer>>& outputHandles ) const; + void insertDecisions( const TrigCompositeUtils::Decision* src, TrigCompositeUtils::Decision* dest ) const; + /** + * @brief makes sure the views are linked, if configuration requireParentView is set, failure to set the parent is an error + **/ + StatusCode linkViewToParent( const TrigCompositeUtils::Decision* inputDecsion, SG::View* newView ) const; + StatusCode placeRoIInView( const TrigRoiDescriptor* roi, SG::View* view, const EventContext& context ) const; }; #endif diff --git a/Trigger/TrigSteer/ViewAlgs/src/TrigL2CaloViewsMergerTool.cxx b/Trigger/TrigSteer/ViewAlgs/src/TrigL2CaloViewsMergerTool.cxx deleted file mode 100644 index 756254aa84f54f5989ac9923ef846a009b0658d4..0000000000000000000000000000000000000000 --- a/Trigger/TrigSteer/ViewAlgs/src/TrigL2CaloViewsMergerTool.cxx +++ /dev/null @@ -1,37 +0,0 @@ -#include "TrigL2CaloViewsMergerTool.h" - - -TrigL2CaloViewsMergerTool::TrigL2CaloViewsMergerTool( const std::string& type, - const std::string& name, - const IInterface* parent ) - : AthAlgTool( type, name, parent ) {} - -StatusCode TrigL2CaloViewsMergerTool::initialize() { - CHECK( m_mergedClustersKey.initialize() ); - renounce( m_inViewClustersKey ); // this is an input no to be seen by scheduler - CHECK( m_inViewClustersKey.initialize() ); - return StatusCode::SUCCESS; -} - -StatusCode TrigL2CaloViewsMergerTool::merge( const EventContext& context, const ViewContainer& views ) const { - - auto output = std::make_unique< ConstDataVector< xAOD::TrigEMClusterContainer > >(); - output->clear( SG::VIEW_ELEMENTS ); - - for ( auto view : views ) { - // make input electrons - EventContext viewContext( context ); - viewContext.setExtension( Atlas::ExtendedEventContext( view ) ); - auto clustersInViewHandle = SG::makeHandle( m_inViewClustersKey, viewContext ); - CHECK ( clustersInViewHandle.isValid() ); - ATH_MSG_DEBUG( "Found: "<< clustersInViewHandle->size() << "clusters in view" ); - for ( auto electron: *clustersInViewHandle ) { - output->push_back( electron ); - } - } - ATH_MSG_DEBUG( "Output clusters container size: " << output->size() ); - - auto outputHandle = SG::makeHandle( m_mergedClustersKey, context ); - CHECK( outputHandle.record( std::move( output ) ) ); - return StatusCode::SUCCESS; -} diff --git a/Trigger/TrigSteer/ViewAlgs/src/TrigL2CaloViewsMergerTool.h b/Trigger/TrigSteer/ViewAlgs/src/TrigL2CaloViewsMergerTool.h deleted file mode 100644 index 2a86bf3ecf6ea2823aba7c21018dbd4bd405ac84..0000000000000000000000000000000000000000 --- a/Trigger/TrigSteer/ViewAlgs/src/TrigL2CaloViewsMergerTool.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef TrigEgammaHypo_TrigL2CaloViewsMergeTool_h -#define TrigEgammaHypo_TrigL2CaloViewsMergeTool_h - - -#include "AthViews/IViewsMergerTool.h" -#include "AthenaBaseComps/AthAlgTool.h" - -#include "AthViews/View.h" -#include "AthContainers/ConstDataVector.h" -#include "xAODTrigCalo/TrigEMClusterContainer.h" - -class TrigL2CaloViewsMergerTool : virtual public IViewsMergerTool, virtual public AthAlgTool { -public: - TrigL2CaloViewsMergerTool( const std::string& type, - const std::string& name, - const IInterface* parent ); - StatusCode initialize() override; - StatusCode merge( const EventContext& context, const ViewContainer& ) const override; - -private: - SG::ReadHandleKey< xAOD::TrigEMClusterContainer > m_inViewClustersKey {this, "InViewClusters", "L2CaloClustersInView", "Input"}; - SG::WriteHandleKey< ConstDataVector<xAOD::TrigEMClusterContainer> > m_mergedClustersKey {this, "MergedClusters", "L2CaloClustersMerged", "Output"}; -}; - - -#endif diff --git a/Trigger/TrigSteer/ViewAlgs/src/TrigL2ElectronViewsMergerTool.cxx b/Trigger/TrigSteer/ViewAlgs/src/TrigL2ElectronViewsMergerTool.cxx deleted file mode 100644 index 55a4407cad0baefc489c5ecc76b00290efa62eba..0000000000000000000000000000000000000000 --- a/Trigger/TrigSteer/ViewAlgs/src/TrigL2ElectronViewsMergerTool.cxx +++ /dev/null @@ -1,37 +0,0 @@ -#include "TrigL2ElectronViewsMergerTool.h" - - -TrigL2ElectronViewsMergerTool::TrigL2ElectronViewsMergerTool( const std::string& type, - const std::string& name, - const IInterface* parent ) - : AthAlgTool( type, name, parent ) {} - -StatusCode TrigL2ElectronViewsMergerTool::initialize() { - CHECK( m_mergedElectronsKey.initialize() ); - renounce( m_inViewElectronsKey ); // this is an input no to be seen by scheduler - CHECK( m_inViewElectronsKey.initialize() ); - return StatusCode::SUCCESS; -} - -StatusCode TrigL2ElectronViewsMergerTool::merge( const EventContext& context, const ViewContainer& views ) const { - - auto output = std::make_unique< ConstDataVector< xAOD::TrigElectronContainer > >(); - output->clear( SG::VIEW_ELEMENTS ); - - for ( auto view : views ) { - // make input electrons - EventContext viewContext( context ); - viewContext.setExtension( Atlas::ExtendedEventContext( view ) ); - auto electronsInViewHandle = SG::makeHandle( m_inViewElectronsKey, viewContext ); - CHECK ( electronsInViewHandle.isValid() ); - ATH_MSG_DEBUG( "Found: "<< electronsInViewHandle->size() << "electrons in view" ); - for ( auto electron: *electronsInViewHandle ) { - output->push_back( electron ); - } - } - ATH_MSG_DEBUG( "Output electrons container size: " << output->size() ); - - auto outputHandle = SG::makeHandle( m_mergedElectronsKey, context ); - CHECK( outputHandle.record( std::move( output ) ) ); - return StatusCode::SUCCESS; -} diff --git a/Trigger/TrigSteer/ViewAlgs/src/TrigL2ElectronViewsMergerTool.h b/Trigger/TrigSteer/ViewAlgs/src/TrigL2ElectronViewsMergerTool.h deleted file mode 100644 index 07c53fc3e650f82804ace001e01676a5ff5e359a..0000000000000000000000000000000000000000 --- a/Trigger/TrigSteer/ViewAlgs/src/TrigL2ElectronViewsMergerTool.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef TrigEgammaHypo_TrigL2ElectronViewsMergeTool_h -#define TrigEgammaHypo_TrigL2ElectronViewsMergeTool_h - - -#include "AthViews/IViewsMergerTool.h" -#include "AthenaBaseComps/AthAlgTool.h" - -#include "AthViews/View.h" -#include "AthContainers/ConstDataVector.h" -#include "xAODTrigEgamma/TrigElectronContainer.h" - - -class TrigL2ElectronViewsMergerTool : virtual public IViewsMergerTool, virtual public AthAlgTool { -public: - TrigL2ElectronViewsMergerTool( const std::string& type, - const std::string& name, - const IInterface* parent ); - StatusCode initialize() override; - StatusCode merge( const EventContext& context, const ViewContainer& ) const override; - -private: - SG::ReadHandleKey< xAOD::TrigElectronContainer > m_inViewElectronsKey {this, "InViewElectrons", "L2ElectronContainerInView", "Input"}; - SG::WriteHandleKey< ConstDataVector<xAOD::TrigElectronContainer> > m_mergedElectronsKey {this, "MergedElectrons", "L2ElectronContainerMerged", "Output"}; -}; - - -#endif diff --git a/Trigger/TrigSteer/ViewAlgs/src/components/ViewAlgs_entries.cxx b/Trigger/TrigSteer/ViewAlgs/src/components/ViewAlgs_entries.cxx index 94cc6cc70c362fa93bb37d9c313c26412dbdf87a..be3e4f9570bc3ef023f3e97b3e3175e3b98b19f0 100644 --- a/Trigger/TrigSteer/ViewAlgs/src/components/ViewAlgs_entries.cxx +++ b/Trigger/TrigSteer/ViewAlgs/src/components/ViewAlgs_entries.cxx @@ -2,12 +2,9 @@ #include "../EventViewCreatorAlgorithm.h" #include "../MergeViews.h" -#include "../TrigL2ElectronViewsMergerTool.h" -#include "../TrigL2CaloViewsMergerTool.h" DECLARE_COMPONENT( EventViewCreatorAlgorithm ) DECLARE_COMPONENT( MergeViews ) -DECLARE_COMPONENT( TrigL2ElectronViewsMergerTool ) -DECLARE_COMPONENT( TrigL2CaloViewsMergerTool ) + diff --git a/Trigger/TrigValidation/TrigUpgradeTest/CMakeLists.txt b/Trigger/TrigValidation/TrigUpgradeTest/CMakeLists.txt index 251b42fc39640e77f625e4786f5169f206418d4f..26cd86365603552d16f2bebb9fa100150b1e5c7a 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/CMakeLists.txt +++ b/Trigger/TrigValidation/TrigUpgradeTest/CMakeLists.txt @@ -145,4 +145,5 @@ atlas_add_test( l1sim ) atlas_install_joboptions( share/*.py ) +atlas_install_data( share/*.ref ) atlas_install_python_modules( python/*.py ) diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/ElectronMenuConfig.py b/Trigger/TrigValidation/TrigUpgradeTest/python/ElectronMenuConfig.py index f67c94668eae9ef5f8a782c9a2ad99228f849547..571a67d8b6b382bb855656e6a35e7257c1749944 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/python/ElectronMenuConfig.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/python/ElectronMenuConfig.py @@ -48,30 +48,31 @@ def TileCondCfg( flags ): acc = ComponentAccumulator() - from TileConditions.TileConditionsConf import TileCondToolEmscale - tool = TileCondToolEmscale() - tool.OnlCacheUnit = 'OnlineMegaElectronVolts' + from IOVDbSvc.IOVDbSvcConfig import addFolders + def __addFolder(f): + acc.merge( addFolders( flags, '%s <key>%s</key>' %(f,f), 'TILE_OFL' if '/OFL' in f else 'TILE_ONL', className="CondAttrListCollection") ) + # from TileConditions.TileConditionsConf import TileCondProxyFile_TileCalibDrawerFlt_ as TileCondProxyFileFlt # from TileConditions.TileConditionsConf import TileCondProxyFile_TileCalibDrawerBch_ as TileCondProxyFileBch from TileConditions.TileConditionsConf import TileCondProxyCool_TileCalibDrawerFlt_ as TileCondProxyCoolFlt from TileConditions.TileConditionsConf import TileCondProxyCool_TileCalibDrawerBch_ as TileCondProxyCoolBch # from TileConditions.TileConditionsConf import TileCondProxyCool_TileCalibDrawerOfc_ as TileCondProxyCoolOfc - from IOVDbSvc.IOVDbSvcConfig import addFolders - def __addFolder(f): - acc.merge(addFolders(flags, '%s <key>%s</key>' %(f,f), 'TILE_OFL' if '/OFL' in f else 'TILE_ONL')) - - tool.ProxyOflCes = TileCondProxyCoolFlt('TileCondProxyCool_OflCes', Source = '/TILE/OFL02/CALIB/CES') - tool.ProxyOflCisLin = TileCondProxyCoolFlt('TileCondProxyCool_OflCisLin', Source = '/TILE/OFL02/CALIB/CIS/LIN') - tool.ProxyOflCisNln = TileCondProxyCoolFlt('TileCondProxyCool_OflCisNln', Source = '/TILE/OFL02/CALIB/CIS/NLN') - tool.ProxyOflEms = TileCondProxyCoolFlt('TileCondProxyCool_OflEms', Source = '/TILE/OFL02/CALIB/EMS') - tool.ProxyOflLasFib = TileCondProxyCoolFlt('TileCondProxyCool_OflLasFib', Source = '/TILE/OFL02/CALIB/LAS/FIBER') - tool.ProxyOflLasLin = TileCondProxyCoolFlt('TileCondProxyCool_OflLasLin', Source = '/TILE/OFL02/CALIB/LAS/LIN') - tool.ProxyOflLasNln = TileCondProxyCoolFlt('TileCondProxyCool_OflLasNln', Source = '/TILE/OFL02/CALIB/LAS/NLN') - tool.ProxyOnlCes = TileCondProxyCoolFlt('TileCondProxyCool_OnlCes', Source = '/TILE/ONL01/CALIB/CES') - tool.ProxyOnlCis = TileCondProxyCoolFlt('TileCondProxyCool_OnlCis', Source = '/TILE/ONL01/CALIB/CIS/LIN') - tool.ProxyOnlEms = TileCondProxyCoolFlt('TileCondProxyCool_OnlEms', Source = '/TILE/ONL01/CALIB/EMS') - tool.ProxyOnlLas = TileCondProxyCoolFlt('TileCondProxyCool_OnlLas', Source = '/TILE/ONL01/CALIB/LAS/LIN') + emScale = 'TileEMScale' + from TileConditions.TileConditionsConf import TileEMScaleCondAlg + emScaleCondAlg = TileEMScaleCondAlg(name = emScale + 'CondAlg', TileEMScale = emScale) + emScaleCondAlg.OnlCacheUnit = 'OnlineMegaElectronVolts' + emScaleCondAlg.OflCesProxy = TileCondProxyCoolFlt('TileCondProxyCool_OflCes', Source = '/TILE/OFL02/CALIB/CES') + emScaleCondAlg.OflCisLinProxy = TileCondProxyCoolFlt('TileCondProxyCool_OflCisLin', Source = '/TILE/OFL02/CALIB/CIS/LIN') + emScaleCondAlg.OflCisNlnProxy = TileCondProxyCoolFlt('TileCondProxyCool_OflCisNln', Source = '/TILE/OFL02/CALIB/CIS/NLN') + emScaleCondAlg.OflEmsProxy = TileCondProxyCoolFlt('TileCondProxyCool_OflEms', Source = '/TILE/OFL02/CALIB/EMS') + emScaleCondAlg.OflLasFibProxy = TileCondProxyCoolFlt('TileCondProxyCool_OflLasFib', Source = '/TILE/OFL02/CALIB/LAS/FIBER') + emScaleCondAlg.OflLasLinProxy = TileCondProxyCoolFlt('TileCondProxyCool_OflLasLin', Source = '/TILE/OFL02/CALIB/LAS/LIN') + emScaleCondAlg.OflLasNlnProxy = TileCondProxyCoolFlt('TileCondProxyCool_OflLasNln', Source = '/TILE/OFL02/CALIB/LAS/NLN') + emScaleCondAlg.OnlCesProxy = TileCondProxyCoolFlt('TileCondProxyCool_OnlCes', Source = '/TILE/ONL01/CALIB/CES') + emScaleCondAlg.OnlCisProxy = TileCondProxyCoolFlt('TileCondProxyCool_OnlCis', Source = '/TILE/ONL01/CALIB/CIS/LIN') + emScaleCondAlg.OnlEmsProxy = TileCondProxyCoolFlt('TileCondProxyCool_OnlEms', Source = '/TILE/ONL01/CALIB/EMS') + emScaleCondAlg.OnlLasProxy = TileCondProxyCoolFlt('TileCondProxyCool_OnlLas', Source = '/TILE/ONL01/CALIB/LAS/LIN') __addFolder( '/TILE/OFL02/CALIB/CES') __addFolder( '/TILE/OFL02/CALIB/CIS/LIN') @@ -84,36 +85,74 @@ def TileCondCfg( flags ): __addFolder( '/TILE/ONL01/CALIB/CIS/LIN') __addFolder( '/TILE/ONL01/CALIB/EMS') __addFolder( '/TILE/ONL01/CALIB/LAS/LIN') - acc.addPublicTool( tool ) - from TileConditions.TileConditionsConf import TileCondToolNoiseSample - noiseSampleTool = TileCondToolNoiseSample() - noiseSampleTool.ProxyNoiseSample = TileCondProxyCoolFlt( 'TileCondProxyCool_NoiseSample', Source = '/TILE/OFL02/NOISE/SAMPLE' ) - noiseSampleTool.ProxyOnlineNoiseSample = TileCondProxyCoolFlt( 'TileCondProxyCool_OnlineNoiseSample', Source = '/TILE/ONL01/NOISE/SAMPLE' ) + acc.addCondAlgo( emScaleCondAlg ) + + from TileConditions.TileConditionsConf import TileCondToolEmscale + emScaleTool = TileCondToolEmscale(name = 'TileCondToolEmscale', TileEMScale = emScale) + acc.addPublicTool( emScaleTool ) + + + from TileConditions.TileConditionsConf import TileCalibCondAlg_TileCalibDrawerFlt_ as TileCalibFltCondAlg + def __addCondAlg(calibData, proxy): + calibCondAlg = calibData + 'CondAlg' + condAlg = TileCalibFltCondAlg( name = calibCondAlg, ConditionsProxy = proxy, TileCalibData = calibData) + acc.addCondAlgo( condAlg ) + + + sampleNoise = 'TileSampleNoise' + sampleNoiseProxy = TileCondProxyCoolFlt( 'TileCondProxyCool_NoiseSample', Source = '/TILE/OFL02/NOISE/SAMPLE' ) __addFolder( '/TILE/OFL02/NOISE/SAMPLE' ) + __addCondAlg(sampleNoise, sampleNoiseProxy) + + onlineSampleNoise = 'TileOnlineSampleNoise' + onlineSampleNoiseProxy = TileCondProxyCoolFlt( 'TileCondProxyCool_OnlineNoiseSample', Source = '/TILE/ONL01/NOISE/SAMPLE' ) __addFolder( '/TILE/ONL01/NOISE/SAMPLE' ) + __addCondAlg(onlineSampleNoise, onlineSampleNoiseProxy) + + from TileConditions.TileConditionsConf import TileCondToolNoiseSample + noiseSampleTool = TileCondToolNoiseSample(name = 'TileCondToolNoiseSample', + TileSampleNoise = sampleNoise, + TileOnlineSampleNoise = onlineSampleNoise) acc.addPublicTool( noiseSampleTool ) - from TileConditions.TileConditionsConf import TileCondToolTiming - timingTool = TileCondToolTiming() - timingTool.ProxyAdcOffset = TileCondProxyCoolFlt('TileCondProxyCool_AdcOffset', Source = '/TILE/OFL02/TIME/CHANNELOFFSET/PHY' ) + + timing = 'TileTiming' + timingProxy = TileCondProxyCoolFlt('TileCondProxyCool_AdcOffset', Source = '/TILE/OFL02/TIME/CHANNELOFFSET/PHY' ) __addFolder( '/TILE/OFL02/TIME/CHANNELOFFSET/PHY' ) + __addCondAlg(timing, timingProxy) + + from TileConditions.TileConditionsConf import TileCondToolTiming + timingTool = TileCondToolTiming(name = 'TileCondToolTiming', TileTiming = timing) acc.addPublicTool( timingTool ) - from TileConditions.TileConditionsConf import TileBadChanTool - badChanTool = TileBadChanTool() - badChanTool.ProxyOflBch = TileCondProxyCoolBch('TileCondProxyCool_OflBch', Source = '/TILE/OFL02/STATUS/ADC' ) - badChanTool.ProxyOnlBch = TileCondProxyCoolBch('TileCondProxyCool_OnlBch', Source = '/TILE/ONL01/STATUS/ADC' ) + badChannels = 'TileBadChannels' + from TileConditions.TileConditionsConf import TileBadChannelsCondAlg + badChannelsCondAlg = TileBadChannelsCondAlg( name = badChannels + 'CondAlg', TileBadChannels = badChannels) + badChannelsCondAlg.OflBchProxy = TileCondProxyCoolBch('TileCondProxyCool_OflBch', Source = '/TILE/OFL02/STATUS/ADC' ) + badChannelsCondAlg.OnlBchProxy = TileCondProxyCoolBch('TileCondProxyCool_OnlBch', Source = '/TILE/ONL01/STATUS/ADC' ) __addFolder( '/TILE/OFL02/STATUS/ADC' ) __addFolder( '/TILE/ONL01/STATUS/ADC' ) + acc.addCondAlgo( badChannelsCondAlg ) + + from TileConditions.TileConditionsConf import TileBadChanTool + badChanTool = TileBadChanTool(name = 'TileBadChanTool', TileBadChannels = badChannels) acc.addPublicTool( badChanTool ) + from TileConditions.TileConditionsConf import TileBadChanLegacyTool + from AthenaCommon.Constants import DEBUG + badChanLegacyTool = TileBadChanLegacyTool( 'TileBadChanLegacyTool' ) + badChanLegacyTool.ProxyOflBch = TileCondProxyCoolBch('TileCondProxyCool_OflBchLegacy', Source = '/TILE/OFL02/STATUS/ADC' ) + badChanLegacyTool.ProxyOnlBch = TileCondProxyCoolBch('TileCondProxyCool_OnlBchLegacy', Source = '/TILE/ONL01/STATUS/ADC', OutputLevel=DEBUG ) + acc.addPublicTool( badChanLegacyTool ) + + + acc.merge( addFolders(flags, ['/LAR/BadChannelsOfl/BadChannels <key>/LAR/BadChannels/BadChannels</key>', '/LAR/BadChannelsOfl/MissingFEBs<key>/LAR/BadChannels/MissingFEBs</key>'], 'LAR_OFL')) - from TileConditions.TileConditionsConf import TileInfoLoader, TileCablingSvc infoLoaderSvc = TileInfoLoader() infoLoaderSvc.NoiseScaleIndex= 2 @@ -121,8 +160,6 @@ def TileCondCfg( flags ): # acc.addToAppProperty('CreateSvc', [infoLoaderSvc.getFullName()] ) - - cabligSvc = TileCablingSvc() cabligSvc.CablingType = 4 acc.addService( cabligSvc ) @@ -262,8 +299,8 @@ def l2ElectronCaloStepCfg( flags, chains ): # setup algorithms #acc.addSequence( seqAND('L2CaloEgamma'), parentName=parentSeq ) - from TrigUpgradeTest.MenuComponents import FilterHypoSequence - fhSeq = FilterHypoSequence( 'ElectronFastCalo' ) + from TrigUpgradeTest.MenuComponents import NJMenuSequence + fhSeq = NJMenuSequence( 'ElectronFastCalo' ) fhSeq.addFilter( chains, inKey = 'EMRoIDecisions' ) # out key named after sequence from TrigUpgradeTest.MenuComponents import RecoFragmentsPool @@ -286,7 +323,6 @@ def l2ElectronCaloStepCfg( flags, chains ): return fhSeq - def generateElectronsCfg( flags ): acc = ComponentAccumulator() diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/HLTCFConfig.py b/Trigger/TrigValidation/TrigUpgradeTest/python/HLTCFConfig.py deleted file mode 100644 index d5fe9fb9ca56d97a3a59d380d8d7b002a9fb9c67..0000000000000000000000000000000000000000 --- a/Trigger/TrigValidation/TrigUpgradeTest/python/HLTCFConfig.py +++ /dev/null @@ -1,349 +0,0 @@ -# Classes to configure the CF graph, via Nodes -from AthenaCommon.CFElements import parOR, seqAND, seqOR -from AthenaCommon.Logging import logging -from AthenaCommon.AlgSequence import dumpSequence -from TrigUpgradeTest.HLTCFDot import stepCF_DataFlow_to_dot, stepCF_ControlFlow_to_dot, all_DataFlow_to_dot - -import sys -import copy -from AthenaCommon.Constants import VERBOSE,INFO,DEBUG -log = logging.getLogger('HLTCFConfig') -log.setLevel( VERBOSE ) - -#### Here functions to create the CF tree from CF configuration objects -def makeSummary(name, flatDecisions): - """ Returns a TriggerSummaryAlg connected to given decisions""" - from DecisionHandling.DecisionHandlingConf import TriggerSummaryAlg - summary = TriggerSummaryAlg( name, OutputLevel = 2 ) - summary.InputDecision = "HLTChains" - - summary.FinalDecisions = flatDecisions - summary.HLTSummary = "MonitoringSummary"+name - return summary - -def makeMonitor(name, decisions, EnabledChainNames): - from TrigSteerMonitor.TrigSteerMonitorConf import TrigSignatureMoniMT, DecisionCollectorTool - mon = TrigSignatureMoniMT(name, OutputLevel = 2) - flatDecisions=[] - for step in decisions: flatDecisions.extend (step) - mon.FinalDecisions = flatDecisions - mon.L1Decisions = "HLTChainsResult" # connection with L1Decoder - from TrigUpgradeTest.TestUtils import MenuTest - mon.ChainsList = EnabledChainNames - tools=[] - for step in range (0, len(decisions)): - print "adding collector ",step - print decisions[step] - collect = DecisionCollectorTool("StepCollector%d"%step) - collect.Decisions = decisions[step] - print collect - tools.append(collect) - mon.CollectorTools=tools - print mon - return mon - -def makeStreamESD(name, flatDecisions): - import AthenaPoolCnvSvc.WriteAthenaPool - from OutputStreamAthenaPool.OutputStreamAthenaPool import createOutputStream - StreamESD=createOutputStream(name,"myESD.pool.root",True) - StreamESD.OutputLevel=3 - from AthenaCommon.AlgSequence import AlgSequence - topSequence = AlgSequence() - topSequence.remove( StreamESD ) - def addTC(name): - StreamESD.ItemList += [ "xAOD::TrigCompositeContainer#"+name, "xAOD::TrigCompositeAuxContainer#"+name+"Aux." ] - - for tc in flatDecisions: - addTC( tc ) - - addTC("HLTSummary") - if log.isEnabledFor(logging.DEBUG): - log.debug("ESD file content: ") - log.debug( StreamESD.ItemList ) - return StreamESD - - -def create_step_reco_node(name, seq_list, dump=False): - """ elementary HLT reco step, contianing all sequences of the step """ - if log.isEnabledFor(logging.DEBUG): - log.debug("Create reco step %s with %d sequences", name, len(seq_list)) - stepCF = parOR(name+"_reco") - for seq in seq_list: - step_seq = create_CFSequence(seq) - stepCF += step_seq - - if dump: dumpSequence (stepCF, indent=0) - return stepCF - - -def create_step_filter_node(name, seq_list, dump=False): - """ elementary HLT filter step: OR node containing all Filters of the sequences. The node gates execution of next reco step """ - if log.isEnabledFor(logging.DEBUG): - log.debug("Create filter step %s with %d filters", name, len(seq_list)) - stepCF = parOR(name+"_filter") - for seq in seq_list: - filterAlg=seq.filter.Alg - log.info("Add %s to filter node %s", filterAlg.name(), name) - stepCF += filterAlg - - if dump: dumpSequence (stepCF, indent=0) - return stepCF - - - -def create_step_sequence(name, filterAlg, rest,sublist): - """ elementary HLT step sequencer, filterAlg is gating, rest is anything that needs to happe within the step """ - toadd=rest - for k, v in sublist.iteritems(): - seq= seqAND(k, v) - toadd.append(seq) - - stepReco = parOR(name+"_reco", toadd) - stepAnd = seqAND(name, [ filterAlg, stepReco ]) - return stepAnd - - -def create_CFSequence(CFseq): - """ Creates AthSequencer nodes with sequences attached """ - if log.isEnabledFor(logging.DEBUG): - log.debug(" *** Create CFSequence %s with FilterAlg %s *", CFseq.name, CFseq.filter.Alg.name()) - filterAlg=CFseq.filter.Alg - - - stepReco = parOR(CFseq.name+"_reco") # all reco algoritms from al lthe sequences in a parallel sequence - seqAndView = seqAND(CFseq.name+"_view", [stepReco]) #include in seq:And to run in views: add here the Hypo - seqAndWithFilter = seqAND(CFseq.name, [filterAlg, seqAndView]) # add to the main step+filter - - for menuseq in CFseq.step.sequences: - ath_sequence=menuseq.sequence.Alg - subs = ath_sequence - stepReco += subs - seqAndView += menuseq.hypo.Alg - - if CFseq.step.isCombo: - seqAndView += CFseq.step.combo.Alg - print CFseq.step.combo.Alg - - return seqAndWithFilter - - -def addChainToHypoAlg(hypoAlg, chain): - """ Tmp functions for Combo Hypo """ - if "Comb" in hypoAlg.algname: - prop="Chains" - cval = hypoAlg.Alg.getProperties()[prop] - try: - cval.append(chain) - setattr(hypoAlg.Alg, prop, cval) - except: - pass - - -####################################### -## CORE of Decision Handling -####################################### - - - -def makeHLTTree(HLTChains): - """ creates the full HLT tree""" - - # TopHLTRootSeq = seqAND("TopHLTRoot") # Root - # main HLT top sequence - hltTop = seqOR( "hltTop") - - #add the L1Upcacking -# TopHLTRootSeq += L1UnpackingSeq - - # add the HLT steps Node - steps = seqAND("HLTAllSteps") - hltTop += steps - - # make CF tree - finalDecisions = decisionTree_From_Chains(steps, HLTChains) - EnabledChainNames = [c.name for c in HLTChains] - - - flatDecisions=[] - for step in finalDecisions: flatDecisions.extend (step) - summary= makeSummary("TriggerSummaryFinal", flatDecisions) - #from TrigOutputHandling.TrigOutputHandlingConf import HLTEDMCreator - #edmCreator = HLTEDMCreator() - - #edmCreator.TrigCompositeContainer = flatDecisions - #summary.OutputTools= [ edmCreator ] - hltTop += summary - hltTop += makeMonitor("TriggerMonitorFinal", finalDecisions, EnabledChainNames) - #hltTop += makeStreamESD("StreamESD", flatDecisions) - - - from AthenaCommon.AlgSequence import AlgSequence - topSequence = AlgSequence() - topSequence += hltTop - - - -def decisionTree_From_Chains(HLTNode, chains): - """ creates the decision tree, given the starting node and the chains containing the sequences """ - if log.isEnabledFor(logging.DEBUG): - log.debug("Run decisionTree_From_Chains on %s", HLTNode.name()) - - from TrigUpgradeTest.MenuComponents import CFSequence, RoRSequenceFilterNode, ComboMaker - HLTNodeName= HLTNode.name() - - # find nsteps - NSTEPS=0 - for chain in chains: - steps =len(chain.steps) - if log.isEnabledFor(logging.DEBUG): - log.debug("Adding chain %s with %d steps"%(chain.name,steps)) - if NSTEPS < steps: - NSTEPS = steps - - if log.isEnabledFor(logging.DEBUG): - log.debug("Run on %d steps", NSTEPS) - - - #loop over chains to configure hypotools - # must be done after all chains are created, to avoid conflicts - for chain in chains: - chain.decodeHypoToolConfs() - - finalDecisions = [] # needed for monitor - allSeq_list = [] - for nstep in range(0, NSTEPS): - finalDecisions.append([]) # list of final deciisons per step - stepCF_name = "Step%i"%(nstep+1) - CFseq_list = [] - step_decisions = [] - for chain in chains: - # skip this step if missing - if len(chain.steps) <= nstep: - continue - - chain_step=chain.steps[nstep] - if log.isEnabledFor(logging.DEBUG): - log.debug("\n************* Start step %d %s for chain %s", nstep+1, stepCF_name, chain.name) - - # one filter per step_chain - # one filter input per previous menusequence output (the L1Seed for first step) - # one filter output per menuSeq - - filter_input =[] - if nstep == 0: # L1 seeding - previous_sequence="".join(chain.group_seed) - seeds=chain.group_seed - filter_input.extend( seeds ) - if log.isEnabledFor(logging.DEBUG): - log.debug("Found these seeds from the sequence: %s", seeds) - log.debug("Seeds from this chain: %s", filter_input) - previous_seeds=seeds - - else: - # from previous step, map the seuqence in the same order? - previous_sequence = chain_step.name - prev=chain.steps[nstep-1].sequences - previous_seeds=[] - for seq in prev: - filter_input.extend(seq.outputs) - previous_seeds.append( seq.seed) - - if log.isEnabledFor(logging.DEBUG): - log.debug("Connect to previous sequence through these filter inputs: %s" %str( filter_input) ) - if len(filter_input) != len(previous_seeds): - log.error("found %d filter inputs and %d seeds", len(filter_input), len(previous_seeds)) - sys.exit("ERROR, in size") - - - (sfilter, alreadyFoundFilter) = buildFilter(stepCF_name,previous_sequence, CFseq_list, chain, filter_input, previous_seeds) - - if not alreadyFoundFilter: - CF_seq = CFSequence( ChainStep=chain_step, FilterAlg=sfilter) - CFseq_list.append(CF_seq) - for sequence in chain_step.sequences: - step_decisions.extend(sequence.outputs) - - if len(chain.steps) == nstep+1: - if log.isEnabledFor(logging.DEBUG): - log.debug("Adding finalDecisions for chain %s at step %d:"%(chain.name, nstep+1)) - for seq in chain_step.sequences: - finalDecisions[nstep].extend(seq.outputs) - if log.isEnabledFor(logging.DEBUG): - log.debug(seq.outputs) - - #end of loop over menu sequences - - #end of loop over chains for this step, now implement CF: - if log.isEnabledFor(logging.DEBUG): - log.debug("\n******** Create CF Tree %s with AthSequencers", stepCF_name) - #first make the filter step - stepFilter = create_step_filter_node(stepCF_name, CFseq_list, dump=False) - HLTNode += stepFilter - allSeq_list.append(CFseq_list) - - # then the reco step - stepCF = create_step_reco_node("%s_%s"%(HLTNodeName,stepCF_name), CFseq_list, dump=False) - HLTNode += stepCF - - - # then the monitor summary - summary=makeSummary("TriggerSummary"+ stepCF_name, step_decisions) - HLTNode += summary - - if log.isEnabledFor(logging.DEBUG): - log.debug("Now Draw...") - stepCF_DataFlow_to_dot("%s_%s"%(HLTNodeName,stepCF_name), CFseq_list) - stepCF_ControlFlow_to_dot(stepCF) - - if log.isEnabledFor(logging.DEBUG): - log.info("************* End of step %d, %s", nstep+1, stepCF_name) - # end of steps - - - if log.isEnabledFor(logging.DEBUG): - log.debug("finalDecisions: %s" %str( finalDecisions) ) - all_DataFlow_to_dot(HLTNodeName, allSeq_list) - return finalDecisions - - - -## This can be simplified! -def buildFilter(stepCF_name,previous_sequence, CFseq_list, chain, filter_input, previous_seeds): - from TrigUpgradeTest.MenuComponents import RoRSequenceFilterNode -#### Build the FILTER -# one filter per previous sequence at the start of the sequence: check if it exists or create a new one -# if the previous hypo has more than one output, try to get all of them -# one filter per previous sequence: 1 input/previous seq, 1 output/next seq - filter_name="Filter%s_on_%s"%(stepCF_name,previous_sequence) - findFilter= [cfseq.filter for cfseq in CFseq_list if filter_name in cfseq.filter.algname] - n_filters = len(findFilter) - if n_filters == 1: - sfilter=findFilter[0] - sfilter.setChains(chain.name) - if log.isEnabledFor(logging.DEBUG): - log.debug("Filter %s already exists", filter_name) - log.debug("Adding chain %s to %s", chain.name,sfilter.algname) - log.debug(sfilter.getChains()) - - - elif n_filters == 0: - sfilter = RoRSequenceFilterNode(name=filter_name) - for i in previous_seeds: sfilter.addSeed(i) - for i in filter_input: sfilter.addInput(i) - filter_out=["%s_from_%s"%(filter_name,i) for i in filter_input] - for o in filter_out: sfilter.addOutput(o) - sfilter.setChains(chain.name) - if log.isEnabledFor(logging.DEBUG): - log.debug("Adding these seeds to filter: %s", previous_seeds) - log.debug("Filter Done: %s", sfilter.name) - else: - log.error("found %d filters with name %s", n_filters, filter_name) - sys.exit("ERROR, in filter configuration") - - return (sfilter,n_filters) - - - - - - diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/HLTSignatureConfig.py b/Trigger/TrigValidation/TrigUpgradeTest/python/HLTSignatureConfig.py index b97d03e3de3080d16de538d417c73c3c3458b943..120ea01fe8060ed8c5b4cce723f92404bb8040f0 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/python/HLTSignatureConfig.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/python/HLTSignatureConfig.py @@ -3,7 +3,7 @@ from TrigUpgradeTest.TrigUpgradeTestConf import HLTTest__TestHypoAlg from TrigUpgradeTest.TrigUpgradeTestConf import HLTTest__TestHypoTool from TrigUpgradeTest.TrigUpgradeTestConf import HLTTest__TestComboHypoAlg from AthenaCommon.Constants import VERBOSE,DEBUG - +from TrigUpgradeTest.HLTSignatureHypoTools import * from TrigUpgradeTest.TrigUpgradeTestConf import HLTTest__TestInputMaker def InputMakerAlg(name): @@ -15,7 +15,7 @@ def InputMakerAlg(name): # - declare all the RecoAlg and the HypoAlg -> create the Sequence # - creates the InputMaker, without the inputs -from TrigUpgradeTest.MenuComponents import MenuSequence +from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import MenuSequence from AthenaCommon.CFElements import parOR, seqAND, stepSeq @@ -49,8 +49,11 @@ muHypo.Input = muAlg.Output mustep1_sequence = seqAND("muSeqStep1", [muIM, muAlg]) + + + def muStep1Sequence(): - return MenuSequence(Sequence=mustep1_sequence, Maker=muIM, Hypo=muHypo,HypoToolClassName="MuTestHypoTool") + return MenuSequence(Sequence=mustep1_sequence, Maker=muIM, Hypo=muHypo, HypoToolGen=MuTestHypoTool) # mu step2 muIM2= InputMakerAlg(name="Step2MuInputMaker") @@ -66,7 +69,7 @@ muHypo2.Input = muAlg2.Output mustep2_sequence = seqAND("muSeqStep2", [muIM2, muAlg2]) def muStep2Sequence(): - return MenuSequence( Sequence=mustep2_sequence, Maker=muIM2, Hypo=muHypo2, HypoToolClassName="MuTest2HypoTool") + return MenuSequence( Sequence=mustep2_sequence, Maker=muIM2, Hypo=muHypo2, HypoToolGen=MuTest2HypoTool) @@ -98,7 +101,7 @@ elstep1_sequence = seqAND("elSeqStep1", [elIM, elAlg]) def elStep1Sequence(): - return MenuSequence( Maker=elIM, Sequence=elstep1_sequence, Hypo=elHypo, HypoToolClassName="ElTestHypoTool") + return MenuSequence( Maker=elIM, Sequence=elstep1_sequence, Hypo=elHypo, HypoToolGen=ElTestHypoTool) #step2 elIM2= InputMakerAlg(name="Step2ElInputMaker") @@ -114,5 +117,5 @@ elHypo2.Input = elAlg2.Output elstep2_sequence = seqAND("elSeqStep2", [elIM2, elAlg2]) def elStep2Sequence(): - return MenuSequence( Maker=elIM2, Sequence=elstep2_sequence, Hypo=elHypo2, HypoToolClassName="ElTestHypoTool") + return MenuSequence( Maker=elIM2, Sequence=elstep2_sequence, Hypo=elHypo2, HypoToolGen=ElTestHypoTool) diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/MenuComponents.py b/Trigger/TrigValidation/TrigUpgradeTest/python/MenuComponents.py deleted file mode 100644 index d916a18e2340c71520ee2d375b7fdf23e231fd75..0000000000000000000000000000000000000000 --- a/Trigger/TrigValidation/TrigUpgradeTest/python/MenuComponents.py +++ /dev/null @@ -1,603 +0,0 @@ -import sys, re, copy -from AthenaCommon.Logging import logging -from AthenaCommon.Constants import VERBOSE,INFO,DEBUG -log = logging.getLogger('MenuComponents') -log.setLevel( VERBOSE ) -logLevel=DEBUG - -from DecisionHandling.DecisionHandlingConf import RoRSeqFilter - -class Node(): - """ base class representing one Alg + inputs + outputs, to be used to Draw dot diagrams and connect objects""" - def __init__(self, Alg): - self.name = ("%sNode")%( Alg.name()) - self.Alg=Alg - self.algname = Alg.name() - self.inputs=[] - self.outputs=[] - - def addOutput(self, name): - self.outputs.append(name) - - def addInput(self, name): - self.inputs.append(name) - - def getOutputList(self): - return self.outputs - - def getInputList(self): - return self.inputs - - def __str__(self): - return "Node::%s [%s] -> [%s]"%(self.algname, ' '.join(map(str, self.getInputList())), ' '.join(map(str, self.getOutputList()))) - - - -class AlgNode(Node): - """Node class that connects inputs and outputs to basic alg. properties """ - def __init__(self, Alg, inputProp, outputProp): - Node.__init__(self, Alg) - self.outputProp=outputProp - self.inputProp=inputProp - - def addDefaultOutput(self): - if self.outputProp is not '': - self.addOutput(("%s_%s"%(self.algname,self.outputProp))) - - def setPar(self, prop, name): - cval = self.Alg.getProperties()[prop] - try: - if type(cval) == type(list()): - cval.append(name) - return setattr(self.Alg, prop, cval) - else: - return setattr(self.Alg, prop, name) - except: - pass - - def getPar(self, prop): - try: - return getattr(self.Alg, prop) - except: - return self.Alg.getDefaultProperty(prop) - raise "Error in reading property " + prop + " from " + self.Alg - - def addOutput(self, name): - if self.outputProp is not '': - return self.setPar(self.outputProp,name) - - def getOutputList(self): - outputs = [] - cval = self.getPar(self.outputProp) - if cval == '': - return outputs - if type(cval) == type(list()): - outputs.extend(cval) - else: - outputs.append(cval) - return outputs - - def addInput(self, name): - if self.inputProp is not '': - return self.setPar(self.inputProp,name) - - def getInputList(self): - inputs = [] - cval = self.getPar(self.inputProp) - if cval =='': - return inputs - if type(cval) == type(list()): - inputs.extend(cval) - else: - inputs.append(cval) - return inputs - - def __str__(self): - return "Alg::%s [%s] -> [%s]"%(self.algname, ' '.join(map(str, self.getInputList())), ' '.join(map(str, self.getOutputList()))) - - -class HypoToolConf(): - """ Class to group info on hypotools""" - def __init__(self, HypoToolClassName): - self.className =HypoToolClassName - self.name='' - self.conf='' - - def setName(self, name): - self.name=name - - def setConf(self, conf): - self.conf=conf - - -class HypoAlgNode(AlgNode): - """Node for HypoAlgs""" - def __init__(self, Alg): - assert isHypoBase(Alg), "Error in creating HypoAlgNode from Alg " + Alg.name() - AlgNode.__init__(self, Alg, 'HypoInputDecisions', 'HypoOutputDecisions') - self.addDefaultOutput() - self.tools = [] - self.previous=[] - - def addHypoTool (self, HypoToolConf): - from TrigUpgradeTest.MenuHypoTools import createHypoTool - tools = self.Alg.HypoTools - if HypoToolConf.name not in self.tools: - ## HypoTools are private, so need to be created when added to the Alg - self.Alg.HypoTools = tools+[createHypoTool(HypoToolConf.className, HypoToolConf.name, HypoToolConf.conf)] - self.tools.append(HypoToolConf.name) - return True - - - def setPreviousDecision(self,prev): - self.previous.append(prev) - return self.addInput(prev) - - def __str__(self): - return "HypoAlg::%s [%s] -> [%s], previous = [%s], HypoTools=[%s]"%(self.Alg.name(),' '.join(map(str, self.getInputList())), - ' '.join(map(str, self.getOutputList())), - ' '.join(map(str, self.previous)), - ' '.join(map(str, self.tools))) - - - - -class SequenceFilterNode(AlgNode): - """Node for any kind of sequence filter""" - def __init__(self, Alg, inputProp, outputProp): - AlgNode.__init__(self, Alg, inputProp, outputProp) - self.seeds = [] - - def setChains(self, name): - if log.isEnabledFor(logging.DEBUG): - log.debug("Adding Chain %s to filter %s"%(name, self.name)) - return self.setPar("Chains", name) - - def getChains(self): - return self.getPar("Chains") - - def addSeed(self, seed): - self.seeds.append(seed) - - def __str__(self): - return "SequenceFilter::%s [%s] -> [%s], seeds=[%s], chains=%s"%(self.Alg.name(),' '.join(map(str, self.getInputList())),' '.join(map(str, self.getOutputList())), ' '.join(map(str, self.seeds)), self.getChains()) - - - - -class RoRSequenceFilterNode(SequenceFilterNode): - def __init__(self, name): - Alg= RoRSeqFilter(name, OutputLevel = logLevel) - SequenceFilterNode.__init__(self, Alg, 'Input', 'Output') - - - -class InputMakerNode(AlgNode): - def __init__(self, Alg): - assert isInputMakerBase(Alg), "Error in creating InputMakerNode from Alg " + Alg.name() - AlgNode.__init__(self, Alg, 'InputMakerInputDecisions', 'InputMakerOutputDecisions') - Alg.OutputLevel = logLevel - - -from DecisionHandling.DecisionHandlingConf import ComboHypo -class ComboMaker(AlgNode): - def __init__(self, name): - Alg = ComboHypo(name) - if log.isEnabledFor(logging.DEBUG): - log.debug("Making combo Alg %s"%name) - AlgNode.__init__(self, Alg, 'HypoInputDecisions', 'HypoOutputDecisions') - Alg.OutputLevel = logLevel - self.prop="MultiplicitiesMap" - - - def addChain(self, chain): - if log.isEnabledFor(logging.DEBUG): - log.debug("ComboMaker %s adding chain %s"%(self.algname,chain)) - from MenuChains import getConfFromChainName - confs=getConfFromChainName(chain) - for conf in confs: - seed=conf.replace("HLT_", "") - integers = map(int, re.findall(r'^\d+', seed)) - multi=0 - if len(integers)== 0: - multi=1 - elif len(integers)==1: - multi=integers[0] - re.sub('^\d+',"",seed) #remove the multiplicity form the string - else: - sys.exit("ERROR in decoding combined chain %s"%(chain)) - - newdict={chain:[multi]} - cval = self.Alg.getProperties()[self.prop] - if type(cval) == type(dict()): - if chain in cval.keys(): - cval[chain].append(multi) - else: - cval[chain]=[multi] - else: - cval=newdict - setattr(self.Alg, self.prop, cval) - - - -######################################################### -# USEFULL TOOLS -######################################################### - -def isHypoBase(alg): - if 'HypoInputDecisions' in alg.__class__.__dict__: - return True - prop = alg.__class__.__dict__.get('_properties') - return ('HypoInputDecisions' in prop) - -def isInputMakerBase(alg): - return ('InputMakerInputDecisions' in alg.__class__.__dict__) - -def isFilterAlg(alg): - return isinstance(alg, RoRSeqFilter) - -########################################################## -# NOW sequences and chains -########################################################## - - -class MenuSequence(): - """ Class to group reco sequences with the Hypo""" - def __init__(self, Sequence, Maker, Hypo, HypoToolClassName): - from AthenaCommon.AlgSequence import AthSequencer - self.name = "S_%s"%(Hypo.name()) # sequence name is based on hypo name - self.sequence = Node( Alg=Sequence) - self.maker = InputMakerNode( Alg=Maker) - self.hypoToolConf = HypoToolConf(HypoToolClassName) - self.hypo = HypoAlgNode( Alg=Hypo) - self.inputs=[] - self.outputs=[] - self.seed='' - self.reuse = False # flag to draw dot diagrmas - - def replaceHypoForCombo(self,HypoAlg): - if log.isEnabledFor(logging.DEBUG): - log.debug("set new Hypo %s for combo sequence %s "%(HypoAlg.name(), self.name)) - self.hypo= HypoAlgNode( Alg=HypoAlg) - - def connectToFilter(self,sfilter): - filter_output = sfilter.getOutputList() - inputs=[filter_output[i] for i,fseed in enumerate (sfilter.seeds) if self.seed in fseed ] - if log.isEnabledFor(logging.DEBUG): - log.debug("connectToFilter: found %d inputs to sequence::%s from Filter::%s (from seed %s)", - len(inputs), self.name, sfilter.algname, self.seed) - for i in inputs: log.debug("- "+i) - if len(inputs) == 0: - sys.exit("ERROR, no inputs to sequence are set!") - for inp in inputs: - new_output = "%s_from_%s"%(self.hypo.algname, inp) - self.hypo.addOutput(new_output) - self.outputs.append( new_output) - - #### Connect the InputMaker - for i in inputs: - self.maker.addInput(i) - self.inputs.append(i) - input_maker_output=["%s_from_%s"%(self.maker.algname,i) for i in inputs ] - if len(input_maker_output) == 0: - sys.exit("ERROR, no outputs to sequence are set!") - for out in input_maker_output: - self.maker.addOutput(out) - self.hypo.setPreviousDecision(out) - if log.isEnabledFor(logging.DEBUG): - log.debug("connectToFilter: connecting InputMaker to HypoAlg: adding %d output to InputMaker::%s and sending to HypoAlg::%s", - len(inputs), self.maker.algname, self.hypo.algname) - for i in inputs: log.debug(i) - - def __str__(self): - return "MenuSequence::%s \n Hypo::%s \n Maker::%s \n Sequence::%s"%(self.name, self.hypo, self.maker, self.sequence) - - -class Chain: - """Basic class to define the trigger menu """ - def __init__(self, name, Seed, ChainSteps=[]): - self.name = name - self.seed=Seed - self.steps=ChainSteps - self.vseeds = Seed.strip().split("_") - self.vseeds.pop(0) #remove first L1 string - # group_seed is used to se tthe seed type (EM, MU,JET), removing the actual threshold - self.group_seed = ["L1"+filter(lambda x: x.isalpha(), stri) for stri in self.vseeds] - self.setSeedsToSequences() # save seed of each menuseq - if log.isEnabledFor(logging.DEBUG): - log.debug("Chain " + name + " with seeds: %s "%str( self.vseeds)) - - for step in self.steps: - if step.isCombo: - step.combo.addChain(self.name) - - - def setSeedsToSequences(self): - # set the seed to the menusequences - sequences1=self.steps[0].sequences - tot_seq=len(sequences1) - tot_seed=len(self.vseeds) - if tot_seq==tot_seed: - nseq=0 - for seed in self.vseeds: - for step in self.steps: - seq=step.sequences[nseq] - seq.seed ="L1"+filter(lambda x: x.isalpha(), seed) - if log.isEnabledFor(logging.DEBUG): - log.debug( "Chain %s adding seed %s to sequence %d in step %s"%(self.name, seq.seed, nseq, step.name)) - nseq+=1 - - else: - log.error("found %d sequences in this chain and %d seeds. What to do??", tot_seq, tot_seed) - sys.exit("ERROR, in chain configuration") - - def decodeHypoToolConfs(self): - """ This is extrapolating the hypotool configuration from the (combined) chain name""" - from MenuChains import getConfFromChainName - signatures = getConfFromChainName(self.name) - for step in self.steps: - if len(signatures) != len(step.sequences): - log.error("Error in step %s: found %d signatures and %d sequences"%(step.name, len(signatures), len(step.sequences))) - sys.exit("ERROR, in chain configuration") - nseq=0 - for seq in step.sequences: - seq.hypoToolConf.setConf(signatures[nseq]) - seq.hypoToolConf.setName(self.name) - seq.hypo.addHypoTool(seq.hypoToolConf) - nseq +=1 - - -class CFSequence(): - """Class to describe the ChainStep + filter""" - def __init__(self, ChainStep, FilterAlg): - self.name = ChainStep.name # not needed? - self.filter = FilterAlg - self.step=ChainStep - self.connect() - - def connect(self): - """Connect filter to ChainStep (all its sequences)""" - for seq in self.step.sequences: - seq.connectToFilter(self.filter) - - if self.step.isCombo: self.connectCombo() - - def connectCombo(self): - # reset sequence output, they will b ereplaced by new combo outputs - for seq in self.step.sequences: - seq.outputs=[] - - for seq in self.step.sequences: - combo_input=seq.hypo.getOutputList()[0] - self.step.combo.addInput(combo_input) - log.debug("Adding inputs %s to combo %s"%(combo_input, self.step.combo.algname)) - # inputs are the output decisions of the hypos of the sequences - # outputs are the modified name of input deciions that need to be connected to the next filter - combo_output="combo_%s"%combo_input - self.step.combo.addOutput(combo_output) - seq.outputs.append(combo_output) - log.debug("Adding outputs %s to combo %s"%(combo_output, self.step.combo.algname)) - - - def __str__(self): - return "--- CFSequence %s ---\n + Filter: %s \n + %s \n "%(self.name,\ - self.filter, self.step ) - - - - - -class ChainStep: - """Class to describe one step of a chain; if more than one menuSequence, then the step is combo""" - def __init__(self, name, Sequences=[]): - self.name = name - self.sequences=[] - self.isCombo=len(Sequences)>1 - self.combo=None - if self.isCombo: - self.makeCombo(Sequences) - else: - self.sequences = Sequences - - - def replaceSequence(self, old, new): - # maybe obsolete? - idx=self.sequences.index(old) # this raise exception - self.sequences.pop(idx) - self.sequences.insert(idx, new) - - def makeCombo(self, Sequences): - # For combo sequences, duplicate the Hypo with a Combo_name and create the comboHypoAlg - self.combo = ComboMaker("ComboHypo_%s"%self.name) - for sequence in Sequences: - new_sequence=copy.deepcopy(sequence) - new_sequence.name=("%s_Combo"%sequence.name) - oldhypo=sequence.hypo.Alg - new_hypoAlg=oldhypo.clone("%s_Combo"%oldhypo.name()) - new_sequence.replaceHypoForCombo(new_hypoAlg) - self.sequences.append(new_sequence) - - def __str__(self): - return "--- ChainStep %s ---\n + isCombo: %d \n + %s \n "%(self.name, self.isCombo, ' '.join(map(str, self.sequences) )) - - -from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator -class InEventReco( ComponentAccumulator ): - """ Class to handle in-event reco """ - pass - - -class InViewReco( ComponentAccumulator ): - """ Class to handle in-view reco, sets up the View maker if not provided and exposes InputMaker so that more inputs to it can be added in the process of assembling the menu """ - def __init__(self, name, viewMaker=None): - super( InViewReco, self ).__init__() - self.name = name - from AthenaCommon.CFElements import parOR, seqAND - self.mainSeq = seqAND( name ) - self.addSequence( self.mainSeq ) - - from ViewAlgs.ViewAlgsConf import EventViewCreatorAlgorithm - if viewMaker: - self.viewMakerAlg = viewMaker - else: - from AthenaCommon.Constants import DEBUG - self.viewMakerAlg = EventViewCreatorAlgorithm(name+'ViewsMaker', - ViewFallThrough = True, - RoIsLink = 'initialRoI', # -||- - InViewRoIs = name+'RoIs', - Views = name+'Views', - ViewNodeName = name+"InView", - OutputLevel=DEBUG) - - self.addEventAlgo( self.viewMakerAlg, self.mainSeq.name() ) - self.viewsSeq = parOR( self.viewMakerAlg.ViewNodeName ) - self.addSequence( self.viewsSeq, self.mainSeq.name() ) - - def addInputFromFilter(self, filterAlg ): - assert len(filterAlg.Output) == 1, "Can only oprate on filter algs with one configured output, use addInput to setup specific inputs" - self.addInput( filterAlg.Output[0], "Reco_"+( filterAlg.Output[0].replace("Filtered_", "") ) ) - - def addInput(self, inKey, outKey ): - """Adds input (DecisionsContainer) from which the views should be created """ - self.viewMakerAlg.InputMakerInputDecisions += [ inKey ] - self.viewMakerAlg.InputMakerOutputDecisions += [ outKey ] - - def addRecoAlg( self, alg ): - """Reconstruction alg to be run per view""" - self.addEventAlgo( alg, self.viewsSeq.name() ) - - def sequence( self ): - return self.mainSeq - - def inputMaker( self ): - return self.viewMakerAlg - - -class RecoFragmentsPool: - """ Class to host all the reco fragments that need to be reused """ - fragments = {} - @classmethod - def retrieve( cls, creator, flags, **kwargs ): - """ create, or return created earlier reco fragment - - Reco fragment is uniquelly identified by the function and set og **kwargs. - The flags are not part of unique identifier as creation of new reco fragments should not be caused by difference in the unrelated flags. - """ - - from AthenaCommon.Logging import logging - requestHash = hash( ( creator, tuple(kwargs.keys()), tuple(kwargs.values()) ) ) - if requestHash not in cls.fragments: - recoFragment = creator( flags, **kwargs ) - cls.fragments[requestHash] = recoFragment - log.debug( "created reconstruction fragment" ) - return recoFragment - else: - log.debug( "reconstruction fragment from the cache" ) - return cls.fragments[requestHash] - - # @classmethod - # def mergeTo( cls, acc ): - # """ Adds algorithms in the reco fragments and all related services to the accumulator """ - # for frag in cls.fragments.values(): - # acc.merge( frag ) - - - -class FilterHypoSequence( ComponentAccumulator ): - def __init__( self, name ): - super( FilterHypoSequence, self ).__init__() - from AthenaCommon.CFElements import seqAND - self.name = name - self.mainSeq = seqAND( name ) - self.addSequence( self.mainSeq ) - self.filterAlg = None - self.reco = None - self.hypoAlg = None - - def addReco( self, reco ): - """ Adds reconstruction sequence, has to be one of InViewReco or InEventReco objects """ - assert self.filterAlg, "The filter alg has to be setup first" - self.reco = reco - reco.addInputFromFilter( self.filterAlg ) - self.addSequence( reco.sequence(), self.mainSeq.name() ) - self.merge( reco ) - - def addFilter( self, chains, inKey ): - """ adds filter alg of type RoRSeqFilter, output key is predefined by the sequence name as: Filtered + the name""" - from DecisionHandling.DecisionHandlingConf import RoRSeqFilter - self.filterAlg = RoRSeqFilter( self.name+'Filter' ) - self.filterAlg.Input = [ inKey ] - self.filterAlg.Output = [ 'Filtered_'+self.name ] - self.filterAlg.Chains = chains - from AthenaCommon.Constants import DEBUG - self.filterAlg.OutputLevel = DEBUG - self.addEventAlgo( self.filterAlg, self.mainSeq.name() ) - - def hypoDecisions( self ): - return "Decisions_"+self.name - - def addHypo( self, hypo ): - self.hypoAlg = hypo - self.hypoAlg.HypoInputDecisions = self.reco.inputMaker().InputMakerOutputDecisions[-1] - self.hypoAlg.HypoOutputDecisions = self.hypoDecisions() - self.addEventAlgo( hypo, self.mainSeq.name() ) - - def sequence( self ): - return self.mainSeq - - def filter( self ): - return self.filterAlg - - def check( self ): - assert self.filterAlg, "Filter not configured" - assert self.hypoAlg, "Hypo alg is not configured" - - -class HLTMenuAccumulator( ComponentAccumulator ): - def __init__( self ): - super( HLTMenuAccumulator, self ).__init__() - from AthenaCommon.CFElements import seqAND - HLTSteps = seqAND( "HLTSteps" ) - self.addSequence( HLTSteps ) - - def __getOrMakeStepSequence(self, step, isFilter = False ): - """ Constructs sequence for the step, the filtering step or, reco step will be created depending on isFilter flags - - The function assures that all previous steps are aready in place i.e. HLTStep_1_filter, HLTStep_1 ... until HLTStep_N-1 are in place. - Therefore the steps can be added in any order (not yet sure if that will but better assure robustness now) - """ - from AthenaCommon.CFElements import parOR - name = "HLTStep_%d%s" % (step, "_filters" if isFilter else "" ) - - s = self.getSequence( name ) - if s: - return s - # make sure that sequences for previous steps are in place - for p in range( 1, step ): - self.__getOrMakeStepSequence( p, isFilter = True ) - self.__getOrMakeStepSequence( p, isFilter = False ) - # make sure that filtering steps is placed before reco steps - if not isFilter: - self.__getOrMakeStepSequence( step, isFilter = True ) - s = parOR( name ) - self.addSequence( s, parentName="HLTSteps") - return s - - - def setupSteps( self, steps ): - """ The main menu function, it is responsible for crateion of step sequences and placing slice specific sequencers there. - - It would rely on the MenuSeq object API in two aspects, to obtain filter alg and to obtain the reco sequence - The MenuSeq should already contain all the chains that are needed for the menu setup (chains info can be accessed via flags passed when steps were created) - """ - for stepNo, fhSeq in enumerate( steps, 1 ): - filterStep = self.__getOrMakeStepSequence( stepNo, isFilter = True ) - filterStep += fhSeq.filter() # FilterHypoSequence API - - recoStep = self.__getOrMakeStepSequence( stepNo, isFilter = False ) - self.addSequence( fhSeq.sequence(), recoStep.name() ) - - - def steps( self ): - """ returns step seqeuncers """ - return self.getSequence("HLTSteps") diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/MenuHypoTools.py b/Trigger/TrigValidation/TrigUpgradeTest/python/MenuHypoTools.py deleted file mode 100644 index ba77b854eb2abfb32113427f8612b2f11c41b10f..0000000000000000000000000000000000000000 --- a/Trigger/TrigValidation/TrigUpgradeTest/python/MenuHypoTools.py +++ /dev/null @@ -1,62 +0,0 @@ - -from TrigUpgradeTest.HLTSignatureHypoTools import TestHypoTool, MuTestHypoTool, ElTestHypoTool, MuTest2HypoTool -from TrigEgammaHypo.TrigEgammaHypoConf import TrigL2CaloHypoToolInc, TrigL2CaloHypoToolMult, TrigL2ElectronHypoTool, TrigL2PhotonHypoTool -from TrigMuonHypo.TrigMuonHypoConf import TrigMufastHypoTool, TrigmuCombHypoTool, TrigMuisoHypoTool -from AthenaCommon.Constants import VERBOSE,INFO,DEBUG - - -# HypoTool name is the chain name (can be combined) -# HypoTool conf is a string decondgin the actual configuration (not combined) - -def createHypoTool(hypoToolClassName, hypoToolName, hypoToolConf): - try: - obj=eval(hypoToolClassName)(hypoToolName, hypoToolConf) - except: - print "Error in creating HypoTool " + hypoToolName + " of type " + hypoToolClassName + " with conf " + hypoToolConf - raise - return obj - - -def TrigL2CaloHypoToolConf(name, conf): - from TrigEgammaHypo.TrigL2CaloHypoTool import TrigL2CaloHypoToolFromName - hypotool= TrigL2CaloHypoToolFromName(name,conf) - hypotool.OutputLevel = DEBUG - return hypotool - -def TrigL2ElectronHypoToolConf(name,conf): - from TrigEgammaHypo.TrigL2ElectronHypoTool import TrigL2ElectronHypoToolFromName - hypotool= TrigL2ElectronHypoToolFromName(name,conf) - hypotool.OutputLevel = DEBUG - return hypotool - -def TrigL2PhotonHypoToolConf(name,conf): - from TrigEgammaHypo.TrigL2PhotonHypoTool import TrigL2PhotonHypoToolFromName - hypotool= TrigL2PhotonHypoToolFromName(name,conf) - hypotool.OutputLevel = VERBOSE - return hypotool - - -def TrigMufastHypoToolConf(name, conf): - from TrigMuonHypo.testTrigMuonHypoConfig import TrigMufastHypoToolFromName - hypotool= TrigMufastHypoToolFromName(name, conf) - hypotool.OutputLevel = DEBUG - return hypotool - -def TrigmuCombHypoToolConf(name, conf): - from TrigMuonHypo.testTrigMuonHypoConfig import TrigmuCombHypoToolFromName - hypotool= TrigmuCombHypoToolFromName(name, conf) - hypotool.OutputLevel = DEBUG - return hypotool - -def TrigMuisoHypoToolConf(name, conf): - from TrigMuonHypo.testTrigMuonHypoConfig import TrigMuisoHypoToolFromName - hypotool= TrigMuisoHypoToolFromName(name, conf) - hypotool.OutputLevel = DEBUG - return hypotool - -def TrigMuonEFMSonlyHypoToolConf(name, conf): - from AthenaCommon.Constants import DEBUG - from TrigMuonHypo.testTrigMuonHypoConfig import TrigMuonEFMSonlyHypoToolFromName - hypotool= TrigMuonEFMSonlyHypoToolFromName(name, conf) - hypotool.OutputLevel = DEBUG - return hypotool diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/MuonSetup.py b/Trigger/TrigValidation/TrigUpgradeTest/python/MuonSetup.py index 6519f70966c12f16999f3350229a109be069400e..800bd5d5f364fe7538ec714f19dcd417d90b346d 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/python/MuonSetup.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/python/MuonSetup.py @@ -142,7 +142,9 @@ def makeMuonPrepDataAlgs( doL2SA, doEFSA ): from MuonByteStream.MuonByteStreamConf import Muon__RpcRawDataProvider RpcRawDataProvider = Muon__RpcRawDataProvider(name = "RpcRawDataProvider", - ProviderTool = MuonRpcRawDataProviderTool ) + ProviderTool = MuonRpcRawDataProviderTool, + DoSeededDecoding = True, + RoIs = "MURoIs") #OutputLevel = INFO) if doEFSA == True: viewAlgs_MuEFSA.append( RpcRawDataProvider ) diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/PhotonMenuConfig.py b/Trigger/TrigValidation/TrigUpgradeTest/python/PhotonMenuConfig.py index 553681fe348cfd32d571ac2ffd1301d6193c1de6..2df10841bf16e230943bb10a90ce7eeeb001224f 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/python/PhotonMenuConfig.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/python/PhotonMenuConfig.py @@ -7,8 +7,8 @@ from AthenaCommon.Constants import DEBUG,VERBOSE def l2PhotonCaloStepCfg( flags, chains ): - from TrigUpgradeTest.MenuComponents import FilterHypoSequence - fhSeq = FilterHypoSequence( 'PhotonFastCalo' ) + from TrigUpgradeTest.MenuComponents import NJMenuSequence + fhSeq = NJMenuSequence( 'PhotonFastCalo' ) fhSeq.addFilter( chains, inKey = 'EMRoIDecisions' ) from TrigUpgradeTest.ElectronMenuConfig import l2CaloRecoCfg # generator for the L2 Calo EM clustering @@ -64,8 +64,8 @@ def l2PhotonRecoCfg( flags ): return reco def l2PhotonRecoStepCfg( flags, chains, inputSequence ): - from TrigUpgradeTest.MenuComponents import FilterHypoSequence - fhSeq = FilterHypoSequence( 'PhotonFastReco' ) + from TrigUpgradeTest.MenuComponents import NJMenuSequence + fhSeq = NJMenuSequence( 'PhotonFastReco' ) fhSeq.addFilter( chains, inKey=inputSequence.hypoDecisions() ) from TrigUpgradeTest.ElectronMenuConfig import l2CaloRecoCfg # generator for the L2 Calo EM clustering diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/egammaMenuDefs.py b/Trigger/TrigValidation/TrigUpgradeTest/python/egammaMenuDefs.py index e0b0912ba64a0439c7f2002ddcc875c6108e0870..6102835e50e772dcd7b58b734dea69692fea2e04 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/python/egammaMenuDefs.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/python/egammaMenuDefs.py @@ -25,7 +25,7 @@ include("InDetRecExample/InDetRecConditionsAccess.py") from InDetRecExample.InDetKeys import InDetKeys # menu components -from TrigUpgradeTest.MenuComponents import MenuSequence +from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import MenuSequence # =============================================================================================== # L2 Calo @@ -67,11 +67,13 @@ theFastCaloHypo.CaloClusters = theFastCaloAlgo.ClustersName fastCaloAthSequence = seqAND("fastCaloAthSequence",[fastCaloViewsMaker, fastCaloInViewAlgs ]) +from TrigEgammaHypo.TrigL2CaloHypoTool import TrigL2CaloHypoToolFromName + def fastCaloSequence(): - return MenuSequence( Sequence=fastCaloAthSequence, - Maker=fastCaloViewsMaker, - Hypo=theFastCaloHypo, - HypoToolClassName="TrigL2CaloHypoToolConf") + return MenuSequence( Sequence = fastCaloAthSequence, + Maker = fastCaloViewsMaker, + Hypo = theFastCaloHypo, + HypoToolGen = TrigL2CaloHypoToolFromName ) ######################################### # second step: tracking..... @@ -140,10 +142,11 @@ theElectronHypo.OutputLevel = VERBOSE electronAthSequence = seqAND("electronAthSequence", eventAlgs + [l2ElectronViewsMaker, electronInViewAlgs ] ) +from TrigEgammaHypo.TrigL2ElectronHypoTool import TrigL2ElectronHypoToolFromName def electronSequence(): - return MenuSequence( Maker=l2ElectronViewsMaker, - Sequence=electronAthSequence, - Hypo=theElectronHypo, - HypoToolClassName="TrigL2ElectronHypoToolConf") + return MenuSequence( Maker = l2ElectronViewsMaker, + Sequence = electronAthSequence, + Hypo = theElectronHypo, + HypoToolGen = TrigL2ElectronHypoToolFromName ) diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/muMenuDefs.py b/Trigger/TrigValidation/TrigUpgradeTest/python/muMenuDefs.py index 24e62db9483f020cbfb729456f7bfcadf62e1c2f..9b5939e2fcb7ec225df12ea937186a0cbe5c0618 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/python/muMenuDefs.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/python/muMenuDefs.py @@ -39,7 +39,7 @@ from MuonRecExample.MuonRecFlags import muonRecFlags # menu components -from TrigUpgradeTest.MenuComponents import MenuSequence +from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import MenuSequence ### for Control Flow ### from AthenaCommon.CFElements import parOR, seqAND, seqOR, stepSeq @@ -180,10 +180,13 @@ trigMufastHypo.MuonL2SAInfoFromMuFastAlg = muFastAlg.MuonL2SAInfo l2muFastSequence = seqAND("l2muFastSequence", [ l2MuViewsMaker, l2MuViewNode ]) -muFastStep = MenuSequence( Sequence=l2muFastSequence, - Maker=l2MuViewsMaker, - Hypo=trigMufastHypo, - HypoToolClassName="TrigMufastHypoToolConf") + +from TrigMuonHypo.testTrigMuonHypoConfig import TrigMufastHypoToolFromName + +muFastStep = MenuSequence( Sequence = l2muFastSequence, + Maker = l2MuViewsMaker, + Hypo = trigMufastHypo, + HypoToolGen = TrigMufastHypoToolFromName ) ### ************* Step2 ************* ### @@ -231,10 +234,11 @@ trigmuCombHypo.MuonL2CBInfoFromMuCombAlg = muCombAlg.L2CombinedMuonContainerName l2muCombSequence = seqAND("l2muCombSequence", eventAlgs + [l2muCombViewsMaker, l2muCombViewNode ] ) -muCombStep = MenuSequence( Sequence=l2muCombSequence, - Maker=l2muCombViewsMaker, - Hypo=trigmuCombHypo, - HypoToolClassName="TrigmuCombHypoToolConf") +from TrigMuonHypo.testTrigMuonHypoConfig import TrigmuCombHypoToolFromName +muCombStep = MenuSequence( Sequence = l2muCombSequence, + Maker = l2muCombViewsMaker, + Hypo = trigmuCombHypo, + HypoToolGen = TrigmuCombHypoToolFromName ) ### ************* Step3 ************* ### @@ -349,10 +353,12 @@ trigMuonEFSAHypo.MuonDecisions = "Muons" muonEFMSonlySequence = seqAND( "muonEFMSonlySequence", [efMuViewsMaker, efMuViewNode] ) -muonEFSAStep = MenuSequence( Sequence=muonEFMSonlySequence, - Maker=efMuViewsMaker, - Hypo=trigMuonEFSAHypo, - HypoToolClassName="TrigMuonEFMSonlyHypoToolConf") +from TrigMuonHypo.testTrigMuonHypoConfig import TrigMuonEFMSonlyHypoToolFromName + +muonEFSAStep = MenuSequence( Sequence = muonEFMSonlySequence, + Maker = efMuViewsMaker, + Hypo = trigMuonEFSAHypo, + HypoToolGen = TrigMuonEFMSonlyHypoToolFromName ) ### setup l2Muiso @@ -379,14 +385,14 @@ trigmuIsoHypo = TrigMuisoHypoAlg("L2MuisoHypoAlg") trigmuIsoHypo.OutputLevel = DEBUG trigmuIsoHypo.MuonL2ISInfoName = trigL2muIso.MuonL2ISInfoName - +from TrigMuonHypo.testTrigMuonHypoConfig import TrigMuisoHypoToolFromName ### Define a Sequence to run for muIso ### l2muIsoSequence = seqAND("l2muIsoSequence", [ l2muIsoViewsMaker, l2muIsoViewNode ] ) -muIsoStep = MenuSequence( Sequence=l2muIsoSequence, - Maker=l2muIsoViewsMaker, - Hypo=trigmuIsoHypo, - HypoToolClassName="TrigMuisoHypoToolConf") +muIsoStep = MenuSequence( Sequence = l2muIsoSequence, + Maker = l2muIsoViewsMaker, + Hypo = trigmuIsoHypo, + HypoToolGen = TrigMuisoHypoToolFromName ) def TMEF_TrkMaterialProviderTool(name='TMEF_TrkMaterialProviderTool',**kwargs): diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/photonMenuDefs.py b/Trigger/TrigValidation/TrigUpgradeTest/python/photonMenuDefs.py index 07dc68488705df9b71d3ba99612d38e3f8b18631..bc582590cb19a4352ef63de49a1f940e5c362699 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/python/photonMenuDefs.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/python/photonMenuDefs.py @@ -8,7 +8,7 @@ from AthenaCommon.AppMgr import ServiceMgr as svcMgr import AthenaCommon.CfgMgr as CfgMgr # menu components -from TrigUpgradeTest.MenuComponents import MenuSequence +from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import MenuSequence # =============================================================================================== # L2 Calo @@ -48,11 +48,14 @@ theFastCaloHypo.CaloClusters = theFastCaloAlgo.ClustersName fastCaloAthSequence = seqAND("fastCaloAthSequence",[fastCaloViewsMaker, fastCaloInViewAlgs ]) + +from TrigEgammaHypo.TrigL2CaloHypoTool import TrigL2CaloHypoToolFromName + def fastCaloSequence(): - return MenuSequence( Sequence=fastCaloAthSequence, - Maker=fastCaloViewsMaker, - Hypo=theFastCaloHypo, - HypoToolClassName="TrigL2CaloHypoToolConf") + return MenuSequence( Sequence = fastCaloAthSequence, + Maker = fastCaloViewsMaker, + Hypo = theFastCaloHypo, + HypoToolGen = TrigL2CaloHypoToolFromName ) @@ -96,10 +99,10 @@ thePhotonHypo.OutputLevel = VERBOSE photonAthSequence = seqAND("photonAthSequence", [l2PhotonViewsMaker, photonInViewAlgs] ) - +from TrigEgammaHypo.TrigL2PhotonHypoTool import TrigL2PhotonHypoToolFromName def photonSequence(): return MenuSequence( Maker=l2PhotonViewsMaker, Sequence=photonAthSequence, Hypo=thePhotonHypo, - HypoToolClassName="TrigL2PhotonHypoToolConf") + HypoToolGen=TrigL2PhotonHypoToolFromName) diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/DictFromChainName.py b/Trigger/TrigValidation/TrigUpgradeTest/share/DictFromChainName.py deleted file mode 100644 index e9280f7e0bc1e22e7510af74da467c4f7fe3e505..0000000000000000000000000000000000000000 --- a/Trigger/TrigValidation/TrigUpgradeTest/share/DictFromChainName.py +++ /dev/null @@ -1,261 +0,0 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration - -""" - -Class to obtain the chain configuration dictionary from the short or long name - -Authors: Catrin Bernius, Joerg Stelzer, Moritz Backes -Written in December 2013 -Re-written for AthenaMT starting in July 2017 - -""" -__author__ = 'Moritz Backes & Catrin Bernius & Joerg Stelzer' -__version__="" -__doc__="Obtaining Dictionaries from Chain Names" - -from AthenaCommon.Logging import logging -logging.getLogger().info("Importing %s",__name__) -log = logging.getLogger('TriggerMenu.menu.DictFromChainName') - -include("TrigUpgradeTest/SignatureDicts.py") - - -class DictFromChainName(object): - - def getChainDict(self,chainInfo): - log.debug("chainInfo %s", chainInfo) - - m_chainName = chainInfo[0] - m_L1item = chainInfo[1] - m_L1items_chainParts=[] - - log.debug("Analysing chain with name: %s", m_chainName) - chainProp = self.analyseShortName(m_chainName, m_L1items_chainParts, m_L1item) - log.debug('ChainProperties: %s', chainProp) - - if (chainProp['L1item']== ''): chainProp['L1item'] = m_L1item - - import pprint - pp = pprint.PrettyPrinter(indent=4, depth=8) - log.info('FINAL dictionary: %s', pp.pformat(chainProp)) - - return chainProp - - def analyseShortName(self, chainName, L1items_chainParts, L1item_main): - """ - Function to obtain the chain configuration dictionay from the short name - by parsing its components and finding the corrsponding properties which - are defined in SliceDicts - """ - from copy import deepcopy - - # ---- dictionary with all chain properties ---- - finalChainDict = deepcopy(ChainDictTemplate) - finalChainDict['chainName'] = chainName - - # ---- specific chain part information ---- - cparts = chainName.split("_") - log.debug("cparts: %s", cparts) - - # ---- Find the signature defining patterns as BasePattern ---- - # ---- <Multiplicity(int)><TriggerType(str)><Threshold(int)><etra,...(str|str+int)> ---- - pattern = getBasePattern() - - # ---- define some dictionaries ---- - chainPartDicts=[] # stores the list of dictionaries in case of multiple chain parts - mdicts=[] # generated when checking for the BasePattern - multichainindex=[] - signatureNames = [] - - # ---- Loop over all chain name parts ---- - for cpart in cparts: - log.debug("Looping over cpart: %s", cpart) - - m = pattern.match(cpart) - if m: - log.debug("Pattern found in this string: %s", cpart) - m_groupdict = m.groupdict() - multiChainIndices = [i for i in range(len(chainName)) if ( chainName.startswith(cpart, i) ) ] - log.debug("MultiChainIndices: %s", multiChainIndices) - for theMultiChainIndex in multiChainIndices: - # this check is necessary for the bjet chains, example: j45_bloose_3j45 - if (theMultiChainIndex != 0) & (chainName[theMultiChainIndex-1] != '_'): continue - if not theMultiChainIndex in multichainindex: - multichainindex.append(theMultiChainIndex) - log.debug("multichainindex: %s", multichainindex) - - m_groupdict['signature'] = getSignatureNameFromToken(cpart) - sigToken = getSignatureNameFromToken(cpart) - if sigToken not in signatureNames: signatureNames.append(sigToken) - mdicts.append(m_groupdict) - - else: - log.info('not a BasePattern, continue with analysis') - - # ---- If multiple parts exist, split the string and analyse each ---- - # ---- part depending on the signature it belongs to ---- - multichainparts=[] - multichainindex = sorted(multichainindex, key=int) - cN = chainName - for i in reversed(multichainindex): - if i!=0: - log.debug('Appending to multichainparts (i!=0): %s', chainName[i:len(cN)]) - multichainparts.append(chainName[i:len(cN)]) - cN = cN[0:i-1] - else: - log.debug('Appending to multichainparts: %s', chainName[i:len(cN)]) - multichainparts.append(cN) - log.debug("multichainparts: %s",multichainparts) - - # ---- build the chainProperties dictionary for each part of the chain ---- - # ---- add it to a chainPartDicts ---- - multichainparts.reverse() - for chainindex, chainparts in enumerate(multichainparts): - chainProperties = {} #will contain properties for one part of chain if multiple parts - log.debug('chainparts %s', chainparts) - - # ---- check if L1 item is specified in chain Name ---- - L1itemfromChainName = ''; L1item = ''; - chainpartsNoL1 = chainparts - - # Checking for L1 item for chain part and overall in the name and the L1 for the overall chain - if (chainparts.count("_L1") > 1): - # get position of all L1 items - import re - allL1indices = [match.start() for match in re.finditer(re.escape("_L1"), chainparts)] - allL1items = [] - m_chainparts = deepcopy(chainparts) - for index in reversed(allL1indices): - newindex = index+1 - m_newitem = m_chainparts[newindex:] - m_chainparts = m_chainparts[:newindex-1] - newitem = m_newitem[:2]+'_'+m_newitem[2:] - allL1items.append(newitem) - - allL1items.reverse() - if (allL1items[1] != L1item_main): - log.error("Typo in chain name for overall L1 item? Please check again") - else: # remove the L1 item from the chain name - chainparts = chainparts[:allL1indices[1]] - - if (allL1items[0] not in L1items_chainParts): - log.error("L1 chain part " +L1items_chainParts+" does not match the one in the chain name "+allL1items[0]) - - #this only finds the FIRST instance on L1 - L1index = chainparts.find('_L1') - log.debug('chainparts: %s', chainparts) - log.debug('L1index: %s', L1index) - if L1index != -1: - L1index = L1index+1 # to compensate the _ - L1itemfromChainName = chainparts[L1index:] - if (L1itemfromChainName[2]=='_'): - raise RuntimeError('ERROR IN CHAIN NAME: L1 items are specified as e.g. *_L1EM4, not *_L1_EM4') - else: - L1item = L1itemfromChainName[:2]+'_'+L1itemfromChainName[2:] - if (L1item[-1] == '_'): L1item = L1item[:-1] - - chainpartsNoL1 = chainparts[:L1index-1] # -1 to also remove _ - - else: - log.debug('No L1 item specified in the name') - - # ---- assign L1 to chain parts from L1 item list in menu ---- - # ---- check if enough L1 items given for chain parts ---- - if (len(L1items_chainParts) > 0): - if (len(L1items_chainParts) != len(multichainparts)): - log.info("Not enough L1 items for chain parts of chain %s defined", finalChainDict['chainName']) - - chainProperties['L1item'] = L1items_chainParts[chainindex] - if (L1item != chainProperties['L1item']) & (L1item !=''): - log.info("L1 item in name (%s) of chain %s does not match with given L1item list (%s)!", - L1item, chainName, chainProperties['L1item']) - else: - log.debug('No L1 item specified in the name') - - parts = chainpartsNoL1.split('_') - parts = filter(None,parts) - - # ---- start writing first base pattern info into dict and remove it afterwards ---- - chainProperties['trigType']=mdicts[chainindex]['trigType'] - chainProperties['extra']=mdicts[chainindex]['extra'] - multiplicity = mdicts[chainindex]['multiplicity'] if not mdicts[chainindex]['multiplicity'] == '' else '1' - chainProperties['multiplicity'] = multiplicity - chainProperties['threshold']=mdicts[chainindex]['threshold'] - chainProperties['signature']=mdicts[chainindex]['signature'] - - # ---- if we have a L1 topo in a multi-chain then we want to remove it from the chain name - # but only if it's the same as the L1item_main; otherwise it belongs to chain part and we keep it ---- - chainProperties['chainPartName'] = chainparts - if ('-' in L1item) and (len(multichainparts) > 1) and (L1item_main == L1item): - chainProperties['chainPartName'] = chainpartsNoL1 - ## if we have the overall L1 item in a multi-part chains, then we want to remove it from the chain part name - if( L1item==L1item_main and (len(multichainparts) > 1) and (L1item.count("_") > 1 )): - chainProperties['chainPartName'] = chainpartsNoL1 - - log.debug('Chainparts: %s', chainparts) - parts.pop(0) - - # ---- import the relevant dictionaries for each part of the chain ---- - SignatureDefaultValues, allowedSignaturePropertiesAndValues = getSignatureInformation(chainProperties['signature']) - log.debug('SignatureDefaultValues: %s', SignatureDefaultValues) - - # ---- update chain properties with default properties ---- - sigDefault = deepcopy(SignatureDefaultValues) - sigDefault.update(chainProperties) - chainProperties = sigDefault - - # ---- check remaining parts for complete machtes in allowedPropertiesAndValues Dict ---- - parts = filter(None, parts) #removing empty strings from list - - matchedparts = [] - for pindex, part in enumerate(parts): - origpart = part - for prop, allowedValues in allowedSignaturePropertiesAndValues.items(): - if part in allowedValues: - if type(chainProperties[prop]) == list: - chainProperties[prop] += [part] - else: - chainProperties[prop] = part - matchedparts.append(part) - - log.debug("matched parts %s", matchedparts) - leftoverparts = set(parts)-set(matchedparts) - log.debug('leftoverparts %s', leftoverparts) - for pindex, part in enumerate(leftoverparts): - for prop, allowedValues in allowedSignaturePropertiesAndValues.items(): - if prop in chainProperties.keys(): continue - for aV in allowedValues: - if (aV in part): - if (chainProperties['signature'] in ['Egamma', 'Muon'] )& (prop in ['trkInfo','hypoInfo']): - chainProperties[prop] = part - part = part.replace(part,'') - elif (chainProperties['signature'] in ['Jet'] )& (prop in ['gscThreshold']): - chainProperties[prop] = part - part = part.replace(part,'') - else: - chainProperties[prop] = aV - part = part.replace(aV,'') - break # done with allowed values for that property - - if len(part.split())>0: - raise RuntimeError("These parts of the chain name %s are not understood %r" % (origpart,part)) - - # ---- remove properties that aren't allowed in the chain properties for a given siganture ---- - forbiddenProperties = set(chainProperties.keys()) - set(allowedSignaturePropertiesAndValues.keys()) - log.debug('%s', set(chainProperties.keys())) - log.debug('%s', set(allowedSignaturePropertiesAndValues.keys())) - for fb in forbiddenProperties: - forbiddenValue = chainProperties.pop(fb) - if forbiddenValue != '': - raise RuntimeError("Property %s not allowed for signature '%s', but specified '%s'" % (fb, chainProperties['signature'], forbiddenValue)) - - # ---- the info of the general and the specific chain parts dict ---- - chainPartDicts.append(chainProperties) - - # ---- depending on if signatures are different in this chain, break up the chainProperties dictionary ---- - # ---- finally also taking care of the signatrue key ---- - finalChainDict['chainParts'] = chainPartDicts - finalChainDict['signature'] = chainPartDicts[0]['signature'] - log.debug('finalChainDict that is passed as Final dict %s', finalChainDict) - - return finalChainDict diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/EmuStepProcessingTest.py b/Trigger/TrigValidation/TrigUpgradeTest/share/EmuStepProcessingTest.py index a639b04d4487642f7170ad2c6ed493cd7886bca3..f706bb9f39567fe4c3f026a0316608ce5ee8ac50 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/share/EmuStepProcessingTest.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/share/EmuStepProcessingTest.py @@ -69,8 +69,8 @@ from AthenaCommon.CFElements import parOR, seqAND, stepSeq # signatures -from TrigUpgradeTest.HLTCFConfig import makeHLTTree -from TrigUpgradeTest.MenuComponents import MenuSequence, Chain, ChainStep +from TriggerMenuMT.HLTMenuConfig.Menu.HLTCFConfig import makeHLTTree +from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import MenuSequence, Chain, ChainStep doMuon=True diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/HLTCF.py b/Trigger/TrigValidation/TrigUpgradeTest/share/HLTCF.py index b4830f123486e4f69d47327648f502694b1833a9..01d7c3160608024394729bae65bdc5019dd71e31 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/share/HLTCF.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/share/HLTCF.py @@ -20,7 +20,7 @@ def remember(name, instance): from AthenaCommon.CFElements import parOR, seqAND, stepSeq -from TrigUpgradeTest.HLTCFConfig import * +from TriggerMenuMT.HLTMenuConfig.Menu.HLTCFConfig import * def seqFilter(name, Inputs=[], Outputs=[], Chains=[]): from DecisionHandling.DecisionHandlingConf import RoRSeqFilter, DumpDecisions diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/TriggerMenuMT.py b/Trigger/TrigValidation/TrigUpgradeTest/share/TriggerMenuMT.py deleted file mode 100644 index 4339e1bb59db0935f3f30cb0a15ee0936e41901e..0000000000000000000000000000000000000000 --- a/Trigger/TrigValidation/TrigUpgradeTest/share/TriggerMenuMT.py +++ /dev/null @@ -1,78 +0,0 @@ -#------------------------- -# Imports -#------------------------- -# logging -from AthenaCommon.Logging import logging -logging.getLogger().info("Importing %s",__name__) -log = logging.getLogger('TriggerMenuMT') - -include("TrigUpgradeTest/DictFromChainName.py") - -#------------------------- -# List of chains to run -#------------------------- -def triggerMenuList(): - # --- Input formate for now: - # --- ['chainName', 'L1itemforchain'] - - electrons =[ - ['HLT_e20', 'L1_EM15'], - ['HLT_e30', 'L1_EM24VHI'], - ['HLT_e30_ringer', 'L1_EM24VHI'], - ] - - photons = [ - ['HLT_g100', 'L1_EM24VHI'], - ['HLT_2g50', 'L1_2EM15VH' ], - ] - - muons =[ - ['HLT_mu20', 'L1_MU20' ], - ['HLT_mu8', 'L1_MU6'], - ['HLT_2mu8', 'L1_2MU4'], - ] - - allchains = electrons + photons + muons - log.info('List of all chains to run: %s', allchains) - return allchains - - -#------------------------- -# GenerateMenu class: -# assembels it all -#------------------------- -class GenerateMenu: - - def generate(self): - log.info('GenerateMenu.generate') - - # get names of chains to be generated - chainsInMenu = triggerMenuList() - log.info('chainsInMenu %s', chainsInMenu) - - # get chain dict for each chain - myChainDict = DictFromChainName() - - for chain in chainsInMenu: - log.info('Processing chain: %s', chain) - chainDicts = myChainDict.getChainDict(chain) - - import pprint - pp = pprint.PrettyPrinter(indent=4, depth=8) - log.info('FINAL dictionary: %s', pp.pformat(chainDicts)) - - # use info from dictionary to send it to the right signature - - # in the relevant signature, use the info from dict to assemble the correct - - - - - - - - - - - - diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/egamma.menu.py b/Trigger/TrigValidation/TrigUpgradeTest/share/egamma.menu.py index ed9ef3a38df1e18ae7f958138fab02a812ff4d32..52de3b4f178e295f4d56bff8e7f8b3a13d3f0cca 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/share/egamma.menu.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/share/egamma.menu.py @@ -8,7 +8,7 @@ include("TrigUpgradeTest/testHLT_MT.py") ########################################## # menu ########################################## -from TrigUpgradeTest.MenuComponents import Chain, ChainStep +from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import Chain, ChainStep from TrigUpgradeTest.egammaMenuDefs import fastCaloSequence, electronSequence fastCaloStep= fastCaloSequence() @@ -70,7 +70,7 @@ topSequence.L1DecoderTest.prescaler.Prescales = ["HLT_e3_etcut:2", "HLT_2e3_etcu ########################################## ##### Make all HLT ####### -from TrigUpgradeTest.HLTCFConfig import makeHLTTree +from TriggerMenuMT.HLTMenuConfig.Menu.HLTCFConfig import makeHLTTree makeHLTTree(testChains) diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/egamma.withViews.py b/Trigger/TrigValidation/TrigUpgradeTest/share/egamma.withViews.py index f4fd78444772e946fd87dbfc7c05e6ab34d0ed7a..34fa6bf7f6559507b04f8d6912a1fc55f0c98390 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/share/egamma.withViews.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/share/egamma.withViews.py @@ -1,5 +1,5 @@ # -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration # include("TrigUpgradeTest/testHLT_MT.py") @@ -67,13 +67,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, trigL2CaloRingerFexMT ]) + fastCaloInViewAlgs = seqAND( __prefix+"fastCaloInViewAlgs", [ clusterMaker ]) filterL1RoIsAlg = RoRSeqFilter( __prefix+"filterL1RoIsAlg") filterL1RoIsAlg.Input = [__l1RoIDecisions] @@ -147,7 +148,6 @@ theElectronFex.OutputLevel=VERBOSE filterCaloRoIsAlg = RoRSeqFilter("filterCaloRoIsAlg") caloHypoDecisions = findAlgorithm(egammaCaloStep, "L2CaloHypo").HypoOutputDecisions -print "kkkk ", caloHypoDecisions filterCaloRoIsAlg.Input = [caloHypoDecisions] filterCaloRoIsAlg.Output = ["Filtered" + caloHypoDecisions] filterCaloRoIsAlg.Chains = testChains @@ -184,6 +184,7 @@ theElectronHypo.HypoOutputDecisions = "ElectronL2Decisions" theElectronHypo.Electrons = theElectronFex.ElectronsName theElectronHypo.OutputLevel = VERBOSE +print 'kkk', theElectronHypo theElectronHypo.HypoTools = [ TrigL2ElectronHypoToolFromName( c,c ) for c in testChains ] @@ -192,10 +193,36 @@ for t in theElectronHypo.HypoTools: # topSequence += theElectronHypo # InDetCacheCreatorTrigViews, electronSequence = seqAND("electronSequence", eventAlgs + [l2ElectronViewsMaker, electronInViewAlgs, theElectronHypo ] ) - egammaIDStep = stepSeq("egammaIDStep", filterCaloRoIsAlg, [ electronSequence ] ) + +filterL2ElectronRoIsAlg = RoRSeqFilter("filterL2ElectronRoIsAlg") +electronHypoDecisions = findAlgorithm(egammaIDStep, "TrigL2ElectronHypoAlgMT").HypoOutputDecisions + +filterL2ElectronRoIsAlg.Input = [electronHypoDecisions] +filterL2ElectronRoIsAlg.Output = ["Filtered" + electronHypoDecisions] +filterL2ElectronRoIsAlg.Chains = testChains +filterL2ElectronRoIsAlg.OutputLevel = DEBUG + + +efClusterViewsMaker = EventViewCreatorAlgorithm("efClusterViewsMaker", OutputLevel=DEBUG) +efClusterViewsMaker.InputMakerInputDecisions = [ filterL2ElectronRoIsAlg.Output[0] ] # output of L2CaloHypo +efClusterViewsMaker.RoIsLink = "roi" # -||- +efClusterViewsMaker.InViewRoIs = "CaloRoIs" # contract with the fastCalo +efClusterViewsMaker.Views = "EFCaloViews" +efClusterViewsMaker.ViewFallThrough = True +efClusterViewsMaker.InputMakerOutputDecisions = ["EFClusterLinks"] + + + + +efClusterSequence = seqAND("efClusterSequence", [efClusterViewsMaker] ) +egammaEFCaloStep = stepSeq("egammaEFCalotep", filterL2ElectronRoIsAlg, [ efClusterSequence ] ) + + + + # CF construction from DecisionHandling.DecisionHandlingConf import TriggerSummaryAlg @@ -208,6 +235,7 @@ summaryStep0.OutputLevel = DEBUG step0 = parOR("step0", [ egammaCaloStep, summaryStep0 ] ) step1 = parOR("step1", [ egammaIDStep ] ) +step2 = parOR("step2", [ egammaEFCaloStep ] ) egammaCaloStepRR = createFastCaloSequence( rerun=True ) @@ -255,10 +283,11 @@ summary.OutputLevel = DEBUG step0filter = parOR("step0filter", [ findAlgorithm( egammaCaloStep, "filterL1RoIsAlg") ] ) step1filter = parOR("step1filter", [ findAlgorithm(egammaIDStep, "filterCaloRoIsAlg") ] ) +step2filter = parOR("step2filter", [ findAlgorithm(egammaEFCaloStep, "filterL2ElectronRoIsAlg") ] ) step0rfilter = parOR("step0rfilter", [ findAlgorithm(egammaCaloStepRR, "Rerurn_filterL1RoIsAlg") ] ) -steps = seqAND("HLTSteps", [ step0filter, step0, step1filter, step1, step0rfilter, step0r ] ) +steps = seqAND("HLTSteps", [ step0filter, step0, step1filter, step1, step2filter, step2, step0rfilter, step0r ] ) from TrigSteerMonitor.TrigSteerMonitorConf import TrigSignatureMoniMT, DecisionCollectorTool mon = TrigSignatureMoniMT() diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/egammaMenu.ref b/Trigger/TrigValidation/TrigUpgradeTest/share/egammaMenu.ref index 2a3176651600b37a12ed5e7e31374a2690a15eed..499ce7b5ba5254a3eb0bb8da3f8f6bec23e57555 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/share/egammaMenu.ref +++ b/Trigger/TrigValidation/TrigUpgradeTest/share/egammaMenu.ref @@ -98,9 +98,6 @@ TriggerSummaryStep1 18 0 DEBUG +++ HLT_e5_etcut ID#607 TriggerSummaryStep1 18 0 DEBUG +++ HLT_e3_etcut1step ID#1509456583 TriggerSummaryStep1 18 0 DEBUG +++ HLT_e7_etcut ID#2430733989 TriggerSummaryStep1 18 0 DEBUG +++ HLT_e3_etcut ID#2711808158 -TriggerSummaryStep2 18 0 DEBUG +++ HLT_e5_etcut ID#607406625 -TriggerSummaryStep2 18 0 DEBUG +++ HLT_e7_etcut ID#2430733989 -TriggerSummaryStep2 18 0 DEBUG +++ HLT_e3_etcut ID#2711808158 TriggerSummaryStep1 19 0 DEBUG +++ HLT_e5_etcut ID#607406625 TriggerSummaryStep1 19 0 DEBUG +++ HLT_e3_etcut1step ID#1509456583 TriggerSummaryStep1 19 0 DEBUG +++ HLT_e7_etcut ID#2430733989 @@ -108,6 +105,6 @@ TriggerSummaryStep2 19 0 DEBUG +++ HLT_e5_etcut ID#607 TriggerSummaryStep2 19 0 DEBUG +++ HLT_e7_etcut ID#2430733989 TriggerSummaryStep2 19 0 DEBUG +++ HLT_e3_etcut ID#2711808158 TriggerMonitorFinal DEBUG HLT_e3_etcut1step 20 20 18 0 18 -TriggerMonitorFinal DEBUG HLT_e3_etcut 20 9 8 17 59 -TriggerMonitorFinal DEBUG HLT_e5_etcut 20 20 17 17 68 -TriggerMonitorFinal DEBUG HLT_e7_etcut 20 20 15 17 66 +TriggerMonitorFinal DEBUG HLT_e3_etcut 20 9 8 16 56 +TriggerMonitorFinal DEBUG HLT_e5_etcut 20 20 17 16 65 +TriggerMonitorFinal DEBUG HLT_e7_etcut 20 20 15 16 63 diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/fullMenu.py b/Trigger/TrigValidation/TrigUpgradeTest/share/fullMenu.py index 41a2162f042ee9a582bbb4110fa6374d2e63fb1b..e066b59aba4cb93ce18c1dab6cdc212711abf609 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/share/fullMenu.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/share/fullMenu.py @@ -15,7 +15,7 @@ include("TrigUpgradeTest/testHLT_MT.py") # nightly/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/XML/TriggerMenuXML/LVL1config_Physics_pp_v7.xml ########################################## -from TrigUpgradeTest.MenuComponents import Chain, ChainStep +from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import Chain, ChainStep EnabledElChains = [] EnabledMuChains = [] @@ -115,7 +115,7 @@ topSequence.L1DecoderTest.ChainToCTPMapping = EnabledChainNamesToCTP ########################################## ##### Make all HLT ####### -from TrigUpgradeTest.HLTCFConfig import makeHLTTree +from TriggerMenuMT.HLTMenuConfig.Menu.HLTCFConfig import makeHLTTree makeHLTTree(testChains) diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/fullMenu.ref b/Trigger/TrigValidation/TrigUpgradeTest/share/fullMenu.ref index 6822c26b413f831a201b7a75af35191ba9f4d2bd..02e3f47cfa1b6f9a501b17669ffdb635f4a5baf8 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/share/fullMenu.ref +++ b/Trigger/TrigValidation/TrigUpgradeTest/share/fullMenu.ref @@ -118,9 +118,6 @@ TriggerSummaryStep1 18 0 DEBUG +++ HLT_e5_etcut ID#607 TriggerSummaryStep1 18 0 DEBUG +++ HLT_e3_etcut1step ID#1509456583 TriggerSummaryStep1 18 0 DEBUG +++ HLT_e7_etcut ID#2430733989 TriggerSummaryStep1 18 0 DEBUG +++ HLT_e3_etcut ID#2711808158 -TriggerSummaryStep2 18 0 DEBUG +++ HLT_e5_etcut ID#607406625 -TriggerSummaryStep2 18 0 DEBUG +++ HLT_e7_etcut ID#2430733989 -TriggerSummaryStep2 18 0 DEBUG +++ HLT_e3_etcut ID#2711808158 TriggerSummaryStep1 19 0 DEBUG +++ HLT_e5_etcut ID#607406625 TriggerSummaryStep1 19 0 DEBUG +++ HLT_e3_etcut1step ID#1509456583 TriggerSummaryStep1 19 0 DEBUG +++ HLT_e7_etcut ID#2430733989 @@ -129,9 +126,9 @@ TriggerSummaryStep2 19 0 DEBUG +++ HLT_e5_etcut ID#607 TriggerSummaryStep2 19 0 DEBUG +++ HLT_e7_etcut ID#2430733989 TriggerSummaryStep2 19 0 DEBUG +++ HLT_e3_etcut ID#2711808158 TriggerMonitorFinal DEBUG HLT_e3_etcut1step 20 20 18 0 18 -TriggerMonitorFinal DEBUG HLT_e3_etcut 20 20 18 18 72 -TriggerMonitorFinal DEBUG HLT_e5_etcut 20 20 17 18 71 -TriggerMonitorFinal DEBUG HLT_e7_etcut 20 20 15 18 69 +TriggerMonitorFinal DEBUG HLT_e3_etcut 20 20 18 17 69 +TriggerMonitorFinal DEBUG HLT_e5_etcut 20 20 17 17 68 +TriggerMonitorFinal DEBUG HLT_e7_etcut 20 20 15 17 66 TriggerMonitorFinal DEBUG HLT_mu6 20 20 3 0 6 TriggerMonitorFinal DEBUG HLT_2mu6 20 20 0 0 0 TriggerMonitorFinal DEBUG HLT_mu6Comb 20 20 3 2 10 diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/mu.menu.py b/Trigger/TrigValidation/TrigUpgradeTest/share/mu.menu.py index 8c8d1009380c73b64a0ddf58262399637ebb72b5..1455d659d3b5a094c9238e7ee117c0ce180a8c10 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/share/mu.menu.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/share/mu.menu.py @@ -29,11 +29,11 @@ AlgScheduler.setDataLoaderAlg( 'SGInputLoader' ) # menu components -from TrigUpgradeTest.HLTCFConfig import decisionTree_From_Chains -from TrigUpgradeTest.MenuComponents import MenuSequence, Chain, ChainStep +from TriggerMenuMT.HLTMenuConfig.Menu.HLTCFConfig import decisionTree_From_Chains +from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import MenuSequence, Chain, ChainStep ### CF construction ### -from TrigUpgradeTest.MenuComponents import Chain, ChainStep +from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import Chain, ChainStep from TrigUpgradeTest.egammaMenuDefs import fastCaloSequence, electronSequence @@ -44,7 +44,7 @@ if TriggerFlags.doMuon==True: # menu ########################################## - from TrigUpgradeTest.MenuComponents import Chain, ChainStep + from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import Chain, ChainStep from TrigUpgradeTest.muMenuDefs import muFastStep, muCombStep, muonEFSAStep, muIsoStep, doL2SA, doL2CB, doEFSA, doL2ISO MenuChains = [] @@ -61,6 +61,7 @@ if TriggerFlags.doMuon==True: MenuChains += [Chain(name='HLT_mu6fast', Seed="L1_MU6", ChainSteps=[step1mufast])] + if TriggerFlags.doID==False: if doL2SA==True and doL2CB==False and doEFSA==False and doL2ISO==False: MenuChains += [Chain(name='HLT_mu6', Seed="L1_MU6", ChainSteps=[step1mufast ])] @@ -77,13 +78,10 @@ if TriggerFlags.doMuon==True: MenuChains += [Chain(name='HLT_mu6', Seed="L1_MU6", ChainSteps=[step1mufast, step2muComb, step3muEFSA ])] MenuChains += [Chain(name='HLT_2mu6', Seed="L1_MU6", ChainSteps=[step1mufast, step2muComb, step3muEFSA ])] if doL2SA==True and doL2CB==True and doEFSA==False and doL2ISO==True: - MenuChains += [Chain(name='HLT_mu6', Seed="L1_MU6", ChainSteps=[step1mufast, step2muComb ])] - MenuChains += [Chain(name='HLT_2mu6', Seed="L1_MU6", ChainSteps=[step1mufast, step2muComb ])] MenuChains += [Chain(name='HLT_mu6', Seed="L1_MU6", ChainSteps=[step1mufast, step2muComb, step3muIso ])] MenuChains += [Chain(name='HLT_2mu6', Seed="L1_MU6", ChainSteps=[step1mufast, step2muComb, step3muIso ])] + if doL2SA==True and doL2CB==True and doEFSA==True and doL2ISO==True: - MenuChains += [Chain(name='HLT_mu6', Seed="L1_MU6", ChainSteps=[step1mufast, step2muComb, step3muEFSA ])] - MenuChains += [Chain(name='HLT_2mu6', Seed="L1_MU6", ChainSteps=[step1mufast, step2muComb, step3muEFSA ])] MenuChains += [Chain(name='HLT_mu6', Seed="L1_MU6", ChainSteps=[step1mufast, step2muComb, step3muIso ])] MenuChains += [Chain(name='HLT_2mu6', Seed="L1_MU6", ChainSteps=[step1mufast, step2muComb, step3muIso ])] @@ -139,5 +137,5 @@ if TriggerFlags.doMuon==True: ########################################## ##### Make all HLT ####### - from TrigUpgradeTest.HLTCFConfig import makeHLTTree + from TriggerMenuMT.HLTMenuConfig.Menu.HLTCFConfig import makeHLTTree makeHLTTree(MenuChains) diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/muMenu.ref b/Trigger/TrigValidation/TrigUpgradeTest/share/muMenu.ref index 8725aa0fa8486b6cf2b543d2dd82122a2ba36de3..a78fd072b88baf566f810dd024e03384816e0c31 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/share/muMenu.ref +++ b/Trigger/TrigValidation/TrigUpgradeTest/share/muMenu.ref @@ -6,7 +6,5 @@ TriggerSummaryStep1 2 0 DEBUG +++ HLT_mu6fast ID#2393 TriggerSummaryStep1 5 0 DEBUG +++ HLT_mu6 ID#1672162766 TriggerSummaryStep1 5 0 DEBUG +++ HLT_mu6fast ID#2393852230 TriggerMonitorFinal DEBUG HLT_mu6fast 10 10 3 0 0 3 -TriggerMonitorFinal DEBUG HLT_mu6 0 0 0 0 0 0 -TriggerMonitorFinal DEBUG HLT_2mu6 0 0 0 0 0 0 TriggerMonitorFinal DEBUG HLT_mu6 10 10 3 0 0 3 TriggerMonitorFinal DEBUG HLT_2mu6 10 10 1 0 0 1 diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/newJOtest.py b/Trigger/TrigValidation/TrigUpgradeTest/share/newJOtest.py index ce324e7b5d172e32369ad6f0e99d74d8ed37e6a7..d03cf50162373ff856076ffc3dbacab429543d84 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/share/newJOtest.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/share/newJOtest.py @@ -100,13 +100,6 @@ acc.getService("EventPersistencySvc").CnvServices += [ tagInfoMgr.getName() ] acc.getService("ProxyProviderSvc").ProviderNames += [ tagInfoMgr.getName() ] acc.getService("IOVDbSvc").Folders += ['/TagInfo<metaOnly/>'] -# we need to setup it because of conditions data -from AthenaPoolCnvSvc.AthenaPoolCnvSvcConf import AthenaPoolCnvSvc -athenaPoolSvcSvc = AthenaPoolCnvSvc() -athenaPoolSvcSvc.PoolAttributes = ["DEFAULT_SPLITLEVEL ='0'", "STREAM_MEMBER_WISE = '1'", "DEFAULT_BUFFERSIZE = '32000'", "ContainerName = 'POOLContainer(DataHeader)'; BRANCH_BASKET_SIZE = '256000'", "ContainerName = 'POOLContainerForm(DataHeaderForm)'; BRANCH_BASKET_SIZE = '1024000'", "ContainerName = 'TTree=POOLContainerForm(DataHeaderForm)'; CONTAINER_SPLITLEVEL = '99'"] -acc.addService( athenaPoolSvcSvc ) -acc.getService( "EventPersistencySvc" ).CnvServices += [ athenaPoolSvcSvc.getName() ] - # setup algorithm sequences here, need few additional components from TrigUpgradeTest.RegSelConfig import RegSelConfig diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/photon.menu.py b/Trigger/TrigValidation/TrigUpgradeTest/share/photon.menu.py index 3c8c5c70fc234c1614687b9ceb3f32f2348a99e9..7c7b7774d736cdc768f4950eff72d376a776861c 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/share/photon.menu.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/share/photon.menu.py @@ -31,7 +31,7 @@ for unpack in topSequence.L1DecoderTest.rerunRoiUnpackers: ########################################## # menu ########################################## -from TrigUpgradeTest.MenuComponents import Chain, ChainStep +from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import Chain, ChainStep from TrigUpgradeTest.photonMenuDefs import fastCaloSequence, photonSequence calostep=fastCaloSequence() @@ -54,7 +54,7 @@ topSequence.L1DecoderTest.ChainToCTPMapping = EnabledChainNamesToCTP ########################################## ##### Make all HLT ####### -from TrigUpgradeTest.HLTCFConfig import makeHLTTree +from TriggerMenuMT.HLTMenuConfig.Menu.HLTCFConfig import makeHLTTree makeHLTTree(testChains) diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/photonMenu.ref b/Trigger/TrigValidation/TrigUpgradeTest/share/photonMenu.ref index 5a1a5e1760920930546f41212f431ae912b9822e..6ce72edb1f3ea4e13238c94c74718aa152cd3bfd 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/share/photonMenu.ref +++ b/Trigger/TrigValidation/TrigUpgradeTest/share/photonMenu.ref @@ -1,5 +1,3 @@ -TriggerSummaryStep1 2 0 DEBUG +++ HLT_g5_etcut ID#1407390618 -TriggerSummaryStep2 2 0 DEBUG +++ HLT_g5_etcut ID#1407390618 TriggerSummaryStep1 5 0 DEBUG +++ HLT_g5_etcut ID#1407390618 TriggerSummaryStep2 5 0 DEBUG +++ HLT_g5_etcut ID#1407390618 TriggerSummaryStep1 7 0 DEBUG +++ HLT_g5_etcut ID#1407390618 @@ -8,4 +6,4 @@ TriggerSummaryStep1 8 0 DEBUG +++ HLT_g5_etcut ID#140 TriggerSummaryStep2 8 0 DEBUG +++ HLT_g5_etcut ID#1407390618 TriggerSummaryStep1 9 0 DEBUG +++ HLT_g5_etcut ID#1407390618 TriggerSummaryStep2 9 0 DEBUG +++ HLT_g5_etcut ID#1407390618 -TriggerMonitorFinal DEBUG HLT_g5_etcut 10 10 0 5 5 +TriggerMonitorFinal DEBUG HLT_g5_etcut 10 10 0 4 4 diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/testHLT_MT.py b/Trigger/TrigValidation/TrigUpgradeTest/share/testHLT_MT.py index d2252b6be4106ef672d6853993e2f8ab62a5fdf8..83a8057e42fd0b2d268491f660b9aed70daae423 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/share/testHLT_MT.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/share/testHLT_MT.py @@ -17,7 +17,7 @@ # class opt : setupForMC = None # force MC setup - setLVL1XML = 'TriggerMenuXML/LVL1config_Physics_pp_v7.xml' + setLVL1XML = 'TriggerMenuMT/LVL1config_LS2_v1.xml' # 'TriggerMenu/LVL1config_Physics_pp_v7.xml' # default for legacy setDetDescr = None # force geometry tag setGlobalTag = None # force global conditions tag useCONDBR2 = True # if False, use run-1 conditions DB diff --git a/Trigger/TriggerCommon/TriggerMenu/CMakeLists.txt b/Trigger/TriggerCommon/TriggerMenu/CMakeLists.txt index c96cd1457fe7f37d57ff92c7b0f5f0fbacddaccf..fa766915a7fe50f44166b430edc576d260afb2d2 100644 --- a/Trigger/TriggerCommon/TriggerMenu/CMakeLists.txt +++ b/Trigger/TriggerCommon/TriggerMenu/CMakeLists.txt @@ -55,11 +55,6 @@ function( atlas_run_lowestunprescaled ) ${CMAKE_CURRENT_BINARY_DIR}/LowestUnprescaledLists/unprescaled COMMAND ${CMAKE_BINARY_DIR}/atlas_build_run.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/generateUnprescaledLists.py ${CMAKE_CURRENT_BINARY_DIR}/LowestUnprescaledLists/unprescaled - COMMAND ${CMAKE_COMMAND} -E make_directory - ${CMAKE_PYTHON_OUTPUT_DIRECTORY}/TriggerMenu - COMMAND ${CMAKE_COMMAND} -E copy_directory - ${CMAKE_CURRENT_BINARY_DIR}/LowestUnprescaledLists/unprescaled/ - ${CMAKE_PYTHON_OUTPUT_DIRECTORY}/TriggerMenu/api/ COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/unprescaled.stamp DEPENDS "Package_$<JOIN:$<TARGET_PROPERTY:ATLAS_PACKAGES_TARGET,ATLAS_PACKAGES>,;Package_>" ) @@ -88,7 +83,7 @@ function( atlas_run_lowestunprescaled ) # executed after the previous code. So by this time the files should be # in place, if they could be produced. install( DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/LowestUnprescaledLists/unprescaled/ - DESTINATION ${CMAKE_INSTALL_PYTHONDIR}/TriggerMenu + DESTINATION ${CMAKE_INSTALL_PYTHONDIR}/TriggerMenu/api USE_SOURCE_PERMISSIONS FILES_MATCHING PATTERN "list*.py" ) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/CMakeLists.txt b/Trigger/TriggerCommon/TriggerMenuMT/CMakeLists.txt index f80326d98f910612eb1d558204a7fcc96e45cc8a..eb786fad010c7fcf8ae7fd7a9ff7eb3a1aa296e5 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/CMakeLists.txt +++ b/Trigger/TriggerCommon/TriggerMenuMT/CMakeLists.txt @@ -87,7 +87,7 @@ function( atlas_build_lvl1_trigger_menu menu ) if( NOT TARGET TriggerMenuMTMain ) add_custom_target( TriggerMenuMTMain ALL COMMAND ${CMAKE_COMMAND} -E echo - "TriggerMenuMT: LVL1 menu generation build succeeded" ) + "TriggerMenuMT: Package build succeeded" ) endif() add_dependencies( TriggerMenuMTMain build_menu_${menu} ) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py index 454fa3d13cd8dc3ec68dbe8d1b3115c9e714a219..0d9a3e76ba28731732e87c54a683eb35a9946dd2 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py @@ -1,218 +1,72 @@ # Classes to configure the CF graph, via Nodes -from AthenaCommon.CFElements import parOR, seqAND, stepSeq - - -allAlgs={} -def useExisting(name): - global allAlgs - return allAlgs[name] - -def AlgExisting(name): - global allAlgs - return name in allAlgs - - -def remember(name, instance): - global allAlgs - allAlgs[name] = instance - return instance - - -class AlgNode(): - def __init__(self, Alg, inputProp, outputProp): - self.name = ("%s_%s_%s")%( Alg.name(), inputProp, outputProp) - self.algname = Alg.name() - self.outputProp=outputProp - self.inputProp=inputProp - self.configureAlg(Alg) - - def configureAlg(self, Alg): - alg_name = Alg.getName() - if AlgExisting(alg_name): - print "AlgNode::%s: found already Alg %s"%(self.name,alg_name) - self.Alg = useExisting(alg_name) - else: - print "AlgNode::%s: new Alg %s"%(self.name,alg_name) - self.Alg=Alg - remember(alg_name, self.Alg) - - if self.Alg is None: - return - - self.addDefaultOutput() - - def addDefaultOutput(self): - print "This is main addDefaultOutput" - self.setOutput(("%s_%s_out"%(self.algname,self.outputProp))) - #self.setOutput(("%s_out"%(self.name))) - - - def setPar(self, prop, name): - cval = self.Alg.getProperties()[prop] - try: - if type(cval) == type(list()): - cval.append(name) - setattr(self.Alg, prop, cval) - else: - setattr(self.Alg, prop, name) - except: - pass - - def setParArray(self, prop, name): - cval = self.Alg.getProperties()[prop] - try: - cval.append(name) - setattr(self.Alg, prop, cval) - except: - pass - - def getPar(self, prop): - try: - return getattr(self.Alg, prop) - except: - return self.Alg.getDefaultProperty(prop) - raise "Error in reading property " + prop + " from " + self.Alg - - - def setOutput(self, name): - return self.setPar(self.outputProp,name) - - def getOutput(self): - return self.getPar(self.outputProp) - - def getOutputList(self): - outputs = [] - cval = self.getOutput() - if type(cval) == type(list()): - outputs.extend(cval) - else: - outputs.append(cval) - return outputs - - def setInput(self, name): - return self.setPar(self.inputProp,name) - - def addInput(self, name): - return self.setParArray(self.inputProp,name) - - def getInput(self): - return self.getPar(self.inputProp) - - def getInputList(self): - inputs = [] - cval = self.getInput() - if type(cval) == type(list()): - inputs.extend(cval) - else: - inputs.append(cval) - return inputs - - def __str__(self): - return "Alg::%s [%s] -> [%s]"%(self.name,' '.join(map(str, self.getInputList())), ' '.join(map(str, self.getOutputList()))) - - - -class HypoAlgNode(AlgNode): - def __init__(self, Alg, inputProp, outputProp): - AlgNode.__init__(self, Alg, inputProp, outputProp) - self.tools = [] - self.previous=[] - - - def addHypoTool(self, hypotool): - if "Comb" in self.name: ###TMP combo, only one threshold - import re - thresholds = map(int, re.findall(r'\d+', hypotool.getName())) - self.setPar('Threshold1', thresholds[0]) - self.setPar('Threshold2', thresholds[1]) - status=self.setPar('DecisionLabel', hypotool.getName()) - else: - self.tools.append(hypotool.getName()) - status= self.setParArray('HypoTools',hypotool) - return status - - def addPreviousDecision(self,prev): - self.previous.append(prev) - status= self.setParArray('previousDecisions',prev) - return status - - def setPreviousDecision(self,prev): - if "Comb" in self.name: ###TMP combo: how handle previous decisions in combo? - self.previous.append(prev) - if "from_L1MU" in prev: - if "pt" in self.getPar("Property1"): - status= self.setPar('previousDecisions1',prev) - if "pt" in self.getPar("Property2"): - status= self.setPar('previousDecisions2',prev) - - if "from_L1EM" in prev: - if "et" in self.getPar("Property1"): - status= self.setPar('previousDecisions1',prev) - if "et" in self.getPar("Property2"): - status= self.setPar('previousDecisions2',prev) - - if "Output1" in prev: - status= self.setPar('previousDecisions1',prev) - if "Output2" in prev: - status= self.setPar('previousDecisions2',prev) - - else: - self.previous.append(prev) - status= self.setPar('previousDecisions',prev) - return status - - def __str__(self): - return "HypoAlg::%s [%s] -> [%s], previous = [%s], HypoTools=[%s] --> Alg %s"%(self.name,' '.join(map(str, self.getInputList())), - ' '.join(map(str, self.getOutputList())), - ' '.join(map(str, self.previous)), - ' '.join(map(str, self.tools)), self.Alg) - - - -class SequenceFilterNode(AlgNode): - def __init__(self, Alg, inputProp, outputProp): - AlgNode.__init__(self, Alg, inputProp, outputProp) - - def addDefaultOutput(self): - print "This is SequenceFilter addDefaultOutput" - return #do nothing - - def setChains(self, name): - return self.setPar("Chains", name) - - def getChains(self): - return self.getPar("Chains") - - -from TrigUpgradeTest.TrigUpgradeTestConf import HLTTest__TestRoRSeqFilter -class TestRoRSequenceFilterNode(SequenceFilterNode): - def __init__(self, name): - Alg= HLTTest__TestRoRSeqFilter(name, OutputLevel = 2) - inputProp='Inputs' - outputProp='Outputs' - SequenceFilterNode.__init__(self, Alg, inputProp, outputProp) - if "Step1" in self.name: # so that we see events running through, will be gone once L1 emulation is included - self.Alg.AlwaysPass = True - - - -from DecisionHandling.DecisionHandlingConf import RoRSeqFilter, DumpDecisions -class RoRSequenceFilterNode(SequenceFilterNode): - def __init__(self, name): - Alg= RoRSeqFilter(name, OutputLevel = 2) - inputProp='Input' - outputProp='Output' - SequenceFilterNode.__init__(self, Alg, inputProp, outputProp) - - +from AthenaCommon.CFElements import parOR, seqAND, seqOR +from AthenaCommon.Logging import logging +from AthenaCommon.AlgSequence import dumpSequence +from TriggerMenuMT.HLTMenuConfig.Menu.HLTCFDot import stepCF_DataFlow_to_dot, stepCF_ControlFlow_to_dot, all_DataFlow_to_dot +import sys +import copy +from AthenaCommon.Constants import VERBOSE,INFO,DEBUG +log = logging.getLogger('HLTCFConfig') +log.setLevel( VERBOSE ) #### Here functions to create the CF tree from CF configuration objects - - -from AthenaCommon.AlgSequence import dumpSequence -def create_step_reco_node(name, seq_list, dump=0): - print "Create reco step %s with %d sequences"%(name, len(seq_list)) +def makeSummary(name, flatDecisions): + """ Returns a TriggerSummaryAlg connected to given decisions""" + from DecisionHandling.DecisionHandlingConf import TriggerSummaryAlg + summary = TriggerSummaryAlg( name, OutputLevel = 2 ) + summary.InputDecision = "HLTChains" + + summary.FinalDecisions = flatDecisions + summary.HLTSummary = "MonitoringSummary"+name + return summary + +def makeMonitor(name, decisions, EnabledChainNames): + from TrigSteerMonitor.TrigSteerMonitorConf import TrigSignatureMoniMT, DecisionCollectorTool + mon = TrigSignatureMoniMT(name, OutputLevel = 2) + flatDecisions=[] + for step in decisions: flatDecisions.extend (step) + mon.FinalDecisions = flatDecisions + mon.L1Decisions = "HLTChainsResult" # connection with L1Decoder + from TrigUpgradeTest.TestUtils import MenuTest + mon.ChainsList = EnabledChainNames + tools=[] + for step in range (0, len(decisions)): + print "adding collector ",step + print decisions[step] + collect = DecisionCollectorTool("StepCollector%d"%step) + collect.Decisions = decisions[step] + print collect + tools.append(collect) + mon.CollectorTools=tools + print mon + return mon + +def makeStreamESD(name, flatDecisions): + import AthenaPoolCnvSvc.WriteAthenaPool + from OutputStreamAthenaPool.OutputStreamAthenaPool import createOutputStream + StreamESD=createOutputStream(name,"myESD.pool.root",True) + StreamESD.OutputLevel=3 + from AthenaCommon.AlgSequence import AlgSequence + topSequence = AlgSequence() + topSequence.remove( StreamESD ) + def addTC(name): + StreamESD.ItemList += [ "xAOD::TrigCompositeContainer#"+name, "xAOD::TrigCompositeAuxContainer#"+name+"Aux." ] + + for tc in flatDecisions: + addTC( tc ) + + addTC("HLTSummary") + if log.isEnabledFor(logging.DEBUG): + log.debug("ESD file content: ") + log.debug( StreamESD.ItemList ) + return StreamESD + + +def create_step_reco_node(name, seq_list, dump=False): + """ elementary HLT reco step, contianing all sequences of the step """ + if log.isEnabledFor(logging.DEBUG): + log.debug("Create reco step %s with %d sequences", name, len(seq_list)) stepCF = parOR(name+"_reco") for seq in seq_list: step_seq = create_CFSequence(seq) @@ -222,64 +76,59 @@ def create_step_reco_node(name, seq_list, dump=0): return stepCF -def create_step_filter_node(name, seq_list, dump=0): - print "Create filter step %s with %d filters"%(name, len(seq_list)) +def create_step_filter_node(name, seq_list, dump=False): + """ elementary HLT filter step: OR node containing all Filters of the sequences. The node gates execution of next reco step """ + if log.isEnabledFor(logging.DEBUG): + log.debug("Create filter step %s with %d filters", name, len(seq_list)) stepCF = parOR(name+"_filter") for seq in seq_list: filterAlg=seq.filter.Alg - print "Add %s to filter node %s"%(filterAlg.name(),name) + log.info("Add %s to filter node %s", filterAlg.name(), name) stepCF += filterAlg if dump: dumpSequence (stepCF, indent=0) return stepCF -def create_CFSequence(CFseq): - print "\n * Create CFSequence %s"%(CFseq.name) - filterAlg=CFseq.filter.Alg - - nodes = CFseq.getAllNodes() - algos = [] - for node in nodes: - algos.append(node.Alg) - - algos=list(set(algos)) - - step_seq = create_step_sequence( CFseq.name, filterAlg=filterAlg, rest=algos) - return step_seq -def create_step_sequence(name, filterAlg, rest): +def create_step_sequence(name, filterAlg, rest,sublist): """ elementary HLT step sequencer, filterAlg is gating, rest is anything that needs to happe within the step """ - stepReco = parOR(name+"_reco", rest) + toadd=rest + for k, v in sublist.iteritems(): + seq= seqAND(k, v) + toadd.append(seq) + + stepReco = parOR(name+"_reco", toadd) stepAnd = seqAND(name, [ filterAlg, stepReco ]) return stepAnd - -def find_stepCF_algs(step_list): - algos = [] - for step in step_list: - #print "Finding algos of step %s"%step - step_algs = [] - step_algs.append(step.filter) - for seq in step.menuSeq.nodeSeqList: - step_algs.extend(seq.algs ) - step_algs.append(seq.hypo) - algos.extend(step_algs) - return algos - +def create_CFSequence(CFseq): + """ Creates AthSequencer nodes with sequences attached """ + if log.isEnabledFor(logging.DEBUG): + log.debug(" *** Create CFSequence %s with FilterAlg %s *", CFseq.name, CFseq.filter.Alg.name()) + filterAlg=CFseq.filter.Alg -def addChainToHypoTool(hypotool, chain): - prop="Chains" - cval = hypotool.getProperties()[prop] - try: - cval.append(chain) - setattr(hypotool, prop, cval) - except: - pass + + stepReco = parOR(CFseq.name+"_reco") # all reco algoritms from al lthe sequences in a parallel sequence + seqAndView = seqAND(CFseq.name+"_view", [stepReco]) #include in seq:And to run in views: add here the Hypo + seqAndWithFilter = seqAND(CFseq.name, [filterAlg, seqAndView]) # add to the main step+filter + + for menuseq in CFseq.step.sequences: + ath_sequence=menuseq.sequence.Alg + subs = ath_sequence + stepReco += subs + seqAndView += menuseq.hypo.Alg + + if CFseq.step.isCombo: + seqAndView += CFseq.step.combo.Alg + print CFseq.step.combo.Alg + + return seqAndWithFilter def addChainToHypoAlg(hypoAlg, chain): + """ Tmp functions for Combo Hypo """ if "Comb" in hypoAlg.algname: prop="Chains" cval = hypoAlg.Alg.getProperties()[prop] @@ -291,259 +140,210 @@ def addChainToHypoAlg(hypoAlg, chain): ####################################### -def decisionTree_From_Chains(HLTAllStepsSeq, chains, NSTEPS=1): +## CORE of Decision Handling +####################################### + + + +def makeHLTTree(HLTChains): + """ creates the full HLT tree""" + + # TopHLTRootSeq = seqAND("TopHLTRoot") # Root + # main HLT top sequence + hltTop = seqOR( "hltTop") + + #add the L1Upcacking +# TopHLTRootSeq += L1UnpackingSeq + + # add the HLT steps Node + steps = seqAND("HLTAllSteps") + hltTop += steps + + # make CF tree + finalDecisions = decisionTree_From_Chains(steps, HLTChains) + EnabledChainNames = [c.name for c in HLTChains] + + + flatDecisions=[] + for step in finalDecisions: flatDecisions.extend (step) + summary= makeSummary("TriggerSummaryFinal", flatDecisions) + #from TrigOutputHandling.TrigOutputHandlingConf import HLTEDMCreator + #edmCreator = HLTEDMCreator() + + #edmCreator.TrigCompositeContainer = flatDecisions + #summary.OutputTools= [ edmCreator ] + hltTop += summary + hltTop += makeMonitor("TriggerMonitorFinal", finalDecisions, EnabledChainNames) + #hltTop += makeStreamESD("StreamESD", flatDecisions) + + + from AthenaCommon.AlgSequence import AlgSequence + topSequence = AlgSequence() + topSequence += hltTop + + + +def decisionTree_From_Chains(HLTNode, chains): + """ creates the decision tree, given the starting node and the chains containing the sequences """ + if log.isEnabledFor(logging.DEBUG): + log.debug("Run decisionTree_From_Chains on %s", HLTNode.name()) + + from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import CFSequence, RoRSequenceFilterNode, ComboMaker + HLTNodeName= HLTNode.name() + + # find nsteps + NSTEPS=0 + for chain in chains: + steps =len(chain.steps) + if log.isEnabledFor(logging.DEBUG): + log.debug("Adding chain %s with %d steps"%(chain.name,steps)) + if NSTEPS < steps: + NSTEPS = steps + + if log.isEnabledFor(logging.DEBUG): + log.debug("Run on %d steps", NSTEPS) + - testRoR=False - from TrigUpgradeTest.MenuComponents import CFSequence - #loop over chains to configure - count_steps=0 + #loop over chains to configure hypotools + # must be done after all chains are created, to avoid conflicts + for chain in chains: + chain.decodeHypoToolConfs() + + finalDecisions = [] # needed for monitor + allSeq_list = [] for nstep in range(0, NSTEPS): + finalDecisions.append([]) # list of final deciisons per step stepCF_name = "Step%i"%(nstep+1) CFseq_list = [] - + step_decisions = [] for chain in chains: - chain_step_name= "%s:%s"%(stepCF_name, chain.name) - print "\n*******Filling step %s for chain %s"%(stepCF_name, chain.name) - - chain_step=chain.steps[count_steps] - sequenceHypoTools=chain_step.sequenceHypoTools - countseq=0 - for st in sequenceHypoTools: - sequence=st.sequence - hypotool=st.hypotool - addChainToHypoTool(hypotool, chain.name) - cfseq_name= sequence.name - - print "Going through sequence %s with threshold %s"%(sequence.name, hypotool.getName()) - #define sequence input - if count_steps == 0: # seeding - sequence_input= [nodeSeq.seed for nodeSeq in sequence.nodeSeqList] - print "Seeds from this chain: %s"%(sequence_input) - previous_sequence="".join(chain.group_seed) - else: - # from previous step, map the seuqence in the same order? - previous_sequence=chain.steps[count_steps-1].sequences[countseq].name #menu sequence - sequence_input=chain.steps[count_steps-1].sequences[countseq].outputs - print "Connect to previous sequence:" - print sequence_input - # add hypotools - for nodeSeq in sequence.nodeSeqList: - hypoAlg= nodeSeq.hypo - print "Adding %s to %s"%(hypotool.getName(),hypoAlg.algname) - hypoAlg.addHypoTool(hypotool) - addChainToHypoAlg(hypoAlg, chain.name) # only for TMP Combo - - + # skip this step if missing + if len(chain.steps) <= nstep: + continue - #### FILTER - # one filter per previous sequence at the start of the sequence: check if it exists or create a new one - # if the previous hypo has more than one output, try to get all of them - # one filter per previous sequence: 1 input/previous seq, 1 output/next seq - filter_name="Filter%s_on_%s"%(stepCF_name,previous_sequence) - filter_out=["%s_from_%s_out"%(filter_name,i) for i in sequence_input] - filter_already_exists=False - findFilter= [cfseq.filter for cfseq in CFseq_list if filter_name in cfseq.filter.algname] - if len(findFilter): - print "Filter %s already exists"%(filter_name) - filter_already_exists=True - sfilter=findFilter[0] - print "Adding chain %s to %s"%(chain.name,sfilter.algname) - sfilter.setChains(chain.name) - continue - else: - if (testRoR): - sfilter = TestRoRSequenceFilterNode(name=filter_name) - else: - sfilter = RoRSequenceFilterNode(name=filter_name) - for o in filter_out: sfilter.setOutput(o) - for i in sequence_input: sfilter.addInput(i) - sfilter.setChains(chain.name) - print "Filter Done: %s"%(sfilter) + chain_step=chain.steps[nstep] + if log.isEnabledFor(logging.DEBUG): + log.debug("\n************* Start step %d %s for chain %s", nstep+1, stepCF_name, chain.name) + + # one filter per step_chain + # one filter input per previous menusequence output (the L1Seed for first step) + # one filter output per menuSeq + + filter_input =[] + if nstep == 0: # L1 seeding + previous_sequence="".join(chain.group_seed) + seeds=chain.group_seed + filter_input.extend( seeds ) + if log.isEnabledFor(logging.DEBUG): + log.debug("Found these seeds from the sequence: %s", seeds) + log.debug("Seeds from this chain: %s", filter_input) + previous_seeds=seeds + + else: + # from previous step, map the seuqence in the same order? + previous_sequence = chain_step.name + prev=chain.steps[nstep-1].sequences + previous_seeds=[] + for seq in prev: + filter_input.extend(seq.outputs) + previous_seeds.append( seq.seed) + + if log.isEnabledFor(logging.DEBUG): + log.debug("Connect to previous sequence through these filter inputs: %s" %str( filter_input) ) + if len(filter_input) != len(previous_seeds): + log.error("found %d filter inputs and %d seeds", len(filter_input), len(previous_seeds)) + sys.exit("ERROR, in size") - #loop over NodeSequences of this sequence to add inputs to InputMaker and send decisions to HypoAlg - for nodeSeq in sequence.nodeSeqList: - seed=nodeSeq.seed - input_maker_input= [inp for inp in sfilter.getOutputList() if ("from_"+seed) in inp] - print "Adding %d inputs to sequence::%s from Filter::%s (from seed %s)"%(len(input_maker_input), nodeSeq.name, sfilter.algname, seed) - for i in input_maker_input: print i - if len(input_maker_input) == 0: -# print "ERROR, no inputs to sequence are set!" - sys.exit("ERROR, no inputs to sequence are set!") -# return - for i in input_maker_input: nodeSeq.addInput(i) - - hypoAlg= nodeSeq.hypo - #node = AlgNode(Alg=hypoAlg.Alg,inputProp='', outputProp='Output1') - for i in input_maker_input: hypoAlg.setPreviousDecision(i) # works for one - #for i in input_maker_input: hypoAlg.addPreviousDecision(i) - - print hypoAlg - - - CF_seq = CFSequence( cfseq_name, FilterAlg=sfilter, MenuSequence=sequence) - #for node in otherNodes: CF_seq.addNode(node) - print CF_seq + + (sfilter, alreadyFoundFilter) = buildFilter(stepCF_name,previous_sequence, CFseq_list, chain, filter_input, previous_seeds) + + if not alreadyFoundFilter: + CF_seq = CFSequence( ChainStep=chain_step, FilterAlg=sfilter) CFseq_list.append(CF_seq) - countseq+=1 - - #end of sequence/threshold + for sequence in chain_step.sequences: + step_decisions.extend(sequence.outputs) + + if len(chain.steps) == nstep+1: + if log.isEnabledFor(logging.DEBUG): + log.debug("Adding finalDecisions for chain %s at step %d:"%(chain.name, nstep+1)) + for seq in chain_step.sequences: + finalDecisions[nstep].extend(seq.outputs) + if log.isEnabledFor(logging.DEBUG): + log.debug(seq.outputs) + + #end of loop over menu sequences #end of loop over chains for this step, now implement CF: - print "\n******** Create CF Tree %s with AthSequencers",stepCF_name + if log.isEnabledFor(logging.DEBUG): + log.debug("\n******** Create CF Tree %s with AthSequencers", stepCF_name) #first make the filter step - stepFilter = create_step_filter_node(stepCF_name, CFseq_list, dump=0) - HLTAllStepsSeq += stepFilter - - stepCF = create_step_reco_node(stepCF_name, CFseq_list, dump=0) - HLTAllStepsSeq += stepCF - - print "Now Draw..." - stepCF_DataFlow_to_dot(stepCF_name, CFseq_list) - stepCF_ControlFlow_to_dot(stepCF) - - - print "Added stepCF %s to the root"%stepCF_name - count_steps+=1 - print "************* End of step %s"%stepCF_name - # end of steps - - #stepCF_ControlFlow_to_dot(HLTAllStepsSeq) - dumpSequence (HLTAllStepsSeq, indent=0) - return -##### - + stepFilter = create_step_filter_node(stepCF_name, CFseq_list, dump=False) + HLTNode += stepFilter + allSeq_list.append(CFseq_list) + # then the reco step + stepCF = create_step_reco_node("%s_%s"%(HLTNodeName,stepCF_name), CFseq_list, dump=False) + HLTNode += stepCF -###### Here some graphical methods + # then the monitor summary + summary=makeSummary("TriggerSummary"+ stepCF_name, step_decisions) + HLTNode += summary + if log.isEnabledFor(logging.DEBUG): + log.debug("Now Draw...") + stepCF_DataFlow_to_dot("%s_%s"%(HLTNodeName,stepCF_name), CFseq_list) + stepCF_ControlFlow_to_dot(stepCF) -from ViewAlgsTest.connectAlgorithmsIO import connectAlgorithmsIO, graph_generator -from AthenaCommon.AlgSequence import AthSequencer + if log.isEnabledFor(logging.DEBUG): + log.info("************* End of step %d, %s", nstep+1, stepCF_name) + # end of steps -def algColor(alg): - if "Hypo" in alg: return "darkorchid1" - if "Filter" in alg: return "chartreuse3" - if "InputMaker" in alg: return "cyan3" - return "cadetblue1" - -def stepCF_ControlFlow_to_dot(stepCF): - def _dump (seq, indent): - o = list() - for c in seq.getChildren(): - if "AthSequencer" in c.getFullName(): - o.append( ("%s[color=%s, shape=circle, width=.5, fixedsize=true ,style=filled]\n"%(c.name(),_seqColor(c)), indent) ) - else: - o.append( ("%s[fillcolor=%s,style=filled]\n"%(c.name(),algColor(c.name())), indent) ) - o.append( ("%s -> %s\n"%(seq.name(), c.name()), indent)) - o.extend( _dump (c, indent+1) ) - return o - - def _parOR (seq): - if seq.ModeOR is True: - if seq.Sequential is False: - if seq.StopOverride is True: - return True - return False - - def _seqAND(seq): - if seq.ModeOR is False: - if seq.Sequential is True: - if seq.StopOverride is False: - return True - return False - - def _seqColor(seq): - if _parOR(seq): return "red" - if _seqAND(seq): return "blue" - return "black" + if log.isEnabledFor(logging.DEBUG): + log.debug("finalDecisions: %s" %str( finalDecisions) ) + all_DataFlow_to_dot(HLTNodeName, allSeq_list) + return finalDecisions + + + +## This can be simplified! +def buildFilter(stepCF_name,previous_sequence, CFseq_list, chain, filter_input, previous_seeds): + from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import RoRSequenceFilterNode +#### Build the FILTER +# one filter per previous sequence at the start of the sequence: check if it exists or create a new one +# if the previous hypo has more than one output, try to get all of them +# one filter per previous sequence: 1 input/previous seq, 1 output/next seq + filter_name="Filter%s_on_%s"%(stepCF_name,previous_sequence) + findFilter= [cfseq.filter for cfseq in CFseq_list if filter_name in cfseq.filter.algname] + n_filters = len(findFilter) + if n_filters == 1: + sfilter=findFilter[0] + sfilter.setChains(chain.name) + if log.isEnabledFor(logging.DEBUG): + log.debug("Filter %s already exists", filter_name) + log.debug("Adding chain %s to %s", chain.name,sfilter.algname) + log.debug(sfilter.getChains()) + + + elif n_filters == 0: + sfilter = RoRSequenceFilterNode(name=filter_name) + for i in previous_seeds: sfilter.addSeed(i) + for i in filter_input: sfilter.addInput(i) + filter_out=["%s_from_%s"%(filter_name,i) for i in filter_input] + for o in filter_out: sfilter.addOutput(o) + sfilter.setChains(chain.name) + if log.isEnabledFor(logging.DEBUG): + log.debug("Adding these seeds to filter: %s", previous_seeds) + log.debug("Filter Done: %s", sfilter.name) + else: + log.error("found %d filters with name %s", n_filters, filter_name) + sys.exit("ERROR, in filter configuration") - + return (sfilter,n_filters) - # to visualize: dot -T pdf Step1.dot > Step1.pdf - file = open( '%s.CF.dot'%stepCF.name(), mode="wt" ) - #strict - file.write( 'digraph step {\n'\ - +'\n'\ - +' node [ shape=polygon, fontname=Helvetica ]\n'\ - +' edge [ fontname=Helvetica ]\n' - +' %s [shape=Mdiamond]\n'%stepCF.name()) - - indent=0 - out = [("%s[color=%s shape=circle]\n"%(stepCF.name(),_seqColor(stepCF)), indent)] - - out.extend( _dump( stepCF, indent=indent+1 ) ) - for n,i in out: - line= " "*i+ n - file.write(line) - file.write( '}\n') - -def stepCF_DataFlow_to_dot(name, cfseq_list): - # to visualize: dot -T pdf Step1.dot > Step1.pdf - file = open( '%s.DF.dot'%name, mode="wt" ) - #strict - file.write( 'digraph step {\n'\ - +'\n'\ - +' node [ shape=polygon, fontname=Helvetica ]\n'\ - +' edge [ fontname=Helvetica ]\n' - +' %s [shape=Mdiamond]\n'%name) - - - for cfseq in cfseq_list: - print cfseq.name - file.write(" %s[fillcolor=%s style=filled]\n"%(cfseq.filter.algname,algColor(cfseq.filter.algname))) - for inp in cfseq.filter.getInputList(): - file.write(addConnection(name, cfseq.filter.algname, inp)) - - file.write( '\n subgraph cluster_%s {\n'%(cfseq.name)\ - +' node [color=white style=filled]\n'\ - +' style=filled\n'\ - +' color=lightgrey\n'\ - +' fontname=Helvetica\n'\ - +' label = %s\n'%(cfseq.name)) - - cfseq_algs = [] - cfseq_algs.append(cfseq.filter) - - for seq in cfseq.menuSeq.nodeSeqList: - # cfseq_algs.append(seq.inputMaker) - cfseq_algs.extend(seq.algs ) - if seq.reuse==False: - # file.write(" %s[fillcolor=%s]\n"%(seq.inputMaker.algname, algColor(seq.inputMaker.algname))) - for alg in seq.algs: file.write(" %s[fillcolor=%s]\n"%(alg.algname, algColor(alg.algname))) - seq.reuse=True - cfseq_algs.append(seq.hypo) - - file.write(" %s[color=%s]\n"%(seq.hypo.algname, algColor(seq.hypo.algname))) - file.write(' }\n') - file.write(findConnections(cfseq_algs)) - file.write('\n') - - file.write( '}') - file.close() - - -def findConnections(alg_list): - lineconnect='' - for nodeA in alg_list: - for nodeB in alg_list: - if nodeA is nodeB: - continue - dataIntersection = list(set(nodeA.getOutputList()) & set(nodeB.getInputList())) - if len(dataIntersection) > 0: - for line in dataIntersection: - lineconnect+=addConnection(nodeA.algname,nodeB.algname, line) - print 'Data connections between %s and %s: %s'%(nodeA.algname, nodeB.algname, line) - return lineconnect - -def addConnection(nodeA, nodeB, label): - line = " %s -> %s [label=%s]\n"%(nodeA,nodeB,label) - # print line - return line - diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/HLTCFDot.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFDot.py similarity index 98% rename from Trigger/TrigValidation/TrigUpgradeTest/python/HLTCFDot.py rename to Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFDot.py index 8b6ec2ac4a6b8da5ace171c68d98219fff50d9e3..4ac66ce7c3f46c14e2a80316003efc594e62101a 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/python/HLTCFDot.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFDot.py @@ -3,7 +3,7 @@ from ViewAlgsTest.connectAlgorithmsIO import connectAlgorithmsIO, graph_generator from AthenaCommon.AlgSequence import AthSequencer -from TrigUpgradeTest.MenuComponents import isHypoBase, isInputMakerBase, isFilterAlg +from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import isHypoBase, isInputMakerBase, isFilterAlg import itertools def algColor(alg): diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/MenuChains.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuChains.py similarity index 100% rename from Trigger/TrigValidation/TrigUpgradeTest/python/MenuChains.py rename to Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuChains.py diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuComponents.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuComponents.py index 9b722ff51b14204f74f52d1aee9ce54d5ab4d421..2c61801bbc50ecaed9ee664ff85286ae10bf46cb 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuComponents.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuComponents.py @@ -1,96 +1,607 @@ +import sys, re, copy +from AthenaCommon.Logging import logging +from AthenaCommon.Constants import VERBOSE,INFO,DEBUG +log = logging.getLogger('MenuComponents') +log.setLevel( VERBOSE ) +logLevel=DEBUG +from DecisionHandling.DecisionHandlingConf import RoRSeqFilter +class Node(): + """ base class representing one Alg + inputs + outputs, to be used to Draw dot diagrams and connect objects""" + def __init__(self, Alg): + self.name = ("%sNode")%( Alg.name()) + self.Alg=Alg + self.algname = Alg.name() + self.inputs=[] + self.outputs=[] + + def addOutput(self, name): + self.outputs.append(name) + def addInput(self, name): + self.inputs.append(name) -########################################################## + def getOutputList(self): + return self.outputs + def getInputList(self): + return self.inputs -class NodeSequence(): - def __init__(self, name, Algs, Hypo, Seed): - self.name = name - self.algs = Algs - self.hypo = Hypo - self.seed = Seed - self.output = Hypo.getOutput() - self.reuse = 0 - self.connect() + def __str__(self): + return "Node::%s [%s] -> [%s]"%(self.algname, ' '.join(map(str, self.getInputList())), ' '.join(map(str, self.getOutputList()))) - - def connect(self): - alg_input = "" - #alg_input = self.inputMaker.getOutput() - for Alg in self.algs: - Alg.setInput(alg_input) - alg_input = Alg.getOutput() - self.hypo.setInput(Alg.getOutput()) - print "connect NodeSequence %s"%self.name - - def setInput(self,input): - self.algs[0].setInput(input) - - def addInput(self,input): - self.algs[0].addInput(input) + + +class AlgNode(Node): + """Node class that connects inputs and outputs to basic alg. properties """ + def __init__(self, Alg, inputProp, outputProp): + Node.__init__(self, Alg) + self.outputProp=outputProp + self.inputProp=inputProp + + def addDefaultOutput(self): + if self.outputProp is not '': + self.addOutput(("%s_%s"%(self.algname,self.outputProp))) + + def setPar(self, prop, name): + cval = self.Alg.getProperties()[prop] + try: + if type(cval) == type(list()): + cval.append(name) + return setattr(self.Alg, prop, cval) + else: + return setattr(self.Alg, prop, name) + except: + pass + + def getPar(self, prop): + try: + return getattr(self.Alg, prop) + except: + return self.Alg.getDefaultProperty(prop) + raise "Error in reading property " + prop + " from " + self.Alg + + def addOutput(self, name): + if self.outputProp is not '': + return self.setPar(self.outputProp,name) + + def getOutputList(self): + outputs = [] + cval = self.getPar(self.outputProp) + if cval == '': + return outputs + if type(cval) == type(list()): + outputs.extend(cval) + else: + outputs.append(cval) + return outputs + + def addInput(self, name): + if self.inputProp is not '': + return self.setPar(self.inputProp,name) + + def getInputList(self): + inputs = [] + cval = self.getPar(self.inputProp) + if cval =='': + return inputs + if type(cval) == type(list()): + inputs.extend(cval) + else: + inputs.append(cval) + return inputs + + def __str__(self): + return "Alg::%s [%s] -> [%s]"%(self.algname, ' '.join(map(str, self.getInputList())), ' '.join(map(str, self.getOutputList()))) + + +class HypoToolConf(): + """ Class to group info on hypotools""" + def __init__(self, hypoToolGen): + self.hypoToolGen = hypoToolGen + self.name='' + self.conf='' + + def setName(self, name): + self.name=name + + def setConf(self, conf): + self.conf=conf + + def create(self): + """creates instance of the hypo tool""" + return self.hypoToolGen( self.name, self.conf ) + + +class HypoAlgNode(AlgNode): + """Node for HypoAlgs""" + def __init__(self, Alg): + assert isHypoBase(Alg), "Error in creating HypoAlgNode from Alg " + Alg.name() + AlgNode.__init__(self, Alg, 'HypoInputDecisions', 'HypoOutputDecisions') + self.addDefaultOutput() + self.tools = [] + self.previous=[] + + def addHypoTool (self, hypoToolConf): + if hypoToolConf.name not in self.tools: + ## HypoTools are private, so need to be created when added to the Alg + ## this incantation may seem strange, however it is the only one which works + ## trying tool = hypoToolConf.create() and then assignement does not work! will be no problem in run3 config + tools = self.Alg.HypoTools + self.Alg.HypoTools = tools+[hypoToolConf.create()] + self.tools.append( hypoToolConf.name ) + else: + raise RuntimeError("The hypo tool of name "+ hypoToolConf.name +" already present") + + + def setPreviousDecision(self,prev): + self.previous.append(prev) + return self.addInput(prev) + + def __str__(self): + return "HypoAlg::%s [%s] -> [%s], previous = [%s], HypoTools=[%s]"%(self.Alg.name(),' '.join(map(str, self.getInputList())), + ' '.join(map(str, self.getOutputList())), + ' '.join(map(str, self.previous)), + ' '.join(map(str, self.tools))) + + + + +class SequenceFilterNode(AlgNode): + """Node for any kind of sequence filter""" + def __init__(self, Alg, inputProp, outputProp): + AlgNode.__init__(self, Alg, inputProp, outputProp) + self.seeds = [] + + def setChains(self, name): + if log.isEnabledFor(logging.DEBUG): + log.debug("Adding Chain %s to filter %s"%(name, self.name)) + return self.setPar("Chains", name) + + def getChains(self): + return self.getPar("Chains") + + def addSeed(self, seed): + self.seeds.append(seed) + def __str__(self): - return "NodeSequence::%s with \n Seed::%s \n %s \n Hypo::%s"%(self.name, self.seed, ',\n '.join(map(str, self.algs)), self.hypo) + return "SequenceFilter::%s [%s] -> [%s], seeds=[%s], chains=%s"%(self.Alg.name(),' '.join(map(str, self.getInputList())),' '.join(map(str, self.getOutputList())), ' '.join(map(str, self.seeds)), self.getChains()) + + + + +class RoRSequenceFilterNode(SequenceFilterNode): + def __init__(self, name): + Alg= RoRSeqFilter(name, OutputLevel = logLevel) + SequenceFilterNode.__init__(self, Alg, 'Input', 'Output') + + + +class InputMakerNode(AlgNode): + def __init__(self, Alg): + assert isInputMakerBase(Alg), "Error in creating InputMakerNode from Alg " + Alg.name() + AlgNode.__init__(self, Alg, 'InputMakerInputDecisions', 'InputMakerOutputDecisions') + Alg.OutputLevel = logLevel + +from DecisionHandling.DecisionHandlingConf import ComboHypo +class ComboMaker(AlgNode): + def __init__(self, name): + Alg = ComboHypo(name) + if log.isEnabledFor(logging.DEBUG): + log.debug("Making combo Alg %s"%name) + AlgNode.__init__(self, Alg, 'HypoInputDecisions', 'HypoOutputDecisions') + Alg.OutputLevel = logLevel + self.prop="MultiplicitiesMap" + + + def addChain(self, chain): + if log.isEnabledFor(logging.DEBUG): + log.debug("ComboMaker %s adding chain %s"%(self.algname,chain)) + from MenuChains import getConfFromChainName + confs=getConfFromChainName(chain) + for conf in confs: + seed=conf.replace("HLT_", "") + integers = map(int, re.findall(r'^\d+', seed)) + multi=0 + if len(integers)== 0: + multi=1 + elif len(integers)==1: + multi=integers[0] + re.sub('^\d+',"",seed) #remove the multiplicity form the string + else: + sys.exit("ERROR in decoding combined chain %s"%(chain)) + + newdict={chain:[multi]} + cval = self.Alg.getProperties()[self.prop] + if type(cval) == type(dict()): + if chain in cval.keys(): + cval[chain].append(multi) + else: + cval[chain]=[multi] + else: + cval=newdict + setattr(self.Alg, self.prop, cval) + + + +######################################################### +# USEFULL TOOLS +######################################################### + +def isHypoBase(alg): + if 'HypoInputDecisions' in alg.__class__.__dict__: + return True + prop = alg.__class__.__dict__.get('_properties') + return ('HypoInputDecisions' in prop) + +def isInputMakerBase(alg): + return ('InputMakerInputDecisions' in alg.__class__.__dict__) + +def isFilterAlg(alg): + return isinstance(alg, RoRSeqFilter) + +########################################################## +# NOW sequences and chains +########################################################## + + class MenuSequence(): - def __init__(self, name, nodeSeqList): - self.name = name - self.nodeSeqList=nodeSeqList - self.outputs=[seq.output for seq in nodeSeqList] + """ Class to group reco sequences with the Hypo""" + def __init__(self, Sequence, Maker, Hypo, HypoToolGen ): + from AthenaCommon.AlgSequence import AthSequencer + self.name = "S_%s"%(Hypo.name()) # sequence name is based on hypo name + self.sequence = Node( Alg=Sequence) + self.maker = InputMakerNode( Alg = Maker ) + self.hypoToolConf = HypoToolConf( HypoToolGen ) + self.hypo = HypoAlgNode( Alg = Hypo ) + self.inputs=[] + self.outputs=[] + self.seed='' + self.reuse = False # flag to draw dot diagrmas + + def replaceHypoForCombo(self, HypoAlg): + if log.isEnabledFor(logging.DEBUG): + log.debug("set new Hypo %s for combo sequence %s "%(HypoAlg.name(), self.name)) + self.hypo= HypoAlgNode( Alg=HypoAlg) + + def connectToFilter(self,sfilter): + filter_output = sfilter.getOutputList() + inputs=[filter_output[i] for i,fseed in enumerate (sfilter.seeds) if self.seed in fseed ] + if log.isEnabledFor(logging.DEBUG): + log.debug("connectToFilter: found %d inputs to sequence::%s from Filter::%s (from seed %s)", + len(inputs), self.name, sfilter.algname, self.seed) + for i in inputs: log.debug("- "+i) + if len(inputs) == 0: + sys.exit("ERROR, no inputs to sequence are set!") + for inp in inputs: + new_output = "%s_from_%s"%(self.hypo.algname, inp) + self.hypo.addOutput(new_output) + self.outputs.append( new_output) + + #### Connect the InputMaker + for i in inputs: + self.maker.addInput(i) + self.inputs.append(i) + input_maker_output=["%s_from_%s"%(self.maker.algname,i) for i in inputs ] + if len(input_maker_output) == 0: + sys.exit("ERROR, no outputs to sequence are set!") + for out in input_maker_output: + self.maker.addOutput(out) + self.hypo.setPreviousDecision(out) + if log.isEnabledFor(logging.DEBUG): + log.debug("connectToFilter: connecting InputMaker to HypoAlg: adding %d output to InputMaker::%s and sending to HypoAlg::%s", + len(inputs), self.maker.algname, self.hypo.algname) + for i in inputs: log.debug(i) def __str__(self): - return "MenuSequence::%s \n %s"%(self.name,',\n '.join(map(str, self.nodeSeqList))) + return "MenuSequence::%s \n Hypo::%s \n Maker::%s \n Sequence::%s"%(self.name, self.hypo, self.maker, self.sequence) + + +class Chain: + """Basic class to define the trigger menu """ + def __init__(self, name, Seed, ChainSteps=[]): + self.name = name + self.seed=Seed + self.steps=ChainSteps + self.vseeds = Seed.strip().split("_") + self.vseeds.pop(0) #remove first L1 string + # group_seed is used to se tthe seed type (EM, MU,JET), removing the actual threshold + self.group_seed = ["L1"+filter(lambda x: x.isalpha(), stri) for stri in self.vseeds] + self.setSeedsToSequences() # save seed of each menuseq + if log.isEnabledFor(logging.DEBUG): + log.debug("Chain " + name + " with seeds: %s "%str( self.vseeds)) + + for step in self.steps: + if step.isCombo: + step.combo.addChain(self.name) + + def setSeedsToSequences(self): + # set the seed to the menusequences + sequences1=self.steps[0].sequences + tot_seq=len(sequences1) + tot_seed=len(self.vseeds) + if tot_seq==tot_seed: + nseq=0 + for seed in self.vseeds: + for step in self.steps: + seq=step.sequences[nseq] + seq.seed ="L1"+filter(lambda x: x.isalpha(), seed) + if log.isEnabledFor(logging.DEBUG): + log.debug( "Chain %s adding seed %s to sequence %d in step %s"%(self.name, seq.seed, nseq, step.name)) + nseq+=1 + + else: + log.error("found %d sequences in this chain and %d seeds. What to do??", tot_seq, tot_seed) + sys.exit("ERROR, in chain configuration") + + def decodeHypoToolConfs(self): + """ This is extrapolating the hypotool configuration from the (combined) chain name""" + from TriggerMenuMT.HLTMenuConfig.Menu.MenuChains import getConfFromChainName + signatures = getConfFromChainName(self.name) + for step in self.steps: + if len(signatures) != len(step.sequences): + log.error("Error in step %s: found %d signatures and %d sequences"%(step.name, len(signatures), len(step.sequences))) + sys.exit("ERROR, in chain configuration") + nseq=0 + for seq in step.sequences: + seq.hypoToolConf.setConf(signatures[nseq]) + seq.hypoToolConf.setName(self.name) + seq.hypo.addHypoTool(seq.hypoToolConf) + nseq +=1 + class CFSequence(): - def __init__(self, name, FilterAlg, MenuSequence): - self.name = name + """Class to describe the ChainStep + filter""" + def __init__(self, ChainStep, FilterAlg): + self.name = ChainStep.name # not needed? self.filter = FilterAlg - self.menuSeq = MenuSequence - self.otherNodes = [] + self.step=ChainStep + self.connect() - def addNode(self, node): - self.otherNodes.append(node) + def connect(self): + """Connect filter to ChainStep (all its sequences)""" + for seq in self.step.sequences: + seq.connectToFilter(self.filter) + + if self.step.isCombo: self.connectCombo() + + def connectCombo(self): + # reset sequence output, they will b ereplaced by new combo outputs + for seq in self.step.sequences: + seq.outputs=[] + + for seq in self.step.sequences: + combo_input=seq.hypo.getOutputList()[0] + self.step.combo.addInput(combo_input) + log.debug("Adding inputs %s to combo %s"%(combo_input, self.step.combo.algname)) + # inputs are the output decisions of the hypos of the sequences + # outputs are the modified name of input deciions that need to be connected to the next filter + combo_output="combo_%s"%combo_input + self.step.combo.addOutput(combo_output) + seq.outputs.append(combo_output) + log.debug("Adding outputs %s to combo %s"%(combo_output, self.step.combo.algname)) + def __str__(self): return "--- CFSequence %s ---\n + Filter: %s \n + %s \n "%(self.name,\ - self.filter, \ - self.menuSeq) - - def getAllNodes(self): - nodes = [] - for seq in self.menuSeq.nodeSeqList: - nodes.extend(seq.algs) - nodes.append(seq.hypo) - for node in self.otherNodes: - nodes.append(node) - - return nodes + self.filter, self.step ) + + + + + +class ChainStep: + """Class to describe one step of a chain; if more than one menuSequence, then the step is combo""" + def __init__(self, name, Sequences=[]): + self.name = name + self.sequences=[] + self.isCombo=len(Sequences)>1 + self.combo=None + if self.isCombo: + self.makeCombo(Sequences) + else: + self.sequences = Sequences + + + def replaceSequence(self, old, new): + # maybe obsolete? + idx=self.sequences.index(old) # this raise exception + self.sequences.pop(idx) + self.sequences.insert(idx, new) + + def makeCombo(self, Sequences): + # For combo sequences, duplicate the Hypo with a Combo_name and create the comboHypoAlg + self.combo = ComboMaker("ComboHypo_%s"%self.name) + for sequence in Sequences: + new_sequence=copy.deepcopy(sequence) + new_sequence.name=("%s_Combo"%sequence.name) + oldhypo=sequence.hypo.Alg + new_hypoAlg=oldhypo.clone("%s_Combo"%oldhypo.name()) + new_sequence.replaceHypoForCombo(new_hypoAlg) + self.sequences.append(new_sequence) + + def __str__(self): + return "--- ChainStep %s ---\n + isCombo: %d \n + %s \n "%(self.name, self.isCombo, ' '.join(map(str, self.sequences) )) + + + +# this is fragment for New JO + + +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +class InEventReco( ComponentAccumulator ): + """ Class to handle in-event reco """ + pass + + +class InViewReco( ComponentAccumulator ): + """ Class to handle in-view reco, sets up the View maker if not provided and exposes InputMaker so that more inputs to it can be added in the process of assembling the menu """ + def __init__(self, name, viewMaker=None): + super( InViewReco, self ).__init__() + self.name = name + from AthenaCommon.CFElements import parOR, seqAND + self.mainSeq = seqAND( name ) + self.addSequence( self.mainSeq ) + + from ViewAlgs.ViewAlgsConf import EventViewCreatorAlgorithm + if viewMaker: + self.viewMakerAlg = viewMaker + else: + from AthenaCommon.Constants import DEBUG + self.viewMakerAlg = EventViewCreatorAlgorithm(name+'ViewsMaker', + ViewFallThrough = True, + RoIsLink = 'initialRoI', # -||- + InViewRoIs = name+'RoIs', + Views = name+'Views', + ViewNodeName = name+"InView", + OutputLevel=DEBUG) + + self.addEventAlgo( self.viewMakerAlg, self.mainSeq.name() ) + self.viewsSeq = parOR( self.viewMakerAlg.ViewNodeName ) + self.addSequence( self.viewsSeq, self.mainSeq.name() ) + def addInputFromFilter(self, filterAlg ): + assert len(filterAlg.Output) == 1, "Can only oprate on filter algs with one configured output, use addInput to setup specific inputs" + self.addInput( filterAlg.Output[0], "Reco_"+( filterAlg.Output[0].replace("Filtered_", "") ) ) -class SequenceHypoTool: - def __init__(self, MenuSequence, HypoTool): - self.sequence = MenuSequence - self.hypotool = HypoTool + def addInput(self, inKey, outKey ): + """Adds input (DecisionsContainer) from which the views should be created """ + self.viewMakerAlg.InputMakerInputDecisions += [ inKey ] + self.viewMakerAlg.InputMakerOutputDecisions += [ outKey ] + + def addRecoAlg( self, alg ): + """Reconstruction alg to be run per view""" + self.addEventAlgo( alg, self.viewsSeq.name() ) + + def sequence( self ): + return self.mainSeq + + def inputMaker( self ): + return self.viewMakerAlg + + +class RecoFragmentsPool: + """ Class to host all the reco fragments that need to be reused """ + fragments = {} + @classmethod + def retrieve( cls, creator, flags, **kwargs ): + """ create, or return created earlier reco fragment + + Reco fragment is uniquelly identified by the function and set og **kwargs. + The flags are not part of unique identifier as creation of new reco fragments should not be caused by difference in the unrelated flags. + """ + from AthenaCommon.Logging import logging + requestHash = hash( ( creator, tuple(kwargs.keys()), tuple(kwargs.values()) ) ) + if requestHash not in cls.fragments: + recoFragment = creator( flags, **kwargs ) + cls.fragments[requestHash] = recoFragment + log.debug( "created reconstruction fragment" ) + return recoFragment + else: + log.debug( "reconstruction fragment from the cache" ) + return cls.fragments[requestHash] -class ChainStep: - def __init__(self, name, SequenceHypoTools=[]): - self.name = name - self.sequenceHypoTools = SequenceHypoTools - self.sequences = [sh.sequence for sh in SequenceHypoTools ] + +class NJMenuSequence( ComponentAccumulator ): + def __init__( self, name ): + super( NJMenuSequence, self ).__init__() + from AthenaCommon.CFElements import seqAND + self.name = name + self.mainSeq = seqAND( name ) + self.addSequence( self.mainSeq ) + self.filterAlg = None + self.reco = None + self.hypoAlg = None + + def addReco( self, reco ): + """ Adds reconstruction sequence, has to be one of InViewReco or InEventReco objects """ + assert self.filterAlg, "The filter alg has to be setup first" + self.reco = reco + reco.addInputFromFilter( self.filterAlg ) + self.addSequence( reco.sequence(), self.mainSeq.name() ) + self.merge( reco ) + + def addFilter( self, chains, inKey ): + """ adds filter alg of type RoRSeqFilter, output key is predefined by the sequence name as: Filtered + the name""" + from DecisionHandling.DecisionHandlingConf import RoRSeqFilter + self.filterAlg = RoRSeqFilter( self.name+'Filter' ) + self.filterAlg.Input = [ inKey ] + self.filterAlg.Output = [ 'Filtered_'+self.name ] + self.filterAlg.Chains = chains + from AthenaCommon.Constants import DEBUG + self.filterAlg.OutputLevel = DEBUG + self.addEventAlgo( self.filterAlg, self.mainSeq.name() ) + + def hypoDecisions( self ): + return "Decisions_"+self.name + + def addHypo( self, hypo ): + self.hypoAlg = hypo + self.hypoAlg.HypoInputDecisions = self.reco.inputMaker().InputMakerOutputDecisions[-1] + self.hypoAlg.HypoOutputDecisions = self.hypoDecisions() + self.addEventAlgo( hypo, self.mainSeq.name() ) + + def sequence( self ): + return self.mainSeq + + def filter( self ): + return self.filterAlg + def check( self ): + assert self.filterAlg, "Filter not configured" + assert self.hypoAlg, "Hypo alg is not configured" -class Chain: # going to be my HLTChainDef - def __init__(self, name, Seed, ChainSteps=[]): - self.name = name - self.seed=Seed - self.steps=ChainSteps - - seeds = Seed.strip().split("_") - seeds.pop(0) - self.group_seed = ["L1"+filter(lambda x: x.isalpha(), stri) for stri in seeds] +class HLTMenuAccumulator( ComponentAccumulator ): + def __init__( self ): + super( HLTMenuAccumulator, self ).__init__() + from AthenaCommon.CFElements import seqAND + HLTSteps = seqAND( "HLTSteps" ) + self.addSequence( HLTSteps ) + def __getOrMakeStepSequence(self, step, isFilter = False ): + """ Constructs sequence for the step, the filtering step or, reco step will be created depending on isFilter flags + + The function assures that all previous steps are aready in place i.e. HLTStep_1_filter, HLTStep_1 ... until HLTStep_N-1 are in place. + Therefore the steps can be added in any order (not yet sure if that will but better assure robustness now) + """ + from AthenaCommon.CFElements import parOR + name = "HLTStep_%d%s" % (step, "_filters" if isFilter else "" ) + + s = self.getSequence( name ) + if s: + return s + # make sure that sequences for previous steps are in place + for p in range( 1, step ): + self.__getOrMakeStepSequence( p, isFilter = True ) + self.__getOrMakeStepSequence( p, isFilter = False ) + # make sure that filtering steps is placed before reco steps + if not isFilter: + self.__getOrMakeStepSequence( step, isFilter = True ) + s = parOR( name ) + self.addSequence( s, parentName="HLTSteps") + return s + + + def setupSteps( self, steps ): + """ The main menu function, it is responsible for crateion of step sequences and placing slice specific sequencers there. + + It would rely on the MenuSeq object API in two aspects, to obtain filter alg and to obtain the reco sequence + The MenuSeq should already contain all the chains that are needed for the menu setup (chains info can be accessed via flags passed when steps were created) + """ + for stepNo, fhSeq in enumerate( steps, 1 ): + filterStep = self.__getOrMakeStepSequence( stepNo, isFilter = True ) + filterStep += fhSeq.filter() # FilterHypoSequence API + + recoStep = self.__getOrMakeStepSequence( stepNo, isFilter = False ) + self.addSequence( fhSeq.sequence(), recoStep.name() ) + + + def steps( self ): + """ returns step seqeuncers """ + return self.getSequence("HLTSteps") diff --git a/graphics/VP1/VP1Base/src/VP1CustomTourEditor.cxx b/graphics/VP1/VP1Base/src/VP1CustomTourEditor.cxx index 2524c4e0bde32f50a49162da453e83d6b2b73e9e..49bf26ea9f97c6d072147b30ba8c5cbd96f78ae0 100644 --- a/graphics/VP1/VP1Base/src/VP1CustomTourEditor.cxx +++ b/graphics/VP1/VP1Base/src/VP1CustomTourEditor.cxx @@ -30,6 +30,7 @@ #include <QShortcut> #include <QCloseEvent> #include <QScrollBar> +#include <QAction> #include <iostream> diff --git a/graphics/VP1/VP1Utils/CMakeLists.txt b/graphics/VP1/VP1Utils/CMakeLists.txt index 1566c883f2d85828d2110903deb8807a958c7be7..1de2eb71f69a20058c3102ed43375672a177a6be 100644 --- a/graphics/VP1/VP1Utils/CMakeLists.txt +++ b/graphics/VP1/VP1Utils/CMakeLists.txt @@ -11,8 +11,7 @@ atlas_subdir( VP1Utils ) # Declare the package's dependencies: atlas_depends_on_subdirs( PUBLIC - Control/CLIDSvc - Control/SGTools + Control/AthenaKernel Control/StoreGate DetectorDescription/GeoModel/GeoModelKernel DetectorDescription/GeoPrimitives @@ -60,7 +59,7 @@ atlas_add_library( VP1Utils VP1Utils/*.h src/*.cxx src/*.cpp INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} PRIVATE_INCLUDE_DIRS ${HEPPDT_INCLUDE_DIRS} ${COIN3D_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} - LINK_LIBRARIES ${CLHEP_LIBRARIES} SGTools GeoModelKernel EventPrimitives + LINK_LIBRARIES ${CLHEP_LIBRARIES} GeoModelKernel EventPrimitives GaudiKernel VP1Base StoreGateLib SGtests AthDSoCallBacks MuonIdHelpersLib GeoPrimitives Qt5::Core PRIVATE_LINK_LIBRARIES ${HEPPDT_LIBRARIES} ${COIN3D_LIBRARIES} diff --git a/graphics/VP1/VP1Utils/VP1Utils/VP1SGAccessHelper.icc b/graphics/VP1/VP1Utils/VP1Utils/VP1SGAccessHelper.icc index 3daa27c37e284d1eb188a5a8b4ad6c183eb36474..ebe2342413a19206ea0b3fc9671c492594bccb8d 100644 --- a/graphics/VP1/VP1Utils/VP1Utils/VP1SGAccessHelper.icc +++ b/graphics/VP1/VP1Utils/VP1Utils/VP1SGAccessHelper.icc @@ -30,7 +30,7 @@ inline const T* VP1SGAccessHelper::retrieve( const QString& key ) const try { t = storeGate()->retrieve<const T>(key.toStdString()); exception = false; - } catch (std::runtime_error e) { + } catch (const std::runtime_error& e) { exception = true; t = 0; } diff --git a/graphics/VP1/VP1Utils/VP1Utils/VP1SGContentsHelper.h b/graphics/VP1/VP1Utils/VP1Utils/VP1SGContentsHelper.h index 2cdd513ed8cb6370b9dc783296fba2237fbcc6b2..09cce828eb5bbe0f4d289255340cf584e64593a9 100644 --- a/graphics/VP1/VP1Utils/VP1Utils/VP1SGContentsHelper.h +++ b/graphics/VP1/VP1Utils/VP1Utils/VP1SGContentsHelper.h @@ -19,7 +19,7 @@ #define VP1SGCONTENTSHELPER_H #include "VP1Base/VP1HelperClassBase.h" -#include "CLIDSvc/tools/ClassID_traits.h" +#include "AthenaKernel/ClassID_traits.h" #include <QStringList> class StoreGateSvc; diff --git a/graphics/VP1/VP1Utils/src/VP1SGContentsHelper.cxx b/graphics/VP1/VP1Utils/src/VP1SGContentsHelper.cxx index 53e8201fbf94441fccd70a69741ead898ff10229..c45bafabe116968a9070c73dd1ccaf85fe186118 100644 --- a/graphics/VP1/VP1Utils/src/VP1SGContentsHelper.cxx +++ b/graphics/VP1/VP1Utils/src/VP1SGContentsHelper.cxx @@ -56,7 +56,7 @@ bool VP1SGContentsHelper::contains( const CLID& id, const QString& key ) const try { contains = m_sg->contains(id,key.toStdString()); exception = false; - } catch (std::runtime_error e) { + } catch (const std::runtime_error& e) { exception = true; } if (exception) { @@ -84,7 +84,7 @@ QStringList VP1SGContentsHelper::getKeys(const CLID& id) const try { keys = m_sg->keys(id); exception = false; - } catch (std::runtime_error e) { + } catch (const std::runtime_error& e) { exception = true; } if (exception) {