CMS 3D CMS Logo

ConversionSeedFinder.cc
Go to the documentation of this file.
5 // Field
6 // Geometry
8 //
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  LayerCollector collector(theNavigationSchool_, &prop, this->getMeasurementTracker(), 5., 5.);
115 
116  theLayerList_ = collector.allLayers(traj);
117 
118  for (unsigned int i = 0; i < theLayerList_.size(); ++i) {
119  printLayer(i);
120  }
121 }
122 
124  const DetLayer* layer = theLayerList_[i];
125  if (layer->location() == GeomDetEnumerators::barrel) {
126  // const BarrelDetLayer * barrelLayer = dynamic_cast<const BarrelDetLayer*>(layer);
127  //float r = barrelLayer->specificSurface().radius();
128  // std::cout << " barrel layer radius " << r << " " << barrelLayer->specificSurface().bounds().length()/2. << "\n";
129 
130  } else {
131  // const ForwardDetLayer * forwardLayer = dynamic_cast<const ForwardDetLayer*>(layer);
132  // float z = fabs(forwardLayer->surface().position().z());
133  // std::cout << " forward layer position " << z << " " << forwardLayer->specificSurface().innerRadius() << " " << forwardLayer->specificSurface().outerRadius() << "\n";
134  }
135 }
Vector3DBase
Definition: Vector3DBase.h:8
ConversionSeedFinder::theBeamSpot_
reco::BeamSpot theBeamSpot_
Definition: ConversionSeedFinder.h:113
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:428
MessageLogger.h
TrackerGeometry.h
ConversionSeedFinder::theMeasurementTrackerName_
std::string theMeasurementTrackerName_
Definition: ConversionSeedFinder.h:89
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:114
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89353
TrackerRecoGeometryRecord.h
TrackerRecoGeometryRecord
Definition: TrackerRecoGeometryRecord.h:11
CkfComponentsRecord.h
ConversionSeedFinder::theMF_
edm::ESHandle< MagneticField > theMF_
Definition: ConversionSeedFinder.h:94
edm::Handle< reco::BeamSpot >
ConversionSeedFinder::thePropagatorOppositeToMomentum_
const Propagator * thePropagatorOppositeToMomentum_
Definition: ConversionSeedFinder.h:111
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
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
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:55
GlobalTrajectoryParameters
Definition: GlobalTrajectoryParameters.h:15
ConversionSeedFinder::printLayer
void printLayer(int i) const
Definition: ConversionSeedFinder.cc:123
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:531
reco::BeamSpot::position
const Point & position() const
position
Definition: BeamSpot.h:59
Point3DBase< float, GlobalTag >
MeasurementTracker::geomTracker
const TrackerGeometry * geomTracker() const
Definition: MeasurementTracker.h:36
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
ConversionSeedFinder::beamSpotToken_
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
Definition: ConversionSeedFinder.h:97
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
bphysicsOniaDQM_cfi.vertex
vertex
Definition: bphysicsOniaDQM_cfi.py:7
StraightLinePropagator
Definition: StraightLinePropagator.h:16
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:223
MeasurementTrackerEvent
Definition: MeasurementTrackerEvent.h:16
edm::ParameterSet
Definition: ParameterSet.h:47
ConversionSeedFinder::theSCenergy_
float theSCenergy_
Definition: ConversionSeedFinder.h:103
ConversionSeedFinder::theSCPosition_
GlobalPoint theSCPosition_
Definition: ConversionSeedFinder.h:87
ConversionSeedFinder::thePropagatorAlongMomentum_
const Propagator * thePropagatorAlongMomentum_
Definition: ConversionSeedFinder.h:110
ConversionSeedFinder::getMeasurementTracker
const MeasurementTracker * getMeasurementTracker() const
Definition: ConversionSeedFinder.h:65
IdealGeometryRecord.h
edm::EventSetup
Definition: EventSetup.h:57
get
#define get
ConversionSeedFinder::measurementTrkToken_
edm::EDGetTokenT< MeasurementTrackerEvent > measurementTrkToken_
Definition: ConversionSeedFinder.h:98
ConversionSeedFinder::theGeomSearchTracker_
edm::ESHandle< GeometricSearchTracker > theGeomSearchTracker_
Definition: ConversionSeedFinder.h:95
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:91
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:92
ConversionSeedFinder::theLayerList_
std::vector< const DetLayer * > theLayerList_
Definition: ConversionSeedFinder.h:105
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:45
alongMomentum
Definition: PropagationDirection.h:4
ConversionSeedFinder::theMeasurementTracker_
const MeasurementTracker * theMeasurementTracker_
Definition: ConversionSeedFinder.h:90
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23
TrackingComponentsRecord
Definition: TrackingComponentsRecord.h:12