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
SimpleCscClusterFitter Class Reference

#include <SimpleCscClusterFitter.h>

Inheritance diagram for SimpleCscClusterFitter:
Collaboration diagram for SimpleCscClusterFitter:

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

 SimpleCscClusterFitter (const std::string &, const std::string &, const IInterface *)
 
 ~SimpleCscClusterFitter ()=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 Results fit (const StripFitList &sfits) const=0
 
virtual Results fit (const StripFitList &sfits, double dposdz) const=0
 
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

std::string m_option
 
double m_intrinsic_cluster_width
 
bool m_use_peakthreshold
 
double m_defaultErrorScaler_eta
 
double m_defaultErrorScaler_phi
 
ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
 
SG::ReadCondHandleKey< MuonGM::MuonDetectorManagerm_DetectorManagerKey
 retrieve MuonDetectorManager from the conditions store More...
 
ToolHandle< ICscAlignmentToolm_alignmentTool
 
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 26 of file SimpleCscClusterFitter.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

◆ SimpleCscClusterFitter()

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

Definition at line 28 of file SimpleCscClusterFitter.cxx.

28  :
30  declareInterface<ICscClusterFitter>(this);
31  declareProperty("position_option", m_option = "MEAN", "Cluster fitting option: MEAN, PEAK, CENTROID");
32  declareProperty("intrinsic_cluster_width", m_intrinsic_cluster_width = 20.0, "Intrinsic cluster width (mm)");
33  declareProperty("use_peakthreshold", m_use_peakthreshold = false);
34  declareProperty("defaultErrorScaler_eta", m_defaultErrorScaler_eta = 1.0);
35  declareProperty("defaultErrorScaler_phi", m_defaultErrorScaler_phi = 1.0);
36 }

◆ ~SimpleCscClusterFitter()

SimpleCscClusterFitter::~SimpleCscClusterFitter ( )
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/4]

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

The former version had istrip + 2 == nstrip as an alternative condition. But q over next is then just zero and hence always smaller than qthis

Update the charge for the next iterator

Implements ICscClusterFitter.

Definition at line 53 of file SimpleCscClusterFitter.cxx.

53  {
55  Result res;
56 
57  // Check the input lists.
58  unsigned int nstrip = sfits.size();
59  if (nstrip == 0) {
60  ATH_MSG_WARNING("Strip list is empty.");
61  res.fitStatus = 1;
62  results.push_back(res);
63  return results;
64  }
65  if (sfits.size() != nstrip) {
66  ATH_MSG_WARNING("Fit and strip lists have different sizes");
67  res.fitStatus = 2;
68  results.push_back(res);
69  return results;
70  }
71 
72  if (sfits.empty() || !sfits[0].strip) {
73  ATH_MSG_WARNING("Strip pointer is null.");
74  res.fitStatus = 4;
75  results.push_back(res);
76  return results;
77  }
78  const CscStripPrepData* pstrip = sfits[0].strip;
79  const Identifier idStrip0 = pstrip->identify();
80 
81  // retrieve MuonDetectorManager from the conditions store
83  const MuonGM::MuonDetectorManager* MuonDetMgr = DetectorManagerHandle.cptr();
84  if (!MuonDetMgr) {
85  ATH_MSG_ERROR("Null pointer to the MuonDetectorManager conditions object");
86  return results;
87  }
88  const CscReadoutElement* pro = MuonDetMgr->getCscReadoutElement(idStrip0);
89 
90  bool measphi = m_idHelperSvc->cscIdHelper().CscIdHelper::measuresPhi(idStrip0);
91  double pitch = pro->cathodeReadoutPitch(0, measphi);
92  int maxstrip = pro->maxNumberOfStrips(measphi);
93  int strip0 = m_idHelperSvc->cscIdHelper().strip(idStrip0) - 1;
94 
95  int zsec = m_idHelperSvc->cscIdHelper().stationEta(idStrip0);
96  int station = m_idHelperSvc->cscIdHelper().stationName(idStrip0) - 49; // 1=CSS, 2=CSL
97  int phisec = m_idHelperSvc->cscIdHelper().stationPhi(idStrip0);
98 
99  int sector = zsec * (2 * phisec - station + 1);
100  int wlay = m_idHelperSvc->cscIdHelper().wireLayer(idStrip0);
101 
102  // In SimpleCscClusterFitter istrip_peak = strip0;
103  int peak_count = 0; // # peaks in the cluster
104  bool edge = (strip0 == 0); // is cluster on the edge of the chamber?
105  int stripidx = 0; // actual strip position [0-191] or [0-47]
106  int countstrip = 0; // counting strip in for loop
107  double qsum = 0; // charge sum of strips in cluster
108  double xsum = 0; // stripidx sum in cluster
109  double qxsum = 0; // position weighted (stripidx) charge sum
110  double qerravg = 0;
111  // istrip starts from 0.
112  // stripidx is for actual strip position [0-191] or [0-47].
113  // Out of for loop, stripidx will be the last strip of cluster.
114  unsigned int istrip_peak = 0;
115  double lastqpeak = 0;
116  float qlast = 0.;
117  float q_second_last = 0.;
118 
119  for (unsigned int istrip = 0; istrip < nstrip; ++istrip) {
120  const StripFit& sfit = sfits[istrip];
121  const float qthis = sfit.charge;
122  const float qnext = (istrip + 1 < nstrip) ? sfits[istrip + 1].charge : 0.;
123  const float q_over_next = (istrip + 2 < nstrip) ? sfits[istrip + 2].charge : 0.;
124  countstrip = istrip + 1;
125 
126  stripidx = strip0 + istrip;
127  qsum += qthis;
128  qerravg += qthis;
129  xsum += stripidx;
130  qxsum += qthis * stripidx;
131 
132  if (countstrip == 2 && qthis < qlast) ++peak_count;
133  if (countstrip > 2 && qthis < qlast && qlast >= q_second_last) ++peak_count;
134 
135  bool ispeak = qthis > qlast && qthis > qnext;
136  // Special case: next strip has the same charge.
137  // Require the previous strip has less charge and the next following
138  // strip be absent or have less charge.
141  if (!ispeak && qthis == qnext) { ispeak = qthis > qlast && q_over_next < qthis; }
142 
143  // Special case: first and second strips have the same charge.
144  // Require the third strip has less charge.
145  if (!ispeak && istrip == 1 && qthis == qlast) {
146  ispeak = qthis > qnext; // bug found 10/13/07
147  }
148 
149  // Record if peak.
150  if (ispeak && qthis > lastqpeak) {
151  istrip_peak = istrip;
152  lastqpeak = qthis;
153  }
155  q_second_last = qlast;
156  qlast = qthis;
157  }
158  if (stripidx == maxstrip - 1) edge = true;
159  // Update peak count and edge.
160  if (countstrip == 1) ++peak_count;
161  if (countstrip > 1 && sfits[nstrip - 1].charge >= sfits[nstrip - 2].charge) ++peak_count;
162 
163  // Fix to avoid division-by-zero (W.L. 29 Jun 2012)
164  if (qsum <= 0) {
165  // ATH_MSG_WARNING("Charge sum is not positive.");
166  // ATH_MSG_WARNING("Charge sum : "<<qsum);
167  res.fitStatus = 0;
168  double savg = strip0 + istrip_peak; // peak position: this strip has Q>0
169  res.position = pitch * (savg + 0.5 - 0.5 * maxstrip);
170  res.strip = istrip_peak; // relative to cluster start
171  double errorScaler = measphi ? m_defaultErrorScaler_phi : m_defaultErrorScaler_eta;
172  res.dposition = errorScaler * pitch / sqrt(12.0);
173  //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++added 13/06/2014 to avoid index out of range in
174  // CscThreshholdClusterBuilder.cxx
175  res.fstrip = 0;
176  res.lstrip = nstrip - 1;
177  res.time = sfits[istrip_peak].time;
178  res.timeStatus = sfits[istrip_peak].timeStatus;
179  res.qpeak = sfits[istrip_peak].charge;
180 
181  res.charge = res.qpeak;
182  res.charge_beforeBPCorr = sfits[res.strip].charge_beforeBPCorr;
183 
184  res.qleft = 0.;
185  res.qright = 0.;
186 
187  if (istrip_peak >= 1) {
188  res.qleft = sfits[istrip_peak - 1].charge;
189  res.charge += res.qleft;
190  res.charge_beforeBPCorr += sfits[istrip_peak - 1].charge_beforeBPCorr;
191  }
192  if (istrip_peak + 1 < nstrip) {
193  res.qright = sfits[istrip_peak + 1].charge;
194  res.charge += res.qright;
195  res.charge_beforeBPCorr += sfits[istrip_peak + 1].charge_beforeBPCorr;
196  }
197  res.time_beforeT0Corr = sfits[res.strip].time_beforeT0Corr;
198  res.time_beforeBPCorr = sfits[res.strip].time_beforeBPCorr;
199  //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
200  results.emplace_back(res);
201  return results;
202  }
203 
204  // Calculate strip averages.
205  double strip_mean = xsum / nstrip; // Avg strip position
206  double strip_qmean = qxsum / qsum; // Avg strip position weighted by charge
207  qerravg = qerravg / nstrip; // for centroid error calculation....
208  // Assign cluster status.
209  // Cluster is spoiled if it is on the edge or has multiple peaks.
210  res.fitStatus = 0;
211  res.clusterStatus = Muon::CscStatusSimple;
212  if (edge)
213  res.clusterStatus = Muon::CscStatusEdge;
214  else if (peak_count > 1)
215  res.clusterStatus = Muon::CscStatusMultiPeak;
216 
217  double savg = -99.;
218  if (m_option == "MEAN") {
219  savg = strip_mean;
220  } else if (m_option == "PEAK") {
221  savg = strip0 + istrip_peak;
222  } else if (m_option == "CENTROID") {
223  savg = strip_qmean;
224  } else {
225  ATH_MSG_WARNING("Invalid position option: " << m_option);
226  res.clusterStatus = Muon::CscStatusUndefined;
227  }
228 
229  // WP treats.... special centroid method....
230  if (m_use_peakthreshold && nstrip > 2 && peak_count == 1) savg = strip_qmean;
231 
232  if (measphi) savg = strip_mean;
233 
234  // Assign cluster identifier and time using the center of the cluster.
235  // res.strip = (sfits.size()-1)/2;
236  // Assign cluster identifier and time using peak strip 2/24/2009
237  res.strip = istrip_peak;
238 
239  // Assign position.
240  res.position = pitch * (savg + 0.5 - 0.5 * maxstrip);
241 
242  // internal alignment ...
243  Identifier id = sfits[res.strip].strip->identify();
244  double offset = m_alignmentTool->getAlignmentOffset(id);
245  res.position -= offset;
246 
247  // Assign position error.
248  double wmeas = pitch * nstrip;
249  double weff = wmeas - m_intrinsic_cluster_width;
250  double weffmin = 0.5 * wmeas;
251  if (weff < weffmin) weff = weffmin;
252  double errorScaler = measphi ? m_defaultErrorScaler_phi : m_defaultErrorScaler_eta;
253  res.dposition = errorScaler * weff / sqrt(12.0); // CENTROID doesn't make any effect on the case nstrip=1
254  /*
255  if (nstrip>1) {
256  if ( m_option == "CENTROID" || ( m_use_peakthreshold && nstrip>2 && peak_count==1) ) {
257  double scale_centroid = qerravg/qsum;
258  double xxsum =0;
259  for ( unsigned int istrip =0; istrip<nstrip; ++istrip ) {
260  StripFit sfit = sfits[istrip];
261  stripidx = strip0+istrip;
262  xxsum += (stripidx-strip_qmean)*(stripidx-strip_qmean);
263  }
264 
265  res.dposition = pitch*scale_centroid*sqrt(xxsum);
266  ATH_MSG_VERBOSE ("qerravg:qsum:scale_centroid:xxsum:res.dposition= "
267  << qerravg << ":" << qsum << ":" << scale_centroid << ":"<< xxsum << ":"<< res.dposition);
268  }
269  }
270  */
271  ATH_MSG_VERBOSE(" Simple Fit Result "
272  << " nstr=" << nstrip << "[sector:wlay:measphi]= " << sector << ":" << wlay << ":" << measphi << " strip0=" << strip0
273  << " istrip_peak=" << istrip_peak << " peaktime=" << sfits[istrip_peak].time
274  << " peakstatus=" << sfits[istrip_peak].status << " peaktimeStatus=" << sfits[istrip_peak].timeStatus
275  << " pos=" << res.position << " dpos=" << res.dposition << " chg=" << qsum);
276 
277  // cluster charge should be qsum over three strip... 3/21/2011
278  res.fstrip = 0;
279  res.lstrip = nstrip - 1;
280  res.time = sfits[istrip_peak].time;
281  res.timeStatus = sfits[istrip_peak].timeStatus;
282  res.qpeak = sfits[istrip_peak].charge;
283 
284  res.charge = res.qpeak;
285  res.charge_beforeBPCorr = sfits[res.strip].charge_beforeBPCorr;
286 
287  res.qleft = 0.;
288  res.qright = 0.;
289 
290  if (istrip_peak >= 1) {
291  res.qleft = sfits[istrip_peak - 1].charge;
292  res.charge += res.qleft;
293  res.charge_beforeBPCorr += sfits[istrip_peak - 1].charge_beforeBPCorr;
294  }
295  if (istrip_peak + 1 < nstrip) {
296  res.qright = sfits[istrip_peak + 1].charge;
297  res.charge += res.qright;
298  res.charge_beforeBPCorr += sfits[istrip_peak + 1].charge_beforeBPCorr;
299  }
300  res.time_beforeT0Corr = sfits[res.strip].time_beforeT0Corr;
301  res.time_beforeBPCorr = sfits[res.strip].time_beforeBPCorr;
302 
303  // res.charge = qsum;
304 
305  results.emplace_back(res);
306  return results;
307 }

◆ fit() [2/4]

virtual Results ICscClusterFitter::fit

◆ fit() [3/4]

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

Implements ICscClusterFitter.

Definition at line 311 of file SimpleCscClusterFitter.cxx.

311 { return fit(sfits); }

◆ fit() [4/4]

virtual Results ICscClusterFitter::fit

◆ getCorrectedError()

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

Implements ICscClusterFitter.

Definition at line 314 of file SimpleCscClusterFitter.cxx.

314 { return 0; }

◆ initialize()

StatusCode SimpleCscClusterFitter::initialize ( )

Definition at line 40 of file SimpleCscClusterFitter.cxx.

40  {
41  ATH_MSG_DEBUG(" Position option: " << m_option);
42  ATH_MSG_DEBUG(" Intrinsic width: " << m_intrinsic_cluster_width << " mm");
43 
44  ATH_CHECK(m_idHelperSvc.retrieve());
45  ATH_CHECK(m_alignmentTool.retrieve());
46  // retrieve MuonDetectorManager from the conditions store
48  return StatusCode::SUCCESS;
49 }

◆ 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_alignmentTool

ToolHandle<ICscAlignmentTool> SimpleCscClusterFitter::m_alignmentTool
private
Initial value:
{
this,
"CscAlignmentTool",
"CscAlignmentTool/CscAlignmentTool",
}

Definition at line 54 of file SimpleCscClusterFitter.h.

◆ m_defaultErrorScaler_eta

double SimpleCscClusterFitter::m_defaultErrorScaler_eta
private

Definition at line 45 of file SimpleCscClusterFitter.h.

◆ m_defaultErrorScaler_phi

double SimpleCscClusterFitter::m_defaultErrorScaler_phi
private

Definition at line 46 of file SimpleCscClusterFitter.h.

◆ m_DetectorManagerKey

SG::ReadCondHandleKey<MuonGM::MuonDetectorManager> SimpleCscClusterFitter::m_DetectorManagerKey
private
Initial value:
{this, "DetectorManagerKey", "MuonDetectorManager",
"Key of input MuonDetectorManager condition data"}

retrieve MuonDetectorManager from the conditions store

Definition at line 51 of file SimpleCscClusterFitter.h.

◆ 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> SimpleCscClusterFitter::m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
private

Definition at line 48 of file SimpleCscClusterFitter.h.

◆ m_intrinsic_cluster_width

double SimpleCscClusterFitter::m_intrinsic_cluster_width
private

Definition at line 43 of file SimpleCscClusterFitter.h.

◆ m_option

std::string SimpleCscClusterFitter::m_option
private

Definition at line 42 of file SimpleCscClusterFitter.h.

◆ m_use_peakthreshold

bool SimpleCscClusterFitter::m_use_peakthreshold
private

Definition at line 44 of file SimpleCscClusterFitter.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:
SimpleCscClusterFitter::m_option
std::string m_option
Definition: SimpleCscClusterFitter.h:42
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
SimpleCscClusterFitter::m_defaultErrorScaler_eta
double m_defaultErrorScaler_eta
Definition: SimpleCscClusterFitter.h:45
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
DataNames
ICscClusterFitter::DataNames DataNames
Definition: CscSplitClusterFitter.cxx:20
SimpleCscClusterFitter::m_use_peakthreshold
bool m_use_peakthreshold
Definition: SimpleCscClusterFitter.h:44
SimpleCscClusterFitter::fit
Results fit(const StripFitList &sfits) const
Definition: SimpleCscClusterFitter.cxx:53
MuonGM::CscReadoutElement
Definition: CscReadoutElement.h:56
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
SimpleCscClusterFitter::m_alignmentTool
ToolHandle< ICscAlignmentTool > m_alignmentTool
Definition: SimpleCscClusterFitter.h:54
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
python.Dumpers.aname
string aname
Definition: Dumpers.py:5541
SimpleCscClusterFitter::m_intrinsic_cluster_width
double m_intrinsic_cluster_width
Definition: SimpleCscClusterFitter.h:43
Muon::CscStripPrepData
Class representing the raw data of one CSC strip (for clusters look at Muon::CscPrepData).
Definition: CscStripPrepData.h:40
SimpleCscClusterFitter::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: SimpleCscClusterFitter.h:48
MuonGM::CscReadoutElement::maxNumberOfStrips
int maxNumberOfStrips(int measuresPhi) const
Definition: CscReadoutElement.cxx:162
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
MuonGM::MuonDetectorManager::getCscReadoutElement
const CscReadoutElement * getCscReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx:225
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
Muon::CscStatusSimple
@ CscStatusSimple
Cluster with non-precision fit.
Definition: CscClusterStatus.h:29
res
std::pair< std::vector< unsigned int >, bool > res
Definition: JetGroupProductTest.cxx:14
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
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
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
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
Result
Definition: fbtTestBasics.cxx:47
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
SimpleCscClusterFitter::m_defaultErrorScaler_phi
double m_defaultErrorScaler_phi
Definition: SimpleCscClusterFitter.h:46
charge
double charge(const T &p)
Definition: AtlasPID.h:494
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
python.ami.results
def results
Definition: ami.py:386
Results
std::vector< Result > Results
Definition: CscSplitClusterFitter.cxx:22
Muon::CscStatusMultiPeak
@ CscStatusMultiPeak
More than one peak in cluster.
Definition: CscClusterStatus.h:37
a
TList * a
Definition: liststreamerinfos.cxx:10
h
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
MuonGM::MuonDetectorManager
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h:49
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
SimpleCscClusterFitter::m_DetectorManagerKey
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_DetectorManagerKey
retrieve MuonDetectorManager from the conditions store
Definition: SimpleCscClusterFitter.h:51
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:616
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
merge.status
status
Definition: merge.py:17
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
MuonGM::CscReadoutElement::cathodeReadoutPitch
double cathodeReadoutPitch(int chLayer, int measuresPhi) const
Definition: CscReadoutElement.cxx:147