![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
37 return "no such plane";
40 CscPlane findPlane(
int station,
bool measphi) {
46 }
else if (station == 2) {
104 declareInterface<ICscClusterFitter>(
this);
133 return StatusCode::SUCCESS;
138 static const DataNames dnames ={
"qA",
"qB",
"qC"};
161 unsigned int nstrip = sfits.size();
163 ATH_MSG_VERBOSE(
" CscStatusNarrow: Input has fewer than three strips.");
169 for (
unsigned int istrip = 0; istrip < nstrip; istrip++) {
170 if (sfits[istrip].
strip ==
nullptr) {
184 if (MuonDetMgr ==
nullptr) {
185 ATH_MSG_ERROR(
"Null pointer to the MuonDetectorManager conditions object");
191 bool measphi =
m_idHelperSvc->cscIdHelper().CscIdHelper::measuresPhi(idStrip0);
194 unsigned int strip0 =
m_idHelperSvc->cscIdHelper().strip(idStrip0) - 1;
195 int station =
m_idHelperSvc->cscIdHelper().stationName(idStrip0) - 49;
196 CscPlane plane = findPlane(station, measphi);
198 ATH_MSG_WARNING(
"Invalid CSC plane: station=" << station <<
"; measphi=" << measphi);
206 for (
unsigned int istrip = 0; istrip < nstrip; ++istrip) {
207 Identifier id = sfits[istrip].strip->identify();
210 <<
" amp:" << (
int)(sfits[istrip].charge / 1000) <<
" ke.");
215 unsigned int istrip_peak = 0;
219 double charge_clu = sfits[0].charge + sfits[nstrip - 1].charge;
220 for (
unsigned int istrip = 1; istrip < nstrip - 1; ++istrip) {
221 float qthis = sfits[istrip].charge;
222 float qlast = sfits[istrip - 1].charge;
223 float qnext = sfits[istrip + 1].charge;
224 double thr =
m_multi * sfits[istrip].dcharge / 10;
225 Identifier id = sfits[istrip].strip->identify();
227 <<
" amp:" << (
int)(sfits[istrip].charge / 1000) <<
" ke, thr: " << (
int)(thr / 1000) <<
" ke "
228 << ((qthis > thr) ?
"signal" :
"noise") << sfits[istrip].dcharge / 1000);
232 if ((qthis >= qlast) && (qthis >= qnext)) {
234 istrip_peak = istrip;
237 if (qthis > thr) numPeaks++;
241 ATH_MSG_VERBOSE(
" Peak is at index " << istrip_peak <<
" amp = " << qpeak / 1000);
244 ATH_MSG_VERBOSE(
" CscStatusMultiPeak: multiple peaks are found: " << numPeaks);
248 if (istrip_peak == 0) {
257 if (strip0 + istrip_peak <= 0 || strip0 + istrip_peak >= maxstrip - 1) {
259 ATH_MSG_VERBOSE(
" CscStatusEdge: strip0+istrip_peak = " << strip0 + istrip_peak);
290 double qA = sfits[istrip_peak - 1].charge;
291 double qB = sfits[istrip_peak].charge;
292 double qC = sfits[istrip_peak + 1].charge;
295 double dqA = sfits[istrip_peak - 1].dcharge;
296 double dqB = sfits[istrip_peak].dcharge;
297 double dqC = sfits[istrip_peak + 1].dcharge;
311 double cog = 1.2 * (qC - qA) / (qA + qB + qC);
315 double dpos = (dqA + dqB + dqC) / 3 / (qA + qB + qC) * pitch * std::sqrt(2.0);
317 if (measphi) dpos = 2.5;
327 savg =
pos + strip0 + istrip_peak;
329 ATH_MSG_VERBOSE(
" Parabola correction: plane = '" << splane(plane) <<
"' qA=" << qA <<
" qB=" << qB <<
" qC=" << qC <<
" raw=" << raw
330 <<
" pos=" <<
pos <<
", cog=" << cog);
342 res.position = pitch * (savg + 0.5 - 0.5 * maxstrip);
343 res.dposition = std::sqrt(dpos * dpos + dpostht * dpostht);
344 res.strip = istrip_peak;
346 res.lstrip = nstrip - 1;
347 res.charge = charge_clu;
348 res.time = sfits[
res.strip].time;
354 ATH_MSG_VERBOSE(
" Position: pos=" <<
res.position <<
" dpos:dtht=" << dpos <<
":" << dpostht <<
" ==>" <<
res.dposition
355 <<
" at tanth = " << tantheta);
376 int station =
m_idHelperSvc->cscIdHelper().stationName(idStrip0) - 49;
389 double newError = std::sqrt(dpos * dpos - old_dpostht * old_dpostht + new_dpostht * new_dpostht);
391 ATH_MSG_VERBOSE(
" Position :: pos=" <<
pos <<
" dpos:newdpos=" << dpos <<
" : " << newError <<
" " << old_dpostht <<
" "
401 for (
unsigned int iresult = 0; iresult <
results.size(); ++iresult) {
404 new_results.push_back(
res);
410 int station =
m_idHelperSvc->cscIdHelper().stationName(idStrip0) - 49;
413 double pos =
res.position;
421 double dpos =
res.dposition;
422 res.dposition = std::sqrt(dpos * dpos + dpostht * dpostht);
425 new_results.push_back(
res);
double getCorrectedError(const Muon::CscPrepData *pclu, double slope) const
Correct the positon error for track angle.
std::vector< Result > Results
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_DetectorManagerKey
retrieve MuonDetectorManager from the conditions store
const Amg::MatrixX & localCovariance() const
return const ref to the error matrix
ICscClusterFitter::Result Result
ICscClusterFitter::DataNames DataNames
#define ATH_MSG_VERBOSE(x)
double m_xtan_csl_eta_offset
constant to Calculate the angle of incidence.
Class representing the raw data of one CSC strip (for clusters look at Muon::CscPrepData).
double m_xtan_csl_eta_slope
constant to Calculate the angle of incidence.
int maxNumberOfStrips(int measuresPhi) const
const CscReadoutElement * getCscReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
Class representing clusters from the CSC.
::StatusCode StatusCode
StatusCode definition for legacy code.
double m_xtan_css_eta_offset
constant to Calculate the angle of incidence.
std::vector< std::string > DataNames
std::pair< std::vector< unsigned int >, bool > res
std::vector< unsigned int > m_max_width
Max.
const DataNames & dataNames() const
data names for ntuple output in csc_cluster tree
std::map< std::string, double > DataMap
Identifier identify() const
return the identifier
@ CscStatusNarrow
Too narrow.
@ CscStatusUnspoiled
Clean cluster with precision fit.
static double ParabolaCorrection(CscPlane &plane, double &raw)
Correction of raw parabola positions.
Results fit(const StripFitList &sfits) const
double error(const Amg::MatrixX &mat, int index)
return diagonal error of the matrix caller should ensure the matrix is symmetric and the index is in ...
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
const Amg::Vector2D & localPosition() const
return the local position reference
StatusCode initialize(bool used=true)
std::vector< Result > Results
@ CscStatusMultiPeak
More than one peak in cluster.
double m_multi
threshold multiplier for cluster peak finding
ParabolaCscClusterFitter(const std::string &type, const std::string &aname, const IInterface *parent)
Constructor.
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
#define ATH_MSG_WARNING(x)
std::vector< StripFit > StripFitList
CscClusterStatus
Enum to represent the cluster status - see the specific enum values for more details.
double m_xtan_css_eta_slope
constant to Calculate the angle of incidence.
double m_error_tantheta
error contribution in mm for the tan(theta) track angle correction
@ CscStatusEdge
Cluster reaches the edge of plane.
double cathodeReadoutPitch(int chLayer, int measuresPhi) const