LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
LArPropertiesServiceArgoNeuT.h
Go to the documentation of this file.
1 // LArPropertiesServiceArgoNeuT.h
3 //
4 // Utility LAr functions
5 //
6 // maddalena.antonello@lngs.infn.it
7 // ornella.palamara@lngs.infn.it
8 // msoderbe@syr.edu
9 // joshua.spitz@yale.edu
10 //
11 // Optical Properties:
12 // bjpjones@mit.edu
13 //
14 // From the original LArProperties.h ; this one preserves the dependency on
15 // DatabaseUtil service and the ability to read information from a database
16 // with direct DB connection.
17 // For new experiments, an indirect connection should be used instead.
18 //
19 // PLEASE DO NOT take this as a model to develop a service:
20 // this is just a backward-compatible hack.
21 //
23 #ifndef LARPROPERTIESSERVICEARGONEUT_H
24 #define LARPROPERTIESSERVICEARGONEUT_H
25 
28 
29 #include "fhiclcpp/ParameterSet.h"
33 #include "string.h"
34 
35 
36 
38 namespace util{
50  : public detinfo::LArProperties // implements provider interface
51  , public detinfo::LArPropertiesService // implements service interface
52  {
53  public:
54 
55  //------------------------------------------------------------------------
57 
58  //------------------------------------------------------------------------
59  //--- service interface
62 
63  virtual ~LArPropertiesServiceArgoNeuT() = default;
64 
65  virtual void reconfigure(fhicl::ParameterSet const& pset) override;
66  virtual const detinfo::LArProperties* provider() const override { return this; }
67 
68  //------------------------------------------------------------------------
69  //--- service provider interface
70 
72  virtual double AtomicNumber() const override { return fZ; }
74  virtual double AtomicMass() const override { return fA; }
76  virtual double ExcitationEnergy() const override { return fI; }
77 
78  virtual double RadiationLength() const override { return fRadiationLength; }
79  virtual double Argon39DecayRate() const override { return fArgon39DecayRate; }
80 
81 
82  virtual double ScintResolutionScale() const override { return fScintResolutionScale; }
83  virtual double ScintFastTimeConst() const override { return fScintFastTimeConst; }
84  virtual double ScintSlowTimeConst() const override { return fScintSlowTimeConst; }
85  virtual double ScintBirksConstant() const override { return fScintBirksConstant; }
86 
87  virtual bool ScintByParticleType() const override { return fScintByParticleType; }
88 
89  virtual double ScintYield(bool prescale = false) const override { return fScintYield * ScintPreScale(prescale);}
90  virtual double ScintPreScale(bool prescale = true) const override { return (prescale ? fScintPreScale : 1); }
91  virtual double ScintYieldRatio() const override { return fScintYieldRatio; }
92 
93  virtual double ProtonScintYield(bool prescale = false) const override { return fProtonScintYield * ScintPreScale(prescale); }
94  virtual double ProtonScintYieldRatio() const override { return fProtonScintYieldRatio; }
95  virtual double MuonScintYield(bool prescale = false) const override { return fMuonScintYield * ScintPreScale(prescale); }
96  virtual double MuonScintYieldRatio() const override { return fMuonScintYieldRatio; }
97  virtual double KaonScintYield(bool prescale = false) const override { return fKaonScintYield * ScintPreScale(prescale); }
98  virtual double KaonScintYieldRatio() const override { return fKaonScintYieldRatio; }
99  virtual double PionScintYield(bool prescale = false) const override { return fPionScintYield * ScintPreScale(prescale); }
100  virtual double PionScintYieldRatio() const override { return fPionScintYieldRatio; }
101  virtual double ElectronScintYield(bool prescale = false) const override { return fElectronScintYield * ScintPreScale(prescale);}
102  virtual double ElectronScintYieldRatio() const override { return fElectronScintYieldRatio; }
103  virtual double AlphaScintYield(bool prescale = false) const override { return fAlphaScintYield * ScintPreScale(prescale); }
104  virtual double AlphaScintYieldRatio() const override { return fAlphaScintYieldRatio; }
105 
106  virtual bool CerenkovLightEnabled() const override { return fEnableCerenkovLight; }
107 
108  virtual std::map<double, double> SlowScintSpectrum() const override;
109  virtual std::map<double, double> FastScintSpectrum() const override;
110  virtual std::map<double, double> RIndexSpectrum() const override;
111  virtual std::map<double, double> AbsLengthSpectrum() const override;
112  virtual std::map<double, double> RayleighSpectrum() const override;
113 
114  virtual std::map<std::string, std::map<double, double> > SurfaceReflectances() const override;
115  virtual std::map<std::string, std::map<double, double> > SurfaceReflectanceDiffuseFractions() const override;
116 
117 
118  //------------------------------------------------------------------------
119 
120  // this stuff is moved to DetectorProperties
121  double DriftVelocity(double efield=0., double temperature=0.) const;
122  double Efield(unsigned int planegap=0) const;
123  double ElectronLifetime() const;
124  double Density(double temperature=0.) const;
125  double Temperature() const;
126 
128  double Eloss(double mom, double mass, double tcut) const;
129 
131  double ElossVar(double mom, double mass) const;
132 
134  double BirksCorrection(double dQdX) const;
135  double ModBoxCorrection(double dQdX) const;
136  virtual bool ExtraMatProperties() const override { return fExtraMatProperties; }
137  virtual double TpbTimeConstant() const override { return fTpbTimeConstant; }
138 
139  private:
140 
141  void preBeginRun(art::Run const& run);
142  void checkDBstatus() const;
143 
144 
145  std::vector< double > fEfield;
146  double fTemperature;
151 
153 
155 
156  // Following parameters are for use in Bethe-Bloch formula for dE/dx.
157 
158  double fZ;
159  double fA;
160  double fI;
161  double fSa;
162  double fSk;
163  double fSx0;
164  double fSx1;
165  double fScbar;
166 
167 
168  // Optical parameters for LAr
169 
170  std::vector<double> fFastScintSpectrum;
171  std::vector<double> fFastScintEnergies;
172  std::vector<double> fSlowScintSpectrum;
173  std::vector<double> fSlowScintEnergies;
174  std::vector<double> fRIndexSpectrum;
175  std::vector<double> fRIndexEnergies;
176  std::vector<double> fAbsLengthSpectrum;
177  std::vector<double> fAbsLengthEnergies;
178  std::vector<double> fRayleighSpectrum;
179  std::vector<double> fRayleighEnergies;
180 
182  virtual std::map<double, double> TpbAbs() const override;
183  virtual std::map<double, double> TpbEm() const override;
185 
186 
188 
201 
202  double fScintYield;
209 
211 
212  std::vector<std::string> fReflectiveSurfaceNames;
213  std::vector<double> fReflectiveSurfaceEnergies;
214  std::vector<std::vector<double> > fReflectiveSurfaceReflectances;
215  std::vector<std::vector<double> > fReflectiveSurfaceDiffuseFractions;
216 
217  std::vector<double> fTpbEmmisionEnergies;
218  std::vector<double> fTpbEmmisionSpectrum;
219  std::vector<double> fTpbAbsorptionEnergies;
220  std::vector<double> fTpbAbsorptionSpectrum;
221 
222 
224  DBsettingsClass();
225 
228  }; // DBsettingsClass
229 
231 
232  }; // class LArPropertiesServiceArgoNeuT
233 
236 
237 } //namespace util
239 #endif // LARPROPERTIESSERVICEARGONEUT_H
bool ShouldConnect
equivalent parameter in DatabaseUtil
virtual ~LArPropertiesServiceArgoNeuT()=default
virtual std::map< double, double > RIndexSpectrum() const override
Namespace for general, non-LArSoft-specific utilities.
Definition: PIDAAlg.h:17
virtual double KaonScintYieldRatio() const override
virtual std::map< double, double > SlowScintSpectrum() const override
virtual bool CerenkovLightEnabled() const override
virtual double ExcitationEnergy() const override
Ar mean excitation energy (eV)
std::vector< std::string > fReflectiveSurfaceNames
virtual double ProtonScintYield(bool prescale=false) const override
DBsettingsClass DBsettings
settings read from DB access
double ElossVar(double mom, double mass) const
Energy loss fluctuation (sigma_E^2 / length in MeV^2/cm).
double DriftVelocity(double efield=0., double temperature=0.) const
cm/us
virtual double AtomicMass() const override
Ar atomic mass (g/mol)
virtual bool ScintByParticleType() const override
virtual double ScintFastTimeConst() const override
virtual double Argon39DecayRate() const override
decays per cm^3 per second
virtual std::map< double, double > FastScintSpectrum() const override
virtual double ElectronScintYield(bool prescale=false) const override
LArPropertiesServiceArgoNeuT(fhicl::ParameterSet const &pset, art::ActivityRegistry &reg)
virtual double ScintResolutionScale() const override
Definition: Run.h:30
virtual std::map< double, double > TpbEm() const override
virtual double KaonScintYield(bool prescale=false) const override
virtual void reconfigure(fhicl::ParameterSet const &pset) override
virtual double ScintYield(bool prescale=false) const override
virtual double ScintBirksConstant() const override
double fArgon39DecayRate
decays per cm^3 per second
double Efield(unsigned int planegap=0) const
kV/cm
Properties related to liquid argon environment in the detector.
virtual double PionScintYield(bool prescale=false) const override
virtual double ScintSlowTimeConst() const override
bool ToughErrorTreatment
equivalent parameter in DatabaseUtil
virtual std::map< double, double > AbsLengthSpectrum() const override
virtual double ElectronScintYieldRatio() const override
virtual double RadiationLength() const override
g/cm^2
bool fAlreadyReadFromDB
tests whether the values have alread been picked up from the Database
virtual std::map< std::string, std::map< double, double > > SurfaceReflectances() const override
virtual double TpbTimeConstant() const override
virtual std::map< std::string, std::map< double, double > > SurfaceReflectanceDiffuseFractions() const override
double BirksCorrection(double dQdX) const
dQ/dX in electrons/cm, returns dE/dX in MeV/cm.
virtual const detinfo::LArProperties * provider() const override
virtual double MuonScintYield(bool prescale=false) const override
double Eloss(double mom, double mass, double tcut) const
Restricted mean dE/dx energy loss (MeV/cm).
double fI
Ar mean excitation energy (eV)
virtual std::map< double, double > TpbAbs() const override
std::vector< std::vector< double > > fReflectiveSurfaceReflectances
std::vector< std::vector< double > > fReflectiveSurfaceDiffuseFractions
virtual double AtomicNumber() const override
Ar atomic number.
virtual double AlphaScintYieldRatio() const override
double Density(double temperature=0.) const
g/cm^3
virtual bool ExtraMatProperties() const override
virtual double ProtonScintYieldRatio() const override
virtual double PionScintYieldRatio() const override
virtual double ScintYieldRatio() const override
virtual std::map< double, double > RayleighSpectrum() const override
#define DECLARE_ART_SERVICE_INTERFACE_IMPL(svc, iface, scope)
virtual double ScintPreScale(bool prescale=true) const override
virtual double MuonScintYieldRatio() const override
double fScbar
Sternheimer parameter Cbar.
virtual double AlphaScintYield(bool prescale=false) const override