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  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 }
34 
37 
38  //get the BeamSpot
39  edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
40  evt.getByToken(beamSpotToken_, recoBeamSpotHandle);
41  theBeamSpot_ = *recoBeamSpotHandle;
42 
44 }
45 
49 
51 
53 
55 }
56 
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 }
68 
70  const GlobalPoint& theOrigin,
72  float scaleFactor) const {
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 }
107 
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 }
121 
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 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
const Propagator * thePropagatorAlongMomentum_
T perp() const
Definition: PV3DBase.h:69
const MeasurementTracker * theMeasurementTracker_
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
const Point & position() const
position
Definition: BeamSpot.h:59
T z() const
Definition: PV3DBase.h:61
std::vector< const DetLayer * > allLayers(const FTS &aFts) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:536
const NavigationSchool * theNavigationSchool_
std::vector< const DetLayer * > theLayerList_
Definition: config.py:1
PropagationDirection
const Propagator * thePropagatorOppositeToMomentum_
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > theMFToken_
edm::ESGetToken< GeometricSearchTracker, TrackerRecoGeometryRecord > theGeomSearchTrackerToken_
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
const TrackerGeometry * geomTracker() const
T sqrt(T t)
Definition: SSEVec.h:19
constexpr G4double scaleFactor
const TrackingGeometry * theTrackerGeom_
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_
void setEvent(const edm::Event &e)
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
void setEventSetup(const edm::EventSetup &es)
Initialize EventSetup objects at each event.
edm::ESGetToken< MeasurementTracker, CkfComponentsRecord > theMeasurementTrackerToken_
void printLayer(int i) const
const MeasurementTracker * getMeasurementTracker() const
Vector3DBase unit() const
Definition: Vector3DBase.h:54
edm::Handle< MeasurementTrackerEvent > theTrackerData_
edm::EDGetTokenT< MeasurementTrackerEvent > measurementTrkToken_
FreeTrajectoryState trackStateFromClusters(int aCharge, const GlobalPoint &gpOrigine, PropagationDirection dir, float scaleFactor) const
edm::ESGetToken< Propagator, TrackingComponentsRecord > thePropagatorOppositeToMomentumToken_
Geom::Theta< T > theta() const
Definition: PV3DBase.h:72
#define LogDebug(id)