#include <Alignment/LaserAlignment/interface/SeedGeneratorForLaserBeams.h>
Definition at line 29 of file SeedGeneratorForLaserBeams.h.
Definition at line 32 of file SeedGeneratorForLaserBeams.h.
SeedGeneratorForLaserBeams::SeedGeneratorForLaserBeams | ( | const edm::ParameterSet & | iConfig | ) |
constructor
Definition at line 27 of file SeedGeneratorForLaserBeams.cc.
References builderName, conf_, edm::ParameterSet::getParameter(), propagatorName, ptmin, and region.
00028 : conf_(iConfig), region(), 00029 thePairGenerator(), magfield(), tracker(), transformer(), theUpdator(), 00030 thePropagatorMaterialAl(), thePropagatorMaterialOp(), thePropagatorAnalyticalAl(), 00031 thePropagatorAnalyticalOp(), TTRHBuilder(), builderName(), propagatorName() 00032 { 00033 double ptmin = conf_.getParameter<double>("ptMin"); 00034 double originradius = conf_.getParameter<double>("originRadius"); 00035 double halflength = conf_.getParameter<double>("originHalfLength"); 00036 double originz = conf_.getParameter<double>("originZPosition"); 00037 builderName = conf_.getParameter<std::string>("TTRHBuilder"); 00038 propagatorName = conf_.getParameter<std::string>("Propagator"); 00039 00040 region = GlobalTrackingRegion(ptmin, originradius, halflength, originz); 00041 00042 edm::LogInfo("SeedGeneratorForLaserBeams") << " Using " << propagatorName 00043 << " Propagator, PtMin of track is " << ptmin 00044 << " The Radius of the cylinder for seeds is " << originradius << " cm"; 00045 }
SeedGeneratorForLaserBeams::~SeedGeneratorForLaserBeams | ( | ) | [virtual] |
destructor
Definition at line 47 of file SeedGeneratorForLaserBeams.cc.
References propagatorName, thePairGenerator, thePropagatorAnalyticalAl, thePropagatorAnalyticalOp, thePropagatorMaterialAl, thePropagatorMaterialOp, and theUpdator.
00048 { 00049 if (propagatorName == "WithMaterial") 00050 { 00051 if ( thePropagatorMaterialAl != 0 ) { delete thePropagatorMaterialAl; } 00052 if ( thePropagatorMaterialOp != 0 ) { delete thePropagatorMaterialOp; } 00053 } 00054 else if (propagatorName == "Analytical") 00055 { 00056 if ( thePropagatorAnalyticalAl != 0 ) { delete thePropagatorAnalyticalAl; } 00057 if ( thePropagatorAnalyticalOp != 0 ) { delete thePropagatorAnalyticalOp; } 00058 } 00059 if ( theUpdator != 0 ) { delete theUpdator; } 00060 if ( thePairGenerator != 0) { delete thePairGenerator; } 00061 }
void SeedGeneratorForLaserBeams::init | ( | const SiStripRecHit2DCollection & | collstereo, | |
const SiStripRecHit2DCollection & | collrphi, | |||
const SiStripMatchedRecHit2DCollection & | collmatched, | |||
const edm::EventSetup & | iSetup | |||
) |
initialize seed finder algorithm
Definition at line 63 of file SeedGeneratorForLaserBeams.cc.
References alongMomentum, AnalyticalPropagator_cfi::AnalyticalPropagator, builderName, edm::EventSetup::get(), LaserLayerPairs::init(), magfield, oppositeToMomentum, edm::ESHandle< T >::product(), propagatorName, thePairGenerator, thePropagatorAnalyticalAl, thePropagatorAnalyticalOp, thePropagatorMaterialAl, thePropagatorMaterialOp, theUpdator, tracker, and TTRHBuilder.
Referenced by LaserSeedGenerator::produce().
00067 { 00068 iSetup.get<IdealMagneticFieldRecord>().get(magfield); 00069 iSetup.get<TrackerDigiGeometryRecord>().get(tracker); 00070 00071 if ( propagatorName == "WithMaterial" ) 00072 { 00073 thePropagatorMaterialAl = new PropagatorWithMaterial(alongMomentum, 0.0, &(*magfield) ); 00074 thePropagatorMaterialOp = new PropagatorWithMaterial(oppositeToMomentum, 0.0, &(*magfield) ); 00075 } 00076 else if ( propagatorName == "Analytical" ) 00077 { 00078 thePropagatorAnalyticalAl = new AnalyticalPropagator(&(*magfield), alongMomentum); 00079 thePropagatorAnalyticalOp = new AnalyticalPropagator(&(*magfield), oppositeToMomentum); 00080 } 00081 00082 theUpdator = new KFUpdator(); 00083 00084 // get the transient builder 00085 edm::ESHandle<TransientTrackingRecHitBuilder> theBuilder; 00086 iSetup.get<TransientRecHitRecord>().get(builderName, theBuilder); 00087 TTRHBuilder = theBuilder.product(); 00088 00089 LaserLayerPairs laserLayers; 00090 laserLayers.init(collstereo, collrphi, collmatched, iSetup); 00091 thePairGenerator = new LaserHitPairGenerator(laserLayers, iSetup); 00092 }
void SeedGeneratorForLaserBeams::propagateAnalytical | ( | OrderedLaserHitPairs & | HitPairs, | |
TrajectorySeedCollection & | output | |||
) | [private] |
propagate using AnalyticalPropagator
Definition at line 190 of file SeedGeneratorForLaserBeams.cc.
References alongMomentum, TransientTrackingRecHitBuilder::build(), clone(), i, SurfaceOrientation::inner, TrajectoryStateOnSurface::isValid(), LogDebug, magfield, oppositeToMomentum, SurfaceOrientation::outer, TrajectoryStateTransform::persistentState(), AnalyticalPropagator::propagate(), edm::OwnVector< T, P >::push_back(), OrderedLaserHitPairs::size(), thePropagatorAnalyticalAl, thePropagatorAnalyticalOp, theUpdator, tracker, transformer, TTRHBuilder, KFUpdator::update(), and PV3DBase< T, PVType, FrameType >::z().
Referenced by run().
00191 { 00192 for (uint i = 0; i < HitPairs.size(); i++) 00193 { 00194 GlobalPoint inner = tracker->idToDet(HitPairs[i].inner()->geographicalId())->surface().toGlobal(HitPairs[i].inner()->localPosition()); 00195 GlobalPoint outer = tracker->idToDet(HitPairs[i].outer()->geographicalId())->surface().toGlobal(HitPairs[i].outer()->localPosition()); 00196 00197 TransientTrackingRecHit::ConstRecHitPointer outrhit = TTRHBuilder->build(HitPairs[i].outer()); 00198 00199 edm::OwnVector<TrackingRecHit> hits; 00200 hits.push_back(HitPairs[i].inner()->clone()); 00201 hits.push_back(HitPairs[i].outer()->clone()); 00202 00203 if ( ( (outer.z()-inner.z())>0 && outer.z() > 0 && inner.z() > 0 ) 00204 || ( (outer.z() - inner.z()) < 0 && outer.z() < 0 && inner.z() < 0 ) ) 00205 { 00206 // the 0 is a possible problem!!!! 00207 // GlobalTrajectoryParameters Gtp(outer, inner-outer, 0, &(*magfield)); 00208 GlobalTrajectoryParameters Gtp(outer, outer-inner, -1, &(*magfield)); 00209 FreeTrajectoryState LaserSeed(Gtp, CurvilinearTrajectoryError(AlgebraicSymMatrix(5,1))); 00210 00211 LogDebug("SeedGeneratorForLaserBeams:propagateAnalytical") << " FirstTSOS " << LaserSeed; 00212 00213 // First propagation 00214 const TSOS outerState = thePropagatorAnalyticalAl->propagate(LaserSeed, tracker->idToDet(HitPairs[i].outer()->geographicalId())->surface()); 00215 00216 if (outerState.isValid()) 00217 { 00218 LogDebug("SeedGeneratorForLaserBeams:propagateAnalytical") << " outerState " << outerState; 00219 const TSOS outerUpdated = theUpdator->update( outerState, *outrhit); 00220 00221 if (outerUpdated.isValid()) 00222 { 00223 LogDebug("SeedGeneratorForLaserBeams:propagateAnalytical") << " outerUpdated " << outerUpdated; 00224 00225 PTrajectoryStateOnDet *pTraj = transformer.persistentState(outerUpdated, HitPairs[i].outer()->geographicalId().rawId()); 00226 TrajectorySeed * trSeed = new TrajectorySeed(*pTraj, hits, alongMomentum); 00227 // store seed 00228 output.push_back(*trSeed); 00229 } 00230 else { edm::LogError("SeedGeneratorForLaserBeams:propagateAnalytical") << " SeedForLaserBeams first update failed "; } 00231 } 00232 else { edm::LogError("SeedGeneratorForLaserBeams:propagateAnalytical") << " SeedForLaserBeams first propagation failed "; } 00233 } 00234 else 00235 { 00236 // the 0 is a possible problem!!!! 00237 // GlobalTrajectoryParameters Gtp(outer, outer-inner, 0, &(*magfield)); 00238 GlobalTrajectoryParameters Gtp(outer, outer-inner, -1, &(*magfield)); 00239 FreeTrajectoryState LaserSeed(Gtp, CurvilinearTrajectoryError(AlgebraicSymMatrix(5,1))); 00240 LogDebug("SeedGeneratorForLaserBeams:propagateWithAnalytical") << " FirstTSOS " << LaserSeed; 00241 00242 // First propagation 00243 const TSOS outerState = thePropagatorAnalyticalOp->propagate(LaserSeed, tracker->idToDet(HitPairs[i].outer()->geographicalId())->surface()); 00244 00245 if (outerState.isValid()) 00246 { 00247 LogDebug("SeedGeneratorForLaserBeams:propagateAnalytical") << " outerState " << outerState; 00248 const TSOS outerUpdated = theUpdator->update(outerState, *outrhit); 00249 00250 if (outerUpdated.isValid()) 00251 { 00252 LogDebug("SeedGeneratorForLaserBeams:propagateAnalytical") << " outerUpdated " << outerUpdated; 00253 PTrajectoryStateOnDet *pTraj = transformer.persistentState(outerUpdated, HitPairs[i].outer()->geographicalId().rawId()); 00254 00255 TrajectorySeed *trSeed = new TrajectorySeed(*pTraj, hits, oppositeToMomentum); 00256 // store seed 00257 output.push_back(*trSeed); 00258 } 00259 else { edm::LogError("SeedGeneratorForLaserBeams:propagateAnalytical") << " SeedForLaserBeams first update failed "; } 00260 } 00261 else { edm::LogError("SeedGeneratorForLaserBeams:propagateAnalytical") << " SeedForLaserBeams first propagation failed "; } 00262 } 00263 } 00264 }
void SeedGeneratorForLaserBeams::propagateWithMaterial | ( | OrderedLaserHitPairs & | HitPairs, | |
TrajectorySeedCollection & | output | |||
) | [private] |
propagate using PropagatorWithMaterial
Definition at line 114 of file SeedGeneratorForLaserBeams.cc.
References alongMomentum, TransientTrackingRecHitBuilder::build(), clone(), i, SurfaceOrientation::inner, TrajectoryStateOnSurface::isValid(), LogDebug, magfield, oppositeToMomentum, SurfaceOrientation::outer, TrajectoryStateTransform::persistentState(), PropagatorWithMaterial::propagate(), edm::OwnVector< T, P >::push_back(), OrderedLaserHitPairs::size(), thePropagatorMaterialAl, thePropagatorMaterialOp, theUpdator, tracker, transformer, TTRHBuilder, KFUpdator::update(), and PV3DBase< T, PVType, FrameType >::z().
Referenced by run().
00115 { 00116 for (uint i = 0; i < HitPairs.size(); i++) 00117 { 00118 GlobalPoint inner = tracker->idToDet(HitPairs[i].inner()->geographicalId())->surface().toGlobal(HitPairs[i].inner()->localPosition()); 00119 GlobalPoint outer = tracker->idToDet(HitPairs[i].outer()->geographicalId())->surface().toGlobal(HitPairs[i].outer()->localPosition()); 00120 00121 TransientTrackingRecHit::ConstRecHitPointer outrhit = TTRHBuilder->build(HitPairs[i].outer()); 00122 00123 edm::OwnVector<TrackingRecHit> hits; 00124 hits.push_back(HitPairs[i].inner()->clone()); 00125 hits.push_back(HitPairs[i].outer()->clone()); 00126 00127 if ( ( (outer.z()-inner.z())>0 && outer.z() > 0 && inner.z() > 0 ) 00128 || ( (outer.z() - inner.z()) < 0 && outer.z() < 0 && inner.z() < 0 ) ) 00129 { 00130 // the 0 is a possible problem!!!! 00131 // GlobalTrajectoryParameters Gtp(outer, inner-outer, 0, &(*magfield)); 00132 GlobalTrajectoryParameters Gtp(outer, outer-inner, -1, &(*magfield)); 00133 FreeTrajectoryState LaserSeed(Gtp, CurvilinearTrajectoryError(AlgebraicSymMatrix(5,1))); 00134 00135 LogDebug("SeedGeneratorForLaserBeams:propagateWithMaterial") << " FirstTSOS " << LaserSeed; 00136 00137 // First propagation 00138 const TSOS outerState = thePropagatorMaterialAl->propagate(LaserSeed, tracker->idToDet(HitPairs[i].outer()->geographicalId())->surface()); 00139 00140 if (outerState.isValid()) 00141 { 00142 LogDebug("SeedGeneratorForLaserBeams:propagateWithMaterial") << " outerState " << outerState; 00143 const TSOS outerUpdated = theUpdator->update( outerState, *outrhit); 00144 00145 if (outerUpdated.isValid()) 00146 { 00147 LogDebug("SeedGeneratorForLaserBeams:propagateWithMaterial") << " outerUpdated " << outerUpdated; 00148 00149 PTrajectoryStateOnDet *pTraj = transformer.persistentState(outerUpdated, HitPairs[i].outer()->geographicalId().rawId()); 00150 TrajectorySeed * trSeed = new TrajectorySeed(*pTraj, hits, alongMomentum); 00151 // store seed 00152 output.push_back(*trSeed); 00153 } 00154 else { edm::LogError("SeedGeneratorForLaserBeams:propagateWithMaterial") << " SeedForLaserBeams first update failed "; } 00155 } 00156 else { edm::LogError("SeedGeneratorForLaserBeams:propagateWithMaterial") << " SeedForLaserBeams first propagation failed "; } 00157 } 00158 else 00159 { 00160 // the 0 is a possible problem!!!! 00161 // GlobalTrajectoryParameters Gtp(outer, outer-inner, 0, &(*magfield)); 00162 GlobalTrajectoryParameters Gtp(outer, outer-inner, -1, &(*magfield)); 00163 FreeTrajectoryState LaserSeed(Gtp, CurvilinearTrajectoryError(AlgebraicSymMatrix(5,1))); 00164 LogDebug("SeedGeneratorForLaserBeams:propagateWithMaterial") << " FirstTSOS " << LaserSeed; 00165 00166 // First propagation 00167 const TSOS outerState = thePropagatorMaterialOp->propagate(LaserSeed, tracker->idToDet(HitPairs[i].outer()->geographicalId())->surface()); 00168 00169 if (outerState.isValid()) 00170 { 00171 LogDebug("SeedGeneratorForLaserBeams:propagateWithMaterial") << " outerState " << outerState; 00172 const TSOS outerUpdated = theUpdator->update(outerState, *outrhit); 00173 00174 if (outerUpdated.isValid()) 00175 { 00176 LogDebug("SeedGeneratorForLaserBeams:propagateWithMaterial") << " outerUpdated " << outerUpdated; 00177 PTrajectoryStateOnDet *pTraj = transformer.persistentState(outerUpdated, HitPairs[i].outer()->geographicalId().rawId()); 00178 00179 TrajectorySeed *trSeed = new TrajectorySeed(*pTraj, hits, oppositeToMomentum); 00180 // store seed 00181 output.push_back(*trSeed); 00182 } 00183 else { edm::LogError("SeedGeneratorForLaserBeams:propagateWithMaterial") << " SeedForLaserBeams first update failed "; } 00184 } 00185 else { edm::LogError("SeedGeneratorForLaserBeams:propagateWithMaterial") << " SeedForLaserBeams first propagation failed "; } 00186 } 00187 } 00188 }
void SeedGeneratorForLaserBeams::run | ( | TrajectorySeedCollection & | output, | |
const edm::EventSetup & | iSetup | |||
) |
run the seed finder
Definition at line 94 of file SeedGeneratorForLaserBeams.cc.
References LaserHitPairGenerator::hitPairs(), propagateAnalytical(), propagateWithMaterial(), propagatorName, region, OrderedLaserHitPairs::size(), and thePairGenerator.
Referenced by LaserSeedGenerator::produce().
00095 { 00096 OrderedLaserHitPairs HitPairs; 00097 thePairGenerator->hitPairs(region, HitPairs, iSetup); 00098 00099 if (HitPairs.size() > 0) 00100 { 00101 stable_sort(HitPairs.begin(), HitPairs.end(), CompareHitPairsZ(iSetup) ); 00102 00103 if (propagatorName == "WithMaterial") 00104 { 00105 propagateWithMaterial(HitPairs, output); 00106 } 00107 else if ( propagatorName == "Analytical") 00108 { 00109 propagateAnalytical(HitPairs, output); 00110 } 00111 } 00112 }
std::string SeedGeneratorForLaserBeams::builderName [private] |
Definition at line 66 of file SeedGeneratorForLaserBeams.h.
Referenced by init(), and SeedGeneratorForLaserBeams().
Definition at line 54 of file SeedGeneratorForLaserBeams.h.
Referenced by SeedGeneratorForLaserBeams().
Definition at line 57 of file SeedGeneratorForLaserBeams.h.
Referenced by init(), propagateAnalytical(), and propagateWithMaterial().
std::string SeedGeneratorForLaserBeams::propagatorName [private] |
Definition at line 67 of file SeedGeneratorForLaserBeams.h.
Referenced by init(), run(), SeedGeneratorForLaserBeams(), and ~SeedGeneratorForLaserBeams().
Definition at line 55 of file SeedGeneratorForLaserBeams.h.
Referenced by run(), and SeedGeneratorForLaserBeams().
Definition at line 56 of file SeedGeneratorForLaserBeams.h.
Referenced by init(), run(), and ~SeedGeneratorForLaserBeams().
Definition at line 63 of file SeedGeneratorForLaserBeams.h.
Referenced by init(), propagateAnalytical(), and ~SeedGeneratorForLaserBeams().
Definition at line 64 of file SeedGeneratorForLaserBeams.h.
Referenced by init(), propagateAnalytical(), and ~SeedGeneratorForLaserBeams().
Definition at line 61 of file SeedGeneratorForLaserBeams.h.
Referenced by init(), propagateWithMaterial(), and ~SeedGeneratorForLaserBeams().
Definition at line 62 of file SeedGeneratorForLaserBeams.h.
Referenced by init(), propagateWithMaterial(), and ~SeedGeneratorForLaserBeams().
KFUpdator* SeedGeneratorForLaserBeams::theUpdator [private] |
Definition at line 60 of file SeedGeneratorForLaserBeams.h.
Referenced by init(), propagateAnalytical(), propagateWithMaterial(), and ~SeedGeneratorForLaserBeams().
Definition at line 58 of file SeedGeneratorForLaserBeams.h.
Referenced by init(), propagateAnalytical(), and propagateWithMaterial().
Definition at line 59 of file SeedGeneratorForLaserBeams.h.
Referenced by propagateAnalytical(), and propagateWithMaterial().
const TransientTrackingRecHitBuilder* SeedGeneratorForLaserBeams::TTRHBuilder [private] |
Definition at line 65 of file SeedGeneratorForLaserBeams.h.
Referenced by init(), propagateAnalytical(), and propagateWithMaterial().