ATLAS Offline Software
Loading...
Searching...
No Matches
ICscClusterFitter.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5// ICscClusterFitter.h
6
7#ifndef ICscClusterFitter_H
8#define ICscClusterFitter_H
9
10// David Adams and Woochun Park
11// February 2007
12//
13// Interface for tool to fit a CSC cluster.
14//
15// Returns the coordinate in the measurement plane, i.e. in the
16// wire plane in the direction transverse to the strips.
17//
18// Also optionally rerurns a map of intermediate values indexed by
19// name. It is intended that this list be used to tune the tool
20// and provide measures of data quality.
21
22#include <map>
23#include <vector>
24
26#include "GaudiKernel/IAlgTool.h"
28
29namespace Muon {
30 class CscPrepData;
31}
32
33class ICscClusterFitter : virtual public IAlgTool {
34public: // Typedefs.
35 // Input list of strips.
36 typedef std::vector<Muon::CscStripPrepData*> StripList;
37
38 // List of strip fit results.
40 typedef std::vector<StripFit> StripFitList;
41
42 // Time on each strip.
43 typedef std::vector<double> ChargeList;
44
45 // Additional data.
46 typedef std::vector<std::string> DataNames;
47 typedef std::map<std::string, double> DataMap;
48
49public: // Embedded class.
50 // This is a description of a fitted cluster.
51 // The status, strip, position and position error shouls always be filled.
52 class Result {
53 public:
54 int fitStatus{-1}; // Fit status: 0 for success
57 unsigned int strip{999}; // Index of the strip to identify this clustrer
58 unsigned int fstrip{999}; // Index of the first strip to identify this clustrer (for splitCluster)
59 unsigned int lstrip{999}; // Index of the last strip to identify this clustrer (for splitCluster)
60 double position{999.}; // Positon.
61 double dposition{0.}; // Error in the position.
62 double time{999.}; // Time (ns).
63 double dtime{0.}; // Error in the time.
64 double charge{0.}; // Charge (e).
65 double dcharge{0.}; // Error in charge.
66 double width{0.}; // Full width (ns) of the peak, e.g. FWHM, 2sigma, ...
67 double qpeak{0.}; // Peak Charge
68 double qleft{0.}; // Peak Charge
69 double qright{0.}; // Peak Charge
70
71 double time_beforeBPCorr{-FLT_MAX}; // Time (ns) of the peak. without t0 correction
72 double time_beforeT0Corr{-FLT_MAX}; // Time (ns) of the peak. without t0 correction
73 double charge_beforeBPCorr{0.}; // Time (ns) of the peak. without t0 correction
74
75 DataMap dataMap; // Extra data
82 Result(const Result&) = default;
83 ~Result() = default;
84 };
85
86public: // Static methods.
87 // Return the interface ID.
88 // static const InterfaceID& interfaceID();
89 static const InterfaceID& interfaceID() {
90 static const InterfaceID IID_ICscClusterFitter("ICscClusterFitter", 1, 0);
91 return IID_ICscClusterFitter;
92 }
93
94 virtual ~ICscClusterFitter() = default;
95
96public: // Interface methods
97 // Return the list of additional data names.
98 // Implementation here returns an empty list.
99 virtual const DataNames& dataNames() const;
100
101 typedef std::vector<Result> Results;
102 // Fit a cluster with unknown direction.
103 virtual Results fit(const StripFitList& sfits) const = 0;
104
105 // Fit a cluster with specified track direction.
106 virtual Results fit(const StripFitList& sfits, double dposdz) const = 0;
107
108 virtual double getCorrectedError(const Muon::CscPrepData* pclu, double slope = -999) const = 0;
109
110public:
111 // Old interface for backward compatibility.
112 // This is temporary--please use one of the inteface methods.
113 // Fit a cluster.
114 // Input:
115 // strips - List of strips in the cluster.
116 // sfits - Results from fits of these strips
117 // Output:
118 // pos = Position of the fitted cluster.
119 // dpos = Error in the position.
120 // clustatus = Status indicating if and how the cluster is spoiled.
121 // istrip = Index of the strip that should be used to identify the cluster
122 // time = cluster time
123 // pdmap = Additional data for validation, etc. Null to not fill.
124 // Returns 0 for success.
125 // For nonzero return, pos and dpos need not be filled but spoil
126 // should be assigned a meaningful value.
127 /* int fit(const StripList& strips, const StripFitList& sfits,
128 double& pos, double& dpos, Muon::CscClusterStatus& clustatus,
129 unsigned int& istrip, double& charge, double& time, DataMap* pdmap =0) const;
130 */
131};
132
133#endif
Result(const Result &)=default
Muon::CscTimeStatus timeStatus
Muon::CscClusterStatus clusterStatus
Result(int stat=0, Muon::CscClusterStatus cstat=Muon::CscStatusUndefined, Muon::CscTimeStatus tstat=Muon::CscTimeStatusUndefined)
virtual const DataNames & dataNames() const
std::vector< Muon::CscStripPrepData * > StripList
virtual ~ICscClusterFitter()=default
ICscStripFitter::Result StripFit
static const InterfaceID & interfaceID()
virtual Results fit(const StripFitList &sfits) const =0
virtual double getCorrectedError(const Muon::CscPrepData *pclu, double slope=-999) const =0
virtual Results fit(const StripFitList &sfits, double dposdz) const =0
std::vector< std::string > DataNames
std::vector< Result > Results
std::vector< StripFit > StripFitList
std::vector< double > ChargeList
std::map< std::string, double > DataMap
Class representing clusters from the CSC.
Definition CscPrepData.h:39
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
CscClusterStatus
Enum to represent the cluster status - see the specific enum values for more details.
@ CscStatusUndefined
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.