ATLAS Offline Software
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
CscSplitClusterFitter Class Reference

#include <CscSplitClusterFitter.h>

Inheritance diagram for CscSplitClusterFitter:
Collaboration diagram for CscSplitClusterFitter:

Public Types

typedef std::vector< Muon::CscStripPrepData * > StripList
 
typedef ICscStripFitter::Result StripFit
 
typedef std::vector< StripFitStripFitList
 
typedef std::vector< double > ChargeList
 
typedef std::vector< std::string > DataNames
 
typedef std::map< std::string, double > DataMap
 
typedef std::vector< ResultResults
 

Public Member Functions

 CscSplitClusterFitter (const std::string &, const std::string &, const IInterface *)
 
 ~CscSplitClusterFitter ()=default
 
StatusCode initialize ()
 
Results fit (const StripFitList &sfits) const
 
Results fit (const StripFitList &sfits, double dposdz) const
 
double getCorrectedError (const Muon::CscPrepData *pclu, double slope) const
 
virtual const DataNamesdataNames () const
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

int m_min_dist
 
float m_max_qratio
 
ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc
 
ToolHandle< ICscClusterFitterm_pfitter_def
 
ToolHandle< ICscClusterFitterm_pfitter_prec
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Definition at line 24 of file CscSplitClusterFitter.h.

Member Typedef Documentation

◆ ChargeList

typedef std::vector<double> ICscClusterFitter::ChargeList
inherited

Definition at line 43 of file ICscClusterFitter.h.

◆ DataMap

typedef std::map<std::string, double> ICscClusterFitter::DataMap
inherited

Definition at line 47 of file ICscClusterFitter.h.

◆ DataNames

typedef std::vector<std::string> ICscClusterFitter::DataNames
inherited

Definition at line 46 of file ICscClusterFitter.h.

◆ Results

typedef std::vector<Result> ICscClusterFitter::Results
inherited

Definition at line 101 of file ICscClusterFitter.h.

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

◆ StripFit

Definition at line 39 of file ICscClusterFitter.h.

◆ StripFitList

typedef std::vector<StripFit> ICscClusterFitter::StripFitList
inherited

Definition at line 40 of file ICscClusterFitter.h.

◆ StripList

typedef std::vector<Muon::CscStripPrepData*> ICscClusterFitter::StripList
inherited

Definition at line 36 of file ICscClusterFitter.h.

Constructor & Destructor Documentation

◆ CscSplitClusterFitter()

CscSplitClusterFitter::CscSplitClusterFitter ( const std::string &  type,
const std::string &  aname,
const IInterface *  parent 
)

Definition at line 31 of file CscSplitClusterFitter.cxx.

31  :
33  declareInterface<ICscClusterFitter>(this);
34  declareProperty("min_dist", m_min_dist = 2); // Minimum distance between peaks and valley
35  declareProperty("max_qratio", m_max_qratio = 0.15); // Maximum charge ratio between peak strip and valley strip
36 }

◆ ~CscSplitClusterFitter()

CscSplitClusterFitter::~CscSplitClusterFitter ( )
default

Member Function Documentation

◆ dataNames()

const DataNames & ICscClusterFitter::dataNames ( ) const
virtualinherited

Reimplemented in ParabolaCscClusterFitter, and QratCscClusterFitter.

Definition at line 14 of file ICscClusterFitter.cxx.

14  {
15  static const DataNames dnames{};
16  return dnames;
17 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ fit() [1/2]

Results CscSplitClusterFitter::fit ( const StripFitList sfits) const
virtual

Implements ICscClusterFitter.

Definition at line 65 of file CscSplitClusterFitter.cxx.

65  {
67  // Check input has at least three strips.
68  unsigned int nstrip = sfits.size();
69  // Use the first strip to extract the layer parameters.
70  const CscStripPrepData* pstrip = sfits[0].strip;
71  Identifier idStrip0 = pstrip->identify();
72  bool measphi = m_idHelperSvc->cscIdHelper().CscIdHelper::measuresPhi(idStrip0);
73 
74  // Display input strips.
75  ATH_MSG_DEBUG("CscStrip fittter input has " << nstrip << " strips");
76 
77  for (unsigned int istrip = 0; istrip < nstrip; ++istrip) {
78  Identifier id = sfits[istrip].strip->identify();
79  ATH_MSG_VERBOSE(" " << istrip << " " << m_idHelperSvc->cscIdHelper().strip(id) << " " << sfits[istrip].charge);
80  }
81  // Find the peak strip and valley strip
82  // Loop over strips
83  std::vector<float> istrip_peaks;
84  std::vector<float> istrip_vals;
85 
86  // Start peak all the time...
87  for (unsigned int istrip = 1; istrip < nstrip - 1; ++istrip) {
88  StripFit sfit = sfits[istrip];
89  float qthis = sfit.charge;
90  float qlast = sfits[istrip - 1].charge;
91  float qnext = sfits[istrip + 1].charge;
92  // Peak at first
93  if (istrip == 1 && qlast > qthis) istrip_peaks.push_back(0);
94  // Peak at last
95  if (istrip + 2 == nstrip && qthis < qnext) istrip_peaks.push_back(nstrip - 1);
96  // Peak if the adjacent strips have less charge.
97  bool ispeak = qthis > qlast && qthis > qnext;
98  bool isval = qthis < qlast && qthis < qnext;
99  // Record if peak.
100 
101  if (ispeak) istrip_peaks.push_back(istrip);
102  if (isval) istrip_vals.push_back(istrip);
103  if (ispeak || isval) continue;
104 
105  // It's only for istrip==1 and 0th and 1st charges are same....
106  if (istrip == 1 && qlast == qthis) {
107  float nstripsameCharge = 2.;
108  unsigned int theStrip = 0;
109  for (unsigned int mstrip = istrip + 1; mstrip < nstrip - 1; ++mstrip) {
110  theStrip = mstrip;
111  if (qthis == sfits[mstrip].charge)
112  nstripsameCharge += 1.;
113  else
114  break;
115  }
116  ispeak = (qthis > sfits[theStrip].charge);
117  isval = (qthis < sfits[theStrip].charge);
118  float offset = 0.5 * (nstripsameCharge - 1);
119  if (ispeak) istrip_peaks.push_back(offset);
120  // We want to start peak all the time...
121  // if ( isval ) istrip_vals.push_back(offset);
122  istrip += int(nstripsameCharge) - 2;
123  continue;
124  }
125 
126  // Special case: next strip has the same charge.
127  // Require the previous strip has less charge and the next following
128  // strip be absent or have less charge.
129  if (qthis == qnext) {
130  float nstripsameCharge = 2.;
131  unsigned int theStrip = 0;
132  bool sameCharge = 1;
133  for (unsigned int mstrip = istrip + 2; mstrip < nstrip - 1; ++mstrip) {
134  theStrip = mstrip;
135  if (qthis == sfits[mstrip].charge)
136  nstripsameCharge += 1.;
137  else {
138  sameCharge = 0;
139  break;
140  }
141  }
142  if (sameCharge) {
143  ispeak = (qthis > qlast);
144  isval = (qthis < qlast);
145  } else {
146  ispeak = (qthis > qlast) && (qthis > sfits[theStrip].charge);
147  isval = (qthis < qlast) && (qthis < sfits[theStrip].charge);
148  }
149  float offset = 0.5 * (nstripsameCharge - 1);
150  if (ispeak) istrip_peaks.push_back(istrip + offset);
151  if (isval) istrip_vals.push_back(istrip + offset);
152  istrip += int(nstripsameCharge) - 1;
153  continue;
154  }
155  }
156 
157  ATH_MSG_DEBUG(" #Peak is " << istrip_peaks.size());
158 
159  // Decide in which valley strip we split cluster
160  // Starting from Peak all the time!!!
161  // Regular case : #peaks - #vals =1
162  // If #peaks == $vals, avoid it at the end of vals..
163 
164  std::vector<unsigned int> splitOnValley;
165  for (unsigned int ival = 0; ival < istrip_vals.size() && ival + 1 < istrip_peaks.size(); ++ival) {
166  // Set initial strip position.
167  float istrip_peak0 = istrip_peaks[ival];
168  float istrip_peak1 = istrip_peaks[ival + 1];
169  float istrip_val = istrip_vals[ival];
170 
171  float dist_ptov = istrip_val - istrip_peak0;
172  float dist_vtop = istrip_peak1 - istrip_val;
173 
174  ATH_MSG_DEBUG(" [ " << istrip_peak0 << ", " << istrip_val << ", " << istrip_peak1 << "] "
175  << "dist p2v:v2p " << dist_ptov << " : " << dist_vtop);
176 
177  if (dist_ptov < 0 || dist_vtop < 0) {
178  ATH_MSG_WARNING(" Peak-to-Val dist is " << dist_ptov << " Val-to-Peak dist is " << dist_vtop
179  << " Shouldnot be negative value :" << istrip_peak0 << " " << istrip_val << " "
180  << istrip_peak1);
181  }
182 
183  float qlpeak = sfits[int(istrip_peak0)].charge;
184  float qval = sfits[int(istrip_val)].charge;
185  float qrpeak = sfits[int(istrip_peak1)].charge;
186 
187  ATH_MSG_DEBUG("qlpk:qval:qrpk " << qlpeak << " " << qval << " " << qrpeak << " " << qval / qlpeak << " " << qval / qrpeak
188  << " " << m_max_qratio);
189 
190  if (dist_ptov < m_min_dist || dist_vtop < m_min_dist || qval / qlpeak > m_max_qratio || qval / qrpeak > m_max_qratio)
191  splitOnValley.push_back(0);
192  else
193  splitOnValley.push_back(1);
194  }
195 
196  unsigned int cnt = 0;
197  for (unsigned int ii = 0; ii < splitOnValley.size(); ii++)
198  if (splitOnValley[ii] == 1) cnt++;
199 
200  if (cnt == 0) {
201  ATH_MSG_DEBUG("No split cluster ");
203  res.fitStatus = 6;
204  res.clusterStatus = Muon::CscStatusWide;
205  results.push_back(res);
206  return results;
207  }
208  ATH_MSG_DEBUG("Cluster is split ");
209 
210  // For the last cluster and strip
211  unsigned int nvals = splitOnValley.size();
212  if (istrip_vals[nvals - 1] != nstrip - 1) {
213  istrip_vals.push_back(nstrip - 1);
214  splitOnValley.push_back(1);
215  nvals = splitOnValley.size();
216  }
217 
218  // if (splitOnValley.size() != istrip_peaks.size())
219  // ATH_MSG_ERROR << " splitOnValley.size() should be same as istrip_peaks.size()" );
220 
221  // Rearrange strips to submit in fitter
222  StripFitList sfits_split;
223  unsigned int firstStripID = 0;
224  unsigned int thisfirstStripID = 0;
225  for (unsigned int isplit = 0; isplit < nvals; ++isplit) {
226  if (splitOnValley[isplit]) {
227  sfits_split.clear();
228 
229  for (unsigned int ist = firstStripID; ist <= istrip_vals[isplit]; ++ist) {
230  ATH_MSG_DEBUG(ist << " " << firstStripID << " " << istrip_vals << " lsplit " << splitOnValley);
231 
232  sfits_split.push_back(sfits[ist]);
233  }
234  // unsigned int split_nstrip = istrip_vals[isplit]-firstStripID;
235  // bool ledge = (isplit==0 && strip0 <=0) ? 1 : 0;
236  // bool redge = (isplit==nvals-1 && strip0+nstrip>maxstrip) ? 1 : 0;
237 
238  thisfirstStripID = firstStripID;
239  firstStripID = int(istrip_vals[isplit]);
240 
241  int fitresult = 99;
242  std::vector<ICscClusterFitter::Result> local_results;
244  // Precision fit.
245  if (!measphi && m_pfitter_prec) {
246  ATH_MSG_VERBOSE(" In CscSplit performing precision fit with " << m_pfitter_prec);
247 
248  local_results = m_pfitter_prec->fit(sfits_split);
249  res = local_results[0];
250  fitresult = res.fitStatus;
251  if (fitresult) {
252  ATH_MSG_VERBOSE(" Precision fit failed: return=" << fitresult);
253  } else {
254  ATH_MSG_VERBOSE(" Precision fit succeeded");
255  }
256  }
257 
258  int prec_fitresult = fitresult;
259  CscClusterStatus oldclustatus = res.clusterStatus;
260  // Default fit.
261  if (fitresult) { // including measphi case
262  ATH_MSG_VERBOSE(" Performing default fit with " << m_pfitter_def);
263  local_results = m_pfitter_def->fit(sfits_split);
264  res = local_results[0];
265  fitresult = res.fitStatus;
266  if (fitresult) {
267  ATH_MSG_VERBOSE(" Default fit failed: return=" << fitresult);
268  } else {
269  ATH_MSG_VERBOSE(" Default fit succeeded");
270  }
271  // Keep the status from the first fit if it is defined.
272  if (oldclustatus != Muon::CscStatusUndefined) res.clusterStatus = oldclustatus;
273  }
274 
275  if (prec_fitresult) { // precision fitter is failed...
276  res.fitStatus = 20 + prec_fitresult;
277 
278  if (oldclustatus == Muon::CscStatusSimple)
279  res.clusterStatus = Muon::CscStatusSplitSimple;
280  else if (oldclustatus == Muon::CscStatusEdge)
281  res.clusterStatus = Muon::CscStatusSplitEdge;
282  else if (oldclustatus == Muon::CscStatusMultiPeak)
283  res.clusterStatus = Muon::CscStatusSplitMultiPeak;
284  else if (oldclustatus == Muon::CscStatusNarrow)
285  res.clusterStatus = Muon::CscStatusSplitNarrow;
286  else if (oldclustatus == Muon::CscStatusWide)
287  res.clusterStatus = Muon::CscStatusSplitWide;
288  else if (oldclustatus == Muon::CscStatusSkewed)
289  res.clusterStatus = Muon::CscStatusSplitSkewed;
290  else if (oldclustatus == Muon::CscStatusQratInconsistent)
292  else if (oldclustatus == Muon::CscStatusStripFitFailed)
293  res.clusterStatus = Muon::CscStatusSplitStripFitFailed;
294  else if (oldclustatus == Muon::CscStatusSaturated)
295  res.clusterStatus = Muon::CscStatusSplitSaturated;
296 
297  } else { // precision fit is successful
298  res.fitStatus = 20;
299  res.clusterStatus = Muon::CscStatusSplitUnspoiled;
300  }
301  // strip in Result class is filled by Qrat or SimpleClusterFitter which is only relevant to the cluster
302  // passed by CscSplitCluster. This should be corrected here.
303  // fstrip and lstrip should be defined in CscSplitClusterFitter but not for the other fitter.
304  res.strip = res.strip + thisfirstStripID;
305  res.fstrip = res.fstrip + thisfirstStripID;
306  res.lstrip = res.lstrip + thisfirstStripID;
307 
308  ATH_MSG_DEBUG(" res.fitStatus " << res.fitStatus << " fitresult " << fitresult);
309 
310  results.push_back(res);
311  }
312  } // for
313 
314  return results;
315 }

◆ fit() [2/2]

Results CscSplitClusterFitter::fit ( const StripFitList sfits,
double  dposdz 
) const
virtual

Implements ICscClusterFitter.

Definition at line 319 of file CscSplitClusterFitter.cxx.

319 { return fit(sfits); }

◆ getCorrectedError()

double CscSplitClusterFitter::getCorrectedError ( const Muon::CscPrepData pclu,
double  slope 
) const
virtual

Implements ICscClusterFitter.

Definition at line 322 of file CscSplitClusterFitter.cxx.

322 { return 0; }

◆ initialize()

StatusCode CscSplitClusterFitter::initialize ( )

Definition at line 40 of file CscSplitClusterFitter.cxx.

40  {
41  ATH_MSG_DEBUG("Initalizing " << name());
42 
43  ATH_CHECK(m_idHelperSvc.retrieve());
44 
45  // Retrieve the default cluster fitting tool.
47 
48  ATH_MSG_DEBUG("CscClusterization " << name() << ": retrieved " << m_pfitter_def);
49 
50  // Retrieve the precision cluster fitting tool.
52 
53  ATH_MSG_DEBUG("CscClusterization " << name() << ": retrieved " << m_pfitter_prec);
54 
55  ATH_MSG_DEBUG("Properties for " << name() << ":");
56  ATH_MSG_DEBUG(" Default cluster fitter is " << m_pfitter_def.typeAndName());
57  ATH_MSG_DEBUG(" Precision cluster fitter is " << m_pfitter_prec.typeAndName());
58  ATH_MSG_DEBUG(" Min dist peak to valley: " << m_min_dist);
59  ATH_MSG_DEBUG(" Max qratio qval / qpeak: " << m_max_qratio);
60 
61  return StatusCode::SUCCESS;
62 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ interfaceID()

static const InterfaceID& ICscClusterFitter::interfaceID ( )
inlinestaticinherited

Must declare this, with name of interface

Definition at line 89 of file ICscClusterFitter.h.

89  {
90  static const InterfaceID IID_ICscClusterFitter("ICscClusterFitter", 1, 0);
91  return IID_ICscClusterFitter;
92  }

◆ msg() [1/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_idHelperSvc

ServiceHandle<Muon::IMuonIdHelperSvc> CscSplitClusterFitter::m_idHelperSvc
private
Initial value:
{
this,
"MuonIdHelperSvc",
"Muon::MuonIdHelperSvc/MuonIdHelperSvc",
}

Definition at line 44 of file CscSplitClusterFitter.h.

◆ m_max_qratio

float CscSplitClusterFitter::m_max_qratio
private

Definition at line 42 of file CscSplitClusterFitter.h.

◆ m_min_dist

int CscSplitClusterFitter::m_min_dist
private

Definition at line 40 of file CscSplitClusterFitter.h.

◆ m_pfitter_def

ToolHandle<ICscClusterFitter> CscSplitClusterFitter::m_pfitter_def
private
Initial value:
{
this,
"default_fitter",
"SimpleCscClusterFitter/SimpleCscClusterFitter",
}

Definition at line 51 of file CscSplitClusterFitter.h.

◆ m_pfitter_prec

ToolHandle<ICscClusterFitter> CscSplitClusterFitter::m_pfitter_prec
private
Initial value:
{
this,
"precision_fitter",
"QratCscClusterFitter/QratCscClusterFitter",
}

Definition at line 56 of file CscSplitClusterFitter.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
verify_menu_config.results
results
Definition: verify_menu_config.py:67
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
Muon::CscStatusSplitSkewed
@ CscStatusSplitSkewed
Skewed, e.g.
Definition: CscClusterStatus.h:80
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
ICscStripFitter::Result::charge
double charge
Definition: ICscStripFitter.h:31
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
ATH_CHECK_RECOVERABLE
#define ATH_CHECK_RECOVERABLE
Evaluate an expression and check for errors.
Definition: AthCheckMacros.h:48
DataNames
ICscClusterFitter::DataNames DataNames
Definition: CscSplitClusterFitter.cxx:20
Muon::CscStatusSplitNarrow
@ CscStatusSplitNarrow
Too narrow after split cluster.
Definition: CscClusterStatus.h:74
Muon::CscStatusSplitSimple
@ CscStatusSplitSimple
Cluster with non-precision fit after split cluster.
Definition: CscClusterStatus.h:63
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
CscSplitClusterFitter::m_pfitter_def
ToolHandle< ICscClusterFitter > m_pfitter_def
Definition: CscSplitClusterFitter.h:51
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
python.Dumpers.aname
string aname
Definition: Dumpers.py:5546
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
Muon::CscStripPrepData
Class representing the raw data of one CSC strip (for clusters look at Muon::CscPrepData).
Definition: CscStripPrepData.h:40
WriteCellNoiseToCool.ival
ival
Definition: WriteCellNoiseToCool.py:337
Muon::CscStatusSplitStripFitFailed
@ CscStatusSplitStripFitFailed
Definition: CscClusterStatus.h:88
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
Muon::CscStatusSaturated
@ CscStatusSaturated
Definition: CscClusterStatus.h:56
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ICscClusterFitter::Result
Definition: ICscClusterFitter.h:52
CscSplitClusterFitter::m_max_qratio
float m_max_qratio
Definition: CscSplitClusterFitter.h:42
Muon::CscStatusStripFitFailed
@ CscStatusStripFitFailed
Definition: CscClusterStatus.h:53
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
Muon::CscStatusSplitMultiPeak
@ CscStatusSplitMultiPeak
More than one peak in cluster after split cluster.
Definition: CscClusterStatus.h:71
Muon::CscStatusSimple
@ CscStatusSimple
Cluster with non-precision fit.
Definition: CscClusterStatus.h:29
Muon::CscStatusQratInconsistent
@ CscStatusQratInconsistent
Positions from Qrat_left and Qrat_right is not consistent.
Definition: CscClusterStatus.h:49
res
std::pair< std::vector< unsigned int >, bool > res
Definition: JetGroupProductTest.cxx:14
test_pyathena.parent
parent
Definition: test_pyathena.py:15
Muon::CscStatusSplitEdge
@ CscStatusSplitEdge
Cluster reaches the edge of plane after split cluster.
Definition: CscClusterStatus.h:68
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Muon::CscStatusWide
@ CscStatusWide
Too wide.
Definition: CscClusterStatus.h:43
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
Muon::CscStatusSkewed
@ CscStatusSkewed
Skewed, e.g.
Definition: CscClusterStatus.h:46
Muon::CscStatusUndefined
@ CscStatusUndefined
Undefined, should not happen, most likely indicates a problem.
Definition: CscClusterStatus.h:94
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
CscSplitClusterFitter::m_min_dist
int m_min_dist
Definition: CscSplitClusterFitter.h:40
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
Trk::PrepRawData::identify
Identifier identify() const
return the identifier
fitman.fitresult
fitresult
Definition: fitman.py:590
Muon::CscStatusNarrow
@ CscStatusNarrow
Too narrow.
Definition: CscClusterStatus.h:40
Muon::CscStatusSplitSaturated
@ CscStatusSplitSaturated
Definition: CscClusterStatus.h:91
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
charge
double charge(const T &p)
Definition: AtlasPID.h:756
Muon::CscStatusSplitWide
@ CscStatusSplitWide
Too wide.
Definition: CscClusterStatus.h:77
CscSplitClusterFitter::m_pfitter_prec
ToolHandle< ICscClusterFitter > m_pfitter_prec
Definition: CscSplitClusterFitter.h:56
Results
std::vector< Result > Results
Definition: CscSplitClusterFitter.cxx:22
Muon::CscStatusMultiPeak
@ CscStatusMultiPeak
More than one peak in cluster.
Definition: CscClusterStatus.h:37
Muon::CscStatusSplitQratInconsistent
@ CscStatusSplitQratInconsistent
Positions from Qrat_left and Qrat_right is not consistent after split cluster.
Definition: CscClusterStatus.h:84
a
TList * a
Definition: liststreamerinfos.cxx:10
Muon::CscStatusSplitUnspoiled
@ CscStatusSplitUnspoiled
Clean cluster with precision fit after split cluster.
Definition: CscClusterStatus.h:59
h
trigbs_pickEvents.cnt
cnt
Definition: trigbs_pickEvents.py:71
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
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
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
Muon::CscStatusEdge
@ CscStatusEdge
Cluster reaches the edge of plane.
Definition: CscClusterStatus.h:34
fitman.k
k
Definition: fitman.py:528
CscSplitClusterFitter::fit
Results fit(const StripFitList &sfits) const
Definition: CscSplitClusterFitter.cxx:65
Identifier
Definition: IdentifierFieldParser.cxx:14
CscSplitClusterFitter::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: CscSplitClusterFitter.h:44