diff --git a/ForwardDetectors/ZDC/ZDC_GeoM/share/zdcsimu.py b/ForwardDetectors/ZDC/ZDC_GeoM/share/zdcsimu.py deleted file mode 100644 index b12faaa71e7e5d475372a88edf4e5ad159b6fe8a..0000000000000000000000000000000000000000 --- a/ForwardDetectors/ZDC/ZDC_GeoM/share/zdcsimu.py +++ /dev/null @@ -1,93 +0,0 @@ -# Read arguments from environment variables -import os -#serialNumber = os.environ['serialNumber'] -#runNumber = os.environ['runNumber'] -numEvents = 2 - - -#--- Detector flags ------------------------------------------- -from AthenaCommon.DetFlags import DetFlags -DetFlags.ID_setOff() -DetFlags.Calo_setOff() -DetFlags.Muon_setOff() -DetFlags.ZDC_setOn() -DetFlags.simulate.Truth_setOn() - - -from RngComps.RngCompsConf import AtRndmGenSvc -ServiceMgr += AtRndmGenSvc() - - -#--- AthenaCommon flags --------------------------------------- -from AthenaCommon.AthenaCommonFlags import athenaCommonFlags -athenaCommonFlags.PoolHitsOutput= "Hits.pool.root" -athenaCommonFlags.EvtMax=int(numEvents) - - -#--- Simulation flags ----------------------------------------- -from G4AtlasApps.SimFlags import SimFlags -SimFlags.SeedsG4 = 1114 -SimFlags.SimLayout.set_On() # Use the default value - - -# for the next three lines look into Andrea Dellacqua's talk in the Forwardsimulation meeting of Nov23-2010 -# http://indico.cern.ch/conferenceDisplay.py?confId=114120 -SimFlags.ForwardDetectors.set_On() -SimFlags.ForwardDetectors=1 -SimFlags.EventFilter.set_Off() -#SimFlags.WorldZRange.statusOn=True -#SimFlags.WorldZRange.set_Value(145000) - - -from AthenaCommon.GlobalFlags import jobproperties -jobproperties.Global.ConditionsTag = "OFLCOND-SIM-BS7T-00" -# Look into SimFlags.SimLayout for other possible values -#SimFlags.SimLayout='ATLAS-GEO-06-00-00' # specific value -#SimFlags.SimLayout.set_On() # uses the default value -SimFlags.MagneticField.set_Off() - - -# - uses single particle generator -SimFlags.KinematicsMode='SingleParticle' -# e-/+ = +/-11, mu-/+ = +/-13, pi+/- = +/-211, pi0=111, eta=221, -# neutron=2112, proton=2212, gamma 22 -SimFlags.ParticlePDG='22' -# set energy constant to 10 GeV -SimFlags.Energy=10000 -# set your own particle generator orders here. -# do this for example if you need generation at fixed pt -# PDG code will be set following user instructions in the SimFlags.ParticlePDG -# SimFlags.Energy will be ingored if you uncomment the following lines -SimFlags.ParticleGeneratorOrders={ - 'vertX:' : ' flat -1.0 1.0', - 'vertY:' : ' flat -1.0 1.0', - 'vertZ:' : ' constant -139500.0', - 't:' : ' constant 0.0', - 'eta:' : ' constant -100.0', - 'phi:' : ' flat 0 6.28318', - 'e:' : ' constant 1360000'} -# 'pt:' : ' constant 50000'} - - -#--- Output printout level ----------------------------------- -#output threshold (2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL) -#you can override this for individual modules if necessary -MessageSvc = Service( "MessageSvc" ) -MessageSvc.OutputLevel = 2 - - -#============================================================== -# Job configuration -# ***>> Do not add flags or simulation options below this line -#============================================================== -from G4AtlasApps import SimKernel - - -# The following lines store the desired container into the output file -from AthenaPoolCnvSvc.WriteAthenaPool import AthenaPoolOutputStream -stream1 = AthenaPoolOutputStream( "StreamEVGEN" ) -stream1.OutputFile = "SimOut.pool.root" -stream1.ItemList += [ 'EventInfo#*', 'McEventCollection#*','ZDC_SimPixelHit_Collection#*','ZDC_SimStripHit_Collection#*' ] - - -#--- End jobOptions.G4Atlas_Sim.py file ------------------------------ diff --git a/ForwardDetectors/ZDC/ZDC_SD/CMakeLists.txt b/ForwardDetectors/ZDC/ZDC_SD/CMakeLists.txt index 23831d91a890d93b3a92271114cff6c7370da455..224f962a7278fe8d11fa983a845f7d7915c8112c 100644 --- a/ForwardDetectors/ZDC/ZDC_SD/CMakeLists.txt +++ b/ForwardDetectors/ZDC/ZDC_SD/CMakeLists.txt @@ -27,16 +27,6 @@ atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} ) atlas_install_joboptions( share/optionForTest.txt ) # Tests in the package: -atlas_add_test( ZDC_StripSD_gtest - SOURCES test/ZDC_StripSD_gtest.cxx - LINK_LIBRARIES TestTools ZDC_SDLib G4AtlasToolsLib CxxUtils CaloG4SimLib - POST_EXEC_SCRIPT nopost.sh ) - -atlas_add_test( ZDC_PixelSD_gtest - SOURCES test/ZDC_PixelSD_gtest.cxx - LINK_LIBRARIES TestTools ZDC_SDLib G4AtlasToolsLib CxxUtils CaloG4SimLib - POST_EXEC_SCRIPT nopost.sh ) - atlas_add_test( ZDC_FiberSD_gtest SOURCES test/ZDC_FiberSD_gtest.cxx LINK_LIBRARIES TestTools ZDC_SDLib G4AtlasToolsLib CxxUtils CaloG4SimLib diff --git a/ForwardDetectors/ZDC/ZDC_SD/python/ZDC_SDConfig.py b/ForwardDetectors/ZDC/ZDC_SD/python/ZDC_SDConfig.py index d27b0f8d80abf0eab8bc99556c8bd01d7f939fd0..2ae96c75d55c69af290a5503dfaf9cbc3c0ebde4 100644 --- a/ForwardDetectors/ZDC/ZDC_SD/python/ZDC_SDConfig.py +++ b/ForwardDetectors/ZDC/ZDC_SD/python/ZDC_SDConfig.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from AthenaConfiguration.ComponentFactory import CompFactory @@ -36,18 +36,3 @@ def ZDC_G4CalibSDCfg(flags, name="ZDC_G4CalibSD", **kwargs): kwargs.setdefault("OutputCollectionNames", ["ZDC_CalibrationHits"]) result.setPrivateTools(CompFactory.ZDC_G4CalibSDTool(name, **kwargs)) return result - -def ZDC_StripSDCfg(flags, name="ZDC_StripSD", **kwargs): - result = ComponentAccumulator() - kwargs.setdefault("LogicalVolumeNames", ["ZDC::Strip_Logical"]) - kwargs.setdefault("OutputCollectionNames", ["ZDC_SimStripHit_Collection"]) - result.setPrivateTools(CompFactory.ZDC_StripSDTool(name, **kwargs)) - return result - - -def ZDC_PixelSDCfg(flags, name="ZDC_PixelSD", **kwargs): - result = ComponentAccumulator() - kwargs.setdefault("LogicalVolumeNames", ["ZDC::Pixel_Logical"]) - kwargs.setdefault("OutputCollectionNames", ["ZDC_SimPixelHit_Collection"]) - result.setPrivateTools(CompFactory.ZDC_PixelSDTool(name, **kwargs)) - return result diff --git a/ForwardDetectors/ZDC/ZDC_SD/python/ZDC_SDConfigDb.py b/ForwardDetectors/ZDC/ZDC_SD/python/ZDC_SDConfigDb.py index 9ed344e3db6a76debe83b99fcf093c8a7a3e9b24..5cc8ec9eb8d382cd059f1501f432103ad39a1100 100644 --- a/ForwardDetectors/ZDC/ZDC_SD/python/ZDC_SDConfigDb.py +++ b/ForwardDetectors/ZDC/ZDC_SD/python/ZDC_SDConfigDb.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration from AthenaCommon.CfgGetter import addTool addTool("ZDC_SD.ZDC_SDConfigLegacy.getZDC_FiberSD" , "ZDC_FiberSD" ) addTool("ZDC_SD.ZDC_SDConfigLegacy.getZDC_G4CalibSD", "ZDC_G4CalibSD" ) -addTool("ZDC_SD.ZDC_SDConfigLegacy.getZDC_StripSD" , "ZDC_StripSD" ) -addTool("ZDC_SD.ZDC_SDConfigLegacy.getZDC_PixelSD" , "ZDC_PixelSD" ) diff --git a/ForwardDetectors/ZDC/ZDC_SD/python/ZDC_SDConfigLegacy.py b/ForwardDetectors/ZDC/ZDC_SD/python/ZDC_SDConfigLegacy.py index 336fdf180036d75cfce2b64ed070803e51b49862..aa84c88ad31546d01ca5b03e9459c2f5afa26adc 100644 --- a/ForwardDetectors/ZDC/ZDC_SD/python/ZDC_SDConfigLegacy.py +++ b/ForwardDetectors/ZDC/ZDC_SD/python/ZDC_SDConfigLegacy.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration from AthenaCommon import CfgMgr def getZDC_FiberSD(name="ZDC_FiberSD", **kwargs): @@ -31,14 +31,3 @@ def getZDC_G4CalibSD(name="ZDC_G4CalibSD", **kwargs): ,"ZDC::RPD_Buff_Readout_Logical"]) kwargs.setdefault("OutputCollectionNames", ["ZDC_CalibrationHits"]) return CfgMgr.ZDC_G4CalibSDTool(name, **kwargs) - -def getZDC_StripSD(name="ZDC_StripSD", **kwargs): - kwargs.setdefault("LogicalVolumeNames", ["ZDC::Strip_Logical"]) - kwargs.setdefault("OutputCollectionNames", ["ZDC_SimStripHit_Collection"]) - return CfgMgr.ZDC_StripSDTool(name, **kwargs) - - -def getZDC_PixelSD(name="ZDC_PixelSD", **kwargs): - kwargs.setdefault("LogicalVolumeNames", ["ZDC::Pixel_Logical"]) - kwargs.setdefault("OutputCollectionNames", ["ZDC_SimPixelHit_Collection"]) - return CfgMgr.ZDC_PixelSDTool(name, **kwargs) diff --git a/ForwardDetectors/ZDC/ZDC_SD/src/ZDC_PixelSD.cxx b/ForwardDetectors/ZDC/ZDC_SD/src/ZDC_PixelSD.cxx deleted file mode 100644 index 90e3ea6d39d470e4950ed9affa191df652cbfe3f..0000000000000000000000000000000000000000 --- a/ForwardDetectors/ZDC/ZDC_SD/src/ZDC_PixelSD.cxx +++ /dev/null @@ -1,206 +0,0 @@ -/* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration -*/ - -// Class header -#include "ZDC_PixelSD.h" - -// Geant4 headers -#include "G4Poisson.hh" - -// CLHEP headers -#include "CLHEP/Units/SystemOfUnits.h" -#include "CLHEP/Units/PhysicalConstants.h" - -// STL headers -#include <cmath> - -ZDC_PixelSD::ZDC_PixelSD(const std::string& name, const std::string& hitCollectionName) - : G4VSensitiveDetector( name ) - , m_HitColl( hitCollectionName ) -{ -} - -void ZDC_PixelSD::StartOfAthenaEvent() -{ - if (verboseLevel>5) - { - G4cout << "IN INITIALIZE OF PIXELSD" << G4endl; - } - - for (int I=0; I<=1; I++) - { - for (int J=0; J<=1; J++) - { - for (int K=0; K<80; K++) - { - m_Edep_Cherenkov_Pixel [I][J][K] = 0; - m_NPhoton_Cherenkov_Pixel[I][J][K] = 0; - } - } - } -} - -void ZDC_PixelSD::Initialize(G4HCofThisEvent *) -{ - if (!m_HitColl.isValid()) m_HitColl = std::make_unique<ZDC_SimPixelHit_Collection>(); -} - -G4bool ZDC_PixelSD::ProcessHits(G4Step* aStep, G4TouchableHistory*) -{ - const G4StepPoint* pPreStepPoint = aStep->GetPreStepPoint(); - const G4StepPoint* pPostStepPoint = aStep->GetPostStepPoint(); - const G4DynamicParticle* aParticle = aStep->GetTrack()->GetDynamicParticle(); - const G4double charge = aParticle->GetDefinition()->GetPDGCharge(); - const G4double beta = (pPreStepPoint ->GetBeta() + pPostStepPoint->GetBeta())/2.; - - G4double MeanNumberOfPhotons = 291.93*(charge/CLHEP::eplus)*(charge/CLHEP::eplus)* (1.0 - 1.0/(beta*1.48*beta*1.48))/(CLHEP::cm); - - if (MeanNumberOfPhotons <= 0.0) { return true; } - - const G4double step_length = aStep->GetStepLength(); - - MeanNumberOfPhotons = MeanNumberOfPhotons * step_length; - - const G4int NumPhotons = (G4int)G4Poisson(MeanNumberOfPhotons); - - if (NumPhotons <= 0) { return true; } - - //THIS PART LOCATES THE SIDE, MODULE AND PIXEL WHERE THE HIT OCCURED - - int Pixel_No(-1); - int Module(-1); - int Side(-1); - - const G4int Location_From_Copy_No = pPreStepPoint->GetPhysicalVolume()->GetCopyNo(); - - Pixel_No = (Location_From_Copy_No%100); - Module = int(Location_From_Copy_No/999) %10 - 1; - Side = int(Location_From_Copy_No/9999)%10 - 1; - - if (Pixel_No<0 || Module<0 || Side<0) { - - G4cout << "ERROR: COULD NOT LOCATE PIXEL(From Copy) Values are (Side,Module,Pixel_No) = " - << Side << " " - << Module << " " - << Pixel_No << " " << G4endl; - G4ExceptionDescription description; - description << "ProcessHits: COULD NOT LOCATE PIXEL(From Copy)"; - G4Exception("ZDC_PixelSD", "FailedToLocatePixel", FatalException, description); - return false; //The G4Exception call above should abort the job, but Coverity does not seem to pick this up. - } - - if (Pixel_No>79 || Module>1 || Side>1) { - G4cout << "ERROR: Impossible values obtained. Values are (Side,Module,Pixel_No) = " - << Side << " " - << Module << " " - << Pixel_No << " " << G4endl; - G4ExceptionDescription description; - description << "ProcessHits: IMPOSSIBLE PIXEL LOCATION (From Copy)"; - G4Exception("ZDC_PixelSD", "ImpossiblePixelLocation", FatalException, description); - return false; //The G4Exception call above should abort the job, but Coverity does not seem to pick this up. - } - - //THIS PART CALCULATES THE CHERENKOV ENERGY DEPOSITED IN PIXELS (AFTER CHECKING THE CUTS) - - const G4ThreeVector p0 = aStep->GetDeltaPosition().unit(); - const G4double Pmin = 2.761*CLHEP::eV; // Rindex->GetMinPhotonEnergy(); - //G4double Pmax = 3.550*CLHEP::eV; // Rindex->GetMaxPhotonEnergy(); - const G4double dp = 0.789*CLHEP::eV; // Pmax - Pmin; - const G4double BetaInverse = 1./beta; - - for (G4int I = 0; I < NumPhotons; I++) { - - G4double rand; - G4double sampledEnergy,sampledRI; - G4double cosTheta, sin2Theta; - - // sample an energy for Photon - rand = G4UniformRand(); - sampledEnergy = Pmin + rand * dp; - sampledRI = 1.48; - cosTheta = BetaInverse / sampledRI; - sin2Theta = (1.0 - cosTheta)*(1.0 + cosTheta); - - // Generate random position of photon on cone surface defined by Theta - rand = G4UniformRand(); - const G4double phi = 2.*M_PI*rand; - const G4double sinPhi = sin(phi); - const G4double cosPhi = cos(phi); - - // calculate x,y, and z components of photon momentum - // (in coord system with primary particle direction aligned with the z axis) - // and Rotate momentum direction back to global reference system - const G4double sinTheta = sqrt(sin2Theta); - const G4double px = sinTheta*cosPhi; - const G4double py = sinTheta*sinPhi; - const G4double pz = cosTheta; - G4ParticleMomentum photonMomentum(px, py, pz); - photonMomentum.rotateUz(p0); - -#define TRANSMISSION_PER_INTERNAL_REFLECTION 1.00 //Probability for photon to survive each time it undergoes a total internal reflection -#define LENGTH_OF_PIXEL 33*cm -#define DIAMETER_OF_PIXEL 1.0*mm -#define THETA_CRITICAL_QUARTZ 0.742 - - G4double Transmission = 1.0; - const G4double PT = sqrt(photonMomentum.getX()*photonMomentum.getX() + photonMomentum.getY()*photonMomentum.getY()); - const G4double PZ = photonMomentum.getZ(); - - if (PZ<0) continue; // If photon is travelling with -ve PZ, Its not going to reach the PMT - else if (PT==0) Transmission=1.0; // if photon is along Z-axis it will be completely transmitted into the PMT - else { - - const G4double Theta = M_PI/2.0-atan(PT/PZ); - - if (Theta < THETA_CRITICAL_QUARTZ) continue; - else Transmission=1.0; - } - - m_Edep_Cherenkov_Pixel [Side][Module][Pixel_No] += sampledEnergy*Transmission; - m_NPhoton_Cherenkov_Pixel[Side][Module][Pixel_No] += 1; - } - - return true; -} - -void ZDC_PixelSD::EndOfAthenaEvent() -{ - if (verboseLevel>5) - { - G4cout << "Printing Final Energy(eV) deposited in Pixel" << G4endl; - } - - for (int I=0; I<=1; I++) - { - int Jmin = 0; - if (I==1) { Jmin = 1; } - for (int J=Jmin; J<=1; J++) - { - int Kmax = 24; // CHANGE TO 80 IF YOU WANT EACH PIXEL IN HMXY TP BE READ OUT SEPARATELY (Also make corresponding change in ZDC_GeoM file) - if (J==0) { Kmax = 64; } - for (int K=0; K<Kmax; K++) - { - const int NPhoton = m_NPhoton_Cherenkov_Pixel[I][J][K]; - const double Edep_C = m_Edep_Cherenkov_Pixel [I][J][K]/CLHEP::eV; - if (verboseLevel>5) - { - G4cout << " Final Cherenkov Energy(eV) deposited in Pixel " - << I << " " - << J << " " - << K << " = " - << Edep_C << " eV and Number of Photons deposited = " << NPhoton << G4endl; - } - m_HitColl->Emplace(I, J, K, NPhoton, Edep_C); - } - } - } - //for (ZDC_SimPixelHit_ConstIterator it = m_ZDC_SimPixelHit_Collection->begin(); it != m_ZDC_SimPixelHit_Collection->end(); it++) - // ATH_MSG_DEBUG(" BUG_TRACKER " - // << " Side: " << it->GetSide() - // << " ModuleNo: " << it->GetMod() - // << " PixNo: " << it->GetPix() - // << " NPhotons: " << it->GetNPhotons() - // << " Edep: " << it->GetEdep()); - return; -} diff --git a/ForwardDetectors/ZDC/ZDC_SD/src/ZDC_PixelSD.h b/ForwardDetectors/ZDC/ZDC_SD/src/ZDC_PixelSD.h deleted file mode 100644 index 1258fa8584c4ed9ab3bcae0dd2bcd2e366b92880..0000000000000000000000000000000000000000 --- a/ForwardDetectors/ZDC/ZDC_SD/src/ZDC_PixelSD.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef ZDC_SD_ZDC_PIXEL_SD_H -#define ZDC_SD_ZDC_PIXEL_SD_H - -// Base class -#include "G4VSensitiveDetector.hh" - -// Athena headers -#include "ZDC_SimEvent/ZDC_SimPixelHit_Collection.h" -#include "StoreGate/WriteHandle.h" -#include <gtest/gtest_prod.h> - -// STL header -#include <string> - -// G4 needed classes -class G4Step; -class G4HCofThisEvent; - -class ZDC_PixelSD : public G4VSensitiveDetector -{ - - FRIEND_TEST( ZDC_PixelSDtest, ProcessHits ); - FRIEND_TEST( ZDC_PixelSDtest, Initialize ); - FRIEND_TEST( ZDC_PixelSDtest, StartOfAthenaEvent ); - FRIEND_TEST( ZDC_PixelSDtest, EndOfAthenaEvent ); - FRIEND_TEST( ZDC_PixelSDtest, AddHit ); - public: - // Constructor - ZDC_PixelSD(const std::string& name, const std::string& hitCollectionName); - - // Destructor - ~ZDC_PixelSD() { /* I don't own myHitColl if all has gone well */ }; - - // Called from ZDC_PixelSDTool::SetupEvent - void StartOfAthenaEvent (); - - // Initialize from G4 - void Initialize(G4HCofThisEvent *) override final; - - // Process the hits from G4 - G4bool ProcessHits(G4Step *aStep, G4TouchableHistory* ROhist) override final; - - // Called from ZDC_PixelSDTool::Gather - void EndOfAthenaEvent(); - - /** Templated method to stuff a single hit into the sensitive detector class. This - could get rather tricky, but the idea is to allow fast simulations to use the very - same SD classes as the standard simulation. */ - template <class... Args> void AddHit(Args&&... args){ m_HitColl->Emplace( args... ); } - -private: - // The hits collection - SG::WriteHandle<ZDC_SimPixelHit_Collection> m_HitColl; - - double m_Edep_Cherenkov_Pixel [2][2][80]{}; - int m_NPhoton_Cherenkov_Pixel[2][2][80]{}; - - // The first index is [A_side/C_side] second is [EMXY/HMXY] third is [0...79(63)] channel No - // I keep 80 channels in the HMXY and add them up later during digitization -}; - -#endif //ZDC_SD_ZDC_PIXEL_SD_H diff --git a/ForwardDetectors/ZDC/ZDC_SD/src/ZDC_PixelSDTool.cxx b/ForwardDetectors/ZDC/ZDC_SD/src/ZDC_PixelSDTool.cxx deleted file mode 100644 index 8f197ccff304ef43cd60aa759dd4c335b9d73076..0000000000000000000000000000000000000000 --- a/ForwardDetectors/ZDC/ZDC_SD/src/ZDC_PixelSDTool.cxx +++ /dev/null @@ -1,71 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - - -// Class header -#include "ZDC_PixelSDTool.h" - -// Package headers -#include "ZDC_PixelSD.h" - -ZDC_PixelSDTool::ZDC_PixelSDTool(const std::string& type, const std::string& name, const IInterface* parent) - : SensitiveDetectorBase(type,name,parent) -{ -} - - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -StatusCode ZDC_PixelSDTool::SetupEvent() -{ - ATH_MSG_VERBOSE( "ZDC_PixelSDTool::SetupEvent()" ); - if(!getSD()) - { - ATH_MSG_ERROR ("SetupEvent: ZDC_PixelSD never created!"); - return StatusCode::FAILURE; - } - else - { - ZDC_PixelSD *localSD = dynamic_cast<ZDC_PixelSD*>(getSD()); - if(!localSD) - { - ATH_MSG_ERROR ("SetupEvent: Failed to cast m_SD into ZDC_PixelSD."); - return StatusCode::FAILURE; - } - localSD->StartOfAthenaEvent(); - } - return StatusCode::SUCCESS; -} - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -StatusCode ZDC_PixelSDTool::Gather() -{ - ATH_MSG_VERBOSE( "ZDC_PixelSDTool::Gather()" ); - if(!getSD()) - { - ATH_MSG_ERROR ("Gather: ZDC_PixelSD never created!"); - return StatusCode::FAILURE; - } - else - { - ZDC_PixelSD *localSD = dynamic_cast<ZDC_PixelSD*>(getSD()); - if(!localSD) - { - ATH_MSG_ERROR ("Gather: Failed to cast m_SD into ZDC_PixelSD."); - return StatusCode::FAILURE; - } - localSD->EndOfAthenaEvent(); - } - return StatusCode::SUCCESS; -} - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -G4VSensitiveDetector* ZDC_PixelSDTool::makeSD() const -{ - ATH_MSG_DEBUG( "Initializing SD" ); - // Create a fresh SD - return new ZDC_PixelSD(name(), m_outputCollectionNames[0]); -} diff --git a/ForwardDetectors/ZDC/ZDC_SD/src/ZDC_PixelSDTool.h b/ForwardDetectors/ZDC/ZDC_SD/src/ZDC_PixelSDTool.h deleted file mode 100644 index 80c27e292347e20dbe461976834da57096878f80..0000000000000000000000000000000000000000 --- a/ForwardDetectors/ZDC/ZDC_SD/src/ZDC_PixelSDTool.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef ZDC_SD_ZDC_PIXEL_SDTOOL_H -#define ZDC_SD_ZDC_PIXEL_SDTOOL_H - -// Base class -#include "G4AtlasTools/SensitiveDetectorBase.h" - -// STL headers -#include <string> - -class G4VSensitiveDetector; - -class ZDC_PixelSDTool : public SensitiveDetectorBase -{ - - public: - // Constructor - ZDC_PixelSDTool(const std::string& type, const std::string& name, const IInterface* parent); - - // Destructor - ~ZDC_PixelSDTool() {}; - /** Beginning of an athena event. This is where collection initialization should happen.*/ - StatusCode SetupEvent() override final; //FIXME would be good to be able to avoid this. - /** End of an athena event */ - StatusCode Gather() override final; //FIXME would be good to be able to avoid this. - - // Make me an SD! - G4VSensitiveDetector* makeSD() const override final; - -}; - -#endif //ZDC_SD_ZDC_PIXEL_SDTOOL_H diff --git a/ForwardDetectors/ZDC/ZDC_SD/src/ZDC_StripSD.cxx b/ForwardDetectors/ZDC/ZDC_SD/src/ZDC_StripSD.cxx deleted file mode 100644 index 2432b26ed5f4bb285c3e85b7afb31e8baac87e41..0000000000000000000000000000000000000000 --- a/ForwardDetectors/ZDC/ZDC_SD/src/ZDC_StripSD.cxx +++ /dev/null @@ -1,185 +0,0 @@ -/* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration -*/ - -// Class header -#include "ZDC_StripSD.h" - -// Geant4 headers -#include "G4Poisson.hh" - -// CLHEP headers -#include "CLHEP/Units/SystemOfUnits.h" -#include "CLHEP/Units/PhysicalConstants.h" - -// STL headers -#include <cmath> - -ZDC_StripSD::ZDC_StripSD(const std::string& name, const std::string& hitCollectionName) - : G4VSensitiveDetector( name ), m_HitColl(hitCollectionName) -{ -} - -void ZDC_StripSD::StartOfAthenaEvent() -{ - if(verboseLevel>5) - { - G4cout << "ZDC_StripSD::StartOfAthenaEvent()" << G4endl; - } - for (int I=0; I<2; I++) - { - for (int J=0; J<4; J++) - { - m_Edep_Cherenkov_Strip [I][J] = 0; - m_NPhoton_Cherenkov_Strip[I][J] = 0; - } - } -} - -void ZDC_StripSD::Initialize(G4HCofThisEvent *) -{ - if (!m_HitColl.isValid()) m_HitColl = std::make_unique<ZDC_SimStripHit_Collection>(); -} - -G4bool ZDC_StripSD::ProcessHits(G4Step*aStep,G4TouchableHistory*) -{ - const G4DynamicParticle* aParticle = aStep->GetTrack()->GetDynamicParticle(); - const G4double charge = aParticle->GetDefinition()->GetPDGCharge(); - - if (charge==0) { return true; } - - const G4StepPoint* pPreStepPoint = aStep->GetPreStepPoint(); - const G4StepPoint* pPostStepPoint = aStep->GetPostStepPoint(); - const G4double beta = (pPreStepPoint ->GetBeta() + pPostStepPoint->GetBeta())/2.; - - if (beta==0) { return true; } - - G4double MeanNumberOfPhotons = 291.93*(charge/CLHEP::eplus)*(charge/CLHEP::eplus)*(1.0 - 1.0/(beta*1.48*beta*1.48))/(CLHEP::cm); - - if (MeanNumberOfPhotons <= 0.0) { return true; } - - const float step_length(aStep->GetStepLength()); - - MeanNumberOfPhotons = MeanNumberOfPhotons * step_length; - - const G4int NumPhotons = (G4int)G4Poisson(MeanNumberOfPhotons); - - if (NumPhotons <= 0) { return true; } - - //THIS PART LOCATES THE MODULE WHERE THE HIT OCCURED - - int Zloc(-1); - int Side(-1); - - G4int Location_From_Copy_No = pPreStepPoint->GetPhysicalVolume()->GetCopyNo(); - - Zloc = (Location_From_Copy_No/1000) %10 -1; // can be 0,1,2,3 - Side = (Location_From_Copy_No/10000)%10 -1; //Side==0 is A-side; and Side ==1 is C-Side - - if (Side<0 || Zloc <0) - { - - G4cout << "ERROR: LOCATING MODULE " << Side << " " << Zloc << G4endl; - G4ExceptionDescription description; - description << "ProcessHits: COULD NOT LOCATE MODULE(From Copy)"; - G4Exception("ZDC_StripSD", "FailedToLocateModule", FatalException, description); - return false; //The G4Exception call above should abort the job, but Coverity does not seem to pick this up. - } - - if (Side>1 || Zloc>3) - { - G4cout << "ERROR: Impossible values obtained. Values are (Side,Zloc) = " - << Side << " " - << Zloc << " " << G4endl; - G4ExceptionDescription description; - description << "ProcessHits: IMPOSSIBLE MODULE LOCATION (From Copy)"; - G4Exception("ZDC_StripSD", "ImpossibleModuleLocation", FatalException, description); - return false; //The G4Exception call above should abort the job, but Coverity does not seem to pick this up. - } - const G4ThreeVector p0 = aStep->GetDeltaPosition().unit(); - const float Pmin = 2.761*CLHEP::eV; // MinPhotonEnergy :: Cherenkov Photons below this energy are not produced - //float Pmax = 3.550*CLHEP::eV; // MaxPhotonEnergy :: Cherenkov Photons above this energy are not produced - const float dp = 0.789*CLHEP::eV; // Pmax - Pmin; - const float BetaInverse = 1./beta; - - for (G4int I = 0; I < NumPhotons; I++) { - - G4double rand; - float sampledEnergy, sampledRI; - float cosTheta, sin2Theta; - - // sample an energy for Photon - rand = G4UniformRand(); - sampledEnergy = Pmin + rand * dp; - sampledRI = 1.48; - cosTheta = BetaInverse / sampledRI; - sin2Theta = (1.0 - cosTheta)*(1.0 + cosTheta); - - // Generate random position of photon on cone surface defined by Theta - rand = G4UniformRand(); - const float phi = 2.*M_PI*rand; - const float sinPhi = std::sin(phi); - const float cosPhi = std::cos(phi); - - // calculate x,y, and z components of photon momentum - // (in coord system with primary particle direction aligned with the z axis) - // and Rotate momentum direction back to global reference system - const float sinTheta = std::sqrt(sin2Theta); - const float px = sinTheta*cosPhi; - const float py = sinTheta*sinPhi; - const float pz = cosTheta; - - G4ParticleMomentum photonMomentum(px, py, pz); - photonMomentum.rotateUz(p0); - -#define TRANSMISSION_PER_INTERNAL_REFLECTION 1.00 //Probability for photon to survive each time it undergoes a total internal reflection -#define LENGTH_OF_STRIP 33*CLHEP::cm -#define DIAMETER_OF_STRIP 1.5*CLHEP::mm -#define THETA_CRITICAL_QUARTZ 0.742 - - float Transmission=1.0; - const float PT = sqrt(photonMomentum.getX()*photonMomentum.getX() + photonMomentum.getZ()*photonMomentum.getZ()); - const float PY = photonMomentum.getY(); - - if (PY<=0) continue; // If photon is travelling with -ve PY, Its not going to reach the PMT - else if (PT==0) Transmission=1.0; // if photon is along Y-axis it will be completely transmitted into the PMT - else { - - const float Theta = M_PI/2.0-std::atan(PT/PY); - - if (Theta < THETA_CRITICAL_QUARTZ) continue; - else Transmission=1.0; - } - - m_Edep_Cherenkov_Strip [Side][Zloc] +=sampledEnergy*Transmission; - m_NPhoton_Cherenkov_Strip[Side][Zloc] +=1; - } - - return true; -} - -void ZDC_StripSD::EndOfAthenaEvent() -{ - if(verboseLevel>5) - { - G4cout << "ZDC_StripSD::EndOfAthenaEvent(): Printing Final Energy(eV) deposited in Strip " << G4endl; - } - - for (int I=0; I<2; I++) - { - for (int J=0; J<4; J++) - { - const double Edep_C = m_Edep_Cherenkov_Strip[I][J]/CLHEP::eV; - const int NPhoton = m_NPhoton_Cherenkov_Strip[I][J]; - if(verboseLevel>5) - { - G4cout << "ZDC_StripSD::EndOfAthenaEvent(): Final Energy(eV) deposited in Strip " - << I << " " - << J << " = " - << Edep_C << " eV and Number of Photons deposited = " << NPhoton << G4endl; - } - m_HitColl->Emplace(I, J, NPhoton, Edep_C); - } - } - return; -} diff --git a/ForwardDetectors/ZDC/ZDC_SD/src/ZDC_StripSD.h b/ForwardDetectors/ZDC/ZDC_SD/src/ZDC_StripSD.h deleted file mode 100644 index 150dc81246750c1df745bca4e13f96e88569c032..0000000000000000000000000000000000000000 --- a/ForwardDetectors/ZDC/ZDC_SD/src/ZDC_StripSD.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef ZDC_SD_ZDC_STRIP_SD_H -#define ZDC_SD_ZDC_STRIP_SD_H - -// Base class -#include "G4VSensitiveDetector.hh" - -// use of the hits -#include "ZDC_SimEvent/ZDC_SimStripHit_Collection.h" -#include "StoreGate/WriteHandle.h" - -// STL header -#include <string> -#include <gtest/gtest_prod.h> - -// G4 needed classes -class G4Step; -class G4HCofThisEvent; - -class ZDC_StripSD : public G4VSensitiveDetector -{ - FRIEND_TEST( ZDC_StripSDtest, ProcessHits ); - FRIEND_TEST( ZDC_StripSDtest, Initialize ); - FRIEND_TEST( ZDC_StripSDtest, StartOfAthenaEvent ); - FRIEND_TEST( ZDC_StripSDtest, EndOfAthenaEvent ); - FRIEND_TEST( ZDC_StripSDtest, AddHit ); - public: - - ZDC_StripSD(const std::string& name, const std::string& hitCollectionName); - ~ZDC_StripSD() { /* I don't own myHitColl if all has gone well */ }; - - // Called from ZDC_StripSDTool::SetupEvent - void StartOfAthenaEvent (); - // Initialize from G4 - void Initialize(G4HCofThisEvent *) override final; - G4bool ProcessHits(G4Step*, G4TouchableHistory*) override final; - // Called from ZDC_StripSDTool::Gather - void EndOfAthenaEvent(); - - /** Templated method to stuff a single hit into the sensitive detector class. This - could get rather tricky, but the idea is to allow fast simulations to use the very - same SD classes as the standard simulation. */ - template <class... Args> void AddHit(Args&&... args){ m_HitColl->Emplace( args... ); } - - private: - SG::WriteHandle<ZDC_SimStripHit_Collection> m_HitColl; - float m_Edep_Cherenkov_Strip[2][4]{}; - int m_NPhoton_Cherenkov_Strip[2][4]{}; -}; - -#endif //ZDC_SD_ZDC_STRIP_SD_H diff --git a/ForwardDetectors/ZDC/ZDC_SD/src/ZDC_StripSDTool.cxx b/ForwardDetectors/ZDC/ZDC_SD/src/ZDC_StripSDTool.cxx deleted file mode 100644 index 57f53759e7b4da6b9a0cac3e8fea4af56af5ce2c..0000000000000000000000000000000000000000 --- a/ForwardDetectors/ZDC/ZDC_SD/src/ZDC_StripSDTool.cxx +++ /dev/null @@ -1,72 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - - -// Class header -#include "ZDC_StripSDTool.h" - -// For the SD itself -#include "ZDC_StripSD.h" - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -ZDC_StripSDTool::ZDC_StripSDTool(const std::string& type, const std::string& name, const IInterface* parent) - : SensitiveDetectorBase(type,name,parent) -{ -} - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -StatusCode ZDC_StripSDTool::SetupEvent() -{ - ATH_MSG_VERBOSE( "ZDC_StripSDTool::SetupEvent()" ); - if(!getSD()) - { - ATH_MSG_ERROR ("SetupEvent: ZDC_StripSD never created!"); - return StatusCode::FAILURE; - } - else - { - ZDC_StripSD *localSD = dynamic_cast<ZDC_StripSD*>(getSD()); - if(!localSD) - { - ATH_MSG_ERROR ("SetupEvent: Failed to cast m_SD into ZDC_StripSD."); - return StatusCode::FAILURE; - } - localSD->StartOfAthenaEvent(); - } - return StatusCode::SUCCESS; -} - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -StatusCode ZDC_StripSDTool::Gather() -{ - ATH_MSG_VERBOSE( "ZDC_StripSDTool::Gather()" ); - if(!getSD()) - { - ATH_MSG_ERROR ("Gather: ZDC_StripSD never created!"); - return StatusCode::FAILURE; - } - else - { - ZDC_StripSD *localSD = dynamic_cast<ZDC_StripSD*>(getSD()); - if(!localSD) - { - ATH_MSG_ERROR ("Gather: Failed to cast m_SD into ZDC_StripSD."); - return StatusCode::FAILURE; - } - localSD->EndOfAthenaEvent(); - } - return StatusCode::SUCCESS; -} - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -G4VSensitiveDetector* ZDC_StripSDTool::makeSD() const -{ - ATH_MSG_DEBUG( "Initializing SD" ); - // Create a fresh SD - return new ZDC_StripSD(name(), m_outputCollectionNames[0]); -} diff --git a/ForwardDetectors/ZDC/ZDC_SD/src/ZDC_StripSDTool.h b/ForwardDetectors/ZDC/ZDC_SD/src/ZDC_StripSDTool.h deleted file mode 100644 index 4099f48142caaee7b167f1d6673d8c3e4cc21590..0000000000000000000000000000000000000000 --- a/ForwardDetectors/ZDC/ZDC_SD/src/ZDC_StripSDTool.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef ZDC_SD_ZDC_STRIP_SDTOOL_H -#define ZDC_SD_ZDC_STRIP_SDTOOL_H - -#include "G4AtlasTools/SensitiveDetectorBase.h" - -// STL headers -#include <string> - -class G4VSensitiveDetector; - -class ZDC_StripSDTool : public SensitiveDetectorBase -{ - - public: - // Constructor - ZDC_StripSDTool(const std::string& type, const std::string& name, const IInterface* parent); - // Destructor - ~ZDC_StripSDTool() {}; - /** Beginning of an athena event. This is where collection initialization should happen.*/ - StatusCode SetupEvent() override final; //FIXME would be good to be able to avoid this. - /** End of an athena event */ - StatusCode Gather() override final; //FIXME would be good to be able to avoid this. - -protected: - // Make me an SD! - G4VSensitiveDetector* makeSD() const override final; -}; - -#endif //ZDC_SD_ZDC_STRIP_SDTOOL_H diff --git a/ForwardDetectors/ZDC/ZDC_SD/src/components/ZDC_SD_entries.cxx b/ForwardDetectors/ZDC/ZDC_SD/src/components/ZDC_SD_entries.cxx index b7166c1fd64ad2e186318aa40e0664de48f63ff8..e33f25c5cdb61967c9c6acc2c9c6f4ac4261c8e3 100644 --- a/ForwardDetectors/ZDC/ZDC_SD/src/components/ZDC_SD_entries.cxx +++ b/ForwardDetectors/ZDC/ZDC_SD/src/components/ZDC_SD_entries.cxx @@ -1,9 +1,5 @@ #include "../ZDC_FiberSDTool.h" #include "../ZDC_G4CalibSDTool.h" -#include "../ZDC_PixelSDTool.h" -#include "../ZDC_StripSDTool.h" -DECLARE_COMPONENT( ZDC_PixelSDTool ) -DECLARE_COMPONENT( ZDC_StripSDTool ) DECLARE_COMPONENT( ZDC_G4CalibSDTool ) DECLARE_COMPONENT( ZDC_FiberSDTool ) \ No newline at end of file diff --git a/ForwardDetectors/ZDC/ZDC_SD/test/ZDC_PixelSD_gtest.cxx b/ForwardDetectors/ZDC/ZDC_SD/test/ZDC_PixelSD_gtest.cxx deleted file mode 100644 index d73c5ea4e195e8d72435ae2fcdc38c1eb588c6a3..0000000000000000000000000000000000000000 --- a/ForwardDetectors/ZDC/ZDC_SD/test/ZDC_PixelSD_gtest.cxx +++ /dev/null @@ -1,170 +0,0 @@ -/* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration -*/ - -#include "CxxUtils/checker_macros.h" -ATLAS_NO_CHECK_FILE_THREAD_SAFETY; - -#include "src/ZDC_PixelSD.h" - -#include "gtest/gtest.h" - -#include <vector> - -#include "TestTools/initGaudi.h" - -#include "G4HCofThisEvent.hh" -#include "G4Step.hh" -#include "G4TouchableHistory.hh" - -#include "G4Track.hh" -#include "G4StepPoint.hh" -#include "G4DynamicParticle.hh" -#include "G4ThreeVector.hh" -#include "G4Box.hh" -#include "G4NistManager.hh" -#include "G4Material.hh" -#include "G4VPhysicalVolume.hh" -#include "G4SystemOfUnits.hh" - -#include "G4AtlasTools/DerivedG4PhysicalVolume.h" -#include "G4AtlasTools/DerivedG4SensitiveDetectorTestSetting.h" - -//set environment -class GaudiEnvironment : public ::testing::Environment { - protected: - virtual void SetUp() override { - Athena_test::initGaudi("ZDC_SD/optionForTest.txt", m_svcLoc); - } - ISvcLocator* m_svcLoc = nullptr; -}; -class ZDC_PixelSDtest : public ::testing::Test { - protected: - virtual void SetUp() override { - } - - virtual void TearDown() override { - } -}; -//end of environment setting - -TEST_F( ZDC_PixelSDtest, Initialize ) -{ - G4HCofThisEvent hce; - ZDC_PixelSD sd1( "name1", "name1" ); - sd1.Initialize(&hce); - ASSERT_TRUE(sd1.m_HitColl.isValid()); -} - -TEST_F( ZDC_PixelSDtest, ProcessHits ) -{ - G4HCofThisEvent hce; - G4Step sp; - G4TouchableHistory th; - - G4double totalenergydeposit = 0.8; - std::vector<G4String> physicalname = {"physicsTDQuarticBar[9]"}; - G4String logicalname = "BBBBBBBBBTubeGas"; - std::vector<G4int> copynos = {21978}; - G4ThreeVector preStepPos = G4ThreeVector(0,0,1); - G4ThreeVector postStepPos = G4ThreeVector(0,0,2); - G4double globaltime0 = 0.5; - G4double kineticenergy0 = 1.5; - G4double velocity0 = 250; - G4double globaltime = 5.0; - G4double kineticenergy = 0.5; - G4double globaltime1 = 0.5; - G4double kineticenergy1 = 0.5; - G4double velocity1 = 250; - G4double steplength = 1.0; - G4double charge = 1.0; - G4int encoding = 22; - G4int antiencoding = 22; - G4String astring = "Cerenkov"; - G4ProcessType atype = (G4ProcessType)0; - G4String nop1 = "opticalphoton"; - G4String nop2 = "opticalphoton"; - G4String nop3 = "photon"; - DerivedG4SensitiveDetectorTestSetting(sp, totalenergydeposit, physicalname, logicalname, copynos, preStepPos, postStepPos, globaltime0, kineticenergy0, velocity0, globaltime, kineticenergy, globaltime1, kineticenergy1, velocity1, steplength, charge, encoding, antiencoding, astring, atype, nop1, nop2, nop3); - - ZDC_PixelSD sd2("name2", "name2"); - sd2.Initialize(&hce); - sd2.StartOfAthenaEvent(); - sd2.ProcessHits(&sp, &th); - - ASSERT_FLOAT_EQ(sd2.m_Edep_Cherenkov_Pixel[1][1][78], 2.2452348e-05); //Based on my setting, Side=1, Module=1, Pixel_No=78, so m_Edep_Cherenkov_Pixel[1][1][78] was accumulated and finally it should be 2.2452348e-05. - ASSERT_EQ(sd2.m_NPhoton_Cherenkov_Pixel[1][1][78], 7); //Likewise, based on my setting, Side=1, Module=1, Pixel_No=78, so m_NPhoton_Cherenkov_Pixel[1][1][78] was accumulated and finally it should be 7 -} - -TEST_F( ZDC_PixelSDtest, StartOfAthenaEvent ) -{ - G4HCofThisEvent hce; - ZDC_PixelSD sd3( "name3", "name3" ); - sd3.Initialize(&hce); - sd3.StartOfAthenaEvent(); - - for (int I=0; I<=1; I++) //test if the Hit info is the same with what the member function StartOfAthenaEvent() sets - { - for (int J=0; J<=1; J++) - { - for (int K=0; K<80; K++) - { - ASSERT_TRUE(sd3.m_Edep_Cherenkov_Pixel [I][J][K] == 0); - ASSERT_TRUE(sd3.m_NPhoton_Cherenkov_Pixel[I][J][K] == 0); - } - } - } -} - -TEST_F( ZDC_PixelSDtest, EndOfAthenaEvent ) -{ - G4HCofThisEvent hce; - ZDC_PixelSD sd4( "name4", "name4" ); - sd4.Initialize(&hce); - sd4.StartOfAthenaEvent(); - sd4.EndOfAthenaEvent(); - - ZDC_SimPixelHit_Collection * a = sd4.m_HitColl.ptr(); - ASSERT_TRUE(a->begin()->GetSide()==0); //test if the Side value is the same with what the member function EndOfAthenaEvent() sets, the same below - ASSERT_TRUE((a->end()-1)->GetSide()==1); - ASSERT_TRUE(a->begin()->GetMod()==0); - ASSERT_TRUE((a->end()-1)->GetMod()==1); - ASSERT_EQ(a->begin()->GetPix(),0); - ASSERT_EQ((a->end()-1)->GetPix(),23); - ASSERT_FLOAT_EQ(a->begin()->GetEdep(),0); - ASSERT_FLOAT_EQ((a->end()-1)->GetEdep(),0); - ASSERT_EQ(a->begin()->GetNPhotons(),0); - ASSERT_EQ((a->end()-1)->GetNPhotons(),0); -} - -TEST_F( ZDC_PixelSDtest, AddHit ) -{ - G4HCofThisEvent hce; - ZDC_PixelSD sd5( "name5", "name5" ); - sd5.Initialize(&hce); - - int i = 1; - int j = 2; - int k = 3; - int NPhoton = 4; - double energy = 5.0; - sd5.AddHit( i, j, k, NPhoton, energy ); - - ZDC_SimPixelHit_Collection * a = sd5.m_HitColl.ptr(); - ASSERT_TRUE(a->begin()->GetSide()==1); //test if the Side value is the same with the input value 1, the same below - ASSERT_TRUE(a->begin()->GetMod()==2); - ASSERT_TRUE(a->begin()->GetPix()==3); - ASSERT_TRUE(a->begin()->GetEdep()==5.0); - ASSERT_TRUE(a->begin()->GetNPhotons()==4); -} - -int main( int argc, char** argv ) { - - auto g=new GaudiEnvironment; - ::testing::AddGlobalTestEnvironment(g); - ::testing::InitGoogleTest( &argc, argv ); - return RUN_ALL_TESTS(); - -} - - diff --git a/ForwardDetectors/ZDC/ZDC_SD/test/ZDC_StripSD_gtest.cxx b/ForwardDetectors/ZDC/ZDC_SD/test/ZDC_StripSD_gtest.cxx deleted file mode 100644 index 03ab765e01203f8478583c7a6e64c4f65be70c0b..0000000000000000000000000000000000000000 --- a/ForwardDetectors/ZDC/ZDC_SD/test/ZDC_StripSD_gtest.cxx +++ /dev/null @@ -1,164 +0,0 @@ -/* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration -*/ - -#include "CxxUtils/checker_macros.h" -ATLAS_NO_CHECK_FILE_THREAD_SAFETY; - -#include "src/ZDC_StripSD.h" -#include "gtest/gtest.h" - -#include <vector> - -#include "TestTools/initGaudi.h" - -#include "G4HCofThisEvent.hh" -#include "G4Step.hh" -#include "G4TouchableHistory.hh" - - -#include "G4Track.hh" -#include "G4StepPoint.hh" -#include "G4DynamicParticle.hh" -#include "G4ThreeVector.hh" -#include "G4Box.hh" -#include "G4NistManager.hh" -#include "G4Material.hh" -#include "G4VPhysicalVolume.hh" -#include "G4SystemOfUnits.hh" - -#include "G4AtlasTools/DerivedG4PhysicalVolume.h" -#include "G4AtlasTools/DerivedG4SensitiveDetectorTestSetting.h" - -//set environment -class GaudiEnvironment : public ::testing::Environment { - protected: - virtual void SetUp() override { - Athena_test::initGaudi("ZDC_SD/optionForTest.txt", m_svcLoc); - } - ISvcLocator* m_svcLoc = nullptr; -}; -class ZDC_StripSDtest : public ::testing::Test { - protected: - virtual void SetUp() override { - } - - virtual void TearDown() override { - } -}; -//end of environment setting - -TEST_F( ZDC_StripSDtest, Initialize ) -{ - G4HCofThisEvent hce; - ZDC_StripSD sd1( "name1", "name1" ); - sd1.Initialize(&hce); - ASSERT_TRUE(sd1.m_HitColl.isValid()); -} - -TEST_F( ZDC_StripSDtest, ProcessHits ) -{ - G4HCofThisEvent hce; - G4Step sp; - G4TouchableHistory th; - - G4double totalenergydeposit = 0.8; - std::vector<G4String> physicalname = {"physicsTDQuarticBar[9]"}; - G4String logicalname = "BBBBBBBBBTubeGas"; - std::vector<G4int> copynos = {11000}; - G4ThreeVector preStepPos = G4ThreeVector(0,0,1); - G4ThreeVector postStepPos = G4ThreeVector(0,0,2); - G4double globaltime0 = 0.5; - G4double kineticenergy0 = 1.5; - G4double velocity0 = 2500; - G4double globaltime = 5.0; - G4double kineticenergy = 0.5; - G4double globaltime1 = 0.5; - G4double kineticenergy1 = 0.5; - G4double velocity1 = 2500; - G4double steplength = 1.0; - G4double charge = 1.0; - G4int encoding = 22; - G4int antiencoding = 22; - G4String astring = "Cerenkov"; - G4ProcessType atype = (G4ProcessType)0; - G4String nop1 = "opticalphoton"; - G4String nop2 = "opticalphoton"; - G4String nop3 = "photon"; - DerivedG4SensitiveDetectorTestSetting(sp, totalenergydeposit, physicalname, logicalname, copynos, preStepPos, postStepPos, globaltime0, kineticenergy0, velocity0, globaltime, kineticenergy, globaltime1, kineticenergy1, velocity1, steplength, charge, encoding, antiencoding, astring, atype, nop1, nop2, nop3); - - ZDC_StripSD sd2("name2", "name2"); - sd2.Initialize(&hce); - sd2.StartOfAthenaEvent(); - sd2.ProcessHits(&sp, &th); - - ASSERT_FLOAT_EQ(sd2.m_Edep_Cherenkov_Strip[0][0], 1.4782044e-05); //Based on my setting, Side=0, Zloc=0, so m_Edep_Cherenkov_Strip[0][0] was accumulated and finally its value should be 1.4782044e-05 - ASSERT_EQ(sd2.m_NPhoton_Cherenkov_Strip[0][0], 5); //Similarly, based on my setting, Side=0, Zloc=0, so m_NPhoton_Cherenkov_Strip[0][0] was accumulated for five times and finally its value should be 5 -} - -TEST_F( ZDC_StripSDtest, StartOfAthenaEvent ) -{ - G4HCofThisEvent hce; - ZDC_StripSD sd3( "name3", "name3" ); - sd3.Initialize(&hce); - sd3.StartOfAthenaEvent(); - - for (int I=0; I<2; I++) //test if the Hit info is the same with what the member function StartOfAthenaEvent() sets - { - for (int J=0; J<4; J++) - { - ASSERT_TRUE( sd3.m_Edep_Cherenkov_Strip [I][J] == 0 ); - ASSERT_TRUE( sd3.m_NPhoton_Cherenkov_Strip[I][J] == 0 ); - } - } -} - -TEST_F( ZDC_StripSDtest, EndOfAthenaEvent ) -{ - G4HCofThisEvent hce; - ZDC_StripSD sd4( "name4", "name4" ); - sd4.Initialize(&hce); - sd4.StartOfAthenaEvent(); - sd4.EndOfAthenaEvent(); - - ZDC_SimStripHit_Collection * a = sd4.m_HitColl.ptr(); - ASSERT_TRUE(a->begin()->GetSide()==0); //test if the Side value is the same with what the member function EndOfAthenaEvent() sets, the same below - ASSERT_TRUE((a->end()-1)->GetSide()==1); - ASSERT_TRUE(a->begin()->GetMod()==0); - ASSERT_TRUE((a->end()-1)->GetMod()==3); - ASSERT_FLOAT_EQ(a->begin()->GetEdep(),0); - ASSERT_FLOAT_EQ((a->end()-1)->GetEdep(),0); - ASSERT_EQ(a->begin()->GetNPhotons(),0); - ASSERT_EQ((a->end()-1)->GetNPhotons(),0); - -} - -TEST_F( ZDC_StripSDtest, AddHit ) -{ - G4HCofThisEvent hce; - ZDC_StripSD sd5( "name5", "name5" ); - sd5.Initialize(&hce); - - int i = 1; - int j = 2; - int NPhoton = 4; - double energy = 5.0; - sd5.AddHit( i, j, NPhoton, energy ); - - ZDC_SimStripHit_Collection * a = sd5.m_HitColl.ptr(); - ASSERT_TRUE(a->begin()->GetSide()==1); //test if the Side value is same with my input value 1, the same below - ASSERT_TRUE(a->begin()->GetMod()==2); - ASSERT_TRUE(a->begin()->GetEdep()==5.0); - ASSERT_TRUE(a->begin()->GetNPhotons()==4); - -} - -int main( int argc, char** argv ) { - - auto g=new GaudiEnvironment; - ::testing::AddGlobalTestEnvironment(g); - ::testing::InitGoogleTest( &argc, argv ); - return RUN_ALL_TESTS(); - -} - diff --git a/ForwardDetectors/ZDC/ZDC_SimEvent/ZDC_SimEvent/ZDC_SimPixelHit.h b/ForwardDetectors/ZDC/ZDC_SimEvent/ZDC_SimEvent/ZDC_SimPixelHit.h deleted file mode 100644 index b07d80810a298e84b55d3dd74d8830d0e0148724..0000000000000000000000000000000000000000 --- a/ForwardDetectors/ZDC/ZDC_SimEvent/ZDC_SimEvent/ZDC_SimPixelHit.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef ZDC_PIXEL_SIMHIT -#define ZDC_PIXEL_SIMHIT - -class ZDC_SimPixelHit -{ - public: - - ZDC_SimPixelHit() { //must have a constructor with no argument as otherwise there is some problem from the ".xml" file - - m_Side = -1; m_ModNo = -1; m_PixNo = -1; m_Edep = -1; m_Nphotons = -1; - } - - ZDC_SimPixelHit(int side, int modno, int pixno, int nphot, double edep) { - - m_Side = side; m_ModNo = modno; m_PixNo = pixno; m_Nphotons = nphot; m_Edep = edep; - } - - int GetSide() const { return m_Side; } - int GetMod() const { return m_ModNo; } - int GetPix() const { return m_PixNo; } - double GetEdep() const { return m_Edep; } - int GetNPhotons() const { return m_Nphotons; } - - int operator == (const ZDC_SimPixelHit&) const; - bool operator < (const ZDC_SimPixelHit&) const; - - private: - - int m_Side, m_ModNo, m_PixNo; - int m_Nphotons; - double m_Edep; -}; - -#endif - - diff --git a/ForwardDetectors/ZDC/ZDC_SimEvent/ZDC_SimEvent/ZDC_SimPixelHit_Collection.h b/ForwardDetectors/ZDC/ZDC_SimEvent/ZDC_SimEvent/ZDC_SimPixelHit_Collection.h deleted file mode 100644 index d87e74bd8e3fa62652eba7cf539c0fa109fc9afa..0000000000000000000000000000000000000000 --- a/ForwardDetectors/ZDC/ZDC_SimEvent/ZDC_SimEvent/ZDC_SimPixelHit_Collection.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef ZDC_SIMPIXELHIT_COLLECTION -#define ZDC_SIMPIXELHIT_COLLECTION - -#include "ZDC_SimPixelHit.h" -#include "HitManagement/AtlasHitsVector.h" -#include "AthenaKernel/CLASS_DEF.h" -#include <string> - -typedef AtlasHitsVector<ZDC_SimPixelHit> ZDC_SimPixelHit_Collection1; - -class ZDC_SimPixelHit_Collection: public ZDC_SimPixelHit_Collection1 -{ - - public : - - ZDC_SimPixelHit_Collection(const std::string& name="ZDC_SimPixelHit_Collection") : ZDC_SimPixelHit_Collection1(name.c_str()) {} -}; - -typedef ZDC_SimPixelHit_Collection::iterator ZDC_SimPixelHit_Iterator; -typedef ZDC_SimPixelHit_Collection::const_iterator ZDC_SimPixelHit_ConstIterator; - -#ifndef __CINT__ - CLASS_DEF(ZDC_SimPixelHit_Collection, 1300880191, 1) -#endif - -#endif diff --git a/ForwardDetectors/ZDC/ZDC_SimEvent/ZDC_SimEvent/ZDC_SimStripHit.h b/ForwardDetectors/ZDC/ZDC_SimEvent/ZDC_SimEvent/ZDC_SimStripHit.h deleted file mode 100644 index b72407b3665cb539b0ab958993bb2540c223c63a..0000000000000000000000000000000000000000 --- a/ForwardDetectors/ZDC/ZDC_SimEvent/ZDC_SimEvent/ZDC_SimStripHit.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef ZDC_SIMSTRIPHIT -#define ZDC_SIMSTRIPHIT - -class ZDC_SimStripHit -{ - - public: - - ZDC_SimStripHit() { // must have a constructor with no argument as otherwise there is some problem from the ".xml" file - - m_Side = -1; m_ModNo = -1; m_Edep =-1; m_Nphotons = -1; - } - - ZDC_SimStripHit(int side, int modno, int nphot, double edep) { - - m_Side = side; m_ModNo = modno; m_Edep = edep; m_Nphotons = nphot; - } - - int GetSide() const { return m_Side; } - int GetMod() const { return m_ModNo; } - double GetEdep() const { return m_Edep; } - int GetNPhotons() const { return m_Nphotons; } - - int operator == (const ZDC_SimStripHit&) const; - bool operator < (const ZDC_SimStripHit&) const; - - private: - - int m_Side, m_ModNo; // The side and Module_No to which this entry corresponds to - int m_Nphotons; // The number of detected cherenkov photons in this TimeBin - double m_Edep; // The total energy of all the cherenkov photons in this TimeBin -}; - -#endif - - diff --git a/ForwardDetectors/ZDC/ZDC_SimEvent/ZDC_SimEvent/ZDC_SimStripHit_Collection.h b/ForwardDetectors/ZDC/ZDC_SimEvent/ZDC_SimEvent/ZDC_SimStripHit_Collection.h deleted file mode 100644 index 97a3da2db65ba363d90d4df641111fbba6f94f77..0000000000000000000000000000000000000000 --- a/ForwardDetectors/ZDC/ZDC_SimEvent/ZDC_SimEvent/ZDC_SimStripHit_Collection.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef ZDC_SIMSTRIPHIT_COLLECTION -#define ZDC_SIMSTRIPHIT_COLLECTION - -#include "ZDC_SimStripHit.h" -#include "HitManagement/AtlasHitsVector.h" -#include "AthenaKernel/CLASS_DEF.h" -#include <string> - -typedef AtlasHitsVector<ZDC_SimStripHit> ZDC_SimStripHit_Collection1; - -class ZDC_SimStripHit_Collection: public ZDC_SimStripHit_Collection1 -{ - - public : - ZDC_SimStripHit_Collection(const std::string& name="ZDC_SimStripHit_Collection") : ZDC_SimStripHit_Collection1(name.c_str()) {} -}; - -typedef ZDC_SimStripHit_Collection::iterator ZDC_SimStripHit_Iterator; -typedef ZDC_SimStripHit_Collection::const_iterator ZDC_SimStripHit_ConstIterator; - -#ifndef __CINT__ - CLASS_DEF(ZDC_SimStripHit_Collection, 1098700737, 1) -#endif - -#endif diff --git a/ForwardDetectors/ZDC/ZDC_SimEvent/ZDC_SimEvent/selection.xml b/ForwardDetectors/ZDC/ZDC_SimEvent/ZDC_SimEvent/selection.xml index df35ebe5bd91ad93c684836dd2ae9ab9a3d77e93..8216c3e10e6bd9b28c5805ec7f5856a47dd191fc 100644 --- a/ForwardDetectors/ZDC/ZDC_SimEvent/ZDC_SimEvent/selection.xml +++ b/ForwardDetectors/ZDC/ZDC_SimEvent/ZDC_SimEvent/selection.xml @@ -1,14 +1,4 @@ <lcgdict> - <class name="ZDC_SimStripHit_Collection" id="1082F8C1-BA19-47AF-83D7-4669BD12E9AC" /> - <class name="AtlasHitsVector<ZDC_SimStripHit>" /> - <class name="std::vector<ZDC_SimStripHit>" /> - <class name="ZDC_SimStripHit" /> - - <class name="ZDC_SimPixelHit_Collection" id="EBCA37BF-38FF-4F19-B577-E5D0EFFA51D0" /> - <class name="AtlasHitsVector<ZDC_SimPixelHit>" /> - <class name="std::vector<ZDC_SimPixelHit>" /> - <class name="ZDC_SimPixelHit" /> - <class name="ZDC_SimFiberHit_Collection" id="92374D8F-1A24-4A38-86B4-611AAFA89CFB" /> <class name="AtlasHitsVector<ZDC_SimFiberHit>" /> <class name="std::vector<ZDC_SimFiberHit>" /> diff --git a/ForwardDetectors/ZDC/ZDC_SimEvent/src/ZDC_SimPixelHit.cxx b/ForwardDetectors/ZDC/ZDC_SimEvent/src/ZDC_SimPixelHit.cxx deleted file mode 100644 index f6851c081904e33ccfe151b2a1b69c2222462552..0000000000000000000000000000000000000000 --- a/ForwardDetectors/ZDC/ZDC_SimEvent/src/ZDC_SimPixelHit.cxx +++ /dev/null @@ -1,16 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#include "ZDC_SimEvent/ZDC_SimPixelHit.h" - -int ZDC_SimPixelHit::operator == (const ZDC_SimPixelHit& simhit) const { return (this==&simhit) ? 1 : 0; } - -bool ZDC_SimPixelHit::operator < (const ZDC_SimPixelHit& rhs) const { - - if (m_Side < rhs.m_Side) return true; - if (m_ModNo < rhs.m_ModNo) return true; - if (m_PixNo < rhs.m_PixNo) return true; - - return false; -} diff --git a/ForwardDetectors/ZDC/ZDC_SimEvent/src/ZDC_SimStripHit.cxx b/ForwardDetectors/ZDC/ZDC_SimEvent/src/ZDC_SimStripHit.cxx deleted file mode 100644 index cd4e723aacd8e0efcdd390a88af1820d99aea2a4..0000000000000000000000000000000000000000 --- a/ForwardDetectors/ZDC/ZDC_SimEvent/src/ZDC_SimStripHit.cxx +++ /dev/null @@ -1,15 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#include "ZDC_SimEvent/ZDC_SimStripHit.h" - -int ZDC_SimStripHit::operator == (const ZDC_SimStripHit& simhit) const { return (this==&simhit) ? 1 : 0; } - -bool ZDC_SimStripHit::operator < (const ZDC_SimStripHit& rhs) const { - - if (m_Side < rhs.m_Side) return true; - if (m_ModNo < rhs.m_ModNo) return true; - - return false; -} diff --git a/ForwardDetectors/ZDC/ZDC_SimuDigitization/CMakeLists.txt b/ForwardDetectors/ZDC/ZDC_SimuDigitization/CMakeLists.txt index 79f9e78193e35ceb4a3cc7d2c196284ccd394f77..a2de3828e5a1336da63459361d49f4f76251f219 100644 --- a/ForwardDetectors/ZDC/ZDC_SimuDigitization/CMakeLists.txt +++ b/ForwardDetectors/ZDC/ZDC_SimuDigitization/CMakeLists.txt @@ -16,5 +16,4 @@ atlas_add_component( ZDC_SimuDigitization # Install files from the package: atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} ) -atlas_install_joboptions( share/*.py ) diff --git a/ForwardDetectors/ZDC/ZDC_SimuDigitization/share/DigitizationRTT_zdc.py b/ForwardDetectors/ZDC/ZDC_SimuDigitization/share/DigitizationRTT_zdc.py deleted file mode 100644 index be708aa2ec0ccf4baa2ce16f0b82a6daf7e1bfd7..0000000000000000000000000000000000000000 --- a/ForwardDetectors/ZDC/ZDC_SimuDigitization/share/DigitizationRTT_zdc.py +++ /dev/null @@ -1,33 +0,0 @@ - -from AthenaCommon.AthenaCommonFlags import jobproperties - -jobproperties.AthenaCommonFlags.PoolHitsInput = ["atlasG4.hits.pool.root"] -jobproperties.AthenaCommonFlags.PoolRDOOutput = "digi.pool.root" -jobproperties.AthenaCommonFlags.EvtMax = -1 - -from AthenaCommon.GlobalFlags import jobproperties - -jobproperties.Global.DetDescrVersion = 'ATLAS-GEO-18-01-00' - -from AthenaCommon.DetFlags import DetFlags - -DetFlags.ZDC_setOn() -DetFlags.Truth_setOn() - -include("Digitization/Digitization.py") - -Service("StoreGateSvc").ActivateHistory = False -Service("GeoModelSvc").IgnoreTagDifference = True - -# Digitization parameters (comment the following lines to use default values) -zdc.ScaleStrip=3e-4 -zdc.ScalePixel=1e-1 -zdc.MaxTimeBin=5 -zdc.OutputLevel = DEBUG - -# Following lines to add also _ZdcRawChannelCollection_ in the output file (needed for ZdcD3PDMaker) -from ZdcRec.ZdcRecConf import ZdcRec -topSequence += ZdcRec() - -if DetFlags.writeRDOPool.ZDC_on(): - Stream1.ItemList+=["ZdcRawChannelCollection#*"] diff --git a/ForwardDetectors/ZDC/ZDC_SimuDigitization/share/ZDC_Digitization_JobOptions.py b/ForwardDetectors/ZDC/ZDC_SimuDigitization/share/ZDC_Digitization_JobOptions.py deleted file mode 100644 index 12769ca43fc27bc1155f5ee8e1866d24f11f2185..0000000000000000000000000000000000000000 --- a/ForwardDetectors/ZDC/ZDC_SimuDigitization/share/ZDC_Digitization_JobOptions.py +++ /dev/null @@ -1,5 +0,0 @@ -from AthenaCommon.AlgSequence import AlgSequence -job = AlgSequence() -from AthenaCommon import CfgGetter -job += CfgGetter.getAlgorithm("ZDC_DigiTop/ZDC_DigiTop", tryDefaultConfigurable=True) -zdc = job.ZDC_DigiTop.DigitizationTool diff --git a/ForwardDetectors/ZDC/ZDC_SimuDigitization/share/ZDC_PileUpTool_JobOptions.py b/ForwardDetectors/ZDC/ZDC_SimuDigitization/share/ZDC_PileUpTool_JobOptions.py deleted file mode 100644 index 70445b35dcb523397150c6833c3add69883573f2..0000000000000000000000000000000000000000 --- a/ForwardDetectors/ZDC/ZDC_SimuDigitization/share/ZDC_PileUpTool_JobOptions.py +++ /dev/null @@ -1,5 +0,0 @@ -from AthenaCommon.AlgSequence import AlgSequence -job = AlgSequence() -from AthenaCommon import CfgGetter -job.PileUpToolsAlg.PileUpTools += [ CfgGetter.getPrivateTool("ZDC_PileUpTool", checkType=True) ] -zdcPileUpTool = job.PileUpToolsAlg.PileUpTools[ "ZDC_PileUpTool" ] diff --git a/ForwardDetectors/ZDC/ZDC_SimuDigitization/share/jobOptions.G4Atlas.zdc.pgun.py b/ForwardDetectors/ZDC/ZDC_SimuDigitization/share/jobOptions.G4Atlas.zdc.pgun.py deleted file mode 100644 index f2133cec2cab1f95b4638d6b32780aac77e25780..0000000000000000000000000000000000000000 --- a/ForwardDetectors/ZDC/ZDC_SimuDigitization/share/jobOptions.G4Atlas.zdc.pgun.py +++ /dev/null @@ -1,52 +0,0 @@ - -from AthenaCommon.AlgSequence import AlgSequence -topSeq = AlgSequence() - -ServiceMgr.MessageSvc.OutputLevel = DEBUG - -from AthenaCommon.DetFlags import DetFlags -DetFlags.bpipe_setOn() -DetFlags.ZDC_setOn() -DetFlags.Truth_setOn() - -from RngComps.RngCompsConf import AtRndmGenSvc -ServiceMgr += AtRndmGenSvc() - -from AthenaCommon.GlobalFlags import jobproperties -jobproperties.Global.ConditionsTag = "OFLCOND-SDR-BS7T-05-14" - -from AthenaCommon.AthenaCommonFlags import athenaCommonFlags -athenaCommonFlags.PoolHitsOutput = "atlasG4.hits.pool.root" -athenaCommonFlags.EvtMax = 3 - -from G4AtlasApps.SimFlags import simFlags -simFlags.load_atlas_flags() -simFlags.SimLayout='ATLAS-GEO-18-01-00' -simFlags.EventFilter.set_Off() -simFlags.MagneticField.set_Off() -simFlags.ForwardDetectors.set_On() -simFlags.ForwardDetectors=2 - -from AthenaCommon.AthenaCommonFlags import athenaCommonFlags -athenaCommonFlags.PoolEvgenInput.set_Off() - -import AthenaCommon.AtlasUnixGeneratorJob -spgorders = ['pdgcode: constant 2112', - 'vertX: flat -1.0 1.0', - 'vertY: flat -1.0 1.0', - 'vertZ: constant -139500.0', - 't: constant 0.0', - 'eta: constant -100.0', - 'phi: flat 0 6.28318', - 'e: constant 1360000' - ] - -from ParticleGenerator.ParticleGeneratorConf import ParticleGenerator -topSeq += ParticleGenerator() -topSeq.ParticleGenerator.orders = sorted(spgorders) - -include("G4AtlasApps/G4Atlas.flat.configuration.py") - -from AthenaCommon.CfgGetter import getAlgorithm -topSeq += getAlgorithm("G4AtlasAlg",tryDefaultConfigurable=True) - diff --git a/ForwardDetectors/ZDC/ZDC_SimuDigitization/share/jobOptions.G4Atlas.zdc.phys.py b/ForwardDetectors/ZDC/ZDC_SimuDigitization/share/jobOptions.G4Atlas.zdc.phys.py deleted file mode 100644 index 98670248ae5d553e374aedc661dd1a5213393d87..0000000000000000000000000000000000000000 --- a/ForwardDetectors/ZDC/ZDC_SimuDigitization/share/jobOptions.G4Atlas.zdc.phys.py +++ /dev/null @@ -1,34 +0,0 @@ - -from AthenaCommon.AlgSequence import AlgSequence -topSeq = AlgSequence() - -ServiceMgr.MessageSvc.OutputLevel = DEBUG - -from AthenaCommon.DetFlags import DetFlags -DetFlags.bpipe_setOn() -DetFlags.ZDC_setOn() -DetFlags.Truth_setOn() - -from RngComps.RngCompsConf import AtRndmGenSvc -ServiceMgr += AtRndmGenSvc() - -from AthenaCommon.GlobalFlags import jobproperties -jobproperties.Global.ConditionsTag = "OFLCOND-SDR-BS7T-05-14" - -from AthenaCommon.AthenaCommonFlags import athenaCommonFlags -athenaCommonFlags.PoolEvgenInput = ['/afs/cern.ch/user/a/asbrizzi/links/reldis_offline/v0.0/test/inter/evgen/MC12.Reldis.evgen_17.1.4.2_status1_MeV.pool.root'] -athenaCommonFlags.PoolHitsOutput = "atlasG4.hits.pool.root" -athenaCommonFlags.EvtMax = 1 - -from G4AtlasApps.SimFlags import simFlags -simFlags.load_atlas_flags() -simFlags.SimLayout='ATLAS-GEO-18-01-00' -simFlags.EventFilter.set_Off() -simFlags.MagneticField.set_Off() -simFlags.ForwardDetectors.set_On() -simFlags.ForwardDetectors=2 - -include("G4AtlasApps/G4Atlas.flat.configuration.py") - -from AthenaCommon.CfgGetter import getAlgorithm -topSeq += getAlgorithm("G4AtlasAlg",tryDefaultConfigurable=True) diff --git a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventAthenaPool/CMakeLists.txt b/ForwardDetectors/ZDC/ZdcCnv/ZdcEventAthenaPool/CMakeLists.txt index a6e8fce5af44a0fbe0951c598f6407c7295e219c..6418185f22af7dd5a02b7d6ce4943950c02fc776 100644 --- a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventAthenaPool/CMakeLists.txt +++ b/ForwardDetectors/ZDC/ZdcCnv/ZdcEventAthenaPool/CMakeLists.txt @@ -7,8 +7,6 @@ atlas_subdir( ZdcEventAthenaPool ) atlas_add_poolcnv_library( ZdcEventAthenaPoolPoolCnv src/*.h src/*.cxx FILES ZdcEvent/ZdcDigitsCollection.h ZdcEvent/ZdcRawChannelCollection.h - ZDC_SimEvent/ZDC_SimStripHit_Collection.h - ZDC_SimEvent/ZDC_SimPixelHit_Collection.h ZDC_SimEvent/ZDC_SimFiberHit_Collection.h LINK_LIBRARIES AthenaPoolCnvSvcLib AthenaPoolUtilities ZDC_SimEvent ZdcEventTPCnv ZdcEvent GaudiKernel ) diff --git a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventAthenaPool/src/ZDC_SimPixelHit_CollectionCnv.cxx b/ForwardDetectors/ZDC/ZdcCnv/ZdcEventAthenaPool/src/ZDC_SimPixelHit_CollectionCnv.cxx deleted file mode 100644 index 11743b43278f9ff017d38445c28ad1bead67d4be..0000000000000000000000000000000000000000 --- a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventAthenaPool/src/ZDC_SimPixelHit_CollectionCnv.cxx +++ /dev/null @@ -1,46 +0,0 @@ -/* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration -*/ - -/** - * @file ZDC_SimPixelHit_CollectionCnv.cxx - * @brief Generated implementation file which includes header files needed by ZDC_SimPixelHit_CollectionCnv - * @author RD Schaffer <R.D.Schaffer@cern.ch> - */ - -#include "ZDC_SimPixelHit_CollectionCnv.h" -#include "ZdcEventTPCnv/ZDC_SimPixelHit_CollectionCnv_p1.h" - -#include "GaudiKernel/MsgStream.h" - -ZDC_SimPixelHit_Collection_PERS* ZDC_SimPixelHit_CollectionCnv::createPersistent(ZDC_SimPixelHit_Collection* transCont) { - - MsgStream mlog(msgSvc(), "ZDC_SimPixelHit_CollectionConverter" ); - ZDC_SimPixelHit_CollectionCnv_p1 converter; - ZDC_SimPixelHit_Collection_PERS *persObj = converter.createPersistent( transCont, mlog ); - - - return persObj; -} - -ZDC_SimPixelHit_Collection* ZDC_SimPixelHit_CollectionCnv::createTransient() { - - - MsgStream mlog(msgSvc(), "ZDC_SimPixelHit_CollectionConverter" ); - ZDC_SimPixelHit_CollectionCnv_p1 converter_p1; - - ZDC_SimPixelHit_Collection *trans_cont(nullptr); - - static const pool::Guid p1_guid("EBCA37BF-38FF-4F19-B577-E5D0EFFA51D0"); - if( this->compareClassGuid(p1_guid)) { - std::unique_ptr< ZDC_SimPixelHit_Collection_PERS > col_vect( this->poolReadObject< ZDC_SimPixelHit_Collection_PERS >() ); - trans_cont = converter_p1.createTransient(col_vect.get(), mlog ); - } - else { - throw std::runtime_error("Unsupported persistent version of Data collection"); - } - - - return trans_cont; -} - diff --git a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventAthenaPool/src/ZDC_SimPixelHit_CollectionCnv.h b/ForwardDetectors/ZDC/ZdcCnv/ZdcEventAthenaPool/src/ZDC_SimPixelHit_CollectionCnv.h deleted file mode 100644 index 120ff1539a19c66a3a2fd2f74b753cd09eca59a9..0000000000000000000000000000000000000000 --- a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventAthenaPool/src/ZDC_SimPixelHit_CollectionCnv.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -/** - * @file ZDC_SimPixelHit_CollectionCnv.h - * @brief Generated header file which defines a typedef for templated converter class - * @author RD Schaffer <R.D. Schaffer@cern.ch> - */ - -#ifndef ZDC_SimPixelHit_CollectionCnv_H -#define ZDC_SimPixelHit_CollectionCnv_H - -#include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" -#include "ZDC_SimEvent/ZDC_SimPixelHit_Collection.h" -#include "ZdcEventTPCnv/ZDC_SimPixelHit_Collection_p1.h" - -typedef ZDC_SimPixelHit_Collection_p1 ZDC_SimPixelHit_Collection_PERS; - -typedef T_AthenaPoolCustomCnv<ZDC_SimPixelHit_Collection, ZDC_SimPixelHit_Collection_PERS> ZDC_SimPixelHit_CollectionCnvBase; - -class ZDC_SimPixelHit_CollectionCnv : public ZDC_SimPixelHit_CollectionCnvBase { - - friend class CnvFactory<ZDC_SimPixelHit_CollectionCnv>; - -protected: - -public: - ZDC_SimPixelHit_CollectionCnv(ISvcLocator* svcloc) : ZDC_SimPixelHit_CollectionCnvBase ( svcloc) {} -protected: - virtual ZDC_SimPixelHit_Collection_PERS* createPersistent(ZDC_SimPixelHit_Collection* transCont); - virtual ZDC_SimPixelHit_Collection* createTransient (); - -}; - -#endif - diff --git a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventAthenaPool/src/ZDC_SimStripHit_CollectionCnv.cxx b/ForwardDetectors/ZDC/ZdcCnv/ZdcEventAthenaPool/src/ZDC_SimStripHit_CollectionCnv.cxx deleted file mode 100644 index 468fdba2dcc8d555668807a7389c819e945d1518..0000000000000000000000000000000000000000 --- a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventAthenaPool/src/ZDC_SimStripHit_CollectionCnv.cxx +++ /dev/null @@ -1,46 +0,0 @@ -/* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration -*/ - -/** - * @file ZDC_SimStripHit_CollectionCnv.cxx - * @brief Generated implementation file which includes header files needed by ZDC_SimStripHit_CollectionCnv - * @author RD Schaffer <R.D.Schaffer@cern.ch> - */ - -#include "ZDC_SimStripHit_CollectionCnv.h" -#include "ZdcEventTPCnv/ZDC_SimStripHit_CollectionCnv_p1.h" - -#include "GaudiKernel/MsgStream.h" - -ZDC_SimStripHit_Collection_PERS* ZDC_SimStripHit_CollectionCnv::createPersistent(ZDC_SimStripHit_Collection* transCont) { - - MsgStream mlog(msgSvc(), "ZDC_SimStripHit_CollectionConverter" ); - ZDC_SimStripHit_CollectionCnv_p1 converter; - ZDC_SimStripHit_Collection_PERS *persObj = converter.createPersistent( transCont, mlog ); - - - return persObj; -} - -ZDC_SimStripHit_Collection* ZDC_SimStripHit_CollectionCnv::createTransient() { - - - MsgStream mlog(msgSvc(), "ZDC_SimStripHit_CollectionConverter" ); - ZDC_SimStripHit_CollectionCnv_p1 converter_p1; - - ZDC_SimStripHit_Collection *trans_cont(nullptr); - - static const pool::Guid p1_guid("1082F8C1-BA19-47AF-83D7-4669BD12E9AC"); - if( this->compareClassGuid(p1_guid)) { - std::unique_ptr< ZDC_SimStripHit_Collection_PERS > col_vect( this->poolReadObject< ZDC_SimStripHit_Collection_PERS >() ); - trans_cont = converter_p1.createTransient(col_vect.get(), mlog ); - } - else { - throw std::runtime_error("Unsupported persistent version of Data collection"); - } - - - return trans_cont; -} - diff --git a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventAthenaPool/src/ZDC_SimStripHit_CollectionCnv.h b/ForwardDetectors/ZDC/ZdcCnv/ZdcEventAthenaPool/src/ZDC_SimStripHit_CollectionCnv.h deleted file mode 100644 index 2572d08afabac4b1ef19cd014da40bd448280907..0000000000000000000000000000000000000000 --- a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventAthenaPool/src/ZDC_SimStripHit_CollectionCnv.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -/** - * @file ZDC_SimStripHit_CollectionCnv.h - * @brief Generated header file which defines a typedef for templated converter class - * @author RD Schaffer <R.D. Schaffer@cern.ch> - */ - -#ifndef ZDC_SimStripHit_CollectionCnv_H -#define ZDC_SimStripHit_CollectionCnv_H - -#include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" -#include "ZDC_SimEvent/ZDC_SimStripHit_Collection.h" -#include "ZdcEventTPCnv/ZDC_SimStripHit_Collection_p1.h" - -typedef ZDC_SimStripHit_Collection_p1 ZDC_SimStripHit_Collection_PERS; - -typedef T_AthenaPoolCustomCnv<ZDC_SimStripHit_Collection, ZDC_SimStripHit_Collection_PERS> ZDC_SimStripHit_CollectionCnvBase; - -class ZDC_SimStripHit_CollectionCnv : public ZDC_SimStripHit_CollectionCnvBase { - - friend class CnvFactory<ZDC_SimStripHit_CollectionCnv>; - -protected: - -public: - ZDC_SimStripHit_CollectionCnv(ISvcLocator* svcloc) : ZDC_SimStripHit_CollectionCnvBase ( svcloc) {} -protected: - virtual ZDC_SimStripHit_Collection_PERS* createPersistent(ZDC_SimStripHit_Collection* transCont); - virtual ZDC_SimStripHit_Collection* createTransient (); - -}; - -#endif - diff --git a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/CMakeLists.txt b/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/CMakeLists.txt index 3450c69a2ed2fa0527c4332a6c4209f5a2693819..f3c961e786c5ab0e4d59db8277d5d832bbf583da 100644 --- a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/CMakeLists.txt +++ b/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/CMakeLists.txt @@ -36,26 +36,6 @@ atlas_add_test( ZdcRawChannelCollectionCnv_p1_test test/ZdcRawChannelCollectionCnv_p1_test.cxx LINK_LIBRARIES TestTools ZdcEventTPCnv CxxUtils ) - atlas_add_test( ZDC_SimPixelHitCnv_p1_test - SOURCES - test/ZDC_SimPixelHitCnv_p1_test.cxx - LINK_LIBRARIES TestTools ZdcEventTPCnv CxxUtils ) - -atlas_add_test( ZDC_SimPixelHit_CollectionCnv_p1_test - SOURCES - test/ZDC_SimPixelHit_CollectionCnv_p1_test.cxx - LINK_LIBRARIES TestTools ZdcEventTPCnv CxxUtils ) - -atlas_add_test( ZDC_SimStripHitCnv_p1_test - SOURCES - test/ZDC_SimStripHitCnv_p1_test.cxx - LINK_LIBRARIES TestTools ZdcEventTPCnv CxxUtils ) - -atlas_add_test( ZDC_SimStripHit_CollectionCnv_p1_test - SOURCES - test/ZDC_SimStripHit_CollectionCnv_p1_test.cxx - LINK_LIBRARIES TestTools ZdcEventTPCnv CxxUtils ) - atlas_add_test( ZDC_SimFiberHitCnv_p1_test SOURCES test/ZDC_SimFiberHitCnv_p1_test.cxx diff --git a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/ZdcEventTPCnv/ZDC_SimPixelHitCnv_p1.h b/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/ZdcEventTPCnv/ZDC_SimPixelHitCnv_p1.h deleted file mode 100644 index 80e45e34aeee556de287f7c324a29d5cd57b0016..0000000000000000000000000000000000000000 --- a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/ZdcEventTPCnv/ZDC_SimPixelHitCnv_p1.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef ZDC_SIMPIXELHITCNV_P1_H -#define ZDC_SIMPIXELHITCNV_P1_H - -#include "ZDC_SimEvent/ZDC_SimPixelHit.h" -#include "ZdcEventTPCnv/ZDC_SimPixelHit_p1.h" - -#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h" - -class MsgStream; - -class ZDC_SimPixelHitCnv_p1: public T_AthenaPoolTPCnvConstBase<ZDC_SimPixelHit, ZDC_SimPixelHit_p1> { - - public: - using base_class::persToTrans; - using base_class::transToPers; - - ZDC_SimPixelHitCnv_p1() {} - - virtual void persToTrans(const ZDC_SimPixelHit_p1* persObj, ZDC_SimPixelHit* transObj, MsgStream& log) const override; - virtual void transToPers(const ZDC_SimPixelHit* transObj, ZDC_SimPixelHit_p1* persObj, MsgStream& log) const override; - - -}; - - -#endif diff --git a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/ZdcEventTPCnv/ZDC_SimPixelHit_CollectionCnv_p1.h b/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/ZdcEventTPCnv/ZDC_SimPixelHit_CollectionCnv_p1.h deleted file mode 100644 index 927f5a33a7f947c8ba48ddfb4ea077ee6a882fba..0000000000000000000000000000000000000000 --- a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/ZdcEventTPCnv/ZDC_SimPixelHit_CollectionCnv_p1.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef ZDC_SimPixelHit_CollectionCnv_p1_H -#define ZDC_SimPixelHit_CollectionCnv_p1_H - -#include <vector> - -#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h" -#include "ZDC_SimEvent/ZDC_SimPixelHit_Collection.h" -#include "ZdcEventTPCnv/ZDC_SimPixelHit_p1.h" -#include "ZdcEventTPCnv/ZDC_SimPixelHit_Collection_p1.h" - -class MsgStream; - -class ZDC_SimPixelHit_CollectionCnv_p1: public T_AthenaPoolTPCnvConstBase<ZDC_SimPixelHit_Collection, ZDC_SimPixelHit_Collection_p1> { - -public: - using base_class::persToTrans; - using base_class::transToPers; - - ZDC_SimPixelHit_CollectionCnv_p1() {} - - virtual void persToTrans(const ZDC_SimPixelHit_Collection_p1* persObj, ZDC_SimPixelHit_Collection* transObj, MsgStream& log) const override; - virtual void transToPers(const ZDC_SimPixelHit_Collection* transObj, ZDC_SimPixelHit_Collection_p1* persObj, MsgStream& log) const override; -}; - - -template<> -class T_TPCnv<ZDC_SimPixelHit_Collection, ZDC_SimPixelHit_Collection_p1> - : public ZDC_SimPixelHit_CollectionCnv_p1 -{ -public: -}; - - -#endif - diff --git a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/ZdcEventTPCnv/ZDC_SimPixelHit_Collection_p1.h b/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/ZdcEventTPCnv/ZDC_SimPixelHit_Collection_p1.h deleted file mode 100644 index b67b8956c3eccd12e54c6b17b277ab3889d3a0bc..0000000000000000000000000000000000000000 --- a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/ZdcEventTPCnv/ZDC_SimPixelHit_Collection_p1.h +++ /dev/null @@ -1,30 +0,0 @@ -///////////////////////// -*- C++ -*- ///////////////////////////// - -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -// ZDC_SimPixelHit_Collection_p1.h -// Persistent represenation of a ZDC_SimPixelHit_Collection -/////////////////////////////////////////////////////////////////// -#ifndef ZDC_SIMPIXELHIT_COLLECTION_P1_H -#define ZDC_SIMPIXELHIT_COLLECTION_P1_H - -#include "ZdcEventTPCnv/ZDC_SimPixelHit_p1.h" -#include <vector> - -class ZDC_SimPixelHit_Collection_p1 : public std::vector<ZDC_SimPixelHit_p1> -{ -public: - /// typedefs - typedef std::vector<ZDC_SimPixelHit_p1> PixelHitVector; - typedef PixelHitVector::const_iterator const_iterator; - typedef PixelHitVector::iterator iterator; - - /// Default constructor - ZDC_SimPixelHit_Collection_p1 () {} - -private: -}; - -#endif diff --git a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/ZdcEventTPCnv/ZDC_SimPixelHit_p1.h b/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/ZdcEventTPCnv/ZDC_SimPixelHit_p1.h deleted file mode 100644 index 9cca1eb5bdedfbfe80a6f44e7c217c3b842af82f..0000000000000000000000000000000000000000 --- a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/ZdcEventTPCnv/ZDC_SimPixelHit_p1.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef ZDC_SIMPIXELHIT_P1_H -#define ZDC_SIMPIXELHIT_P1_H - -class ZDC_SimPixelHit_p1 { - - public: - - ZDC_SimPixelHit_p1() { - Side=0; - ModNo=0; - PixNo=0; - Nphotons=0; - Edep=0; - }; - - friend class ZDC_SimPixelHitCnv_p1; - - private: - - int Side; - int ModNo; - int PixNo; - int Nphotons; - float Edep; -}; - -#endif diff --git a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/ZdcEventTPCnv/ZDC_SimStripHitCnv_p1.h b/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/ZdcEventTPCnv/ZDC_SimStripHitCnv_p1.h deleted file mode 100644 index 8b16c408b9964a6030b9955878670801cb1ff52d..0000000000000000000000000000000000000000 --- a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/ZdcEventTPCnv/ZDC_SimStripHitCnv_p1.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef ZDC_SIMSTRIPHITCNV_P1_H -#define ZDC_SIMSTRIPHITCNV_P1_H - -#include "ZDC_SimEvent/ZDC_SimStripHit.h" -#include "ZdcEventTPCnv/ZDC_SimStripHit_p1.h" - -#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h" - -class MsgStream; - -class ZDC_SimStripHitCnv_p1: public T_AthenaPoolTPCnvConstBase<ZDC_SimStripHit, ZDC_SimStripHit_p1> { - - public: - using base_class::persToTrans; - using base_class::transToPers; - - ZDC_SimStripHitCnv_p1() {} - - virtual void persToTrans(const ZDC_SimStripHit_p1* persObj, ZDC_SimStripHit* transObj, MsgStream& log) const; - virtual void transToPers(const ZDC_SimStripHit* transObj, ZDC_SimStripHit_p1* persObj, MsgStream& log) const; - - -}; - - -#endif diff --git a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/ZdcEventTPCnv/ZDC_SimStripHit_CollectionCnv_p1.h b/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/ZdcEventTPCnv/ZDC_SimStripHit_CollectionCnv_p1.h deleted file mode 100644 index e70d2d6a97404afc0a8bc5bc0a9c8d39be7d5bbb..0000000000000000000000000000000000000000 --- a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/ZdcEventTPCnv/ZDC_SimStripHit_CollectionCnv_p1.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef ZDC_SimStripHit_CollectionCnv_p1_H -#define ZDC_SimStripHit_CollectionCnv_p1_H - -#include <vector> - -#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h" -#include "ZDC_SimEvent/ZDC_SimStripHit_Collection.h" -#include "ZdcEventTPCnv/ZDC_SimStripHit_p1.h" -#include "ZdcEventTPCnv/ZDC_SimStripHit_Collection_p1.h" - -class MsgStream; - -class ZDC_SimStripHit_CollectionCnv_p1: public T_AthenaPoolTPCnvConstBase<ZDC_SimStripHit_Collection, ZDC_SimStripHit_Collection_p1> { - -public: - using base_class::persToTrans; - using base_class::transToPers; - - ZDC_SimStripHit_CollectionCnv_p1() {} - - virtual void persToTrans(const ZDC_SimStripHit_Collection_p1* persObj, ZDC_SimStripHit_Collection* transObj, MsgStream& log) const override; - virtual void transToPers(const ZDC_SimStripHit_Collection* transObj, ZDC_SimStripHit_Collection_p1* persObj, MsgStream& log) const override; -}; - - -template<> -class T_TPCnv<ZDC_SimStripHit_Collection, ZDC_SimStripHit_Collection_p1> - : public ZDC_SimStripHit_CollectionCnv_p1 -{ -public: -}; - -#endif - diff --git a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/ZdcEventTPCnv/ZDC_SimStripHit_Collection_p1.h b/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/ZdcEventTPCnv/ZDC_SimStripHit_Collection_p1.h deleted file mode 100644 index 01212ef828a3487ace758c2a5717ebd24a673ccf..0000000000000000000000000000000000000000 --- a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/ZdcEventTPCnv/ZDC_SimStripHit_Collection_p1.h +++ /dev/null @@ -1,30 +0,0 @@ -///////////////////////// -*- C++ -*- ///////////////////////////// - -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -// ZDC_SimStripHit_Collection_p1.h -// Persistent represenation of a ZDC_SimStripHit_Collection -/////////////////////////////////////////////////////////////////// -#ifndef ZDC_SIMSTRIPHIT_COLLECTION_P1_H -#define ZDC_SIMSTRIPHIT_COLLECTION_P1_H - -#include "ZdcEventTPCnv/ZDC_SimStripHit_p1.h" -#include <vector> - -class ZDC_SimStripHit_Collection_p1 : public std::vector<ZDC_SimStripHit_p1> -{ -public: - /// typedefs - typedef std::vector<ZDC_SimStripHit_p1> StripHitVector; - typedef StripHitVector::const_iterator const_iterator; - typedef StripHitVector::iterator iterator; - - /// Default constructor - ZDC_SimStripHit_Collection_p1 () {} - -private: -}; - -#endif diff --git a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/ZdcEventTPCnv/ZDC_SimStripHit_p1.h b/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/ZdcEventTPCnv/ZDC_SimStripHit_p1.h deleted file mode 100644 index 43a6d36cea46cb0faab6cb8deb39dfe245543eef..0000000000000000000000000000000000000000 --- a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/ZdcEventTPCnv/ZDC_SimStripHit_p1.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef ZDC_SIMSTRIPHIT_P1_H -#define ZDC_SIMSTRIPHIT_P1_H - -class ZDC_SimStripHit_p1 { - - public: - - ZDC_SimStripHit_p1() { - Side=0; - ModNo=0; - Nphotons=0; - Edep=0; - }; - - friend class ZDC_SimStripHitCnv_p1; - - private: - - int Side; - int ModNo; - int Nphotons; - float Edep; -}; - -#endif diff --git a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/ZdcEventTPCnv/ZdcEventTPCnvDict.h b/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/ZdcEventTPCnv/ZdcEventTPCnvDict.h index 51bd93dfe15f46321048de12c936bd9ebc729aef..082a0dacdbaf97ba887ace788684d03130832558 100644 --- a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/ZdcEventTPCnv/ZdcEventTPCnvDict.h +++ b/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/ZdcEventTPCnv/ZdcEventTPCnvDict.h @@ -9,21 +9,15 @@ #include "ZdcEventTPCnv/ZdcDigitsCollection_p1.h" #include "ZdcEventTPCnv/ZdcRawChannel_p1.h" #include "ZdcEventTPCnv/ZdcRawChannelCollection_p1.h" -#include "ZdcEventTPCnv/ZDC_SimStripHit_p1.h" -#include "ZdcEventTPCnv/ZDC_SimStripHit_Collection_p1.h" -#include "ZdcEventTPCnv/ZDC_SimPixelHit_p1.h" -#include "ZdcEventTPCnv/ZDC_SimPixelHit_Collection_p1.h" #include "ZdcEventTPCnv/ZDC_SimFiberHit_p1.h" #include "ZdcEventTPCnv/ZDC_SimFiberHit_Collection_p1.h" namespace GCCXML_DUMMY_INSTANTIATION_ZDCEVENTTPCNV { - std::vector<ZDC_SimStripHit_p1> zdc0; - std::vector<ZDC_SimPixelHit_p1> zdc1; - std::vector<ZdcDigits_p1> zdc2; - std::vector<ZdcRawChannel_p1> zdc3; - std::vector<ZDC_SimFiberHit_p1> zdc4; - std::vector<ZdcDigits_p1> zdc5; - std::vector<ZdcRawChannel_p1> zdc6; + std::vector<ZdcDigits_p1> zdc0; + std::vector<ZdcRawChannel_p1> zdc1; + std::vector<ZDC_SimFiberHit_p1> zdc2; + std::vector<ZdcDigits_p1> zdc3; + std::vector<ZdcRawChannel_p1> zdc4; } diff --git a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/ZdcEventTPCnv/selection.xml b/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/ZdcEventTPCnv/selection.xml index b19bdf7ae07c4a48eb84384aee5161a10fbbe61d..577c00890f09fa45cf1f8baa81b8ca3dfd8ce995 100644 --- a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/ZdcEventTPCnv/selection.xml +++ b/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/ZdcEventTPCnv/selection.xml @@ -8,14 +8,6 @@ <class name="std::vector<ZdcRawChannel_p1>" /> <class name="ZdcRawChannelCollection_p1" id="A2BDA733-7A0A-459D-9237-33DFF3DC9982"/> - <class name="ZDC_SimStripHit_p1" /> - <class name="std::vector<ZDC_SimStripHit_p1>" /> - <class name="ZDC_SimStripHit_Collection_p1" id="1082F8C1-BA19-47AF-83D7-4669BD12E9AC" /> - - <class name="ZDC_SimPixelHit_p1" /> - <class name="std::vector<ZDC_SimPixelHit_p1>" /> - <class name="ZDC_SimPixelHit_Collection_p1" id="EBCA37BF-38FF-4F19-B577-E5D0EFFA51D0" /> - <class name="ZDC_SimFiberHit_p1" /> <class name="std::vector<ZDC_SimFiberHit_p1>" /> <class name="ZDC_SimFiberHit_Collection_p1" id="92374D8F-1A24-4A38-86B4-611AAFA89CFB" /> diff --git a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/share/ZDC_SimPixelHitCnv_p1_test.ref b/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/share/ZDC_SimPixelHitCnv_p1_test.ref deleted file mode 100644 index a5bce3fd2565d8f458555a0c6f42d0504a848bd5..0000000000000000000000000000000000000000 --- a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/share/ZDC_SimPixelHitCnv_p1_test.ref +++ /dev/null @@ -1 +0,0 @@ -test1 diff --git a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/share/ZDC_SimPixelHit_CollectionCnv_p1_test.ref b/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/share/ZDC_SimPixelHit_CollectionCnv_p1_test.ref deleted file mode 100644 index 627cb39ff9f6dda53feeb0de19e60c4486d4d16e..0000000000000000000000000000000000000000 --- a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/share/ZDC_SimPixelHit_CollectionCnv_p1_test.ref +++ /dev/null @@ -1,4 +0,0 @@ -test1 -Athena::getMessageSvc: WARNING MessageSvc not found, will use std::cout -Athena::getMessageSvc: WARNING MessageSvc not found, will use std::cout -Athena::getMessageSvc: WARNING MessageSvc not found, will use std::cout diff --git a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/share/ZDC_SimStripHitCnv_p1_test.ref b/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/share/ZDC_SimStripHitCnv_p1_test.ref deleted file mode 100644 index a5bce3fd2565d8f458555a0c6f42d0504a848bd5..0000000000000000000000000000000000000000 --- a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/share/ZDC_SimStripHitCnv_p1_test.ref +++ /dev/null @@ -1 +0,0 @@ -test1 diff --git a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/share/ZDC_SimStripHit_CollectionCnv_p1_test.ref b/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/share/ZDC_SimStripHit_CollectionCnv_p1_test.ref deleted file mode 100644 index 627cb39ff9f6dda53feeb0de19e60c4486d4d16e..0000000000000000000000000000000000000000 --- a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/share/ZDC_SimStripHit_CollectionCnv_p1_test.ref +++ /dev/null @@ -1,4 +0,0 @@ -test1 -Athena::getMessageSvc: WARNING MessageSvc not found, will use std::cout -Athena::getMessageSvc: WARNING MessageSvc not found, will use std::cout -Athena::getMessageSvc: WARNING MessageSvc not found, will use std::cout diff --git a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/src/ZDC_SimPixelHitCnv_p1.cxx b/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/src/ZDC_SimPixelHitCnv_p1.cxx deleted file mode 100644 index 622a5c3bbbec1ba014a26579157ca721401ddb14..0000000000000000000000000000000000000000 --- a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/src/ZDC_SimPixelHitCnv_p1.cxx +++ /dev/null @@ -1,31 +0,0 @@ -/* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration -*/ - -#include "ZDC_SimEvent/ZDC_SimPixelHit.h" -#include "Identifier/Identifier.h" -#include "ZdcEventTPCnv/ZDC_SimPixelHitCnv_p1.h" - -void ZDC_SimPixelHitCnv_p1::persToTrans(const ZDC_SimPixelHit_p1* persObj, ZDC_SimPixelHit* transObj, MsgStream& log) const { - - log << MSG::DEBUG << " In ZDC_SimPixelHitCnv_p1::persToTrans " << endmsg; - - *transObj = ZDC_SimPixelHit (persObj->Side, - persObj->ModNo, - persObj->PixNo, - persObj->Nphotons, - persObj->Edep); - -} - -void ZDC_SimPixelHitCnv_p1::transToPers(const ZDC_SimPixelHit* transObj, ZDC_SimPixelHit_p1* persObj, MsgStream& log) const { - - log << MSG::DEBUG << " In ZDC_SimPixelHitCnv_p1::transToPers " << endmsg; - - persObj->Side = transObj->GetSide(); - persObj->ModNo = transObj->GetMod(); - persObj->PixNo = transObj->GetPix(); - persObj->Edep = transObj->GetEdep(); - persObj->Nphotons = transObj->GetNPhotons(); - -} diff --git a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/src/ZDC_SimPixelHit_CollectionCnv_p1.cxx b/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/src/ZDC_SimPixelHit_CollectionCnv_p1.cxx deleted file mode 100644 index f43621ba6eec57caf925e06166b1be92c784d193..0000000000000000000000000000000000000000 --- a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/src/ZDC_SimPixelHit_CollectionCnv_p1.cxx +++ /dev/null @@ -1,38 +0,0 @@ -/* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration -*/ - -#include "ZdcEventTPCnv/ZDC_SimPixelHitCnv_p1.h" -#include "ZdcEventTPCnv/ZDC_SimPixelHit_CollectionCnv_p1.h" -#include "GaudiKernel/MsgStream.h" - -static const ZDC_SimPixelHitCnv_p1 ZdcPixelHitConv; - -void ZDC_SimPixelHit_CollectionCnv_p1::transToPers(const ZDC_SimPixelHit_Collection* transObj, ZDC_SimPixelHit_Collection_p1* persObj, MsgStream& log) const { - - persObj->resize(transObj->size()); - - for (unsigned int i=0; i<transObj->size(); ++i) { - - ZDC_SimPixelHit_p1& pixelhit = (*persObj)[i]; - const ZDC_SimPixelHit& pixelhit_t = (*transObj)[i]; - - ZdcPixelHitConv.transToPers(&pixelhit_t, &pixelhit, log); - } -} - -void ZDC_SimPixelHit_CollectionCnv_p1::persToTrans(const ZDC_SimPixelHit_Collection_p1* persObj, ZDC_SimPixelHit_Collection* transObj, MsgStream& log) const { - - //log << MSG::INFO << " size = " << persObj->size() << endmsg; - - transObj->reserve(persObj->size()); - - for (unsigned int i=0; i<persObj->size(); ++i) { - - //log << MSG::INFO << " i = " << i << endmsg; - const ZDC_SimPixelHit_p1* pixelhit = &((*persObj)[i]); - - std::unique_ptr<ZDC_SimPixelHit> ptr (ZdcPixelHitConv.createTransientConst(pixelhit, log)); - transObj->push_back(*ptr); - } -} diff --git a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/src/ZDC_SimStripHitCnv_p1.cxx b/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/src/ZDC_SimStripHitCnv_p1.cxx deleted file mode 100644 index 2e5a5387c27d20ead34cac81efe011ec4a459f68..0000000000000000000000000000000000000000 --- a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/src/ZDC_SimStripHitCnv_p1.cxx +++ /dev/null @@ -1,28 +0,0 @@ -/* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration -*/ - -#include "ZDC_SimEvent/ZDC_SimStripHit.h" -#include "Identifier/Identifier.h" -#include "ZdcEventTPCnv/ZDC_SimStripHitCnv_p1.h" - -void ZDC_SimStripHitCnv_p1::persToTrans(const ZDC_SimStripHit_p1* persObj, ZDC_SimStripHit* transObj, MsgStream& log) const { - - log << MSG::DEBUG << " In ZDC_SimStripHitCnv_p1::persToTrans " << endmsg; - - *transObj = ZDC_SimStripHit (persObj->Side, - persObj->ModNo, - persObj->Nphotons, - persObj->Edep); -} - -void ZDC_SimStripHitCnv_p1::transToPers(const ZDC_SimStripHit* transObj, ZDC_SimStripHit_p1* persObj, MsgStream& log) const { - - log << MSG::DEBUG << " In ZDC_SimStripHitCnv_p1::transToPers " << endmsg; - - persObj->Side = transObj->GetSide(); - persObj->ModNo = transObj->GetMod(); - persObj->Edep = transObj->GetEdep(); - persObj->Nphotons = transObj->GetNPhotons(); - -} diff --git a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/src/ZDC_SimStripHit_CollectionCnv_p1.cxx b/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/src/ZDC_SimStripHit_CollectionCnv_p1.cxx deleted file mode 100644 index 4198b87df42d0fd08ca8fda32839d0f711bbf488..0000000000000000000000000000000000000000 --- a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/src/ZDC_SimStripHit_CollectionCnv_p1.cxx +++ /dev/null @@ -1,38 +0,0 @@ -/* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration -*/ - -#include "ZdcEventTPCnv/ZDC_SimStripHitCnv_p1.h" -#include "ZdcEventTPCnv/ZDC_SimStripHit_CollectionCnv_p1.h" -#include "GaudiKernel/MsgStream.h" - -static const ZDC_SimStripHitCnv_p1 ZdcStripHitConv; - -void ZDC_SimStripHit_CollectionCnv_p1::transToPers(const ZDC_SimStripHit_Collection* transObj, ZDC_SimStripHit_Collection_p1* persObj, MsgStream& log) const { - - persObj->resize(transObj->size()); - - for (unsigned int i=0; i<transObj->size(); ++i) { - - ZDC_SimStripHit_p1& striphit = (*persObj)[i]; - const ZDC_SimStripHit& striphit_t = (*transObj)[i]; - - ZdcStripHitConv.transToPers(&striphit_t, &striphit, log); - } -} - -void ZDC_SimStripHit_CollectionCnv_p1::persToTrans(const ZDC_SimStripHit_Collection_p1* persObj, ZDC_SimStripHit_Collection* transObj, MsgStream& log) const { - - //log << MSG::INFO << " size = " << persObj->size() << endmsg; - - transObj->reserve(persObj->size()); - - for (unsigned int i=0; i<persObj->size(); ++i) { - - //log << MSG::INFO << " i = " << i << endmsg; - const ZDC_SimStripHit_p1* striphit = &((*persObj)[i]); - - std::unique_ptr<ZDC_SimStripHit> ptr (ZdcStripHitConv.createTransientConst(striphit, log)); - transObj->push_back(*ptr); - } -} diff --git a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/test/ZDC_SimPixelHitCnv_p1_test.cxx b/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/test/ZDC_SimPixelHitCnv_p1_test.cxx deleted file mode 100644 index 216af8e961bababdfea4fd2aba63b90c8bc9c65d..0000000000000000000000000000000000000000 --- a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/test/ZDC_SimPixelHitCnv_p1_test.cxx +++ /dev/null @@ -1,59 +0,0 @@ -/* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration -*/ -/** - * @file ZdcEventTPCnv/test/ZDC_SimPixelHitCnv_p1_test.cxx - * @author scott snyder <snyder@bnl.gov> - * @date Mar, 2016 - * @brief Tests for ZDC_SimPixelHitCnv_p1. - */ - - -#undef NDEBUG -#include "ZdcEventTPCnv/ZDC_SimPixelHitCnv_p1.h" -#include "CxxUtils/checker_macros.h" -#include "TestTools/leakcheck.h" -#include <cassert> -#include <iostream> - - -void compare (const ZDC_SimPixelHit& p1, - const ZDC_SimPixelHit& p2) -{ - assert (p1.GetSide() == p2.GetSide()); - assert (p1.GetMod() == p2.GetMod()); - assert (p1.GetPix() == p2.GetPix()); - assert (p1.GetEdep() == p2.GetEdep()); - assert (p1.GetNPhotons() == p2.GetNPhotons()); -} - - -void testit (const ZDC_SimPixelHit& trans1) -{ - MsgStream log (nullptr, "test"); - ZDC_SimPixelHitCnv_p1 cnv; - ZDC_SimPixelHit_p1 pers; - cnv.transToPers (&trans1, &pers, log); - ZDC_SimPixelHit trans2; - cnv.persToTrans (&pers, &trans2, log); - - compare (trans1, trans2); -} - - -void test1 ATLAS_NOT_THREAD_SAFE () -{ - std::cout << "test1\n"; - Athena_test::Leakcheck check; - - ZDC_SimPixelHit trans1 (123, 234, 345, 21, 12345.5); - - testit (trans1); -} - - -int main ATLAS_NOT_THREAD_SAFE () -{ - test1(); - return 0; -} diff --git a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/test/ZDC_SimPixelHit_CollectionCnv_p1_test.cxx b/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/test/ZDC_SimPixelHit_CollectionCnv_p1_test.cxx deleted file mode 100644 index e49900df6e78b7f29058bf3a53f0ddc17d25ea99..0000000000000000000000000000000000000000 --- a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/test/ZDC_SimPixelHit_CollectionCnv_p1_test.cxx +++ /dev/null @@ -1,74 +0,0 @@ -/* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration -*/ -/** - * @file ZdcEventTPCnv/test/ZDC_SimPixelHit_CollectionCnv_p1_test.cxx - * @author scott snyder <snyder@bnl.gov> - * @date Mar, 2016 - * @brief Tests for ZDC_SimPixelHit_CollectionCnv_p1. - */ - - -#undef NDEBUG -#include "ZdcEventTPCnv/ZDC_SimPixelHit_CollectionCnv_p1.h" -#include "CxxUtils/checker_macros.h" -#include "TestTools/leakcheck.h" -#include <cassert> -#include <iostream> - - -void compare (const ZDC_SimPixelHit& p1, - const ZDC_SimPixelHit& p2) -{ - assert (p1.GetSide() == p2.GetSide()); - assert (p1.GetMod() == p2.GetMod()); - assert (p1.GetPix() == p2.GetPix()); - assert (p1.GetEdep() == p2.GetEdep()); - assert (p1.GetNPhotons() == p2.GetNPhotons()); -} - - -void compare (const ZDC_SimPixelHit_Collection& p1, - const ZDC_SimPixelHit_Collection& 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 ZDC_SimPixelHit_Collection& trans1) -{ - MsgStream log (nullptr, "test"); - ZDC_SimPixelHit_CollectionCnv_p1 cnv; - ZDC_SimPixelHit_Collection_p1 pers; - cnv.transToPers (&trans1, &pers, log); - ZDC_SimPixelHit_Collection trans2; - cnv.persToTrans (&pers, &trans2, log); - - compare (trans1, trans2); -} - - -void test1 ATLAS_NOT_THREAD_SAFE () -{ - std::cout << "test1\n"; - ZDC_SimPixelHit_Collection dum1 ("coll"); - Athena_test::Leakcheck check; - - ZDC_SimPixelHit_Collection trans1 ("coll"); - for (int i = 0; i < 10; i++) { - int o = i*100; - trans1.Emplace (123+o, 234+o, 345+o, 21+o, 12345.5+o); - } - - testit (trans1); -} - - -int main ATLAS_NOT_THREAD_SAFE () -{ - test1(); - return 0; -} diff --git a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/test/ZDC_SimStripHitCnv_p1_test.cxx b/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/test/ZDC_SimStripHitCnv_p1_test.cxx deleted file mode 100644 index e3daef9bd3f92c07866e275000ffbaa04993802c..0000000000000000000000000000000000000000 --- a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/test/ZDC_SimStripHitCnv_p1_test.cxx +++ /dev/null @@ -1,58 +0,0 @@ -/* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration -*/ -/** - * @file ZdcEventTPCnv/test/ZDC_SimStripHitCnv_p1_test.cxx - * @author scott snyder <snyder@bnl.gov> - * @date Mar, 2016 - * @brief Tests for ZDC_SimStripHitCnv_p1. - */ - - -#undef NDEBUG -#include "ZdcEventTPCnv/ZDC_SimStripHitCnv_p1.h" -#include "CxxUtils/checker_macros.h" -#include "TestTools/leakcheck.h" -#include <cassert> -#include <iostream> - - -void compare (const ZDC_SimStripHit& p1, - const ZDC_SimStripHit& p2) -{ - assert (p1.GetSide() == p2.GetSide()); - assert (p1.GetMod() == p2.GetMod()); - assert (p1.GetEdep() == p2.GetEdep()); - assert (p1.GetNPhotons() == p2.GetNPhotons()); -} - - -void testit (const ZDC_SimStripHit& trans1) -{ - MsgStream log (nullptr, "test"); - ZDC_SimStripHitCnv_p1 cnv; - ZDC_SimStripHit_p1 pers; - cnv.transToPers (&trans1, &pers, log); - ZDC_SimStripHit trans2; - cnv.persToTrans (&pers, &trans2, log); - - compare (trans1, trans2); -} - - -void test1 ATLAS_NOT_THREAD_SAFE () -{ - std::cout << "test1\n"; - Athena_test::Leakcheck check; - - ZDC_SimStripHit trans1 (123, 234, 21, 12345.5); - - testit (trans1); -} - - -int main ATLAS_NOT_THREAD_SAFE () -{ - test1(); - return 0; -} diff --git a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/test/ZDC_SimStripHit_CollectionCnv_p1_test.cxx b/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/test/ZDC_SimStripHit_CollectionCnv_p1_test.cxx deleted file mode 100644 index a62f5a3f11ab6be750fa9e5c8221b209dc019cc1..0000000000000000000000000000000000000000 --- a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventTPCnv/test/ZDC_SimStripHit_CollectionCnv_p1_test.cxx +++ /dev/null @@ -1,73 +0,0 @@ -/* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration -*/ -/** - * @file ZdcEventTPCnv/test/ZDC_SimStripHit_CollectionCnv_p1_test.cxx - * @author scott snyder <snyder@bnl.gov> - * @date Mar, 2016 - * @brief Tests for ZDC_SimStripHit_CollectionCnv_p1. - */ - - -#undef NDEBUG -#include "ZdcEventTPCnv/ZDC_SimStripHit_CollectionCnv_p1.h" -#include "CxxUtils/checker_macros.h" -#include "TestTools/leakcheck.h" -#include <cassert> -#include <iostream> - - -void compare (const ZDC_SimStripHit& p1, - const ZDC_SimStripHit& p2) -{ - assert (p1.GetSide() == p2.GetSide()); - assert (p1.GetMod() == p2.GetMod()); - assert (p1.GetEdep() == p2.GetEdep()); - assert (p1.GetNPhotons() == p2.GetNPhotons()); -} - - -void compare (const ZDC_SimStripHit_Collection& p1, - const ZDC_SimStripHit_Collection& 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 ZDC_SimStripHit_Collection& trans1) -{ - MsgStream log (nullptr, "test"); - ZDC_SimStripHit_CollectionCnv_p1 cnv; - ZDC_SimStripHit_Collection_p1 pers; - cnv.transToPers (&trans1, &pers, log); - ZDC_SimStripHit_Collection trans2; - cnv.persToTrans (&pers, &trans2, log); - - compare (trans1, trans2); -} - - -void test1 ATLAS_NOT_THREAD_SAFE () -{ - std::cout << "test1\n"; - ZDC_SimStripHit_Collection dum1 ("coll"); - Athena_test::Leakcheck check; - - ZDC_SimStripHit_Collection trans1 ("coll"); - for (int i = 0; i < 10; i++) { - int o = i*100; - trans1.Emplace (123+o, 234+o, 21+o, 12345.5+o); - } - - testit (trans1); -} - - -int main ATLAS_NOT_THREAD_SAFE () -{ - test1(); - return 0; -}