Go to the documentation of this file.00001 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00002 #include "RecoEgamma/EgammaPhotonAlgos/interface/ConversionSeedFinder.h"
00003
00004 #include "MagneticField/Engine/interface/MagneticField.h"
00005
00006 #include "Geometry/Records/interface/IdealGeometryRecord.h"
00007 #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
00008
00009 #include "RecoTracker/TkDetLayers/interface/GeometricSearchTracker.h"
00010 #include "RecoTracker/TkNavigation/interface/StartingLayerFinder.h"
00011 #include "RecoTracker/TkNavigation/interface/LayerCollector.h"
00012
00013
00014 #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
00015 #include "RecoTracker/Record/interface/TrackerRecoGeometryRecord.h"
00016 #include "RecoTracker/Record/interface/CkfComponentsRecord.h"
00017
00018 ConversionSeedFinder::ConversionSeedFinder(const edm::ParameterSet& config ):
00019 conf_(config),
00020 theUpdator_()
00021 {
00022
00023 LogDebug("ConversionSeedFinder") << " CTOR " << "\n";
00024
00025
00026 }
00027
00028
00029
00030 void ConversionSeedFinder::setEvent(const edm::Event& evt ) {
00031
00032 theMeasurementTracker_->update(evt);
00033 theTrackerGeom_= this->getMeasurementTracker()->geomTracker();
00034
00035
00036 edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
00037 evt.getByLabel("offlineBeamSpot",recoBeamSpotHandle);
00038 theBeamSpot_ = *recoBeamSpotHandle;
00039
00040
00041
00042 }
00043
00044 void ConversionSeedFinder::setEventSetup(const edm::EventSetup& es ) {
00045 es.get<TrackerRecoGeometryRecord>().get( theGeomSearchTracker_);
00046 es.get<IdealMagneticFieldRecord>().get( theMF_ );
00047
00048
00049 edm::ESHandle<MeasurementTracker> measurementTrackerHandle;
00050 es.get<CkfComponentsRecord>().get(measurementTrackerHandle);
00051 theMeasurementTracker_ = measurementTrackerHandle.product();
00052
00053 edm::ESHandle<Propagator> propagatorAlongMomHandle;
00054 es.get<TrackingComponentsRecord>().get("alongMomElePropagator",propagatorAlongMomHandle);
00055 thePropagatorAlongMomentum_ = &(*propagatorAlongMomHandle);
00056
00057
00058 edm::ESHandle<Propagator> propagatorOppoToMomHandle;
00059 es.get<TrackingComponentsRecord>().get("oppositeToMomElePropagator",propagatorOppoToMomHandle);
00060 thePropagatorOppositeToMomentum_ = &(*propagatorOppoToMomHandle);
00061
00062
00063
00064
00065 }
00066
00067
00068 void ConversionSeedFinder::findLayers() const {
00069
00070
00071 int charge;
00072
00073
00074
00075 GlobalPoint vertex(theBeamSpot_.position().x(),theBeamSpot_.position().y(),theBeamSpot_.position().z());
00076 charge=-1;
00077 FreeTrajectoryState theStraightLineFTS = trackStateFromClusters(charge, vertex, alongMomentum, 1.);
00078
00079 findLayers( theStraightLineFTS );
00080
00081
00082 }
00083
00084 FreeTrajectoryState ConversionSeedFinder::trackStateFromClusters( int charge, const GlobalPoint & theOrigin,
00085 PropagationDirection dir, float scaleFactor) const {
00086
00087
00088
00089 double caloEnergy = theSCenergy_ * scaleFactor ;
00090
00091 GlobalVector radiusCalo = theSCPosition_ - theOrigin ;
00092
00093 GlobalVector momentumWithoutCurvature = radiusCalo.unit() * caloEnergy;
00094
00095
00096 GlobalTrajectoryParameters gtp;
00097 if(dir == alongMomentum) {
00098 gtp = GlobalTrajectoryParameters(theOrigin, momentumWithoutCurvature, charge, &(*theMF_) ) ;
00099 } else {
00100 gtp = GlobalTrajectoryParameters(theSCPosition_, momentumWithoutCurvature, charge, &(*theMF_) ) ;
00101 }
00102
00103
00104
00105
00106
00107
00108 float dpos = 0.4/sqrt(theSCenergy_);
00109 dpos *= 2.;
00110 float dphi = dpos/theSCPosition_.perp();
00111
00112
00113 float theta1 = theSCPosition_.theta();
00114 float theta2 = atan2(double(theSCPosition_.perp()), theSCPosition_.z()-5.5);
00115 float dtheta = theta1 - theta2;
00116 AlgebraicSymMatrix m(5,1) ;
00117 m[0][0] = 1.; m[1][1] = dpos*dpos ; m[2][2] = dpos*dpos ;
00118 m[3][3] = dphi*dphi ; m[4][4] = dtheta * dtheta ;
00119
00120 FreeTrajectoryState fts(gtp, CurvilinearTrajectoryError(m)) ;
00121
00122 return fts ;
00123
00124
00125 }
00126
00127 void ConversionSeedFinder::findLayers(const FreeTrajectoryState & traj) const {
00128
00129
00130
00131 theLayerList_.clear();
00132
00133
00134 StraightLinePropagator prop( &(*theMF_), alongMomentum);
00135
00136 StartingLayerFinder starter(&prop, this->getMeasurementTracker() );
00137
00138 LayerCollector collector(&prop, &starter, 5., 5.);
00139
00140 theLayerList_ = collector.allLayers(traj);
00141
00142
00143 for(unsigned int i = 0; i < theLayerList_.size(); ++i) {
00144 printLayer(i);
00145 }
00146
00147
00148 }
00149
00150
00151 void ConversionSeedFinder::printLayer(int i) const {
00152 const DetLayer * layer = theLayerList_[i];
00153 if (layer->location() == GeomDetEnumerators::barrel ) {
00154
00155
00156
00157
00158 } else {
00159
00160
00161
00162 }
00163 }
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174