LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
DetectorClocks.h
Go to the documentation of this file.
1 
9 #ifndef LARDATA_DETECTORINFO_DETECTORCLOCKS_H
10 #define LARDATA_DETECTORINFO_DETECTORCLOCKS_H
11 
13 
14 namespace detinfo{
15 
27  };
28 
299 
300  public:
301  DetectorClocks(const DetectorClocks &) = delete;
302  DetectorClocks(DetectorClocks &&) = delete;
303  DetectorClocks& operator = (const DetectorClocks &) = delete;
305  virtual ~DetectorClocks() = default;
306 
307  // --- BEGIN Configuration information -------------------------------------
310 
313  virtual std::vector<std::string> ConfigNames() const = 0;
314 
318  virtual std::vector<double> ConfigValues() const = 0;
319 
321  // --- END Configuration information ---------------------------------------
322 
323 
324 
325  // --- BEGIN Time points and intervals -------------------------------------
328 
343  virtual double TriggerOffsetTPC() const = 0;
344 
346  virtual double TriggerTime() const = 0;
347 
349  virtual double TPCTime() const = 0;
350 
352  virtual double BeamGateTime() const = 0;
353 
354 
355 
357  // --- END Time points and intervals ---------------------------------------
358 
359 
360 
361  // --- BEGIN Time conversions ----------------------------------------------
364 
366  virtual double G4ToElecTime(double g4_time) const = 0;
367 
368  //
369  // Getters for time [us] w.r.t. trigger given information from waveform
370  //
371 
373  virtual double TPCTick2TrigTime(double tick) const = 0;
375  virtual double TPCTick2BeamTime(double tick) const = 0;
376 
377 
379  // --- END Time conversions ------------------------------------------------
380 
381 
382 
383  // --- BEGIN Electronics clocks --------------------------------------------
385 
412  //
413  // Getters of TPC ElecClock
414  //
431  virtual const ::detinfo::ElecClock& TPCClock() const = 0;
432 
447  virtual ::detinfo::ElecClock TPCClock(double time) const = 0;
448 
464  virtual detinfo::ElecClock TPCClock(unsigned int sample,unsigned int frame) const = 0;
465 
466 
467  //
468  // Getters of Optical ElecClock
469  //
486  virtual const detinfo::ElecClock& OpticalClock() const = 0;
487 
502  virtual detinfo::ElecClock OpticalClock(double time) const = 0;
503 
518  virtual detinfo::ElecClock OpticalClock(unsigned int sample, unsigned int frame) const = 0;
519 
520 
521  //
522  // Getters of Trigger ElecClock
523  //
542  virtual const detinfo::ElecClock& TriggerClock() const = 0;
543 
560  virtual detinfo::ElecClock TriggerClock(double time) const = 0;
561 
580  virtual detinfo::ElecClock TriggerClock(unsigned int sample, unsigned int frame) const = 0;
581 
582 
583  //
584  // Getters of External ElecClock
585  //
601  virtual const detinfo::ElecClock& ExternalClock() const = 0;
602 
616  virtual detinfo::ElecClock ExternalClock(double time) const = 0;
617 
633  virtual detinfo::ElecClock ExternalClock(unsigned int sample, unsigned int frame) const = 0;
634 
636  // --- END Electronics clocks ----------------------------------------------
637 
638 
639 
640  // --- BEGIN Conversions from electronics waveform ticks -------------------
642 
649 
656  virtual double TPCTDC2Tick(double tdc) const = 0;
657 
674  virtual double TPCTick2TDC(double tick) const = 0;
675 
684  virtual double TPCTick2Time(double tick) const = 0;
685 
686 
711  virtual double OpticalTick2TrigTime(double tick, size_t sample, size_t frame) const = 0;
712 
726  virtual double OpticalTick2BeamTime(double tick, size_t sample, size_t frame) const = 0;
727 
749  virtual double OpticalTick2TDC(double tick, size_t sample, size_t frame) const = 0;
750 
771  virtual double OpticalTick2Time(double tick, size_t sample, size_t frame) const = 0;
772 
773 
786  virtual double ExternalTick2TrigTime(double tick, size_t sample, size_t frame) const = 0;
787 
800  virtual double ExternalTick2BeamTime(double tick, size_t sample, size_t frame) const = 0;
801 
803 
815  virtual double ExternalTick2TDC(double tick, size_t sample, size_t frame) const = 0;
816 
836  virtual double ExternalTick2Time(double tick, size_t sample, size_t frame) const = 0;
837 
839  // --- END Conversions from electronics waveform ticks ---------------------
840 
841 
842 
843  // --- BEGIN Conversions to electronics waveform ticks ---------------------
845 
865  virtual double TPCG4Time2TDC(double g4time) const = 0;
866 
879  virtual double TPCG4Time2Tick(double g4time) const = 0;
880 
881 
900  virtual double OpticalG4Time2TDC(double g4time) const = 0;
901 
913  virtual double ExternalG4Time2TDC(double g4time) const = 0;
914 
916  // --- END Conversions to electronics waveform ticks ---------------------
917 
918 
919  protected:
920  DetectorClocks() = default;
921 
922  }; // class DetectorClocks
923 
924 } //namespace detinfo
925 
926 
927 #endif // LARDATA_DETECTORINFO_DETECTORCLOCKS_H
virtual double TPCTDC2Tick(double tdc) const =0
Given electronics clock count [tdc] returns TPC time-tick.
virtual const ::detinfo::ElecClock & TPCClock() const =0
Lends a constant TPC clock with time set to trigger time.
virtual double BeamGateTime() const =0
Beam gate opening time (in electronics time frame) [µs].
virtual double TriggerTime() const =0
Harware trigger time (in electronics time frame) [µs].
virtual double TriggerOffsetTPC() const =0
Time offset from hardware trigger to TPC electronics start time.
virtual double OpticalG4Time2TDC(double g4time) const =0
Converts a simulation time into optical electronics time ticks.
virtual const detinfo::ElecClock & TriggerClock() const =0
Lends a constant trigger clock with time set to trigger time.
virtual double TPCTick2Time(double tick) const =0
Converts a TPC electronics tick into electronics time [µs].
virtual double OpticalTick2BeamTime(double tick, size_t sample, size_t frame) const =0
Converts an optical time tick into a beam gate time [µs].
virtual double TPCG4Time2Tick(double g4time) const =0
Converts simulation time into a TPC electronics time tick.
virtual double TPCTick2BeamTime(double tick) const =0
Converts a TPC time (in ticks) into a beam gate time [µs].
virtual ~DetectorClocks()=default
virtual double TPCTime() const =0
Returns the TPC electronics start time in electronics time.
virtual std::vector< double > ConfigValues() const =0
virtual double OpticalTick2TrigTime(double tick, size_t sample, size_t frame) const =0
Converts an optical time tick into a trigger time [µs].
General LArSoft Utilities.
virtual double G4ToElecTime(double g4_time) const =0
Given a simulation time [ns], converts it into electronics time [µs].
virtual const detinfo::ElecClock & ExternalClock() const =0
Lends a constant external clock with time set to trigger time.
Conversion of times between different formats and references.
virtual double OpticalTick2Time(double tick, size_t sample, size_t frame) const =0
Converts an optical time tick into time from the first optical frame [µs].
virtual double ExternalG4Time2TDC(double g4time) const =0
Converts a simulation time into external electronics time ticks.
virtual double TPCG4Time2TDC(double g4time) const =0
Converts simulation time into a electronics time tick.
virtual double TPCTick2TDC(double tick) const =0
Converts a TPC time tick into a electronics time tick.
virtual double ExternalTick2TDC(double tick, size_t sample, size_t frame) const =0
Given External time-tick (waveform index), sample and frame number, returns time electronics clock co...
virtual double ExternalTick2BeamTime(double tick, size_t sample, size_t frame) const =0
Converts an external time tick into a beam gate time [µs].
virtual const detinfo::ElecClock & OpticalClock() const =0
Lends a constant optical clock with time set to trigger time.
virtual double OpticalTick2TDC(double tick, size_t sample, size_t frame) const =0
Converts an optical time tick into ticks from the first optical frame.
Class def header for a class ElecClock.
virtual std::vector< std::string > ConfigNames() const =0
virtual double TPCTick2TrigTime(double tick) const =0
Converts a TPC time (in ticks) into a trigger time [µs].
Class representing the time measured by an electronics clock.
Definition: ElecClock.h:91
virtual double ExternalTick2Time(double tick, size_t sample, size_t frame) const =0
Converts an external time tick into time from the first external frame [µs].
virtual double ExternalTick2TrigTime(double tick, size_t sample, size_t frame) const =0
Converts an external time tick into a trigger time [µs].
DetectorClocks & operator=(const DetectorClocks &)=delete