CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Public Attributes | Private Attributes
VectorHitBuilderAlgorithmBase Class Referenceabstract

#include <VectorHitBuilderAlgorithmBase.h>

Inheritance diagram for VectorHitBuilderAlgorithmBase:
VectorHitBuilderAlgorithm

Public Types

typedef Detset::const_iterator const_iterator
 
typedef edmNew::DetSet
< Phase2TrackerCluster1D
Detset
 
typedef edmNew::DetSetVector
< VectorHit
output_t
 
typedef edm::Ref
< edmNew::DetSetVector
< Phase2TrackerCluster1D >
, Phase2TrackerCluster1D
Phase2TrackerCluster1DRef
 
typedef std::pair
< StackGeomDet, std::vector
< Phase2TrackerCluster1D > > 
StackClusters
 

Public Member Functions

virtual VectorHit buildVectorHit (const StackGeomDet *stack, Phase2TrackerCluster1DRef lower, Phase2TrackerCluster1DRef upper) const =0
 
virtual void buildVectorHits (VectorHitCollection &vhAcc, VectorHitCollection &vhRej, DetId detIdStack, const StackGeomDet *stack, edm::Handle< edmNew::DetSetVector< Phase2TrackerCluster1D >> clusters, const Detset &DSVinner, const Detset &DSVouter, const std::vector< bool > &phase2OTClustersToSkip=std::vector< bool >()) const =0
 
double computeParallaxCorrection (const PixelGeomDetUnit *, const Point3DBase< float, LocalTag > &, const PixelGeomDetUnit *, const Point3DBase< float, LocalTag > &) const
 
void printCluster (const GeomDet *geomDetUnit, const Phase2TrackerCluster1D *cluster) const
 
void printClusters (const edmNew::DetSetVector< Phase2TrackerCluster1D > &clusters) const
 
virtual void run (edm::Handle< edmNew::DetSetVector< Phase2TrackerCluster1D >> clusters, VectorHitCollection &vhAcc, VectorHitCollection &vhRej, edmNew::DetSetVector< Phase2TrackerCluster1D > &clustersAcc, edmNew::DetSetVector< Phase2TrackerCluster1D > &clustersRej) const =0
 
 VectorHitBuilderAlgorithmBase (const edm::ParameterSet &, const TrackerGeometry *, const TrackerTopology *, const ClusterParameterEstimator< Phase2TrackerCluster1D > *)
 
virtual ~VectorHitBuilderAlgorithmBase ()
 

Public Attributes

std::vector< double > barrelCut_
 
const
ClusterParameterEstimator
< Phase2TrackerCluster1D > * 
cpe_
 
std::vector< double > endcapCut_
 
unsigned int nMaxVHforeachStack_
 
const TrackerGeometrytkGeom_
 
const TrackerTopologytkTopo_
 

Private Attributes

edm::ESInputTag cpeTag_
 

Detailed Description

Definition at line 18 of file VectorHitBuilderAlgorithmBase.h.

Member Typedef Documentation

Definition at line 22 of file VectorHitBuilderAlgorithmBase.h.

Definition at line 21 of file VectorHitBuilderAlgorithmBase.h.

Definition at line 23 of file VectorHitBuilderAlgorithmBase.h.

Definition at line 20 of file VectorHitBuilderAlgorithmBase.h.

Definition at line 24 of file VectorHitBuilderAlgorithmBase.h.

Constructor & Destructor Documentation

VectorHitBuilderAlgorithmBase::VectorHitBuilderAlgorithmBase ( const edm::ParameterSet conf,
const TrackerGeometry tkGeomProd,
const TrackerTopology tkTopoProd,
const ClusterParameterEstimator< Phase2TrackerCluster1D > *  cpeProd 
)

Definition at line 12 of file VectorHitBuilderAlgorithmBase.cc.

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")) {}
const ClusterParameterEstimator< Phase2TrackerCluster1D > * cpe_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
virtual VectorHitBuilderAlgorithmBase::~VectorHitBuilderAlgorithmBase ( )
inlinevirtual

Definition at line 30 of file VectorHitBuilderAlgorithmBase.h.

30 {}

Member Function Documentation

virtual VectorHit VectorHitBuilderAlgorithmBase::buildVectorHit ( const StackGeomDet stack,
Phase2TrackerCluster1DRef  lower,
Phase2TrackerCluster1DRef  upper 
) const
pure virtual

Implemented in VectorHitBuilderAlgorithm.

virtual void VectorHitBuilderAlgorithmBase::buildVectorHits ( VectorHitCollection vhAcc,
VectorHitCollection vhRej,
DetId  detIdStack,
const StackGeomDet stack,
edm::Handle< edmNew::DetSetVector< Phase2TrackerCluster1D >>  clusters,
const Detset DSVinner,
const Detset DSVouter,
const std::vector< bool > &  phase2OTClustersToSkip = std::vector< bool >() 
) const
pure virtual

Implemented in VectorHitBuilderAlgorithm.

double VectorHitBuilderAlgorithmBase::computeParallaxCorrection ( const PixelGeomDetUnit geomDetUnit_low,
const Point3DBase< float, LocalTag > &  lPosClu_low,
const PixelGeomDetUnit geomDetUnit_upp,
const Point3DBase< float, LocalTag > &  lPosClu_upp 
) const

Definition at line 25 of file VectorHitBuilderAlgorithmBase.cc.

References LogTrace, GeomDet::surface(), Surface::toGlobal(), GloballyPositioned< T >::toLocal(), PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by VectorHitBuilderAlgorithm::buildVectorHits().

28  {
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 }
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:79
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
#define LogTrace(id)
LocalPoint toLocal(const GlobalPoint &gp) const
T z() const
Definition: PV3DBase.h:61
T x() const
Definition: PV3DBase.h:59
void VectorHitBuilderAlgorithmBase::printCluster ( const GeomDet geomDetUnit,
const Phase2TrackerCluster1D cluster 
) const

Definition at line 67 of file VectorHitBuilderAlgorithmBase.cc.

References Surface::bounds(), cpe_, GeomDet::geographicalId(), TrackerGeometry::getDetectorType(), phase1PixelTopology::layer, TrackerTopology::layer(), Bounds::length(), ClusterParameterEstimator< T >::localParameters(), LogTrace, callgraph::module, TrackerTopology::module(), TrackerGeometry::Ph2PSP, TrackerGeometry::Ph2PSS, TrackerGeometry::Ph2SS, PixelTopology::pitch(), DetId::rawId(), PixelGeomDetUnit::specificTopology(), GeomDet::surface(), tkGeom_, tkTopo_, Surface::toGlobal(), and Bounds::width().

Referenced by VectorHitBuilderAlgorithm::buildVectorHit(), VectorHitBuilderAlgorithm::buildVectorHits(), and printClusters().

68  {
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 }
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:79
virtual float length() const =0
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
const Bounds & bounds() const
Definition: Surface.h:87
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
#define LogTrace(id)
constexpr std::array< uint8_t, layerIndexSize > layer
virtual LocalValues localParameters(const T &, const GeomDetUnit &) const =0
unsigned int module(const DetId &id) const
const ClusterParameterEstimator< Phase2TrackerCluster1D > * cpe_
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
ModuleType getDetectorType(DetId) const
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
unsigned int layer(const DetId &id) const
virtual std::pair< float, float > pitch() const =0
virtual float width() const =0
tuple module
Definition: callgraph.py:69
void VectorHitBuilderAlgorithmBase::printClusters ( const edmNew::DetSetVector< Phase2TrackerCluster1D > &  clusters) const

Definition at line 49 of file VectorHitBuilderAlgorithmBase.cc.

References TrackerGeometry::idToDetUnit(), LogDebug, printCluster(), and tkGeom_.

Referenced by VectorHitBuilderEDProducer::produce().

49  {
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 }
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
void printCluster(const GeomDet *geomDetUnit, const Phase2TrackerCluster1D *cluster) const
#define LogDebug(id)
virtual void VectorHitBuilderAlgorithmBase::run ( edm::Handle< edmNew::DetSetVector< Phase2TrackerCluster1D >>  clusters,
VectorHitCollection vhAcc,
VectorHitCollection vhRej,
edmNew::DetSetVector< Phase2TrackerCluster1D > &  clustersAcc,
edmNew::DetSetVector< Phase2TrackerCluster1D > &  clustersRej 
) const
pure virtual

Implemented in VectorHitBuilderAlgorithm.

Member Data Documentation

std::vector<double> VectorHitBuilderAlgorithmBase::barrelCut_
const ClusterParameterEstimator<Phase2TrackerCluster1D>* VectorHitBuilderAlgorithmBase::cpe_
edm::ESInputTag VectorHitBuilderAlgorithmBase::cpeTag_
private

Definition at line 68 of file VectorHitBuilderAlgorithmBase.h.

std::vector<double> VectorHitBuilderAlgorithmBase::endcapCut_
unsigned int VectorHitBuilderAlgorithmBase::nMaxVHforeachStack_

Definition at line 63 of file VectorHitBuilderAlgorithmBase.h.

const TrackerGeometry* VectorHitBuilderAlgorithmBase::tkGeom_
const TrackerTopology* VectorHitBuilderAlgorithmBase::tkTopo_