CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions | Static Private Attributes
MTDCPEBase Class Reference

#include <MTDCPEBase.h>

Inheritance diagram for MTDCPEBase:
MTDClusterParameterEstimator

Classes

struct  ClusterParam
 
struct  DetParam
 

Public Member Functions

ReturnType getParameters (const FTLCluster &cl, const GeomDetUnit &det) const override
 
ReturnType getParameters (const FTLCluster &cl, const GeomDetUnit &det, const LocalTrajectoryParameters &ltp) const override
 
 MTDCPEBase (edm::ParameterSet const &conf, const MTDGeometry &geom)
 
- Public Member Functions inherited from MTDClusterParameterEstimator
virtual ReturnType getParameters (const FTLCluster &cl, const GeomDetUnit &det, const TrajectoryStateOnSurface &tsos) const
 
virtual VLocalValues localParametersV (const FTLCluster &cluster, const GeomDetUnit &gd) const
 
virtual VLocalValues localParametersV (const FTLCluster &cluster, const GeomDetUnit &gd, TrajectoryStateOnSurface &tsos) const
 
 MTDClusterParameterEstimator ()
 
virtual ~MTDClusterParameterEstimator ()
 

Protected Types

using DetParams = std::vector< DetParam >
 

Protected Member Functions

DetParam const & detParam (const GeomDetUnit &det) const
 

Protected Attributes

const MTDGeometrygeom_
 
DetParams m_DetParams
 

Private Member Functions

virtual TimeValue clusterTime (DetParam const &dp, ClusterParam &cp) const
 
virtual TimeValueError clusterTimeError (DetParam const &dp, ClusterParam &cp) const
 
virtual LocalError localError (DetParam const &dp, ClusterParam &cp) const
 
virtual LocalPoint localPosition (DetParam const &dp, ClusterParam &cp) const
 

Static Private Attributes

static constexpr float sigma_flat = 0.2886751f
 

Additional Inherited Members

- Public Types inherited from MTDClusterParameterEstimator
typedef std::pair< LocalPoint, LocalErrorLocalValues
 
using ReturnType = std::tuple< LocalPoint, LocalError, TimeValue, TimeValueError >
 
typedef float TimeValue
 
typedef float TimeValueError
 
typedef std::vector< LocalValuesVLocalValues
 

Detailed Description

Definition at line 31 of file MTDCPEBase.h.

Member Typedef Documentation

◆ DetParams

using MTDCPEBase::DetParams = std::vector<DetParam>
protected

Definition at line 100 of file MTDCPEBase.h.

Constructor & Destructor Documentation

◆ MTDCPEBase()

MTDCPEBase::MTDCPEBase ( edm::ParameterSet const &  conf,
const MTDGeometry geom 
)

Definition at line 21 of file MTDCPEBase.cc.

References cms::cuda::assert(), MuonGeometrySanityCheck_cfi::detectors(), MTDGeometry::detUnits(), geom_, mps_fire::i, LogDebug, m_DetParams, and AlCaHLTBitMon_ParallelJobs::p.

21  : geom_(geom) {
22  //-----------------------------------------------------------------------------
23  // Fill all variables which are constant for an event (geometry)
24  //-----------------------------------------------------------------------------
25  auto const& dus = geom_.detUnits();
26  unsigned detectors = dus.size();
27  m_DetParams.resize(detectors);
28  LogDebug("MTDCPEBase::fillDetParams():") << "caching " << detectors << "MTD detectors" << endl;
29  for (unsigned i = 0; i != detectors; ++i) {
30  auto& p = m_DetParams[i];
31  p.theDet = dynamic_cast<const MTDGeomDetUnit*>(dus[i]);
32  assert(p.theDet);
33 
34  p.theOrigin = p.theDet->surface().toLocal(GlobalPoint(0, 0, 0));
35 
36  //--- p.theDet->type() returns a GeomDetType, which implements subDetector()
37  p.thePart = p.theDet->type().subDetector();
38 
39  //--- bounds() is implemented in BoundSurface itself.
40  p.theThickness = p.theDet->surface().bounds().thickness();
41 
42  // Cache the det id for templates and generic erros
43  p.theTopol = &(static_cast<const ProxyMTDTopology&>(p.theDet->topology()));
44  assert(p.theTopol);
45  p.theRecTopol = &(static_cast<const RectangularMTDTopology&>(p.theTopol->specificTopology()));
46  assert(p.theRecTopol);
47 
48  //--- The geometrical description of one module/plaquette
49  std::pair<float, float> pitchxy = p.theRecTopol->pitch();
50  p.thePitchX = pitchxy.first; // pitch along x
51  p.thePitchY = pitchxy.second; // pitch along y
52 
53  LogDebug("MTDCPEBase::fillDetParams()") << "***** MTD LAYOUT *****"
54  << " thePart = " << p.thePart << " theThickness = " << p.theThickness
55  << " thePitchX = " << p.thePitchX << " thePitchY = " << p.thePitchY;
56  }
57 }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
assert(be >=bs)
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
Definition: MTDGeometry.h:27
def detectors(dt=True, csc=True, me42=False, chambers=True, superlayers=False, layers=False)
DetParams m_DetParams
Definition: MTDCPEBase.h:101
const MTDGeometry & geom_
Definition: MTDCPEBase.h:91
#define LogDebug(id)

Member Function Documentation

◆ clusterTime()

MTDCPEBase::TimeValue MTDCPEBase::clusterTime ( DetParam const &  dp,
ClusterParam cp 
) const
privatevirtual

Definition at line 92 of file MTDCPEBase.cc.

Referenced by getParameters().

92  {
93  return cp.theCluster->time();
94 }

◆ clusterTimeError()

MTDCPEBase::TimeValueError MTDCPEBase::clusterTimeError ( DetParam const &  dp,
ClusterParam cp 
) const
privatevirtual

Definition at line 96 of file MTDCPEBase.cc.

Referenced by getParameters().

96  {
97  return cp.theCluster->timeError();
98 }

◆ detParam()

MTDCPEBase::DetParam const & MTDCPEBase::detParam ( const GeomDetUnit det) const
protected

Definition at line 60 of file MTDCPEBase.cc.

References GeomDet::index(), and m_DetParams.

Referenced by getParameters().

60 { return m_DetParams.at(det.index()); }
int index() const
Definition: GeomDet.h:83
DetParams m_DetParams
Definition: MTDCPEBase.h:101

◆ getParameters() [1/2]

ReturnType MTDCPEBase::getParameters ( const FTLCluster cl,
const GeomDetUnit det 
) const
inlineoverridevirtual

Implements MTDClusterParameterEstimator.

Definition at line 57 of file MTDCPEBase.h.

References haddnano::cl, clusterTime(), clusterTimeError(), CommonMethods::cp(), detParam(), Calorimetry_cff::dp, localError(), localPosition(), and mkLumiAveragedPlots::tuple.

Referenced by getParameters().

57  {
58  DetParam const& dp = detParam(det);
59  ClusterParam cp(cl);
60  auto tuple =
61  std::make_tuple(localPosition(dp, cp), localError(dp, cp), clusterTime(dp, cp), clusterTimeError(dp, cp));
62  return tuple;
63  }
virtual LocalError localError(DetParam const &dp, ClusterParam &cp) const
Definition: MTDCPEBase.cc:74
DetParam const & detParam(const GeomDetUnit &det) const
Definition: MTDCPEBase.cc:60
virtual TimeValue clusterTime(DetParam const &dp, ClusterParam &cp) const
Definition: MTDCPEBase.cc:92
virtual LocalPoint localPosition(DetParam const &dp, ClusterParam &cp) const
Definition: MTDCPEBase.cc:62
virtual TimeValueError clusterTimeError(DetParam const &dp, ClusterParam &cp) const
Definition: MTDCPEBase.cc:96
def cp(fromDir, toDir, listOfFiles, overwrite=False, smallList=False)

◆ getParameters() [2/2]

ReturnType MTDCPEBase::getParameters ( const FTLCluster cl,
const GeomDetUnit det,
const LocalTrajectoryParameters ltp 
) const
inlineoverridevirtual

Implements MTDClusterParameterEstimator.

Definition at line 68 of file MTDCPEBase.h.

References haddnano::cl, and getParameters().

70  {
71  return getParameters(cl, det);
72  }
ReturnType getParameters(const FTLCluster &cl, const GeomDetUnit &det) const override
Definition: MTDCPEBase.h:57

◆ localError()

LocalError MTDCPEBase::localError ( DetParam const &  dp,
ClusterParam cp 
) const
privatevirtual

Definition at line 74 of file MTDCPEBase.cc.

References Calorimetry_cff::dp, sigma_flat, and LocalError::yy().

Referenced by getParameters().

74  {
75  MeasurementPoint pos(cp.theCluster->x(), cp.theCluster->y());
76  float sigma2 = cp.theCluster->positionError(sigma_flat);
77  sigma2 *= sigma2;
78  MeasurementError posErr(sigma2, 0, sigma2);
79  LocalError outErr = dp.theTopol->localError(pos, posErr);
80 
81  if (cp.theCluster->getClusterErrorX() < 0.) {
82  return outErr;
83  } else {
84  LocalPoint outPos(cp.theCluster->getClusterPosX(), dp.theTopol->localY(pos.y()));
85  float sigmaX2 = cp.theCluster->getClusterErrorX();
86  sigmaX2 *= sigmaX2;
87  LocalError outErrDet(sigmaX2, 0, outErr.yy());
88  return outErrDet;
89  }
90 }
static constexpr float sigma_flat
Definition: MTDCPEBase.h:83
float yy() const
Definition: LocalError.h:24

◆ localPosition()

LocalPoint MTDCPEBase::localPosition ( DetParam const &  dp,
ClusterParam cp 
) const
privatevirtual

Definition at line 62 of file MTDCPEBase.cc.

References Calorimetry_cff::dp, and MillePedeFileConverter_cfg::out.

Referenced by getParameters().

62  {
63  //remember measurement point is row(col)+0.5f
64  MeasurementPoint pos(cp.theCluster->x(), cp.theCluster->y());
65 
66  if (cp.theCluster->getClusterErrorX() < 0.) {
67  return dp.theTopol->localPosition(pos);
68  } else {
69  LocalPoint out(cp.theCluster->getClusterPosX(), dp.theTopol->localY(pos.y()));
70  return out;
71  }
72 }

Member Data Documentation

◆ geom_

const MTDGeometry& MTDCPEBase::geom_
protected

Definition at line 91 of file MTDCPEBase.h.

Referenced by MTDCPEBase().

◆ m_DetParams

DetParams MTDCPEBase::m_DetParams
protected

Definition at line 101 of file MTDCPEBase.h.

Referenced by detParam(), and MTDCPEBase().

◆ sigma_flat

constexpr float MTDCPEBase::sigma_flat = 0.2886751f
staticprivate

Definition at line 83 of file MTDCPEBase.h.

Referenced by localError().