CMS 3D CMS Logo

ConversionSeedFinder.cc
Go to the documentation of this file.
4 // Field
5 // Geometry
7 //
10 //
11 
15 
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 }
29 
32 
33  //get the BeamSpot
34  edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
35  evt.getByToken(beamSpotToken_, recoBeamSpotHandle);
36  theBeamSpot_ = *recoBeamSpotHandle;
37 
39 }
40 
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 }
57 
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;
66 
67  findLayers(theStraightLineFTS);
68 }
69 
71  const GlobalPoint& theOrigin,
73  float scaleFactor) const {
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 }
108 
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 }
124 
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 }
Vector3DBase
Definition: Vector3DBase.h:8
ConversionSeedFinder::theBeamSpot_
reco::BeamSpot theBeamSpot_
Definition: ConversionSeedFinder.h:112
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
ConversionSeedFinder::setEventSetup
void setEventSetup(const edm::EventSetup &es)
Initialize EventSetup objects at each event.
Definition: ConversionSeedFinder.cc:41
mps_fire.i
i
Definition: mps_fire.py:355
MessageLogger.h
ConversionSeedFinder::theMeasurementTrackerName_
std::string theMeasurementTrackerName_
Definition: ConversionSeedFinder.h:88
ConversionSeedFinder::findLayers
void findLayers()
Definition: ConversionSeedFinder.cc:58
ConversionSeedFinder.h
DetLayer
Definition: DetLayer.h:21
PV3DBase::theta
Geom::Theta< T > theta() const
Definition: PV3DBase.h:72
LayerCollector
Definition: LayerCollector.h:19
ConversionSeedFinder::theTrackerData_
edm::Handle< MeasurementTrackerEvent > theTrackerData_
Definition: ConversionSeedFinder.h:113
TrackerRecoGeometryRecord.h
TrackerRecoGeometryRecord
Definition: TrackerRecoGeometryRecord.h:11
CkfComponentsRecord.h
ConversionSeedFinder::theMF_
edm::ESHandle< MagneticField > theMF_
Definition: ConversionSeedFinder.h:93
edm::Handle< reco::BeamSpot >
ConversionSeedFinder::thePropagatorOppositeToMomentum_
const Propagator * thePropagatorOppositeToMomentum_
Definition: ConversionSeedFinder.h:110
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
GeomDetEnumerators::barrel
Definition: GeomDetEnumerators.h:9
IdealMagneticFieldRecord
Definition: IdealMagneticFieldRecord.h:11
config
Definition: config.py:1
LayerCollector::allLayers
std::vector< const DetLayer * > allLayers(const FTS &aFts) const
Definition: LayerCollector.cc:7
DetLayer::location
virtual Location location() const =0
Which part of the detector (barrel, endcap)
Vector3DBase::unit
Vector3DBase unit() const
Definition: Vector3DBase.h:54
MeasurementTracker::geomTracker
const TrackingGeometry * geomTracker() const
Definition: MeasurementTracker.h:36
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
CurvilinearTrajectoryError
Definition: CurvilinearTrajectoryError.h:27
CkfComponentsRecord
Definition: CkfComponentsRecord.h:22
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
reco::BeamSpot
Definition: BeamSpot.h:21
IdealMagneticFieldRecord.h
edm::ESHandle< MeasurementTracker >
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:49
GlobalTrajectoryParameters
Definition: GlobalTrajectoryParameters.h:15
ConversionSeedFinder::printLayer
void printLayer(int i) const
Definition: ConversionSeedFinder.cc:125
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:528
reco::BeamSpot::position
const Point & position() const
position
Definition: BeamSpot.h:59
Point3DBase< float, GlobalTag >
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
ConversionSeedFinder::beamSpotToken_
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
Definition: ConversionSeedFinder.h:96
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
bphysicsOniaDQM_cfi.vertex
vertex
Definition: bphysicsOniaDQM_cfi.py:7
StraightLinePropagator
Definition: StraightLinePropagator.h:16
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
MeasurementTrackerEvent
Definition: MeasurementTrackerEvent.h:15
edm::ParameterSet
Definition: ParameterSet.h:36
ConversionSeedFinder::theSCenergy_
float theSCenergy_
Definition: ConversionSeedFinder.h:102
ConversionSeedFinder::theSCPosition_
GlobalPoint theSCPosition_
Definition: ConversionSeedFinder.h:86
ConversionSeedFinder::thePropagatorAlongMomentum_
const Propagator * thePropagatorAlongMomentum_
Definition: ConversionSeedFinder.h:109
ConversionSeedFinder::getMeasurementTracker
const MeasurementTracker * getMeasurementTracker() const
Definition: ConversionSeedFinder.h:64
IdealGeometryRecord.h
edm::EventSetup
Definition: EventSetup.h:57
get
#define get
ConversionSeedFinder::measurementTrkToken_
edm::EDGetTokenT< MeasurementTrackerEvent > measurementTrkToken_
Definition: ConversionSeedFinder.h:97
ConversionSeedFinder::theGeomSearchTracker_
edm::ESHandle< GeometricSearchTracker > theGeomSearchTracker_
Definition: ConversionSeedFinder.h:94
ConversionSeedFinder::trackStateFromClusters
FreeTrajectoryState trackStateFromClusters(int aCharge, const GlobalPoint &gpOrigine, PropagationDirection dir, float scaleFactor) const
Definition: ConversionSeedFinder.cc:70
LayerCollector.h
ConversionSeedFinder::setEvent
void setEvent(const edm::Event &e)
Definition: ConversionSeedFinder.cc:30
ConversionSeedFinder::theTrackerGeom_
const TrackingGeometry * theTrackerGeom_
Definition: ConversionSeedFinder.h:90
FreeTrajectoryState
Definition: FreeTrajectoryState.h:27
PropagationDirection
PropagationDirection
Definition: PropagationDirection.h:4
multiplicitycorr_cfi.scaleFactor
scaleFactor
Definition: multiplicitycorr_cfi.py:7
ConversionSeedFinder::ConversionSeedFinder
ConversionSeedFinder()
ConversionSeedFinder::theNavigationSchool_
const NavigationSchool * theNavigationSchool_
Definition: ConversionSeedFinder.h:91
ConversionSeedFinder::theLayerList_
std::vector< const DetLayer * > theLayerList_
Definition: ConversionSeedFinder.h:104
ConsumesCollector.h
edm::Event
Definition: Event.h:73
AlgebraicSymMatrix55
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
Definition: AlgebraicROOTObjects.h:23
PV3DBase::perp
T perp() const
Definition: PV3DBase.h:69
edm::ConsumesCollector
Definition: ConsumesCollector.h:39
alongMomentum
Definition: PropagationDirection.h:4
StartingLayerFinder.h
StartingLayerFinder
Definition: StartingLayerFinder.h:27
ConversionSeedFinder::theMeasurementTracker_
const MeasurementTracker * theMeasurementTracker_
Definition: ConversionSeedFinder.h:89
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23
TrackingComponentsRecord
Definition: TrackingComponentsRecord.h:12