CMS 3D CMS Logo

VectorHitBuilderAlgorithmBase.cc
Go to the documentation of this file.
5 
9 
11 
13  const edm::ParameterSet& conf,
14  const TrackerGeometry* tkGeomProd,
15  const TrackerTopology* tkTopoProd,
17  : tkGeom_(tkGeomProd),
18  tkTopo_(tkTopoProd),
19  cpe_(cpeProd),
20  nMaxVHforeachStack_(conf.getParameter<int>("maxVectorHitsInAStack")),
21  barrelCut_(conf.getParameter<std::vector<double> >("BarrelCut")),
22  endcapCut_(conf.getParameter<std::vector<double> >("EndcapCut")),
23  cpeTag_(conf.getParameter<edm::ESInputTag>("CPE")) {}
24 
26  const Point3DBase<float, LocalTag>& lPosClu_low,
27  const PixelGeomDetUnit* geomDetUnit_upp,
28  const Point3DBase<float, LocalTag>& lPosClu_upp) const {
29  double parallCorr = 0.0;
30  Global3DPoint origin(0, 0, 0);
31  Global3DPoint gPosClu_low = geomDetUnit_low->surface().toGlobal(lPosClu_low);
32  GlobalVector gV = gPosClu_low - origin;
33  LogTrace("VectorHitsBuilderValidation") << " global vector passing to the origin:" << gV;
34 
35  LocalVector lV = geomDetUnit_low->surface().toLocal(gV);
36  LogTrace("VectorHitsBuilderValidation")
37  << " local vector passing to the origin (in the lower detector system of reference):" << lV;
38  LocalVector lV_norm = lV / lV.z();
39  LogTrace("VectorHitsBuilderValidation")
40  << " normalized local vector passing to the origin (in low the lower detector system of reference):" << lV_norm;
41 
42  Global3DPoint gPosClu_upp = geomDetUnit_upp->surface().toGlobal(lPosClu_upp);
43  Local3DPoint lPosClu_uppInLow = geomDetUnit_low->surface().toLocal(gPosClu_upp);
44  parallCorr = lV_norm.x() * lPosClu_uppInLow.z();
45 
46  return parallCorr;
47 }
48 
50  int nCluster = 0;
51  int numberOfDSV = 0;
52  for (const auto& DSViter : clusters) {
53  ++numberOfDSV;
54  // Loop over the clusters in the detector unit
55  for (const auto& clustIt : DSViter) {
56  nCluster++;
57  // get the detector unit's id
58  const GeomDetUnit* geomDetUnit(tkGeom_->idToDetUnit(DSViter.detId()));
59  if (!geomDetUnit)
60  return;
61  printCluster(geomDetUnit, &clustIt);
62  }
63  }
64  LogDebug("VectorHitBuilder") << " Number of input clusters: " << nCluster << std::endl;
65 }
66 
68  const Phase2TrackerCluster1D* clustIt) const {
69  if (!geomDetUnit)
70  return;
71  const PixelGeomDetUnit* pixelGeomDetUnit = dynamic_cast<const PixelGeomDetUnit*>(geomDetUnit);
72  const PixelTopology& topol = pixelGeomDetUnit->specificTopology();
73  if (!pixelGeomDetUnit)
74  return;
75 
76  unsigned int layer = tkTopo_->layer(geomDetUnit->geographicalId());
77  unsigned int module = tkTopo_->module(geomDetUnit->geographicalId());
78  LogTrace("VectorHitBuilder") << "Layer:" << layer << " and DetId: " << geomDetUnit->geographicalId().rawId()
79  << std::endl;
82  LogTrace("VectorHitBuilder") << "Pixel cluster (module:" << module << ") " << std::endl;
84  LogTrace("VectorHitBuilder") << "Strip cluster (module:" << module << ") " << std::endl;
85  else
86  LogTrace("VectorHitBuilder") << "no module?!" << std::endl;
87  LogTrace("VectorHitBuilder") << "with pitch:" << topol.pitch().first << " , " << topol.pitch().second << std::endl;
88  LogTrace("VectorHitBuilder") << " and width:" << pixelGeomDetUnit->surface().bounds().width()
89  << " , lenght:" << pixelGeomDetUnit->surface().bounds().length() << std::endl;
90 
91  auto&& lparams = cpe_->localParameters(*clustIt, *pixelGeomDetUnit);
92  Global3DPoint gparams = pixelGeomDetUnit->surface().toGlobal(lparams.first);
93 
94  LogTrace("VectorHitBuilder") << "\t global pos " << gparams << std::endl;
95  LogTrace("VectorHitBuilder") << "\t local pos " << lparams.first << "with err " << lparams.second << std::endl;
96  LogTrace("VectorHitBuilder") << std::endl;
97 
98  return;
99 }
Vector3DBase
Definition: Vector3DBase.h:8
Bounds::width
virtual float width() const =0
MessageLogger.h
GeomDet
Definition: GeomDet.h:27
PixelTopology.h
Phase2TrackerCluster1D
Definition: Phase2TrackerCluster1D.h:10
ESInputTag
VectorHitBuilderAlgorithmBase::tkTopo_
const TrackerTopology * tkTopo_
Definition: VectorHitBuilderAlgorithmBase.h:61
TrackerGeometry::ModuleType::Ph2SS
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
edm
HLT enums.
Definition: AlignableModifier.h:19
TrackerTopology
Definition: TrackerTopology.h:16
TkPhase2OTCPERecord.h
PixelTopology::pitch
virtual std::pair< float, float > pitch() const =0
TrackerTopology::layer
unsigned int layer(const DetId &id) const
Definition: TrackerTopology.cc:47
TrackerTopology::module
unsigned int module(const DetId &id) const
Definition: TrackerTopology.cc:66
VectorHitBuilderAlgorithmBase::cpe_
const ClusterParameterEstimator< Phase2TrackerCluster1D > * cpe_
Definition: VectorHitBuilderAlgorithmBase.h:62
TrackerGeometry::getDetectorType
ModuleType getDetectorType(DetId) const
Definition: TrackerGeometry.cc:247
VectorHitBuilderAlgorithmBase::VectorHitBuilderAlgorithmBase
VectorHitBuilderAlgorithmBase(const edm::ParameterSet &, const TrackerGeometry *, const TrackerTopology *, const ClusterParameterEstimator< Phase2TrackerCluster1D > *)
Definition: VectorHitBuilderAlgorithmBase.cc:12
Bounds::length
virtual float length() const =0
TrackerGeometry::idToDetUnit
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: TrackerGeometry.cc:183
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
GeomDet::surface
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
TrackerTopology.h
PixelGeomDetUnit
Definition: PixelGeomDetUnit.h:15
Surface::bounds
const Bounds & bounds() const
Definition: Surface.h:87
TrackerGeometry::ModuleType
ModuleType
Definition: TrackerGeometry.h:29
Surface::toGlobal
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:79
Point3DBase< float, LocalTag >
PixelTopology
Definition: PixelTopology.h:10
ClusterParameterEstimator< Phase2TrackerCluster1D >
VectorHitBuilderAlgorithmBase::printCluster
void printCluster(const GeomDet *geomDetUnit, const Phase2TrackerCluster1D *cluster) const
Definition: VectorHitBuilderAlgorithmBase.cc:67
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
bsc_activity_cfg.clusters
clusters
Definition: bsc_activity_cfg.py:36
GeomDet::geographicalId
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
TrackerDigiGeometryRecord.h
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
edm::ParameterSet
Definition: ParameterSet.h:47
PixelGeomDetUnit::specificTopology
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
Definition: PixelGeomDetUnit.cc:17
VectorHitBuilderAlgorithmBase::computeParallaxCorrection
double computeParallaxCorrection(const PixelGeomDetUnit *, const Point3DBase< float, LocalTag > &, const PixelGeomDetUnit *, const Point3DBase< float, LocalTag > &) const
Definition: VectorHitBuilderAlgorithmBase.cc:25
createfilelist.int
int
Definition: createfilelist.py:10
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
ClusterParameterEstimator::localParameters
virtual LocalValues localParameters(const T &, const GeomDetUnit &) const =0
TrackerGeometry::ModuleType::Ph2PSS
VectorHitBuilderAlgorithmBase::tkGeom_
const TrackerGeometry * tkGeom_
Definition: VectorHitBuilderAlgorithmBase.h:60
callgraph.module
module
Definition: callgraph.py:61
GeomDet.h
edmNew::DetSetVector
Definition: DetSetNew.h:13
std
Definition: JetResolutionObject.h:76
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
GloballyPositioned::toLocal
LocalPoint toLocal(const GlobalPoint &gp) const
Definition: GloballyPositioned.h:98
VectorHitBuilderAlgorithmBase::printClusters
void printClusters(const edmNew::DetSetVector< Phase2TrackerCluster1D > &clusters) const
Definition: VectorHitBuilderAlgorithmBase.cc:49
PixelGeomDetUnit.h
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234
TrackerGeometry::ModuleType::Ph2PSP
VectorHitBuilderAlgorithmBase.h
TrackerGeometry
Definition: TrackerGeometry.h:14