Go to the documentation of this file.00001
00005 #include "RecoMuon/MuonSeedGenerator/src/SETSeedFinder.h"
00006 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00007 #include "FWCore/Framework/interface/Event.h"
00008 #include "RecoMuon/TrackingTools/interface/MuonPatternRecoDumper.h"
00009 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00010 #include "TrackingTools/DetLayers/interface/DetLayer.h"
00011 #include "Geometry/CommonDetUnit/interface/GeomDet.h"
00012 #include "DataFormats/MuonDetId/interface/MuonSubdetId.h"
00013 #include "DataFormats/MuonDetId/interface/CSCDetId.h"
00014 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateTransform.h"
00015
00016 #include "TMath.h"
00017
00018
00019 using namespace edm;
00020 using namespace std;
00021
00022 const string metname = "Muon|RecoMuon|SETMuonSeedFinder";
00023
00024 SETSeedFinder::SETSeedFinder(const ParameterSet& parameterSet)
00025 : MuonSeedVFinder()
00026 {
00027
00028 ParameterSet trajectoryBuilderParameters = parameterSet.getParameter<ParameterSet>("SETTrajBuilderParameters");
00029 apply_prePruning = trajectoryBuilderParameters.getParameter<bool>("Apply_prePruning");
00030
00031 thePtExtractor = new MuonSeedPtExtractor(trajectoryBuilderParameters);
00032
00033 }
00034
00035
00036 void SETSeedFinder::seeds(const MuonRecHitContainer & cluster,
00037 std::vector<TrajectorySeed> & result)
00038 {
00039 }
00040
00041
00042
00043
00044 struct sorter{
00045 bool operator() (MuonTransientTrackingRecHit::MuonRecHitPointer const & hit_1,
00046 MuonTransientTrackingRecHit::MuonRecHitPointer const & hit_2){
00047 return (hit_1->globalPosition().mag2()<hit_2->globalPosition().mag2());
00048
00049 }
00050 } sortSegRadius;
00051
00052
00053
00054 std::vector<SETSeedFinder::MuonRecHitContainer>
00055 SETSeedFinder::sortByLayer(MuonRecHitContainer & cluster) const
00056 {
00057 stable_sort(cluster.begin(), cluster.end(),sortSegRadius);
00058
00059
00060
00061 std::vector< MuonRecHitContainer > MuonRecHitContainer_perLayer;
00062 if(cluster.size()){
00063 int iHit =0;
00064 MuonRecHitContainer hitsInThisLayer;
00065 hitsInThisLayer.push_back(cluster[iHit]);
00066 DetId detId = cluster[iHit]->hit()->geographicalId();
00067 const GeomDet* geomDet = theService->trackingGeometry()->idToDet( detId );
00068 while(iHit<int(cluster.size())-1){
00069 DetId detId_2 = cluster[iHit+1]->hit()->geographicalId();
00070 const GlobalPoint gp_nextHit = cluster[iHit+1]->globalPosition();
00071
00072
00073 float distanceToDetector = fabs(geomDet->surface().localZ(gp_nextHit));
00074
00075
00076
00077
00078
00079
00080 bool specialCase = false;
00081 if( detId.subdetId() == MuonSubdetId::DT &&
00082 detId_2.subdetId() == MuonSubdetId::DT ){
00083 DTChamberId dtCh(detId);
00084 DTChamberId dtCh_2(detId_2);
00085 specialCase = (dtCh.station() == dtCh_2.station());
00086 }
00087 else if(detId.subdetId() == MuonSubdetId::CSC &&
00088 detId_2.subdetId() == MuonSubdetId::CSC){
00089 CSCDetId cscCh(detId);
00090 CSCDetId cscCh_2(detId_2);
00091 specialCase = (cscCh.station() == cscCh_2.station() && cscCh.ring() == cscCh_2.ring());
00092 }
00093
00094 if(distanceToDetector<0.001 || true==specialCase){
00095 hitsInThisLayer.push_back(cluster[iHit+1]);
00096 }
00097 else{
00098 specialCase = false;
00099 if(( (cluster[iHit]->isDT() &&
00100 cluster[iHit+1]->isCSC()) ||
00101 (cluster[iHit]->isCSC() &&
00102 cluster[iHit+1]->isDT())) &&
00103
00104
00105 fabs(cluster[iHit+1]->globalPosition().mag() -
00106 cluster[iHit]->globalPosition().mag())<10.){
00107 hitsInThisLayer.push_back(cluster[iHit+1]);
00108
00109 detId = cluster[iHit+1]->hit()->geographicalId();
00110 geomDet = theService->trackingGeometry()->idToDet( detId );
00111 }
00112 else if(!specialCase){
00113
00114
00115 MuonRecHitContainer_perLayer.push_back(hitsInThisLayer);
00116 hitsInThisLayer.clear();
00117 hitsInThisLayer.push_back(cluster[iHit+1]);
00118 detId = cluster[iHit+1]->hit()->geographicalId();
00119 geomDet = theService->trackingGeometry()->idToDet( detId );
00120 }
00121 }
00122 ++iHit;
00123 }
00124 MuonRecHitContainer_perLayer.push_back(hitsInThisLayer);
00125 }
00126 return MuonRecHitContainer_perLayer;
00127 }
00128
00129 void SETSeedFinder::limitCombinatorics(std::vector< MuonRecHitContainer > & MuonRecHitContainer_perLayer){
00130 const int maximumNumberOfCombinations = 1000000;
00131 unsigned nLayers = MuonRecHitContainer_perLayer.size();
00132 if(1==nLayers){
00133 return ;
00134 }
00135
00136
00137 if(MuonRecHitContainer_perLayer.size()>15){
00138 MuonRecHitContainer_perLayer.resize(1);
00139 return;
00140 }
00141
00142 std::vector <double> sizeOfLayer(nLayers);
00143
00144 double nAllCombinations = 1.;
00145 for(unsigned int i = 0;i<nLayers;++i ){
00146
00147 sizeOfLayer.at(i) = MuonRecHitContainer_perLayer.at(i).size();
00148 nAllCombinations*=MuonRecHitContainer_perLayer.at(i).size();
00149 }
00150
00151
00152 int iCycle = 0;
00153 while(nAllCombinations > float(maximumNumberOfCombinations)){
00154 ++iCycle;
00155 std::vector <double>::iterator maxEl_it = max_element(sizeOfLayer.begin(),sizeOfLayer.end());
00156 int maxEl = maxEl_it - sizeOfLayer.begin();
00157 nAllCombinations/=MuonRecHitContainer_perLayer.at(maxEl).size();
00158
00159 MuonRecHitContainer_perLayer.erase(MuonRecHitContainer_perLayer.begin()+maxEl);
00160 sizeOfLayer.erase(sizeOfLayer.begin()+maxEl);
00161 }
00162 return;
00163 }
00164
00165 std::vector<SETSeedFinder::MuonRecHitContainer>
00166 SETSeedFinder::findAllValidSets(const std::vector<SETSeedFinder::MuonRecHitContainer> & MuonRecHitContainer_perLayer)
00167 {
00168 std::vector <MuonRecHitContainer> allValidSets;
00169
00170
00171
00172
00173
00174 unsigned nLayers = MuonRecHitContainer_perLayer.size();
00175 if(1==nLayers){
00176 return allValidSets;
00177 }
00178 MuonRecHitContainer validSet;
00179 unsigned int iPos0 = 0;
00180 std::vector <unsigned int> iLayer(12);
00181 std::vector <unsigned int> size(12);
00182 if(iPos0<nLayers){
00183 size.at(iPos0) = MuonRecHitContainer_perLayer.at(iPos0).size();
00184 for(iLayer[iPos0] = 0; iLayer[iPos0]<size[iPos0];++iLayer[iPos0]){
00185 validSet.clear();
00186 validSet.push_back(MuonRecHitContainer_perLayer[iPos0][iLayer[iPos0]]);
00187 unsigned int iPos1 = 1;
00188 if(iPos1<nLayers){
00189 size.at(iPos1) = MuonRecHitContainer_perLayer.at(iPos1).size();
00190 for(iLayer[iPos1] = 0; iLayer[iPos1]<size[iPos1];++iLayer[iPos1]){
00191 validSet.resize(iPos1);
00192 validSet.push_back(MuonRecHitContainer_perLayer[iPos1][iLayer[iPos1]]);
00193 unsigned int iPos2 = 2;
00194 if(iPos2<nLayers){
00195 size.at(iPos2) = MuonRecHitContainer_perLayer.at(iPos2).size();
00196 for(iLayer[iPos2] = 0; iLayer[iPos2]<size[iPos2];++iLayer[iPos2]){
00197 validSet.resize(iPos2);
00198 validSet.push_back(MuonRecHitContainer_perLayer[iPos2][iLayer[iPos2]]);
00199 unsigned int iPos3 = 3;
00200 if(iPos3<nLayers){
00201 size.at(iPos3) = MuonRecHitContainer_perLayer.at(iPos3).size();
00202 for(iLayer[iPos3] = 0; iLayer[iPos3]<size[iPos3];++iLayer[iPos3]){
00203 validSet.resize(iPos3);
00204 validSet.push_back(MuonRecHitContainer_perLayer[iPos3][iLayer[iPos3]]);
00205 unsigned int iPos4 = 4;
00206 if(iPos4<nLayers){
00207 size.at(iPos4) = MuonRecHitContainer_perLayer.at(iPos4).size();
00208 for(iLayer[iPos4] = 0; iLayer[iPos4]<size[iPos4];++iLayer[iPos4]){
00209 validSet.resize(iPos4);
00210 validSet.push_back(MuonRecHitContainer_perLayer[iPos4][iLayer[iPos4]]);
00211 unsigned int iPos5 = 5;
00212 if(iPos5<nLayers){
00213 size.at(iPos5) = MuonRecHitContainer_perLayer.at(iPos5).size();
00214 for(iLayer[iPos5] = 0; iLayer[iPos5]<size[iPos5];++iLayer[iPos5]){
00215 validSet.resize(iPos5);
00216 validSet.push_back(MuonRecHitContainer_perLayer[iPos5][iLayer[iPos5]]);
00217 unsigned int iPos6 = 6;
00218 if(iPos6<nLayers){
00219 size.at(iPos6) = MuonRecHitContainer_perLayer.at(iPos6).size();
00220 for(iLayer[iPos6] = 0; iLayer[iPos6]<size[iPos6];++iLayer[iPos6]){
00221 validSet.resize(iPos6);
00222 validSet.push_back(MuonRecHitContainer_perLayer[iPos6][iLayer[iPos6]]);
00223 unsigned int iPos7 = 7;
00224 if(iPos7<nLayers){
00225 size.at(iPos7) = MuonRecHitContainer_perLayer.at(iPos7).size();
00226 for(iLayer[iPos7] = 0; iLayer[iPos7]<size[iPos7];++iLayer[iPos7]){
00227 validSet.resize(iPos7);
00228 validSet.push_back(MuonRecHitContainer_perLayer[iPos7][iLayer[iPos7]]);
00229 unsigned int iPos8 = 8;
00230 if(iPos8<nLayers){
00231 size.at(iPos8) = MuonRecHitContainer_perLayer.at(iPos8).size();
00232 for(iLayer[iPos8] = 0; iLayer[iPos8]<size[iPos8];++iLayer[iPos8]){
00233 validSet.resize(iPos8);
00234 validSet.push_back(MuonRecHitContainer_perLayer[iPos8][iLayer[iPos8]]);
00235 unsigned int iPos9 = 9;
00236 if(iPos9<nLayers){
00237 size.at(iPos9) = MuonRecHitContainer_perLayer.at(iPos9).size();
00238 for(iLayer[iPos9] = 0; iLayer[iPos9]<size[iPos9];++iLayer[iPos9]){
00239 validSet.resize(iPos9);
00240 validSet.push_back(MuonRecHitContainer_perLayer[iPos9][iLayer[iPos9]]);
00241 unsigned int iPos10 = 10;
00242 if(iPos10<nLayers){
00243 size.at(iPos10) = MuonRecHitContainer_perLayer.at(iPos10).size();
00244 for(iLayer[iPos10] = 0; iLayer[iPos10]<size[iPos10];++iLayer[iPos10]){
00245 validSet.resize(iPos10);
00246 validSet.push_back(MuonRecHitContainer_perLayer[iPos10][iLayer[iPos10]]);
00247 unsigned int iPos11 = 11;
00248 if(iPos11<nLayers){
00249 size.at(iPos11) = MuonRecHitContainer_perLayer.at(iPos11).size();
00250 for(iLayer[iPos11] = 0; iLayer[iPos11]<size[iPos11];++iLayer[iPos11]){
00251 }
00252 }
00253 else{
00254 allValidSets.push_back(validSet);
00255
00256 }
00257 }
00258 }
00259 else{
00260 allValidSets.push_back(validSet);
00261 }
00262 }
00263 }
00264 else{
00265 allValidSets.push_back(validSet);
00266 }
00267 }
00268 }
00269 else{
00270 allValidSets.push_back(validSet);
00271 }
00272 }
00273 }
00274 else{
00275 allValidSets.push_back(validSet);
00276 }
00277 }
00278 }
00279 else{
00280 allValidSets.push_back(validSet);
00281 }
00282 }
00283 }
00284 else{
00285 allValidSets.push_back(validSet);
00286 }
00287 }
00288 }
00289 else{
00290 allValidSets.push_back(validSet);
00291 }
00292 }
00293 }
00294 else{
00295 allValidSets.push_back(validSet);
00296 }
00297 }
00298 }
00299 else{
00300 allValidSets.push_back(validSet);
00301 }
00302 }
00303 }
00304 else{
00305 allValidSets.push_back(validSet);
00306 }
00307 }
00308 }
00309 else{
00310 allValidSets.push_back(validSet);
00311 }
00312 return allValidSets;
00313 }
00314
00315
00316 std::pair <int, int>
00317 SETSeedFinder::checkAngleDeviation(double dPhi_1, double dPhi_2) const
00318 {
00319
00320
00321
00322
00323
00324
00325
00326 double mult = dPhi_1 * dPhi_2;
00327 int signVal = 1;
00328 if(fabs(dPhi_1)<fabs(dPhi_2)){
00329 signVal = -1;
00330 }
00331 int signMult = -1;
00332 if(mult>0) signMult = 1;
00333 std::pair <int, int> sign;
00334 sign = make_pair (signVal, signMult);
00335
00336 return sign;
00337 }
00338
00339
00340 void SETSeedFinder::validSetsPrePruning(std::vector<SETSeedFinder::MuonRecHitContainer> & allValidSets)
00341 {
00342
00343
00344
00345
00346 for(unsigned int iSet = 0;iSet<allValidSets.size();++iSet){
00347 pre_prune(allValidSets[iSet]);
00348 }
00349 }
00350
00351
00352 void SETSeedFinder::pre_prune(SETSeedFinder::MuonRecHitContainer & validSet) const
00353 {
00354 unsigned nHits = validSet.size();
00355 if(nHits>3){
00356
00357
00358 std::vector <double> dPhi;
00359 double dPhi_tmp;
00360 bool wildCandidate;
00361 int pruneHit_tmp;
00362
00363 for(unsigned int iHit = 1;iHit<nHits;++iHit){
00364 dPhi_tmp = validSet[iHit]->globalPosition().phi() -
00365 validSet[iHit-1]->globalPosition().phi();
00366 dPhi.push_back(dPhi_tmp);
00367 }
00368 std::vector <int> pruneHit;
00369
00370
00371 for(unsigned int iHit = 0;iHit<nHits;++iHit){
00372 double dPHI_MIN = 0.02;
00373 if(iHit){
00374
00375
00376 wildCandidate = false;
00377
00378
00379
00380 if(4==validSet[iHit-1]->dimension() && 4 == validSet[iHit]->dimension() &&
00381 fabs(validSet[iHit]->globalPosition().phi() -
00382 validSet[iHit-1]->globalPosition().phi())>dPHI_MIN ){
00383 wildCandidate = true;
00384 }
00385 pruneHit_tmp = -1;
00386 if(wildCandidate){
00387
00388 if(1==iHit){
00389 if(4==validSet[iHit+1]->dimension() && 4 == validSet[iHit+2]->dimension()){
00390
00391 dPhi_tmp = validSet[iHit+1]->globalPosition().phi() -
00392 validSet[iHit-1]->globalPosition().phi();
00393
00394 std::pair <int, int> sign = checkAngleDeviation(dPhi_tmp, dPhi[2]);
00395 if( 1==sign.first && 1==sign.second){
00396 pruneHit_tmp = iHit;
00397 }
00398 }
00399 }
00400 else if(iHit>1 && iHit<validSet.size()-1){
00401 if(4 == validSet[0]->dimension() &&
00402 4 == validSet[1]->dimension() &&
00403 pruneHit.back()!=int(iHit-1) && pruneHit.back()!=1){
00404
00405
00406 dPhi_tmp = validSet[iHit+1]->globalPosition().phi() -
00407 validSet[iHit-1]->globalPosition().phi();
00408
00409 std::pair <int, int> sign = checkAngleDeviation(dPhi[0],dPhi_tmp);
00410 if( 1==sign.first && 1==sign.second){
00411 pruneHit_tmp = iHit;
00412 }
00413 else{
00414
00415 dPhi_tmp = validSet[iHit+1]->globalPosition().phi() -
00416 validSet[iHit]->globalPosition().phi();
00417 std::pair <int, int> sign = checkAngleDeviation(dPhi[0],dPhi_tmp);
00418 if( 1==sign.first && 1==sign.second){
00419 pruneHit_tmp = iHit-1;
00420 }
00421 }
00422 }
00423 }
00424 else{
00425
00426 if(pruneHit.size()>1 && pruneHit[pruneHit.size()-1]<0 && pruneHit[pruneHit.size()-2]<0){
00427 std::pair <int, int> sign = checkAngleDeviation(dPhi[dPhi.size()-2], dPhi[dPhi.size()-1]);
00428 if( -1==sign.first && -1==sign.second){
00429 pruneHit_tmp = iHit;
00430 }
00431 }
00432 }
00433 }
00434 pruneHit.push_back(pruneHit_tmp);
00435 }
00436 }
00437
00438
00439 for(unsigned int iHit = 1;iHit<nHits;++iHit){
00440 int count = 0;
00441 if(pruneHit[iHit-1]>0){
00442 validSet.erase(validSet.begin()+pruneHit[iHit-1]-count);
00443 ++count;
00444 }
00445 }
00446 }
00447 }
00448
00449
00450 std::vector <SeedCandidate> SETSeedFinder::
00451 fillSeedCandidates(std::vector <MuonRecHitContainer> & allValidSets){
00452
00453
00454
00455
00456 std::vector <SeedCandidate> seedCandidates_inCluster;
00457
00458
00459 for(unsigned int iSet = 0;iSet<allValidSets.size();++iSet){
00460
00461
00462
00463
00464
00465
00466
00467
00468 CLHEP::Hep3Vector momEstimate;
00469 int chargeEstimate;
00470 estimateMomentum(allValidSets[iSet], momEstimate, chargeEstimate);
00471 MuonRecHitContainer MuonRecHitContainer_theSet_prep;
00472
00473
00474 SeedCandidate seedCandidates_inCluster_prep;
00475 seedCandidates_inCluster_prep.theSet = allValidSets[iSet];
00476 seedCandidates_inCluster_prep.momentum = momEstimate;
00477 seedCandidates_inCluster_prep.charge = chargeEstimate;
00478 seedCandidates_inCluster.push_back(seedCandidates_inCluster_prep);
00479
00480 }
00481 return seedCandidates_inCluster;
00482 }
00483
00484 void SETSeedFinder::estimateMomentum(const MuonRecHitContainer & validSet,
00485 CLHEP::Hep3Vector & momEstimate, int & charge) const
00486 {
00487 int firstMeasurement = -1;
00488 int lastMeasurement = -1;
00489
00490
00491
00492
00493
00494
00495
00496
00497
00498 for(unsigned int iMeas = 0;iMeas<validSet.size();++iMeas){
00499 if(4==validSet[iMeas]->dimension() &&
00500 (validSet[iMeas]->isCSC() || validSet[iMeas]->isDT())){
00501 firstMeasurement = iMeas;
00502 break;
00503 }
00504 }
00505
00506
00507 std::vector<double> momentum_estimate;
00508 double pT = 0.;
00509 MuonTransientTrackingRecHit::ConstMuonRecHitPointer firstHit;
00510 MuonTransientTrackingRecHit::ConstMuonRecHitPointer secondHit;
00511
00512 for(int loop = 0; loop<2; ++loop){
00513
00514 if(!loop){
00515
00516
00517 for(int iMeas = validSet.size()-1;iMeas>-1;--iMeas){
00518 if(4==validSet[iMeas]->dimension() &&
00519 (validSet[iMeas]->isCSC() || validSet[iMeas]->isDT()) &&
00520
00521
00522 fabs(validSet[iMeas]->globalPosition().z())<1000.){
00523 lastMeasurement = iMeas;
00524 break;
00525 }
00526 }
00527 }
00528 else{
00529
00530 for(unsigned int iMeas = 1;iMeas<validSet.size();++iMeas){
00531 if(4==validSet[iMeas]->dimension() &&
00532 (validSet[iMeas]->isCSC() || validSet[iMeas]->isDT())){
00533 lastMeasurement = iMeas;
00534 break;
00535 }
00536 }
00537 }
00538
00539 if(-1==lastMeasurement && -1==firstMeasurement){
00540 firstMeasurement = 0;
00541 lastMeasurement = validSet.size()-1;
00542 }
00543
00544 else if(-1==lastMeasurement){
00545 lastMeasurement = firstMeasurement;
00546 }
00547 else if(-1==firstMeasurement){
00548 firstMeasurement = lastMeasurement;
00549 }
00550
00551 firstHit = validSet[firstMeasurement];
00552 secondHit = validSet[lastMeasurement];
00553 if(firstHit->isRPC() && secondHit->isRPC()){
00554 momentum_estimate.push_back(300.);
00555 momentum_estimate.push_back(300.);
00556 }
00557 else{
00558 if(firstHit->isRPC()){
00559 firstHit = secondHit;
00560 }
00561 else if(secondHit->isRPC()){
00562 secondHit = firstHit;
00563 }
00564
00565
00566
00567
00568
00569 if(2==firstHit->dimension() && 2==secondHit->dimension()){
00570 momentum_estimate.push_back(999999999.);
00571 momentum_estimate.push_back(999999999.);
00572 }
00573 else{
00574 momentum_estimate = thePtExtractor->pT_extract(firstHit, secondHit);
00575 }
00576 }
00577 pT = fabs(momentum_estimate[0]);
00578 if(1 || pT>40.){
00579
00580
00581 break;
00582 }
00583 }
00584
00585 const float pT_min = 1.99;
00586 if(pT>3000.){
00587 pT=3000.;
00588 }
00589 else if(pT<pT_min ){
00590 if(pT>0){
00591 pT=pT_min ;
00592 }
00593 else if(pT>(-1)*pT_min ){
00594 pT=(-1)*pT_min ;
00595 }
00596 else if (pT<-3000.){
00597 pT= -3000;
00598 }
00599 }
00600
00601
00602
00603 charge = momentum_estimate[0]> 0 ? 1 : -1;
00604
00605
00606
00607
00608 double xHit = validSet[firstMeasurement]->globalPosition().x();
00609 double yHit = validSet[firstMeasurement]->globalPosition().y();
00610 double rHit = TMath::Sqrt(pow(xHit,2) + pow(yHit,2));
00611
00612 double thetaInner = validSet[firstMeasurement]->globalPosition().theta();
00613
00614
00615
00616
00617 double rTrack = (pT /(0.3*3.8))*100.;
00618
00619 double par = -1.*(2./charge)*(TMath::ASin(rHit/(2*rTrack)));
00620 double sinPar = TMath::Sin( par );
00621 double cosPar = TMath::Cos( par );
00622
00623
00624 double sinPhiH = 1./(2.*charge*rTrack)*(xHit + ((sinPar)/(cosPar-1.))*yHit);
00625 double cosPhiH = -1./(2.*charge*rTrack)*(((sinPar)/(1.-cosPar))*xHit + yHit);
00626
00627
00628
00629
00630 momEstimate = CLHEP::Hep3Vector(pT*cosPhiH, pT*sinPhiH, pT/TMath::Tan(thetaInner));
00631
00632 const float minMomenum = 5.;
00633 if (momEstimate.mag()<minMomenum){
00634 int sign = (pT<0.) ? -1: 1;
00635 pT = sign * (fabs(pT)+1);
00636 CLHEP::Hep3Vector momEstimate2(pT*cosPhiH, pT*sinPhiH, pT/TMath::Tan(thetaInner));
00637 momEstimate = momEstimate2;
00638 if (momEstimate.mag()<minMomenum){
00639 pT = sign * (fabs(pT)+1);
00640 CLHEP::Hep3Vector momEstimate3(pT*cosPhiH, pT*sinPhiH, pT/TMath::Tan(thetaInner));
00641 momEstimate = momEstimate3;
00642 if (momEstimate.mag()<minMomenum){
00643 pT = sign * (fabs(pT)+1);
00644 CLHEP::Hep3Vector momEstimate4(pT*cosPhiH, pT*sinPhiH, pT/TMath::Tan(thetaInner));
00645 momEstimate = momEstimate4;
00646 }
00647 }
00648 }
00649 }
00650
00651
00652
00653 TrajectorySeed SETSeedFinder::makeSeed(const TrajectoryStateOnSurface & firstTSOS,
00654 const TransientTrackingRecHit::ConstRecHitContainer & hits) const
00655 {
00656 edm::OwnVector<TrackingRecHit> recHitsContainer;
00657 for(unsigned int iHit = 0;iHit < hits.size();++iHit){
00658 recHitsContainer.push_back(hits.at(iHit)->hit()->clone());
00659 }
00660 PropagationDirection dir = oppositeToMomentum;
00661 if(useSegmentsInTrajectory){
00662 dir = alongMomentum;
00663 }
00664
00665 PTrajectoryStateOnDet const & seedTSOS =
00666 trajectoryStateTransform::persistentState( firstTSOS, hits.at(0)->geographicalId().rawId());
00667 TrajectorySeed seed(seedTSOS,recHitsContainer,dir);
00668
00669
00670
00671
00672
00673
00674
00675
00676 return seed;
00677 }
00678
00679