diff --git a/LArCalorimeter/LArG4/LArG4Barrel/src/LArBarrelPresamplerGeometry.cxx b/LArCalorimeter/LArG4/LArG4Barrel/src/LArBarrelPresamplerGeometry.cxx index a35f12952405f7da7934c06043d774f290635f0d..0abf8818d1c91bab4ae94ba7adda2fac613ba699 100644 --- a/LArCalorimeter/LArG4/LArG4Barrel/src/LArBarrelPresamplerGeometry.cxx +++ b/LArCalorimeter/LArG4/LArG4Barrel/src/LArBarrelPresamplerGeometry.cxx @@ -53,6 +53,7 @@ namespace LArG4 { : base_class(name, pSvcLocator) { declareProperty("DetectorName",m_detectorName); + declareProperty("TestBeam", m_testbeam); } //===================================================================================== @@ -125,7 +126,6 @@ namespace LArG4 { const G4NavigationHistory* g4navigation = a_step->GetPreStepPoint()->GetTouchable()->GetHistory(); const G4int ndep = g4navigation->GetDepth(); bool iactive(false); - bool isTestBeam(false); G4int idep(-999); /** Now navigate through the volumes hierarchy */ @@ -133,16 +133,15 @@ namespace LArG4 { // FIXME Need to find a way to avoid these string-comparisons const G4String& vname = g4navigation->GetVolume(ii)->GetName(); if (idep<0 && vname==fullPSName) idep=ii; // half barrel - else if (!isTestBeam && vname==fullCryoName) isTestBeam=true; // TB or not ? else if (!iactive && vname==fullModuleName) iactive=true; } if (idep < 0) std::abort(); if ( iactive ) { - return this->CalculatePSActiveIdentifier( a_step , idep , isTestBeam ); + return this->CalculatePSActiveIdentifier( a_step , idep ); } - return this->CalculatePS_DMIdentifier( a_step , idep , isTestBeam); + return this->CalculatePS_DMIdentifier( a_step , idep ); } // ========================================================================================== @@ -151,7 +150,7 @@ namespace LArG4 { used for calibration hit even if the hit is not really in the "fiducial" active part */ - LArG4Identifier Geometry::CalculatePSActiveIdentifier(const G4Step* a_step, const G4int ind, const bool isTestBeam) const + LArG4Identifier Geometry::CalculatePSActiveIdentifier(const G4Step* a_step, const G4int ind) const { LArG4Identifier PSActiveID = LArG4Identifier(); @@ -167,7 +166,7 @@ namespace LArG4 { const G4NavigationHistory* g4navigation = a_step->GetPreStepPoint()->GetTouchable()->GetHistory(); const G4ThreeVector ploc = g4navigation->GetTransform(ind).TransformPoint(p); - const G4int zSide(this->determineZSide(isTestBeam, p.z())); + const G4int zSide(this->determineZSide(p.z())); CalcData currentCellData; (void)this->findCell(currentCellData,ploc.x(),ploc.y(),ploc.z()); @@ -202,7 +201,7 @@ namespace LArG4 { //========================================================================================== - LArG4Identifier Geometry::CalculatePS_DMIdentifier(const G4Step* a_step, const G4int ind, const bool isTestBeam) const + LArG4Identifier Geometry::CalculatePS_DMIdentifier(const G4Step* a_step, const G4int ind) const { /****************************************************************************** @@ -249,7 +248,7 @@ namespace LArG4 { #endif // 01-Feb-2001 WGS: Add zSide calculation. - const G4int zSide(this->determineZSide(isTestBeam, p.z())); + const G4int zSide(this->determineZSide(p.z())); /** eta,phi in "local" half barrel coordinates */ const G4double phi = (ploc2.phi() < 0.) ? ploc2.phi()+2.*M_PI : ploc2.phi(); diff --git a/LArCalorimeter/LArG4/LArG4Barrel/src/LArBarrelPresamplerGeometry.h b/LArCalorimeter/LArG4/LArG4Barrel/src/LArBarrelPresamplerGeometry.h index dea8b3666a5eafb1abe1f548b58cc07d14ada99a..de81a078b7888a4832ef68a9d9b370403f69cc9b 100644 --- a/LArCalorimeter/LArG4/LArG4Barrel/src/LArBarrelPresamplerGeometry.h +++ b/LArCalorimeter/LArG4/LArG4Barrel/src/LArBarrelPresamplerGeometry.h @@ -39,13 +39,13 @@ namespace LArG4 { virtual bool findCell(CalcData & currentCellData, G4double xloc,G4double yloc,G4double zloc) const override final; private: - LArG4Identifier CalculatePSActiveIdentifier( const G4Step* , const G4int indPS , const bool itb ) const; - LArG4Identifier CalculatePS_DMIdentifier( const G4Step* , const G4int indPS , const bool itb) const; + LArG4Identifier CalculatePSActiveIdentifier( const G4Step* , const G4int indPS ) const; + LArG4Identifier CalculatePS_DMIdentifier( const G4Step* , const G4int indPS ) const; - inline G4int determineZSide(const bool isTestBeam, const double zCoord) const { + inline G4int determineZSide(const double zCoord) const { // in TB case, only 1 side, // in Atlas case, use overall z to decide side - if (isTestBeam) { return 1; } + if (m_testbeam) { return 1; } if (zCoord > 0.) { return 1; } return -1; } @@ -72,7 +72,8 @@ namespace LArG4 { G4int m_ncell_module[8]{}; // total LAr thickness G4double m_halfThickLAr{0.5*13.*Athena::Units::mm}; // LAr total gap - + // is this a test beam simulation job + bool m_testbeam{false}; } ;