29 : fNumberTimeSamples(pset.get< unsigned int >(
"NumberTimeSamples"))
32 (lar::providerFrom<detinfo::LArPropertiesService>());
37 <<
"DetectorPropertiesServiceArgoNeuT service requires" 38 " LArPropertiesServiceArgoNeuT";
52 return lar::providerFrom<detinfo::DetectorClocksService>()->TPCTDC2Tick(tdc);
58 return lar::providerFrom<detinfo::DetectorClocksService>()->TPCTick2TDC(ticks);
69 throw cet::exception(__FUNCTION__) <<
"SamplingRate is a deprecated fcl parameter for DetectorPropertiesServiceArgoNeuT!";
71 throw cet::exception(__FUNCTION__) <<
"TriggerOffset is a deprecated fcl parameter for DetectorPropertiesServiceArgoNeuT!";
73 throw cet::exception(__FUNCTION__) <<
"InheritTriggerOffset is a deprecated fcl parameter for DetectorPropertiesServiceArgoNeuT!";
87 fTPCClock = lar::providerFrom<detinfo::DetectorClocksService>()->TPCClock();
99 fTPCClock = lar::providerFrom<detinfo::DetectorClocksService>()->TPCClock();
109 throw cet::exception(
"DetectorPropertiesServiceArgoNeuT") <<
" Extracting values from DetectorPropertiesServiceArgoNeuT before they " 110 <<
" have been read in from database. \n " 111 <<
"Set ToughErrorTreatment or ShouldConnect " 112 <<
" to false in databaseutil.fcl if you want " 113 <<
" to avoid this. \n";
116 mf::LogWarning(
"DetectorPropertiesServiceArgoNeuT") <<
"!!! Extracting values from DetectorPropertiesServiceArgoNeuT before they " 117 <<
" have been read in from the database. \n " 118 <<
" You may not be using the correct values of " 120 <<
" You should not be initializing" 121 <<
" Database originating values in BeginJob()s or constructors." 122 <<
" You have been warned !!! \n ";
130 return fTPCClock.
Ticks(lar::providerFrom<detinfo::DetectorClocksService>()->TriggerOffsetTPC() * -1.);
189 for(
size_t cstat = 0; cstat < geo->
Ncryostats(); ++cstat){
193 for(
size_t tpc = 0; tpc < geo->
Cryostat(cstat).
NTPC(); ++tpc) {
199 int nplane = tpcgeom.
Nplanes();
201 for(
int plane = 0; plane < nplane; ++plane) {
207 double driftVelocitygap[3];
208 double fXTicksCoefficientgap[3];
209 for (
int igap = 0; igap<3; ++igap){
210 efieldgap[igap] =
Efield(igap);
211 driftVelocitygap[igap] =
DriftVelocity(efieldgap[igap], temperature);
212 fXTicksCoefficientgap[igap] = 0.001 * driftVelocitygap[igap] * samplingRate;
232 for (
int ip = 0; ip < plane; ++ip){
247 for (
int ip = 0; ip < plane; ++ip){
262 throw cet::exception(
"DetectorPropertiesServiceArgoNeuT") <<
"Bad view = " 333 if(filename.size() != 0) {
335 TFile*
file = TFile::Open(filename.c_str(),
"READ");
336 if(file != 0 && !file->IsZombie() && file->IsOpen()) {
344 unsigned int iNumberTimeSamples = 0;
345 unsigned int nNumberTimeSamples = 0;
347 sqlite3_stmt * stmt = 0;
348 sqlite3_prepare_v2(sqliteDB,
"SELECT PSetBlob from ParameterSets;", -1, &stmt, NULL);
349 while (sqlite3_step(stmt) == SQLITE_ROW) {
360 unsigned int newNumberTimeSamples = ps.
get<
unsigned int>(
"NumberTimeSamples");
364 if(newNumberTimeSamples !=
fPS.
get<
unsigned int>(
"NumberTimeSamples")) {
365 if(nNumberTimeSamples == 0)
366 iNumberTimeSamples = newNumberTimeSamples;
367 else if(newNumberTimeSamples != iNumberTimeSamples) {
369 <<
"Historical values of NumberTimeSamples do not agree: " 370 << iNumberTimeSamples <<
" " << newNumberTimeSamples <<
"\n" ;
372 ++nNumberTimeSamples;
382 nNumberTimeSamples != 0 &&
385 <<
"Overriding configuration parameter NumberTimeSamples using historical value.\n" 387 <<
" Historical (used) value: " << iNumberTimeSamples <<
"\n";
Namespace for general, non-LArSoft-specific utilities.
double PlanePitch(unsigned int p1=0, unsigned int p2=1) const
Returns the center of the TPC volume in world coordinates [cm].
double Temperature() const
kelvin
Encapsulate the construction of a single cyostat.
double fTimeOffsetU
time offsets to convert spacepoint
bool fXTicksParamsLoaded
calculations
#define DEFINE_ART_SERVICE_INTERFACE_IMPL(svc, iface)
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
virtual double ConvertTDCToTicks(double tdc) const override
unsigned int Nplanes() const
Number of planes in this tpc.
double fTimeOffsetV
coordinates to hit times on each
double fElectronsToADC
conversion factor for # of ionization electrons to 1 ADC count
double fXTicksCoefficient
Parameters for x<–>ticks.
Geometry information for a single TPC.
Planes which measure Z direction.
void make_ParameterSet(intermediate_table const &tbl, ParameterSet &ps)
int Ticks() const
Current clock tick (that is, the number of tick Time() falls in).
DetectorPropertiesServiceArgoNeuT(fhicl::ParameterSet const &pset, art::ActivityRegistry ®)
virtual double GetXTicksCoefficient() const override
Drift towards negative X values.
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
virtual int TriggerOffset() const override
virtual double ConvertTicksToX(double ticks, int p, int t, int c) const override
virtual double ConvertXToTicks(double X, int p, int t, int c) const override
View_t View() const
Which coordinate does this plane measure.
bool fInheritNumberTimeSamples
Flag saying whether to inherit NumberTimeSamples.
Properties related to liquid argon environment in the detector.
T get(std::string const &key) const
virtual double DriftVelocity(double efield=0., double temperature=0.) const override
Geometry information for a single wire plane.The plane is represented in the geometry by a solid whic...
virtual double Efield(unsigned int planegap=0) const override
< kV/cm
unsigned int NTPC() const
Number of TPCs in this cryostat.
CryostatGeo const & Cryostat(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
unsigned int fReadOutWindowSize
number of clock ticks per readout window
void checkDBstatus() const
bool get_if_present(std::string const &key, T &value) const
std::vector< std::vector< double > > fDriftDirection
void preProcessEvent(const art::Event &evt)
DriftDirection_t DriftDirection() const
Returns an enumerator value describing the drift direction.
void CalculateXTicksParams() const
void postOpenFile(std::string const &filename)
fhicl::ParameterSet fPS
Original parameter set.
virtual double SamplingRate() const override
Returns the period of the TPC readout electronics clock.
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
bool fAlreadyReadFromDB
tests whether the values have alread been picked up from the Database
virtual double GetXTicksOffset(int p, int t, int c) const override
Encapsulate the construction of a single detector plane.
const TPCGeo & TPC(unsigned int itpc) const
Return the itpc'th TPC in the cryostat.
unsigned int fNumberTimeSamples
number of clock ticks per event
GlobalSignal< detail::SignalResponseType::FIFO, void(Event const &)> sPreProcessEvent
std::vector< std::vector< std::vector< double > > > fXTicksOffsets
GlobalSignal< detail::SignalResponseType::LIFO, void(std::string const &)> sPostOpenFile
util::LArPropertiesServiceArgoNeuT const * fLP
Pointer to the specific LArPropertiesServiceArgoNeuT service (provider)
static bool isDetectorPropertiesServiceArgoNeuT(const fhicl::ParameterSet &ps)
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
detinfo::ElecClock fTPCClock
TPC electronics clock.
PlaneGeo const & Plane(geo::View_t view) const
Return the plane in the tpc with View_t view.
virtual double ConvertTicksToTDC(double ticks) const override
virtual void reconfigure(fhicl::ParameterSet const &pset) override
Namespace collecting geometry-related classes utilities.
const double * PlaneLocation(unsigned int p) const
Returns the coordinates of the center of the specified plane [cm].
art framework interface to geometry description
cet::coded_exception< error, detail::translate > exception
Encapsulate the construction of a single detector plane.