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_
 
std::vector< const DetLayer * > theLayerList_
 
const MeasurementTrackertheMeasurementTracker_
 
std::string theMeasurementTrackerName_
 
edm::ESHandle< MagneticFieldtheMF_
 
const NavigationSchooltheNavigationSchool_ = 0
 
const PropagatorthePropagatorAlongMomentum_
 
const PropagatorthePropagatorOppositeToMomentum_
 
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 47 of file ConversionSeedFinder.h.

Constructor & Destructor Documentation

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

Definition at line 16 of file ConversionSeedFinder.cc.

References beamSpotToken_, edm::ConsumesCollector::consumes(), edm::ParameterSet::getParameter(), HLT_2018_cff::InputTag, LogDebug, measurementTrkToken_, AlCaHLTBitMon_QueryRunRegistry::string, and theMeasurementTrackerName_.

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  LogDebug("ConversionSeedFinder") << " CTOR "
25  << "\n";
26 
27  theMeasurementTrackerName_ = config.getParameter<std::string>("MeasurementTrackerName");
28 }
#define LogDebug(id)
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
std::string theMeasurementTrackerName_
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
edm::EDGetTokenT< MeasurementTrackerEvent > measurementTrkToken_
virtual ConversionSeedFinder::~ConversionSeedFinder ( )
inlinevirtual

Definition at line 52 of file ConversionSeedFinder.h.

52 {}

Member Function Documentation

void ConversionSeedFinder::clear ( void  )
inline

Definition at line 71 of file ConversionSeedFinder.h.

References DeadROC_duringRun::dir, mps_fire::i, and multiplicitycorr_cfi::scaleFactor.

71 { theSeeds_.clear(); }
TrajectorySeedCollection theSeeds_
void ConversionSeedFinder::findLayers ( )
protected

Definition at line 58 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().

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

Definition at line 109 of file ConversionSeedFinder.cc.

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

109  {
110  theLayerList_.clear();
111 
113 
114  StartingLayerFinder starter(&prop, this->getMeasurementTracker());
115 
116  LayerCollector collector(theNavigationSchool_, &prop, &starter, 5., 5.);
117 
118  theLayerList_ = collector.allLayers(traj);
119 
120  for (unsigned int i = 0; i < theLayerList_.size(); ++i) {
121  printLayer(i);
122  }
123 }
const MeasurementTracker * getMeasurementTracker() const
const NavigationSchool * theNavigationSchool_
std::vector< const DetLayer * > theLayerList_
void printLayer(int i) const
edm::ESHandle< MagneticField > theMF_
const MeasurementTracker* ConversionSeedFinder::getMeasurementTracker ( ) const
inline
std::vector<const DetLayer*> const& ConversionSeedFinder::layerList ( ) const
inline
virtual void ConversionSeedFinder::makeSeeds ( const edm::Handle< edm::View< reco::CaloCluster > > &  allBc)
pure virtual
void ConversionSeedFinder::printLayer ( int  i) const
protected

Definition at line 125 of file ConversionSeedFinder.cc.

References GeomDetEnumerators::barrel, mps_fire::i, DetLayer::location(), and theLayerList_.

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

125  {
126  const DetLayer* layer = theLayerList_[i];
127  if (layer->location() == GeomDetEnumerators::barrel) {
128  // const BarrelDetLayer * barrelLayer = dynamic_cast<const BarrelDetLayer*>(layer);
129  //float r = barrelLayer->specificSurface().radius();
130  // std::cout << " barrel layer radius " << r << " " << barrelLayer->specificSurface().bounds().length()/2. << "\n";
131 
132  } else {
133  // const ForwardDetLayer * forwardLayer = dynamic_cast<const ForwardDetLayer*>(layer);
134  // float z = fabs(forwardLayer->surface().position().z());
135  // std::cout << " forward layer position " << z << " " << forwardLayer->specificSurface().innerRadius() << " " << forwardLayer->specificSurface().outerRadius() << "\n";
136  }
137 }
virtual Location location() const =0
Which part of the detector (barrel, endcap)
std::vector< const DetLayer * > theLayerList_
TrajectorySeedCollection& ConversionSeedFinder::seeds ( )
inline

Definition at line 56 of file ConversionSeedFinder.h.

56 { return theSeeds_; }
TrajectorySeedCollection theSeeds_
virtual void ConversionSeedFinder::setCandidate ( float  e,
GlobalPoint  pos 
)
inlinevirtual
void ConversionSeedFinder::setEvent ( const edm::Event e)

Definition at line 30 of file ConversionSeedFinder.cc.

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

30  {
32 
33  //get the BeamSpot
34  edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
35  evt.getByToken(beamSpotToken_, recoBeamSpotHandle);
36  theBeamSpot_ = *recoBeamSpotHandle;
37 
38  evt.getByToken(measurementTrkToken_, theTrackerData_);
39 }
const MeasurementTracker * getMeasurementTracker() const
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
const TrackingGeometry * geomTracker() const
const TrackingGeometry * theTrackerGeom_
edm::Handle< MeasurementTrackerEvent > theTrackerData_
edm::EDGetTokenT< MeasurementTrackerEvent > measurementTrkToken_
void ConversionSeedFinder::setEventSetup ( const edm::EventSetup es)

Initialize EventSetup objects at each event.

Definition at line 41 of file ConversionSeedFinder.cc.

References edm::EventSetup::get(), edm::ESHandle< T >::product(), theGeomSearchTracker_, theMeasurementTracker_, theMeasurementTrackerName_, theMF_, thePropagatorAlongMomentum_, and thePropagatorOppositeToMomentum_.

41  {
44 
45  edm::ESHandle<MeasurementTracker> measurementTrackerHandle;
46  es.get<CkfComponentsRecord>().get(theMeasurementTrackerName_, measurementTrackerHandle);
47  theMeasurementTracker_ = measurementTrackerHandle.product();
48 
49  edm::ESHandle<Propagator> propagatorAlongMomHandle;
50  es.get<TrackingComponentsRecord>().get("alongMomElePropagator", propagatorAlongMomHandle);
51  thePropagatorAlongMomentum_ = &(*propagatorAlongMomHandle);
52 
53  edm::ESHandle<Propagator> propagatorOppoToMomHandle;
54  es.get<TrackingComponentsRecord>().get("oppositeToMomElePropagator", propagatorOppoToMomHandle);
55  thePropagatorOppositeToMomentum_ = &(*propagatorOppoToMomHandle);
56 }
const Propagator * thePropagatorAlongMomentum_
const MeasurementTracker * theMeasurementTracker_
const Propagator * thePropagatorOppositeToMomentum_
std::string theMeasurementTrackerName_
edm::ESHandle< GeometricSearchTracker > theGeomSearchTracker_
edm::ESHandle< MagneticField > theMF_
T get() const
Definition: EventSetup.h:73
T const * product() const
Definition: ESHandle.h:86
void ConversionSeedFinder::setMeasurementTracker ( const MeasurementTracker tracker) const
inline

Definition at line 63 of file ConversionSeedFinder.h.

63 { ; }
void ConversionSeedFinder::setNavigationSchool ( const NavigationSchool navigation)
inline

Definition at line 68 of file ConversionSeedFinder.h.

References MillePedeFileConverter_cfg::e.

68 { theNavigationSchool_ = navigation; }
const NavigationSchool * theNavigationSchool_
FreeTrajectoryState ConversionSeedFinder::trackStateFromClusters ( int  aCharge,
const GlobalPoint gpOrigine,
PropagationDirection  dir,
float  scaleFactor 
) const
protected

Definition at line 70 of file ConversionSeedFinder.cc.

References alongMomentum, visualization-live-secondInstance_cfg::m, PV3DBase< T, PVType, FrameType >::perp(), multiplicitycorr_cfi::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().

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

Member Data Documentation

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

Definition at line 96 of file ConversionSeedFinder.h.

Referenced by ConversionSeedFinder(), and setEvent().

PropagationDirection ConversionSeedFinder::dir_
protected

Definition at line 100 of file ConversionSeedFinder.h.

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

Definition at line 97 of file ConversionSeedFinder.h.

Referenced by ConversionSeedFinder(), and setEvent().

float ConversionSeedFinder::theBCEnergy_
protected
GlobalPoint ConversionSeedFinder::theBCPosition_
protected
reco::BeamSpot ConversionSeedFinder::theBeamSpot_
protected
edm::ESHandle<GeometricSearchTracker> ConversionSeedFinder::theGeomSearchTracker_
protected

Definition at line 94 of file ConversionSeedFinder.h.

Referenced by setEventSetup().

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

Definition at line 89 of file ConversionSeedFinder.h.

Referenced by setEventSetup().

std::string ConversionSeedFinder::theMeasurementTrackerName_
protected

Definition at line 88 of file ConversionSeedFinder.h.

Referenced by ConversionSeedFinder(), and setEventSetup().

edm::ESHandle<MagneticField> ConversionSeedFinder::theMF_
protected
const NavigationSchool* ConversionSeedFinder::theNavigationSchool_ = 0
protected

Definition at line 91 of file ConversionSeedFinder.h.

Referenced by findLayers().

const Propagator* ConversionSeedFinder::thePropagatorAlongMomentum_
protected
const Propagator* ConversionSeedFinder::thePropagatorOppositeToMomentum_
protected
reco::CaloCluster* ConversionSeedFinder::theSC_
protected

Definition at line 101 of file ConversionSeedFinder.h.

float ConversionSeedFinder::theSCenergy_
protected
GlobalPoint ConversionSeedFinder::theSCPosition_
protected
TrajectorySeedCollection ConversionSeedFinder::theSeeds_
protected
edm::Handle<MeasurementTrackerEvent> ConversionSeedFinder::theTrackerData_
protected
const TrackingGeometry* ConversionSeedFinder::theTrackerGeom_
protected

Definition at line 90 of file ConversionSeedFinder.h.

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

KFUpdator ConversionSeedFinder::theUpdator_
protected