CMS 3D CMS Logo

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< Phase2TrackerCluster1DDetset
 
typedef edmNew::DetSetVector< VectorHitoutput_t
 
typedef edm::Ref< edmNew::DetSetVector< Phase2TrackerCluster1D >, Phase2TrackerCluster1DPhase2TrackerCluster1DRef
 
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

◆ const_iterator

Definition at line 22 of file VectorHitBuilderAlgorithmBase.h.

◆ Detset

Definition at line 21 of file VectorHitBuilderAlgorithmBase.h.

◆ output_t

Definition at line 23 of file VectorHitBuilderAlgorithmBase.h.

◆ Phase2TrackerCluster1DRef

Definition at line 20 of file VectorHitBuilderAlgorithmBase.h.

◆ StackClusters

Definition at line 24 of file VectorHitBuilderAlgorithmBase.h.

Constructor & Destructor Documentation

◆ VectorHitBuilderAlgorithmBase()

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

Definition at line 10 of file VectorHitBuilderAlgorithmBase.cc.

15  : tkGeom_(tkGeomProd),
16  tkTopo_(tkTopoProd),
17  cpe_(cpeProd),
18  nMaxVHforeachStack_(conf.getParameter<int>("maxVectorHitsInAStack")),
19  barrelCut_(conf.getParameter<std::vector<double> >("BarrelCut")),
20  endcapCut_(conf.getParameter<std::vector<double> >("EndcapCut")),
21  cpeTag_(conf.getParameter<edm::ESInputTag>("CPE")) {}

◆ ~VectorHitBuilderAlgorithmBase()

virtual VectorHitBuilderAlgorithmBase::~VectorHitBuilderAlgorithmBase ( )
inlinevirtual

Definition at line 30 of file VectorHitBuilderAlgorithmBase.h.

30 {}

Member Function Documentation

◆ buildVectorHit()

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

Implemented in VectorHitBuilderAlgorithm.

◆ buildVectorHits()

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.

◆ computeParallaxCorrection()

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 23 of file VectorHitBuilderAlgorithmBase.cc.

26  {
27  double parallCorr = 0.0;
28  Global3DPoint origin(0, 0, 0);
29  Global3DPoint gPosClu_low = geomDetUnit_low->surface().toGlobal(lPosClu_low);
30  GlobalVector gV = gPosClu_low - origin;
31  LogTrace("VectorHitsBuilderValidation") << " global vector passing to the origin:" << gV;
32 
33  LocalVector lV = geomDetUnit_low->surface().toLocal(gV);
34  LogTrace("VectorHitsBuilderValidation")
35  << " local vector passing to the origin (in the lower detector system of reference):" << lV;
36  LocalVector lV_norm = lV / lV.z();
37  LogTrace("VectorHitsBuilderValidation")
38  << " normalized local vector passing to the origin (in low the lower detector system of reference):" << lV_norm;
39 
40  Global3DPoint gPosClu_upp = geomDetUnit_upp->surface().toGlobal(lPosClu_upp);
41  Local3DPoint lPosClu_uppInLow = geomDetUnit_low->surface().toLocal(gPosClu_upp);
42  parallCorr = lV_norm.x() * lPosClu_uppInLow.z();
43 
44  return parallCorr;
45 }

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

Referenced by VectorHitBuilderAlgorithm::buildVectorHits().

◆ printCluster()

void VectorHitBuilderAlgorithmBase::printCluster ( const GeomDet geomDetUnit,
const Phase2TrackerCluster1D cluster 
) const

Definition at line 65 of file VectorHitBuilderAlgorithmBase.cc.

66  {
67  if (!geomDetUnit)
68  return;
69  const PixelGeomDetUnit* pixelGeomDetUnit = dynamic_cast<const PixelGeomDetUnit*>(geomDetUnit);
70  const PixelTopology& topol = pixelGeomDetUnit->specificTopology();
71  if (!pixelGeomDetUnit)
72  return;
73 
74  unsigned int layer = tkTopo_->layer(geomDetUnit->geographicalId());
75  unsigned int module = tkTopo_->module(geomDetUnit->geographicalId());
76  LogTrace("VectorHitBuilder") << "Layer:" << layer << " and DetId: " << geomDetUnit->geographicalId().rawId()
77  << std::endl;
80  LogTrace("VectorHitBuilder") << "Pixel cluster (module:" << module << ") " << std::endl;
82  LogTrace("VectorHitBuilder") << "Strip cluster (module:" << module << ") " << std::endl;
83  else
84  LogTrace("VectorHitBuilder") << "no module?!" << std::endl;
85  LogTrace("VectorHitBuilder") << "with pitch:" << topol.pitch().first << " , " << topol.pitch().second << std::endl;
86  LogTrace("VectorHitBuilder") << " and width:" << pixelGeomDetUnit->surface().bounds().width()
87  << " , lenght:" << pixelGeomDetUnit->surface().bounds().length() << std::endl;
88 
89  auto&& lparams = cpe_->localParameters(*clustIt, *pixelGeomDetUnit);
90  Global3DPoint gparams = pixelGeomDetUnit->surface().toGlobal(lparams.first);
91 
92  LogTrace("VectorHitBuilder") << "\t global pos " << gparams << std::endl;
93  LogTrace("VectorHitBuilder") << "\t local pos " << lparams.first << "with err " << lparams.second << std::endl;
94  LogTrace("VectorHitBuilder") << std::endl;
95 
96  return;
97 }

References Surface::bounds(), cpe_, GeomDet::geographicalId(), TrackerGeometry::getDetectorType(), TrackerTopology::layer(), Bounds::length(), ClusterParameterEstimator< T >::localParameters(), LogTrace, 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().

◆ printClusters()

void VectorHitBuilderAlgorithmBase::printClusters ( const edmNew::DetSetVector< Phase2TrackerCluster1D > &  clusters) const

Definition at line 47 of file VectorHitBuilderAlgorithmBase.cc.

47  {
48  int nCluster = 0;
49  int numberOfDSV = 0;
50  for (const auto& DSViter : clusters) {
51  ++numberOfDSV;
52  // Loop over the clusters in the detector unit
53  for (const auto& clustIt : DSViter) {
54  nCluster++;
55  // get the detector unit's id
56  const GeomDetUnit* geomDetUnit(tkGeom_->idToDetUnit(DSViter.detId()));
57  if (!geomDetUnit)
58  return;
59  printCluster(geomDetUnit, &clustIt);
60  }
61  }
62  LogDebug("VectorHitBuilder") << " Number of input clusters: " << nCluster << std::endl;
63 }

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

Referenced by VectorHitBuilderEDProducer::produce().

◆ run()

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

◆ barrelCut_

std::vector<double> VectorHitBuilderAlgorithmBase::barrelCut_

◆ cpe_

const ClusterParameterEstimator<Phase2TrackerCluster1D>* VectorHitBuilderAlgorithmBase::cpe_

◆ cpeTag_

edm::ESInputTag VectorHitBuilderAlgorithmBase::cpeTag_
private

Definition at line 68 of file VectorHitBuilderAlgorithmBase.h.

◆ endcapCut_

std::vector<double> VectorHitBuilderAlgorithmBase::endcapCut_

◆ nMaxVHforeachStack_

unsigned int VectorHitBuilderAlgorithmBase::nMaxVHforeachStack_

Definition at line 63 of file VectorHitBuilderAlgorithmBase.h.

◆ tkGeom_

const TrackerGeometry* VectorHitBuilderAlgorithmBase::tkGeom_

◆ tkTopo_

const TrackerTopology* VectorHitBuilderAlgorithmBase::tkTopo_
Vector3DBase
Definition: Vector3DBase.h:8
edm::ESInputTag
Definition: ESInputTag.h:87
Bounds::width
virtual float width() const =0
GeomDet
Definition: GeomDet.h:27
VectorHitBuilderAlgorithmBase::tkTopo_
const TrackerTopology * tkTopo_
Definition: VectorHitBuilderAlgorithmBase.h:61
TrackerGeometry::ModuleType::Ph2SS
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
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
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
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, GlobalTag >
PixelTopology
Definition: PixelTopology.h:10
VectorHitBuilderAlgorithmBase::printCluster
void printCluster(const GeomDet *geomDetUnit, const Phase2TrackerCluster1D *cluster) const
Definition: VectorHitBuilderAlgorithmBase.cc:65
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
VectorHitBuilderAlgorithmBase::nMaxVHforeachStack_
unsigned int nMaxVHforeachStack_
Definition: VectorHitBuilderAlgorithmBase.h:63
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:223
PixelGeomDetUnit::specificTopology
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
Definition: PixelGeomDetUnit.cc:17
ClusterParameterEstimator::localParameters
virtual LocalValues localParameters(const T &, const GeomDetUnit &) const =0
TrackerGeometry::ModuleType::Ph2PSS
VectorHitBuilderAlgorithmBase::tkGeom_
const TrackerGeometry * tkGeom_
Definition: VectorHitBuilderAlgorithmBase.h:60
VectorHitBuilderAlgorithmBase::barrelCut_
std::vector< double > barrelCut_
Definition: VectorHitBuilderAlgorithmBase.h:64
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
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:224
VectorHitBuilderAlgorithmBase::endcapCut_
std::vector< double > endcapCut_
Definition: VectorHitBuilderAlgorithmBase.h:65
VectorHitBuilderAlgorithmBase::cpeTag_
edm::ESInputTag cpeTag_
Definition: VectorHitBuilderAlgorithmBase.h:68
TrackerGeometry::ModuleType::Ph2PSP