LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
DetectorClocks.h
Go to the documentation of this file.
1 
9 #ifndef LARDATAALG_DETECTORINFO_DETECTORCLOCKS_H
10 #define LARDATAALG_DETECTORINFO_DETECTORCLOCKS_H
11 
13 
14 // C++ libraries
15 #include <vector>
16 #include <string>
17 
18 
19 namespace detinfo{
20 
32  };
33 
306 
307  public:
308  DetectorClocks(const DetectorClocks &) = delete;
309  DetectorClocks(DetectorClocks &&) = delete;
310  DetectorClocks& operator = (const DetectorClocks &) = delete;
312  virtual ~DetectorClocks() = default;
313 
314  // --- BEGIN Configuration information -------------------------------------
317 
320  virtual std::vector<std::string> ConfigNames() const = 0;
321 
325  virtual std::vector<double> ConfigValues() const = 0;
326 
328  // --- END Configuration information ---------------------------------------
329 
330 
331 
332  // --- BEGIN Time points and intervals -------------------------------------
335 
350  virtual double TriggerOffsetTPC() const = 0;
351 
353  virtual double TriggerTime() const = 0;
354 
356  virtual double TPCTime() const = 0;
357 
359  virtual double BeamGateTime() const = 0;
360 
361 
363  // --- END Time points and intervals ---------------------------------------
364 
365 
366 
367  // --- BEGIN Time conversions ----------------------------------------------
370 
372  virtual double G4ToElecTime(double g4_time) const = 0;
373 
374  //
375  // Getters for time [us] w.r.t. trigger given information from waveform
376  //
377 
379  virtual double TPCTick2TrigTime(double tick) const = 0;
381  virtual double TPCTick2BeamTime(double tick) const = 0;
382 
383 
385  // --- END Time conversions ------------------------------------------------
386 
387 
388 
389  // --- BEGIN Electronics clocks --------------------------------------------
391 
418  //
419  // Getters of TPC ElecClock
420  //
437  virtual const ::detinfo::ElecClock& TPCClock() const = 0;
438 
453  virtual ::detinfo::ElecClock TPCClock(double time) const = 0;
454 
470  virtual detinfo::ElecClock TPCClock(unsigned int sample,unsigned int frame) const = 0;
471 
472 
473  //
474  // Getters of Optical ElecClock
475  //
492  virtual const detinfo::ElecClock& OpticalClock() const = 0;
493 
508  virtual detinfo::ElecClock OpticalClock(double time) const = 0;
509 
524  virtual detinfo::ElecClock OpticalClock(unsigned int sample, unsigned int frame) const = 0;
525 
526 
527  //
528  // Getters of Trigger ElecClock
529  //
548  virtual const detinfo::ElecClock& TriggerClock() const = 0;
549 
566  virtual detinfo::ElecClock TriggerClock(double time) const = 0;
567 
586  virtual detinfo::ElecClock TriggerClock(unsigned int sample, unsigned int frame) const = 0;
587 
588 
589  //
590  // Getters of External ElecClock
591  //
607  virtual const detinfo::ElecClock& ExternalClock() const = 0;
608 
622  virtual detinfo::ElecClock ExternalClock(double time) const = 0;
623 
639  virtual detinfo::ElecClock ExternalClock(unsigned int sample, unsigned int frame) const = 0;
640 
642  // --- END Electronics clocks ----------------------------------------------
643 
644 
645  // --- BEGIN Conversions from electronics time -----------------------------
647 
672  virtual double Time2Tick(double time) const = 0;
673 
675  // --- END Conversions from electronics time -------------------------------
676 
677 
678  // --- BEGIN Conversions from electronics waveform ticks -------------------
680 
687 
694  virtual double TPCTDC2Tick(double tdc) const = 0;
695 
712  virtual double TPCTick2TDC(double tick) const = 0;
713 
722  virtual double TPCTick2Time(double tick) const = 0;
723 
724 
749  virtual double OpticalTick2TrigTime(double tick, size_t sample, size_t frame) const = 0;
750 
764  virtual double OpticalTick2BeamTime(double tick, size_t sample, size_t frame) const = 0;
765 
787  virtual double OpticalTick2TDC(double tick, size_t sample, size_t frame) const = 0;
788 
809  virtual double OpticalTick2Time(double tick, size_t sample, size_t frame) const = 0;
810 
811 
824  virtual double ExternalTick2TrigTime(double tick, size_t sample, size_t frame) const = 0;
825 
838  virtual double ExternalTick2BeamTime(double tick, size_t sample, size_t frame) const = 0;
839 
841 
853  virtual double ExternalTick2TDC(double tick, size_t sample, size_t frame) const = 0;
854 
874  virtual double ExternalTick2Time(double tick, size_t sample, size_t frame) const = 0;
875 
877  // --- END Conversions from electronics waveform ticks ---------------------
878 
879 
880 
881  // --- BEGIN Conversions to electronics waveform ticks ---------------------
883 
903  virtual double TPCG4Time2TDC(double g4time) const = 0;
904 
917  virtual double TPCG4Time2Tick(double g4time) const = 0;
918 
919 
938  virtual double OpticalG4Time2TDC(double g4time) const = 0;
939 
951  virtual double ExternalG4Time2TDC(double g4time) const = 0;
952 
954  // --- END Conversions to electronics waveform ticks ---------------------
955 
956 
957  protected:
958  DetectorClocks() = default;
959 
960  }; // class DetectorClocks
961 
962 } //namespace detinfo
963 
964 
965 #endif // LARDATAALG_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
virtual double Time2Tick(double time) const =0