ATLAS Offline Software
ICscStripFitter.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 #ifndef ICscStripFitter_H
5 #define ICscStripFitter_H
6 
7 #include <float.h>
8 
9 #include <vector>
10 
11 #include "CscStripStatus.h"
12 #include "GaudiKernel/IAlgTool.h"
16 
17 // Interface for tool to fit the time samples on a CSC strip.
18 // Returns the peak charge, the time of the peak and some quality measures.
19 class ICscStripFitter : virtual public IAlgTool {
20 public: // Embedded class.
21  // This is a description of a fitted strip.
22  // The status, charge and time should always be filled. The other values
23  // are optional and, in some cases, their precise meaning will depend on
24  // the algorithm used to fill them.
25  class Result {
26  public:
27  int status{0}; // Fit status: 0 for success
29  const Muon::CscStripPrepData* strip{nullptr}; // Pointer to the strip.
30  double sampleTime{0.}; // Period of input samples.
31  double charge{0.}; // Peak current (electrons/sampleTime)
32  double dcharge{0.}; // Error in the peak current.
33  double time{0.}; // Time (ns) of the peak. t0 corrected time since 16.7.X
34  double dtime{0.}; // Error in the time.
35  double width{0.}; // Full width (ns) of the peak, e.g. FWHM, 2sigma, ...
36  double dwidth{0.}; // Error in the width.
37  double chsq{0.}; // Chi-square for the fit, -1 if not calculated.
38  bool phase{false};
39 
40  double time_beforeT0Corr{-FLT_MAX}; // Time (ns) of the peak. without t0 correction
41  double time_beforeBPCorr{-FLT_MAX};
42  double charge_beforeGainCorr{0.}; // Time (ns) of the peak. without t0 correction
43  double charge_beforeBPCorr{0.}; // Time (ns) of the peak. without t0 correction
46  stripStatus = sstat;
47  timeStatus = tstat;
48  }
49  Result(const Result&) = default;
50  ~Result() = default;
51  };
52 
53 public: // Typedefs.
54  // List of time samples.
55  typedef std::vector<float> ChargeList;
56 
57 public: // Static methods.
58  // Return the interface ID.
59  static const InterfaceID& interfaceID() {
60  static const InterfaceID IID_ICscStripFitter("ICscStripFitter", 1, 0);
61  return IID_ICscStripFitter;
62  }
63 
64 public: // Interface methods
65  // Fit a list of sample charges.
66  // This method returns the time relative to the time of the first sample.
67  // Implementation here fails.
68  // Typical subclass will override this method.
69  // virtual Result fit(const ChargeList& ChargeList, double samplingTime, IdentifierHash& stripHashId) const;
70  // virtual Result fit(const ChargeList& ChargeList, double samplingTime, Identifier& sid) const;
71 
72  virtual Result fit(const ChargeList& ChargeList, double samplingTime, bool samplingPhase, Identifier& sid) const;
73 
74  // Fit a prep data strip.
75  // Implementation here uses the above method.
76  // Typical subclass overiding the above need not overide this.
77  // This method returns the time relative to the time of the first sample.
78  // The strip is set in the result.
79  virtual Result fit(const Muon::CscStripPrepData& strip) const;
80 
81  virtual ~ICscStripFitter() = default;
82 };
83 
84 #endif
ICscStripFitter::~ICscStripFitter
virtual ~ICscStripFitter()=default
ICscStripFitter::Result::stripStatus
Muon::CscStripStatus stripStatus
Definition: ICscStripFitter.h:28
Muon::CscStrStatUndefined
@ CscStrStatUndefined
Undefined, should not happen, most likely indicates a problem.
Definition: CscStripStatus.h:44
SiliconTech::strip
@ strip
ICscStripFitter::Result::sampleTime
double sampleTime
Definition: ICscStripFitter.h:30
ChargeList
ICscStripFitter::ChargeList ChargeList
Definition: CalibCscStripFitter.cxx:14
ICscStripFitter::Result::phase
bool phase
Definition: ICscStripFitter.h:38
ICscStripFitter::Result::status
int status
Definition: ICscStripFitter.h:27
ICscStripFitter::Result::Result
Result(Muon::CscStripStatus sstat=Muon::CscStrStatUndefined, Muon::CscTimeStatus tstat=Muon::CscTimeStatusUndefined)
Definition: ICscStripFitter.h:45
ICscStripFitter::Result::Result
Result(const Result &)=default
ICscStripFitter::Result::charge
double charge
Definition: ICscStripFitter.h:31
ICscStripFitter::fit
virtual Result fit(const ChargeList &ChargeList, double samplingTime, bool samplingPhase, Identifier &sid) const
Definition: ICscStripFitter.cxx:16
CscStripPrepData.h
ICscStripFitter::Result::dwidth
double dwidth
Definition: ICscStripFitter.h:36
ICscStripFitter::interfaceID
static const InterfaceID & interfaceID()
Definition: ICscStripFitter.h:59
ICscStripFitter::Result::time_beforeBPCorr
double time_beforeBPCorr
Definition: ICscStripFitter.h:41
Muon::CscStripPrepData
Class representing the raw data of one CSC strip (for clusters look at Muon::CscPrepData).
Definition: CscStripPrepData.h:40
ICscStripFitter::Result::time_beforeT0Corr
double time_beforeT0Corr
Definition: ICscStripFitter.h:40
ICscStripFitter::Result::charge_beforeBPCorr
double charge_beforeBPCorr
Definition: ICscStripFitter.h:43
CscTimeStatus.h
ICscStripFitter::Result::dcharge
double dcharge
Definition: ICscStripFitter.h:32
ICscStripFitter
Definition: ICscStripFitter.h:19
ICscStripFitter::Result::timeStatus
Muon::CscTimeStatus timeStatus
Definition: ICscStripFitter.h:44
ICscStripFitter::Result
Definition: ICscStripFitter.h:25
ICscStripFitter::Result::chsq
double chsq
Definition: ICscStripFitter.h:37
ICscStripFitter::ChargeList
std::vector< float > ChargeList
Definition: ICscStripFitter.h:55
ICscStripFitter::Result::charge_beforeGainCorr
double charge_beforeGainCorr
Definition: ICscStripFitter.h:42
Result
Definition: fbtTestBasics.cxx:49
ICscStripFitter::Result::width
double width
Definition: ICscStripFitter.h:35
IdentifierHash.h
ICscStripFitter::Result::strip
const Muon::CscStripPrepData * strip
Definition: ICscStripFitter.h:29
Muon::CscStripStatus
CscStripStatus
Enum to represent the strip status - see the specific enum values for more details.
Definition: CscStripStatus.h:23
ICscStripFitter::Result::time
double time
Definition: ICscStripFitter.h:33
ICscStripFitter::Result::dtime
double dtime
Definition: ICscStripFitter.h:34
Muon::CscTimeStatusUndefined
@ CscTimeStatusUndefined
Time is not assessed indicating potential bug.
Definition: CscTimeStatus.h:39
CscStripStatus.h
ICscStripFitter::Result::~Result
~Result()=default
Muon::CscTimeStatus
CscTimeStatus
Enum to represent the cluster time measurement status - see the specific enum values for more details...
Definition: CscTimeStatus.h:24
Identifier
Definition: IdentifierFieldParser.cxx:14