CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
MTDCPEBase.cc
Go to the documentation of this file.
4 
6 
7 // MessageLogger
9 
10 // Magnetic field
12 
13 #include <iostream>
14 
15 using namespace std;
16 
17 //-----------------------------------------------------------------------------
18 // A constructor run for generic and templates
19 //
20 //-----------------------------------------------------------------------------
21 MTDCPEBase::MTDCPEBase(edm::ParameterSet const& conf, const MTDGeometry& geom) : 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 }
58 
59 //------------------------------------------------------------------------
60 MTDCPEBase::DetParam const& MTDCPEBase::detParam(const GeomDetUnit& det) const { return m_DetParams.at(det.index()); }
61 
63  //remember measurement point is row(col)+0.5f
64  MeasurementPoint pos(cp.theCluster->x(), cp.theCluster->y());
65  return dp.theTopol->localPosition(pos);
66 }
67 
69  constexpr double one_over_twelve = 1. / 12.;
70  MeasurementPoint pos(cp.theCluster->x(), cp.theCluster->y());
71  MeasurementError simpleRect(one_over_twelve, 0, one_over_twelve);
72  return dp.theTopol->localError(pos, simpleRect);
73 }
74 
76  return cp.theCluster->time();
77 }
78 
80  return cp.theCluster->timeError();
81 }
virtual LocalError localError(DetParam const &dp, ClusterParam &cp) const
Definition: MTDCPEBase.cc:68
float y() const
Definition: FTLCluster.h:125
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
const FTLCluster * theCluster
Definition: MTDCPEBase.h:51
LocalPoint localPosition(const MeasurementPoint &) const override
float time() const
Definition: FTLCluster.h:130
virtual TimeValue clusterTime(DetParam const &dp, ClusterParam &cp) const
Definition: MTDCPEBase.cc:75
assert(be >=bs)
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
Definition: MTDGeometry.h:27
float timeError() const
Definition: FTLCluster.h:135
float x() const
Definition: FTLCluster.h:120
DetParams m_DetParams
Definition: MTDCPEBase.h:99
virtual TimeValueError clusterTimeError(DetParam const &dp, ClusterParam &cp) const
Definition: MTDCPEBase.cc:79
int index() const
Definition: GeomDet.h:83
LocalError localError(const MeasurementPoint &, const MeasurementError &) const override
DetParam const & detParam(const GeomDetUnit &det) const
Definition: MTDCPEBase.cc:60
const ProxyMTDTopology * theTopol
Definition: MTDCPEBase.h:36
virtual LocalPoint localPosition(DetParam const &dp, ClusterParam &cp) const
Definition: MTDCPEBase.cc:62
const MTDGeometry & geom_
Definition: MTDCPEBase.h:89
MTDCPEBase(edm::ParameterSet const &conf, const MTDGeometry &geom)
Definition: MTDCPEBase.cc:21
#define LogDebug(id)