-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed size_t error in benchmarks cxx files, added preliminary larsoft…
… integration
- Loading branch information
1 parent
37fb492
commit a88edfa
Showing
4 changed files
with
120 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
//////////////////////////////////////////////////////////////////////// | ||
// Class: ISCalcNESTLAr | ||
// Plugin Type: Algorithm | ||
// File: ISCalcNESTLAr.cxx | ||
// Description: | ||
// Aug. 30 by Mu Wei | ||
// Edited by N. Carrara to use LArNEST (05/29/2023) | ||
//////////////////////////////////////////////////////////////////////// | ||
|
||
#include "larsim/IonizationScintillation/ISCalcNESTLAr.h" | ||
#include "larcore/CoreUtils/ServiceUtil.h" | ||
#include "lardata/DetectorInfoServices/LArPropertiesService.h" | ||
#include "lardataalg/DetectorInfo/DetectorPropertiesData.h" | ||
#include "lardataobj/Simulation/SimEnergyDeposit.h" | ||
#include "larevt/SpaceChargeServices/SpaceChargeService.h" | ||
|
||
#include "CLHEP/Random/RandFlat.h" | ||
#include "CLHEP/Random/RandGauss.h" | ||
#include "CLHEP/Units/SystemOfUnits.h" | ||
|
||
#include <algorithm> | ||
|
||
namespace { | ||
constexpr double LAr_Z{18}; | ||
constexpr double Density_LAr{1.393}; | ||
|
||
constexpr double scint_yield{1.0 / (19.5 * CLHEP::eV)}; | ||
constexpr double resolution_scale{0.107}; // Doke 1976 | ||
} | ||
|
||
namespace larg4 { | ||
|
||
//---------------------------------------------------------------------------- | ||
ISCalcNESTLAr::ISCalcNESTLAr(CLHEP::HepRandomEngine& Engine) | ||
: fEngine(Engine), fSCE{lar::providerFrom<spacecharge::SpaceChargeService>()} | ||
{ | ||
LArDetector* detector = new LArDetector(); | ||
mLArNEST = new NEST::LArNEST(detector); | ||
|
||
std::cout << "ISCalcNESTLAr Initialize." << std::endl; | ||
} | ||
|
||
//---------------------------------------------------------------------------- | ||
ISCalcData ISCalcNESTLAr::CalcIonAndScint(detinfo::DetectorPropertiesData const& detProp, | ||
sim::SimEnergyDeposit const& edep) | ||
{ | ||
|
||
std::cout << "HERE IN NEST!" << std::endl; | ||
return {0.0, 0.0, 0.0, 0.0}; | ||
|
||
// return {energyDeposit, | ||
// static_cast<double>(NumElectrons), | ||
// static_cast<double>(NumPhotons), | ||
// GetScintYieldRatio(edep)}; | ||
} | ||
|
||
|
||
|
||
//---------------------------------------------------------------------------- | ||
double ISCalcNESTLAr::EFieldAtStep(double efield, sim::SimEnergyDeposit const& edep) | ||
{ | ||
geo::Point_t pos = edep.MidPoint(); | ||
double EField = efield; | ||
geo::Vector_t eFieldOffsets; | ||
if (fSCE->EnableSimEfieldSCE()) { | ||
eFieldOffsets = fSCE->GetEfieldOffsets(pos); | ||
EField = | ||
std::sqrt((efield + efield * eFieldOffsets.X()) * (efield + efield * eFieldOffsets.X()) + | ||
(efield * eFieldOffsets.Y() * efield * eFieldOffsets.Y()) + | ||
(efield * eFieldOffsets.Z() * efield * eFieldOffsets.Z())); | ||
} | ||
return EField; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
//////////////////////////////////////////////////////////////////////// | ||
// Class: ISCalcNESTLAr | ||
// Plugin Type: Algorithm | ||
// File: ISCalcNESTLAr.cxx | ||
// Description: | ||
// Aug. 30 by Mu Wei | ||
// Edited by N. Carrara to use LArNEST (05/29/2023) | ||
//////////////////////////////////////////////////////////////////////// | ||
|
||
#ifndef LARG4_ISCALCNESTLAr_H | ||
#define LARG4_ISCALCNESTLAr_H | ||
|
||
#include "larsim/IonizationScintillation/ISCalc.h" | ||
#include "LArDetector.hh" | ||
#include "LArNEST.hh" | ||
|
||
namespace spacecharge { | ||
class SpaceCharge; | ||
} | ||
|
||
namespace CLHEP { | ||
class HepRandomEngine; | ||
} | ||
|
||
namespace larg4 { | ||
class ISCalcNESTLAr : public ISCalc { | ||
public: | ||
explicit ISCalcNESTLAr(CLHEP::HepRandomEngine& fEngine); | ||
|
||
double EFieldAtStep(double efield, | ||
sim::SimEnergyDeposit const& edep) | ||
override; //value of field with any corrections for this step | ||
ISCalcData CalcIonAndScint(detinfo::DetectorPropertiesData const& detProp, | ||
sim::SimEnergyDeposit const& edep) override; | ||
|
||
private: | ||
CLHEP::HepRandomEngine& fEngine; // random engine | ||
const spacecharge::SpaceCharge* fSCE; | ||
|
||
NEST::LArNEST* mLArNEST; | ||
}; | ||
} | ||
#endif // LARG4_ISCALCNESTLAr_H |