ATLAS Offline Software
Loading...
Searching...
No Matches
ICscStripFitter.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 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.
19class ICscStripFitter : virtual public IAlgTool {
20public: // 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
49 Result(const Result&) = default;
50 ~Result() = default;
51 };
52
53public: // Typedefs.
54 // List of time samples.
55 typedef std::vector<float> ChargeList;
56
57public: // 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
64public: // 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::ChargeList ChargeList
Muon::CscStripStatus stripStatus
const Muon::CscStripPrepData * strip
Result(const Result &)=default
Result(Muon::CscStripStatus sstat=Muon::CscStrStatUndefined, Muon::CscTimeStatus tstat=Muon::CscTimeStatusUndefined)
Muon::CscTimeStatus timeStatus
virtual ~ICscStripFitter()=default
static const InterfaceID & interfaceID()
std::vector< float > ChargeList
virtual Result fit(const ChargeList &ChargeList, double samplingTime, bool samplingPhase, Identifier &sid) const
Class representing the raw data of one CSC strip (for clusters look at Muon::CscPrepData).
CscStripStatus
Enum to represent the strip status - see the specific enum values for more details.
@ CscStrStatUndefined
Undefined, should not happen, most likely indicates a problem.
CscTimeStatus
Enum to represent the cluster time measurement status - see the specific enum values for more details...
@ CscTimeStatusUndefined
Time is not assessed indicating potential bug.