CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
ConversionSeedFinder Class Referenceabstract

#include <ConversionSeedFinder.h>

Inheritance diagram for ConversionSeedFinder:
InOutConversionSeedFinder OutInConversionSeedFinder

Public Member Functions

void clear ()
 
 ConversionSeedFinder ()
 
 ConversionSeedFinder (const edm::ParameterSet &config, edm::ConsumesCollector &iC)
 
const MeasurementTrackergetMeasurementTracker () const
 
std::vector< const DetLayer * > const & layerList () const
 
virtual void makeSeeds (const edm::Handle< edm::View< reco::CaloCluster > > &allBc)=0
 
TrajectorySeedCollectionseeds ()
 
virtual void setCandidate (float e, GlobalPoint pos)
 
void setEvent (const edm::Event &e)
 
void setEventSetup (const edm::EventSetup &es)
 Initialize EventSetup objects at each event. More...
 
void setMeasurementTracker (const MeasurementTracker *tracker) const
 
void setNavigationSchool (const NavigationSchool *navigation)
 
virtual ~ConversionSeedFinder ()
 

Protected Member Functions

void findLayers ()
 
void findLayers (const FreeTrajectoryState &fts)
 
void printLayer (int i) const
 
FreeTrajectoryState trackStateFromClusters (int aCharge, const GlobalPoint &gpOrigine, PropagationDirection dir, float scaleFactor) const
 

Protected Attributes

edm::EDGetTokenT< reco::BeamSpotbeamSpotToken_
 
PropagationDirection dir_
 
edm::EDGetTokenT< MeasurementTrackerEventmeasurementTrkToken_
 
float theBCEnergy_
 
GlobalPoint theBCPosition_
 
reco::BeamSpot theBeamSpot_
 
edm::ESHandle< GeometricSearchTrackertheGeomSearchTracker_
 
edm::ESGetToken< GeometricSearchTracker, TrackerRecoGeometryRecordtheGeomSearchTrackerToken_
 
std::vector< const DetLayer * > theLayerList_
 
const MeasurementTrackertheMeasurementTracker_
 
edm::ESGetToken< MeasurementTracker, CkfComponentsRecordtheMeasurementTrackerToken_
 
edm::ESHandle< MagneticFieldtheMF_
 
edm::ESGetToken< MagneticField, IdealMagneticFieldRecordtheMFToken_
 
const NavigationSchooltheNavigationSchool_ = nullptr
 
const PropagatorthePropagatorAlongMomentum_
 
edm::ESGetToken< Propagator, TrackingComponentsRecordthePropagatorAlongMomentumToken_
 
const PropagatorthePropagatorOppositeToMomentum_
 
edm::ESGetToken< Propagator, TrackingComponentsRecordthePropagatorOppositeToMomentumToken_
 
reco::CaloClustertheSC_
 
float theSCenergy_
 
GlobalPoint theSCPosition_
 
TrajectorySeedCollection theSeeds_
 
edm::Handle< MeasurementTrackerEventtheTrackerData_
 
const TrackingGeometrytheTrackerGeom_
 
KFUpdator theUpdator_
 

Detailed Description

Author
Nancy Marinelli, U. of Notre Dame, US

Definition at line 52 of file ConversionSeedFinder.h.

Constructor & Destructor Documentation

◆ ConversionSeedFinder() [1/2]

ConversionSeedFinder::ConversionSeedFinder ( )

◆ ConversionSeedFinder() [2/2]

ConversionSeedFinder::ConversionSeedFinder ( const edm::ParameterSet config,
edm::ConsumesCollector iC 
)

Definition at line 16 of file ConversionSeedFinder.cc.

References beamSpotToken_, edm::ConsumesCollector::consumes(), edm::ConsumesCollector::esConsumes(), ProducerED_cfi::InputTag, LogDebug, HLT_2023v12_cff::measurementTrackerName, measurementTrkToken_, AlCaHLTBitMon_QueryRunRegistry::string, theGeomSearchTrackerToken_, theMeasurementTrackerToken_, theMFToken_, thePropagatorAlongMomentumToken_, and thePropagatorOppositeToMomentumToken_.

17  : // conf_(config),
18  theUpdator_() {
20  edm::InputTag("MeasurementTrackerEvent")); //hardcoded because the original was and no time to fix (sigh)
22  edm::InputTag("offlineBeamSpot")); //hardcoded because the original was and no time to fix (sigh)
23 
24  theMFToken_ = iC.esConsumes();
26  thePropagatorAlongMomentumToken_ = iC.esConsumes(edm::ESInputTag("", "alongMomElePropagator"));
27  thePropagatorOppositeToMomentumToken_ = iC.esConsumes(edm::ESInputTag("", "oppositeToMomElePropagator"));
28  LogDebug("ConversionSeedFinder") << " CTOR "
29  << "\n";
30 
31  auto measurementTrackerName = config.getParameter<std::string>("MeasurementTrackerName");
33 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: config.py:1
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > theMFToken_
edm::ESGetToken< GeometricSearchTracker, TrackerRecoGeometryRecord > theGeomSearchTrackerToken_
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
edm::ESGetToken< Propagator, TrackingComponentsRecord > thePropagatorAlongMomentumToken_
edm::ESGetToken< MeasurementTracker, CkfComponentsRecord > theMeasurementTrackerToken_
edm::EDGetTokenT< MeasurementTrackerEvent > measurementTrkToken_
edm::ESGetToken< Propagator, TrackingComponentsRecord > thePropagatorOppositeToMomentumToken_
#define LogDebug(id)

◆ ~ConversionSeedFinder()

virtual ConversionSeedFinder::~ConversionSeedFinder ( )
inlinevirtual

Definition at line 57 of file ConversionSeedFinder.h.

57 {}

Member Function Documentation

◆ clear()

void ConversionSeedFinder::clear ( void  )
inline

Definition at line 76 of file ConversionSeedFinder.h.

References theSeeds_.

Referenced by ConversionTrackCandidateProducer::produce().

76 { theSeeds_.clear(); }
TrajectorySeedCollection theSeeds_

◆ findLayers() [1/2]

void ConversionSeedFinder::findLayers ( )
protected

Definition at line 57 of file ConversionSeedFinder.cc.

References alongMomentum, ALCARECOTkAlJpsiMuMu_cff::charge, reco::BeamSpot::position(), theBeamSpot_, trackStateFromClusters(), and bphysicsOniaDQM_cfi::vertex.

Referenced by OutInConversionSeedFinder::makeSeeds(), and InOutConversionSeedFinder::makeSeeds().

57  {
58  int charge;
59  //List the DetLayers crossed by a straight line from the centre of the
60  //detector to the supercluster position
61  // GlobalPoint vertex(0.,0.,0.);
63  charge = -1;
65 
66  findLayers(theStraightLineFTS);
67 }
const Point & position() const
position
Definition: BeamSpot.h:59
FreeTrajectoryState trackStateFromClusters(int aCharge, const GlobalPoint &gpOrigine, PropagationDirection dir, float scaleFactor) const

◆ findLayers() [2/2]

void ConversionSeedFinder::findLayers ( const FreeTrajectoryState fts)
protected

Definition at line 108 of file ConversionSeedFinder.cc.

References LayerCollector::allLayers(), alongMomentum, getMeasurementTracker(), mps_fire::i, printLayer(), theLayerList_, theMF_, and theNavigationSchool_.

108  {
109  theLayerList_.clear();
110 
112 
113  LayerCollector collector(theNavigationSchool_, &prop, this->getMeasurementTracker(), 5., 5.);
114 
115  theLayerList_ = collector.allLayers(traj);
116 
117  for (unsigned int i = 0; i < theLayerList_.size(); ++i) {
118  printLayer(i);
119  }
120 }
const NavigationSchool * theNavigationSchool_
std::vector< const DetLayer * > theLayerList_
edm::ESHandle< MagneticField > theMF_
void printLayer(int i) const
const MeasurementTracker * getMeasurementTracker() const

◆ getMeasurementTracker()

const MeasurementTracker* ConversionSeedFinder::getMeasurementTracker ( ) const
inline

◆ layerList()

std::vector<const DetLayer*> const& ConversionSeedFinder::layerList ( ) const
inline

◆ makeSeeds()

virtual void ConversionSeedFinder::makeSeeds ( const edm::Handle< edm::View< reco::CaloCluster > > &  allBc)
pure virtual

◆ printLayer()

void ConversionSeedFinder::printLayer ( int  i) const
protected

Definition at line 122 of file ConversionSeedFinder.cc.

References GeomDetEnumerators::barrel, mps_fire::i, nano_mu_digi_cff::layer, and theLayerList_.

Referenced by InOutConversionSeedFinder::completeSeed(), InOutConversionSeedFinder::fillClusterSeeds(), and findLayers().

122  {
123  const DetLayer* layer = theLayerList_[i];
124  if (layer->location() == GeomDetEnumerators::barrel) {
125  // const BarrelDetLayer * barrelLayer = dynamic_cast<const BarrelDetLayer*>(layer);
126  //float r = barrelLayer->specificSurface().radius();
127  // std::cout << " barrel layer radius " << r << " " << barrelLayer->specificSurface().bounds().length()/2. << "\n";
128 
129  } else {
130  // const ForwardDetLayer * forwardLayer = dynamic_cast<const ForwardDetLayer*>(layer);
131  // float z = fabs(forwardLayer->surface().position().z());
132  // std::cout << " forward layer position " << z << " " << forwardLayer->specificSurface().innerRadius() << " " << forwardLayer->specificSurface().outerRadius() << "\n";
133  }
134 }
std::vector< const DetLayer * > theLayerList_

◆ seeds()

TrajectorySeedCollection& ConversionSeedFinder::seeds ( )
inline

Definition at line 61 of file ConversionSeedFinder.h.

References theSeeds_.

Referenced by ConversionTrackCandidateProducer::buildCollections().

61 { return theSeeds_; }
TrajectorySeedCollection theSeeds_

◆ setCandidate()

virtual void ConversionSeedFinder::setCandidate ( float  e,
GlobalPoint  pos 
)
inlinevirtual

◆ setEvent()

void ConversionSeedFinder::setEvent ( const edm::Event e)

Definition at line 35 of file ConversionSeedFinder.cc.

References beamSpotToken_, MeasurementTracker::geomTracker(), edm::Event::getByToken(), getMeasurementTracker(), measurementTrkToken_, theBeamSpot_, theTrackerData_, and theTrackerGeom_.

Referenced by ConversionTrackCandidateProducer::produce().

35  {
37 
38  //get the BeamSpot
39  edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
40  evt.getByToken(beamSpotToken_, recoBeamSpotHandle);
41  theBeamSpot_ = *recoBeamSpotHandle;
42 
43  evt.getByToken(measurementTrkToken_, theTrackerData_);
44 }
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
const TrackerGeometry * geomTracker() const
const TrackingGeometry * theTrackerGeom_
const MeasurementTracker * getMeasurementTracker() const
edm::Handle< MeasurementTrackerEvent > theTrackerData_
edm::EDGetTokenT< MeasurementTrackerEvent > measurementTrkToken_

◆ setEventSetup()

void ConversionSeedFinder::setEventSetup ( const edm::EventSetup es)

Initialize EventSetup objects at each event.

Definition at line 46 of file ConversionSeedFinder.cc.

References edm::EventSetup::getData(), edm::EventSetup::getHandle(), theGeomSearchTracker_, theGeomSearchTrackerToken_, theMeasurementTracker_, theMeasurementTrackerToken_, theMF_, theMFToken_, thePropagatorAlongMomentum_, thePropagatorAlongMomentumToken_, thePropagatorOppositeToMomentum_, and thePropagatorOppositeToMomentumToken_.

Referenced by ConversionTrackCandidateProducer::setEventSetup().

46  {
49 
51 
53 
55 }
const Propagator * thePropagatorAlongMomentum_
const MeasurementTracker * theMeasurementTracker_
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
const Propagator * thePropagatorOppositeToMomentum_
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > theMFToken_
edm::ESGetToken< GeometricSearchTracker, TrackerRecoGeometryRecord > theGeomSearchTrackerToken_
edm::ESHandle< GeometricSearchTracker > theGeomSearchTracker_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:130
edm::ESGetToken< Propagator, TrackingComponentsRecord > thePropagatorAlongMomentumToken_
edm::ESHandle< MagneticField > theMF_
edm::ESGetToken< MeasurementTracker, CkfComponentsRecord > theMeasurementTrackerToken_
edm::ESGetToken< Propagator, TrackingComponentsRecord > thePropagatorOppositeToMomentumToken_

◆ setMeasurementTracker()

void ConversionSeedFinder::setMeasurementTracker ( const MeasurementTracker tracker) const
inline

Definition at line 68 of file ConversionSeedFinder.h.

68 { ; }

◆ setNavigationSchool()

void ConversionSeedFinder::setNavigationSchool ( const NavigationSchool navigation)
inline

Definition at line 73 of file ConversionSeedFinder.h.

References theNavigationSchool_.

Referenced by ConversionTrackCandidateProducer::beginRun().

73 { theNavigationSchool_ = navigation; }
const NavigationSchool * theNavigationSchool_

◆ trackStateFromClusters()

FreeTrajectoryState ConversionSeedFinder::trackStateFromClusters ( int  aCharge,
const GlobalPoint gpOrigine,
PropagationDirection  dir,
float  scaleFactor 
) const
protected

Definition at line 69 of file ConversionSeedFinder.cc.

References alongMomentum, ALCARECOTkAlJpsiMuMu_cff::charge, DeadROC_duringRun::dir, visualization-live-secondInstance_cfg::m, PV3DBase< T, PVType, FrameType >::perp(), scaleFactor, mathSSE::sqrt(), theMF_, theSCenergy_, theSCPosition_, PV3DBase< T, PVType, FrameType >::theta(), Vector3DBase< T, FrameTag >::unit(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by findLayers(), and OutInConversionSeedFinder::startSeed().

72  {
73  double caloEnergy = theSCenergy_ * scaleFactor;
74 
75  GlobalVector radiusCalo = theSCPosition_ - theOrigin;
76 
77  GlobalVector momentumWithoutCurvature = radiusCalo.unit() * caloEnergy;
78 
80  if (dir == alongMomentum) {
81  gtp = GlobalTrajectoryParameters(theOrigin, momentumWithoutCurvature, charge, &(*theMF_));
82  } else {
83  gtp = GlobalTrajectoryParameters(theSCPosition_, momentumWithoutCurvature, charge, &(*theMF_));
84  }
85 
86  // now create error matrix
87  // dpos = 4mm/sqrt(E), dtheta = move vertex by 1sigma
88  float dpos = 0.4 / sqrt(theSCenergy_);
89  dpos *= 2.;
90  float dphi = dpos / theSCPosition_.perp();
91  // float dp = 0.03 * sqrt(theCaloEnergy);
92  // float dp = theCaloEnergy / sqrt(12.); // for fun
93  float theta1 = theSCPosition_.theta();
94  float theta2 = atan2(double(theSCPosition_.perp()), theSCPosition_.z() - 5.5);
95  float dtheta = theta1 - theta2;
97  m[0][0] = 1.;
98  m[1][1] = dpos * dpos;
99  m[2][2] = dpos * dpos;
100  m[3][3] = dphi * dphi;
101  m[4][4] = dtheta * dtheta;
102 
104 
105  return fts;
106 }
T perp() const
Definition: PV3DBase.h:69
T z() const
Definition: PV3DBase.h:61
T sqrt(T t)
Definition: SSEVec.h:19
constexpr G4double scaleFactor
edm::ESHandle< MagneticField > theMF_
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
Vector3DBase unit() const
Definition: Vector3DBase.h:54
Geom::Theta< T > theta() const
Definition: PV3DBase.h:72

Member Data Documentation

◆ beamSpotToken_

edm::EDGetTokenT<reco::BeamSpot> ConversionSeedFinder::beamSpotToken_
protected

Definition at line 106 of file ConversionSeedFinder.h.

Referenced by ConversionSeedFinder(), and setEvent().

◆ dir_

PropagationDirection ConversionSeedFinder::dir_
protected

Definition at line 110 of file ConversionSeedFinder.h.

◆ measurementTrkToken_

edm::EDGetTokenT<MeasurementTrackerEvent> ConversionSeedFinder::measurementTrkToken_
protected

Definition at line 107 of file ConversionSeedFinder.h.

Referenced by ConversionSeedFinder(), and setEvent().

◆ theBCEnergy_

float ConversionSeedFinder::theBCEnergy_
protected

◆ theBCPosition_

GlobalPoint ConversionSeedFinder::theBCPosition_
protected

◆ theBeamSpot_

reco::BeamSpot ConversionSeedFinder::theBeamSpot_
protected

◆ theGeomSearchTracker_

edm::ESHandle<GeometricSearchTracker> ConversionSeedFinder::theGeomSearchTracker_
protected

Definition at line 98 of file ConversionSeedFinder.h.

Referenced by setEventSetup().

◆ theGeomSearchTrackerToken_

edm::ESGetToken<GeometricSearchTracker, TrackerRecoGeometryRecord> ConversionSeedFinder::theGeomSearchTrackerToken_
protected

Definition at line 101 of file ConversionSeedFinder.h.

Referenced by ConversionSeedFinder(), and setEventSetup().

◆ theLayerList_

std::vector<const DetLayer*> ConversionSeedFinder::theLayerList_
protected

◆ theMeasurementTracker_

const MeasurementTracker* ConversionSeedFinder::theMeasurementTracker_
protected

Definition at line 93 of file ConversionSeedFinder.h.

Referenced by getMeasurementTracker(), and setEventSetup().

◆ theMeasurementTrackerToken_

edm::ESGetToken<MeasurementTracker, CkfComponentsRecord> ConversionSeedFinder::theMeasurementTrackerToken_
protected

Definition at line 102 of file ConversionSeedFinder.h.

Referenced by ConversionSeedFinder(), and setEventSetup().

◆ theMF_

edm::ESHandle<MagneticField> ConversionSeedFinder::theMF_
protected

◆ theMFToken_

edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> ConversionSeedFinder::theMFToken_
protected

Definition at line 100 of file ConversionSeedFinder.h.

Referenced by ConversionSeedFinder(), and setEventSetup().

◆ theNavigationSchool_

const NavigationSchool* ConversionSeedFinder::theNavigationSchool_ = nullptr
protected

Definition at line 95 of file ConversionSeedFinder.h.

Referenced by findLayers(), and setNavigationSchool().

◆ thePropagatorAlongMomentum_

const Propagator* ConversionSeedFinder::thePropagatorAlongMomentum_
protected

◆ thePropagatorAlongMomentumToken_

edm::ESGetToken<Propagator, TrackingComponentsRecord> ConversionSeedFinder::thePropagatorAlongMomentumToken_
protected

Definition at line 103 of file ConversionSeedFinder.h.

Referenced by ConversionSeedFinder(), and setEventSetup().

◆ thePropagatorOppositeToMomentum_

const Propagator* ConversionSeedFinder::thePropagatorOppositeToMomentum_
protected

◆ thePropagatorOppositeToMomentumToken_

edm::ESGetToken<Propagator, TrackingComponentsRecord> ConversionSeedFinder::thePropagatorOppositeToMomentumToken_
protected

Definition at line 104 of file ConversionSeedFinder.h.

Referenced by ConversionSeedFinder(), and setEventSetup().

◆ theSC_

reco::CaloCluster* ConversionSeedFinder::theSC_
protected

Definition at line 111 of file ConversionSeedFinder.h.

◆ theSCenergy_

float ConversionSeedFinder::theSCenergy_
protected

◆ theSCPosition_

GlobalPoint ConversionSeedFinder::theSCPosition_
protected

◆ theSeeds_

TrajectorySeedCollection ConversionSeedFinder::theSeeds_
protected

◆ theTrackerData_

edm::Handle<MeasurementTrackerEvent> ConversionSeedFinder::theTrackerData_
protected

◆ theTrackerGeom_

const TrackingGeometry* ConversionSeedFinder::theTrackerGeom_
protected

Definition at line 94 of file ConversionSeedFinder.h.

Referenced by InOutConversionSeedFinder::fillClusterSeeds(), and setEvent().

◆ theUpdator_

KFUpdator ConversionSeedFinder::theUpdator_
protected