CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ConversionSeedFinder.cc
Go to the documentation of this file.
3 // Field
4 // Geometry
6 //
9 //
10 
14 
16  conf_(config),
17  theUpdator_()
18 {
19 
20  LogDebug("ConversionSeedFinder") << " CTOR " << "\n";
21 
22  theMeasurementTrackerName_=config.getParameter<std::string>("MeasurementTrackerName");
23 }
24 
25 
26 
28 
31 
32  //get the BeamSpot
33  edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
34  evt.getByLabel("offlineBeamSpot",recoBeamSpotHandle);
35  theBeamSpot_ = *recoBeamSpotHandle;
36 
37 
38 
39 }
40 
43  es.get<IdealMagneticFieldRecord>().get( theMF_ );
44 
45 
46  edm::ESHandle<MeasurementTracker> measurementTrackerHandle;
47  es.get<CkfComponentsRecord>().get(theMeasurementTrackerName_,measurementTrackerHandle);
48  theMeasurementTracker_ = measurementTrackerHandle.product();
49 
50  edm::ESHandle<Propagator> propagatorAlongMomHandle;
51  es.get<TrackingComponentsRecord>().get("alongMomElePropagator",propagatorAlongMomHandle);
52  thePropagatorAlongMomentum_ = &(*propagatorAlongMomHandle);
53 
54 
55  edm::ESHandle<Propagator> propagatorOppoToMomHandle;
56  es.get<TrackingComponentsRecord>().get("oppositeToMomElePropagator",propagatorOppoToMomHandle);
57  thePropagatorOppositeToMomentum_ = &(*propagatorOppoToMomHandle);
58 
59 
60 
61 
62 }
63 
64 
66 
67 
68  int charge;
69  //List the DetLayers crossed by a straight line from the centre of the
70  //detector to the supercluster position
71  // GlobalPoint vertex(0.,0.,0.);
73  charge=-1;
74  FreeTrajectoryState theStraightLineFTS = trackStateFromClusters(charge, vertex, alongMomentum, 1.);
75 
76  findLayers( theStraightLineFTS );
77 
78 
79 }
80 
82  PropagationDirection dir, float scaleFactor) const {
83 
84 
85 
86  double caloEnergy = theSCenergy_ * scaleFactor ;
87 
88  GlobalVector radiusCalo = theSCPosition_ - theOrigin ;
89 
90  GlobalVector momentumWithoutCurvature = radiusCalo.unit() * caloEnergy;
91 
92 
94  if(dir == alongMomentum) {
95  gtp = GlobalTrajectoryParameters(theOrigin, momentumWithoutCurvature, charge, &(*theMF_) ) ;
96  } else {
97  gtp = GlobalTrajectoryParameters(theSCPosition_, momentumWithoutCurvature, charge, &(*theMF_) ) ;
98  }
99 
100 
101 
102 
103  // now create error matrix
104  // dpos = 4mm/sqrt(E), dtheta = move vertex by 1sigma
105  float dpos = 0.4/sqrt(theSCenergy_);
106  dpos *= 2.;
107  float dphi = dpos/theSCPosition_.perp();
108  // float dp = 0.03 * sqrt(theCaloEnergy);
109  // float dp = theCaloEnergy / sqrt(12.); // for fun
110  float theta1 = theSCPosition_.theta();
111  float theta2 = atan2(double(theSCPosition_.perp()), theSCPosition_.z()-5.5);
112  float dtheta = theta1 - theta2;
114  m[0][0] = 1.; m[1][1] = dpos*dpos ; m[2][2] = dpos*dpos ;
115  m[3][3] = dphi*dphi ; m[4][4] = dtheta * dtheta ;
116 
118 
119  return fts ;
120 
121 
122 }
123 
125 
126 
127 
128  theLayerList_.clear();
129 
130 
132 
133  StartingLayerFinder starter(&prop, this->getMeasurementTracker() );
134 
135  LayerCollector collector(&prop, &starter, 5., 5.);
136 
137  theLayerList_ = collector.allLayers(traj);
138 
139 
140  for(unsigned int i = 0; i < theLayerList_.size(); ++i) {
141  printLayer(i);
142  }
143 
144 
145 }
146 
147 
149  const DetLayer * layer = theLayerList_[i];
150  if (layer->location() == GeomDetEnumerators::barrel ) {
151  // const BarrelDetLayer * barrelLayer = dynamic_cast<const BarrelDetLayer*>(layer);
152  //float r = barrelLayer->specificSurface().radius();
153  // std::cout << " barrel layer radius " << r << " " << barrelLayer->specificSurface().bounds().length()/2. << "\n";
154 
155  } else {
156  // const ForwardDetLayer * forwardLayer = dynamic_cast<const ForwardDetLayer*>(layer);
157  // float z = fabs(forwardLayer->surface().position().z());
158  // std::cout << " forward layer position " << z << " " << forwardLayer->specificSurface().innerRadius() << " " << forwardLayer->specificSurface().outerRadius() << "\n";
159  }
160 }
161 
162 
163 
164 
165 
166 
167 
168 
169 
170 
171 
#define LogDebug(id)
const Propagator * thePropagatorAlongMomentum_
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
const MeasurementTracker * getMeasurementTracker() const
const MeasurementTracker * theMeasurementTracker_
T perp() const
Definition: PV3DBase.h:71
virtual void update(const edm::Event &) const =0
virtual Location location() const =0
Which part of the detector (barrel, endcap)
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
PropagationDirection
double charge(const std::vector< uint8_t > &Ampls)
const Propagator * thePropagatorOppositeToMomentum_
Geom::Theta< T > theta() const
Definition: PV3DBase.h:74
std::string theMeasurementTrackerName_
void printLayer(int i) const
T sqrt(T t)
Definition: SSEVec.h:46
T z() const
Definition: PV3DBase.h:63
std::vector< const DetLayer * > theLayerList_
const TrackingGeometry * geomTracker() const
const TrackingGeometry * theTrackerGeom_
edm::ESHandle< GeometricSearchTracker > theGeomSearchTracker_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
std::vector< const DetLayer * > allLayers(const FTS &aFts) const
Vector3DBase unit() const
Definition: Vector3DBase.h:57
edm::ESHandle< MagneticField > theMF_
void setEvent(const edm::Event &e)
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
FreeTrajectoryState trackStateFromClusters(int aCharge, const GlobalPoint &gpOrigine, PropagationDirection dir, float scaleFactor) const
void setEventSetup(const edm::EventSetup &es)
Initialize EventSetup objects at each event.
const Point & position() const
position
Definition: BeamSpot.h:63
dbl *** dir
Definition: mlp_gen.cc:35