ATLAS Offline Software
ICscClusterFitter.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 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 
29 namespace Muon {
30  class CscPrepData;
31 }
32 
33 class ICscClusterFitter : virtual public IAlgTool {
34 public: // 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 
49 public: // 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
78  fitStatus = stat;
79  clusterStatus = cstat;
80  timeStatus = tstat;
81  }
82  Result(const Result&) = default;
83  ~Result() = default;
84  };
85 
86 public: // 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 
96 public: // 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 
110 public:
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
ICscClusterFitter::Result::qleft
double qleft
Definition: ICscClusterFitter.h:68
CscStripPrepDataContainer.h
ICscClusterFitter::Result::Result
Result(int stat=0, Muon::CscClusterStatus cstat=Muon::CscStatusUndefined, Muon::CscTimeStatus tstat=Muon::CscTimeStatusUndefined)
Definition: ICscClusterFitter.h:76
ICscClusterFitter::Result::time_beforeT0Corr
double time_beforeT0Corr
Definition: ICscClusterFitter.h:72
ICscClusterFitter::getCorrectedError
virtual double getCorrectedError(const Muon::CscPrepData *pclu, double slope=-999) const =0
ICscClusterFitter::Result::dcharge
double dcharge
Definition: ICscClusterFitter.h:65
ICscClusterFitter::Results
std::vector< Result > Results
Definition: ICscClusterFitter.h:101
ICscClusterFitter::Result::time_beforeBPCorr
double time_beforeBPCorr
Definition: ICscClusterFitter.h:71
ICscClusterFitter::Result::clusterStatus
Muon::CscClusterStatus clusterStatus
Definition: ICscClusterFitter.h:55
ICscClusterFitter::Result::fstrip
unsigned int fstrip
Definition: ICscClusterFitter.h:58
ICscClusterFitter::Result::dtime
double dtime
Definition: ICscClusterFitter.h:63
ICscClusterFitter::Result::fitStatus
int fitStatus
Definition: ICscClusterFitter.h:54
ICscClusterFitter::Result::time
double time
Definition: ICscClusterFitter.h:62
Muon
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Definition: TrackSystemController.h:45
ICscClusterFitter::Result::dposition
double dposition
Definition: ICscClusterFitter.h:61
Trk::PrepRawDataType::CscPrepData
@ CscPrepData
ICscClusterFitter::Result::charge_beforeBPCorr
double charge_beforeBPCorr
Definition: ICscClusterFitter.h:73
ICscClusterFitter::ChargeList
std::vector< double > ChargeList
Definition: ICscClusterFitter.h:43
ICscClusterFitter
Definition: ICscClusterFitter.h:33
ICscClusterFitter::Result::dataMap
DataMap dataMap
Definition: ICscClusterFitter.h:75
ICscClusterFitter::Result
Definition: ICscClusterFitter.h:52
ICscClusterFitter::Result::position
double position
Definition: ICscClusterFitter.h:60
Muon::CscPrepData
Class representing clusters from the CSC.
Definition: CscPrepData.h:39
ICscClusterFitter::fit
virtual Results fit(const StripFitList &sfits) const =0
ICscClusterFitter::DataNames
std::vector< std::string > DataNames
Definition: ICscClusterFitter.h:46
ICscClusterFitter::~ICscClusterFitter
virtual ~ICscClusterFitter()=default
ICscClusterFitter::dataNames
virtual const DataNames & dataNames() const
Definition: ICscClusterFitter.cxx:14
ICscClusterFitter::fit
virtual Results fit(const StripFitList &sfits, double dposdz) const =0
ICscStripFitter::Result
Definition: ICscStripFitter.h:25
ICscClusterFitter::Result::qright
double qright
Definition: ICscClusterFitter.h:69
Muon::CscStatusUndefined
@ CscStatusUndefined
Undefined, should not happen, most likely indicates a problem.
Definition: CscClusterStatus.h:94
ICscClusterFitter::Result::charge
double charge
Definition: ICscClusterFitter.h:64
ICscClusterFitter::Result::qpeak
double qpeak
Definition: ICscClusterFitter.h:67
beamspotman.stat
stat
Definition: beamspotman.py:266
ICscClusterFitter::DataMap
std::map< std::string, double > DataMap
Definition: ICscClusterFitter.h:47
ICscClusterFitter::Result::lstrip
unsigned int lstrip
Definition: ICscClusterFitter.h:59
ICscClusterFitter::Result::strip
unsigned int strip
Definition: ICscClusterFitter.h:57
ICscClusterFitter::StripList
std::vector< Muon::CscStripPrepData * > StripList
Definition: ICscClusterFitter.h:36
ICscClusterFitter::Result::Result
Result(const Result &)=default
ICscClusterFitter::Result::~Result
~Result()=default
ICscClusterFitter::Result::width
double width
Definition: ICscClusterFitter.h:66
Muon::CscTimeStatusUndefined
@ CscTimeStatusUndefined
Time is not assessed indicating potential bug.
Definition: CscTimeStatus.h:39
ICscStripFitter.h
ICscClusterFitter::StripFitList
std::vector< StripFit > StripFitList
Definition: ICscClusterFitter.h:40
Muon::CscClusterStatus
CscClusterStatus
Enum to represent the cluster status - see the specific enum values for more details.
Definition: CscClusterStatus.h:23
ICscClusterFitter::StripFit
ICscStripFitter::Result StripFit
Definition: ICscClusterFitter.h:39
ICscClusterFitter::interfaceID
static const InterfaceID & interfaceID()
Definition: ICscClusterFitter.h:89
ICscClusterFitter::Result::timeStatus
Muon::CscTimeStatus timeStatus
Definition: ICscClusterFitter.h:56
Muon::CscTimeStatus
CscTimeStatus
Enum to represent the cluster time measurement status - see the specific enum values for more details...
Definition: CscTimeStatus.h:24