CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
cms::DiMuonSeedGeneratorHIC Class Reference

#include <DiMuonSeedGeneratorHIC.h>

Public Types

typedef std::vector
< DiMuonTrajectorySeed
SeedContainer
 
typedef SeedContainer::iterator SeedIterator
 

Public Member Functions

 DiMuonSeedGeneratorHIC (edm::InputTag, const MagneticField *, const GeometricSearchTracker *, const HICConst *, const std::string, int aMult)
 
virtual std::map< DetLayer
*, SeedContainer
produce (const edm::Event &e, const edm::EventSetup &c, FreeTrajectoryState &, TrajectoryStateOnSurface &, FreeTrajectoryState &, const TransientTrackingRecHitBuilder *RecHitBuilder, const MeasurementTracker *measurementTracker, std::vector< DetLayer * > *)
 
virtual ~DiMuonSeedGeneratorHIC ()
 

Private Member Functions

std::pair
< TrajectoryMeasurement, bool > 
barrelUpdateSeed (const FreeTrajectoryState &, const TrajectoryMeasurement &) const
 
std::pair
< TrajectoryMeasurement, bool > 
forwardUpdateSeed (const FreeTrajectoryState &, const TrajectoryMeasurement &) const
 

Private Attributes

TrackerLayerIdAccessor acc
 
std::vector< LayerWithHits * > allLayersWithHits
 
std::vector< BarrelDetLayer * > bl
 
std::string builderName
 
std::vector< ForwardDetLayer * > fneg
 
std::vector< ForwardDetLayer * > fpos
 
bool isFirstCall
 
const MagneticFieldmagfield
 
edm::InputTag rphirecHitsTag
 
std::vector< const DetLayer * > theDetLayer
 
FreeTrajectoryState theFtsMuon
 
FreeTrajectoryState theFtsTracker
 
const HICConsttheHICConst
 
const LayerMeasurementstheLayerMeasurements
 
int theLowMult
 
const MeasurementTrackertheMeasurementTracker
 
PropagatorthePropagator
 
const GeometricSearchTrackertheTracker
 
const
TransientTrackingRecHitBuilder
TTRHbuilder
 

Detailed Description

Definition at line 69 of file DiMuonSeedGeneratorHIC.h.

Member Typedef Documentation

Definition at line 72 of file DiMuonSeedGeneratorHIC.h.

typedef SeedContainer::iterator cms::DiMuonSeedGeneratorHIC::SeedIterator

Definition at line 73 of file DiMuonSeedGeneratorHIC.h.

Constructor & Destructor Documentation

cms::DiMuonSeedGeneratorHIC::DiMuonSeedGeneratorHIC ( edm::InputTag  ,
const MagneticField ,
const GeometricSearchTracker ,
const HICConst ,
const std::string  ,
int  aMult 
)

Definition at line 16 of file DiMuonSeedGeneratorHIC.cc.

References HLT_ES_cff::magfield, and oppositeToMomentum.

22 {
23 
24 // initialization
25 
26  theTracker = theTracker0;
27  theHICConst = hh;
28  theLowMult = aMult;
29  magfield = magfield0;
30  rphirecHitsTag = rphirecHitsTag0;
31  TTRHbuilder = 0;
32  builderName = bb;
33 
35 
36 }
const TransientTrackingRecHitBuilder * TTRHbuilder
const GeometricSearchTracker * theTracker
virtual cms::DiMuonSeedGeneratorHIC::~DiMuonSeedGeneratorHIC ( )
inlinevirtual

Definition at line 91 of file DiMuonSeedGeneratorHIC.h.

91 {}

Member Function Documentation

pair< TrajectoryMeasurement, bool > cms::DiMuonSeedGeneratorHIC::barrelUpdateSeed ( const FreeTrajectoryState FTSOLD,
const TrajectoryMeasurement tm 
) const
private

Definition at line 165 of file DiMuonSeedGeneratorHIC.cc.

References GlobalTrajectoryParameters::charge(), funct::cos(), gather_cfg::cout, alignCSCRings::e, TrajectoryMeasurement::forwardPredictedState(), TrajectoryStateOnSurface::freeTrajectoryState(), TrajectoryMeasurement::layer(), m, HLT_ES_cff::magfield, edm::max(), edm::min(), GlobalTrajectoryParameters::momentum(), FreeTrajectoryState::parameters(), PV3DBase< T, PVType, FrameType >::perp(), phi, PV3DBase< T, PVType, FrameType >::phi(), pi, GlobalTrajectoryParameters::position(), ptmin, TrajectoryMeasurement::recHit(), funct::sin(), mathSSE::sqrt(), GeometricSearchDet::surface(), funct::tan(), theta(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

169 {
170 
171  bool good=false;
172 #ifdef DEBUG
173  std::cout<<" DiMuonSeedGeneratorHIC::barrelUpdateSeed::BarrelSeed "<<std::endl;
174 #endif
175  const DetLayer* dl = tm.layer();
176  // std::cout<<" BarrelSeed 0"<<std::endl;
178  // std::cout<<" BarrelSeed 1"<<std::endl;
179  if(!(rh->isValid()))
180  {
181 #ifdef DEBUG
182  std::cout<<" DiMuonSeedGeneratorHIC::barrelUpdateSeed::hit is not valid "<<std::endl;
183 #endif
184  return pair<TrajectoryMeasurement,bool>(tm,good);
185  }
186 #ifdef DEBUG
187  std::cout<<" DiMuonSeedGeneratorHIC::barrelUpdateSeed::hit is valid "<<std::endl;
188 #endif
189 // std::cout<<" BarrelSeed 2"<<std::endl;
191 
192 //
193 // Define local variables.
194 //
195  int imin = 0;
196  int imax = 0;
197  int imin1 = 0;
198  int imax1 = 0;
199  double phi = FTSOLD.parameters().position().phi();
200  double pt = FTS.parameters().momentum().perp();
201  double aCharge = FTS.parameters().charge();
202  //AlgebraicSymMatrix55 e = FTS.curvilinearError().matrix();
203 
204  double dptup = 0.35*pt;
205  double dptdown = 0.7*pt;
206  double ptshift = 0.22*pt;
207 
208 // std::cout<<" BarrelSeed 3 "<<std::endl;
209 //
210 // Calculate a bin for lower and upper boundary of PT interval available for track.
211 //
212  int imax0 = (int)((pt+ptshift+dptup-theHICConst->ptboun)/theHICConst->step) + 1;
213  int imin0 = (int)((pt+ptshift-dptdown-theHICConst->ptboun)/theHICConst->step) + 1;
214  if( imin0 < 1 ) imin0 = 1;
215 #ifdef DEBUG
216  std::cout<<" DiMuonSeedGeneratorHIC::barrelUpdateSeed::imin0,imax0 "<<imin0<<" "<<imax0<<" pt,dpt "<<pt+ptshift<<" "<<dptup<<" "<<dptdown<<std::endl;
217 #endif
218 
219  double dens,df,ptmax,ptmin;
220 
221  GlobalPoint realhit = (*rh).globalPosition();
222  df = fabs(realhit.phi() - phi);
223 
224  double pi=4.*atan(1.);
225  double twopi=8.*atan(1.);
226 
227  if(df > pi) df = twopi-df;
228  if(df > 1.e-5)
229  {
230  dens = 1./df;
231  } //end if
232  else
233  {
234  dens = 100000.;
235  } // end else
236  // std::cout<<" Phi rh "<<realhit.phi()<<" phumu "<<phi<<" df "<<df<<" dens "<<dens<<std::endl;
237  //
238  // Calculate new imin, imax, pt (works till 20GeV/c)
239  // It is necessary to parametrized for different Pt value with some step (to be done)
240  //
241 
242  ptmax = (dens-(double)(theHICConst->phias[26]))/(double)(theHICConst->phibs[26]) + theHICConst->ptbmax;
243  ptmin = (dens-(double)(theHICConst->phiai[26]))/(double)(theHICConst->phibi[26]) + theHICConst->ptbmax;
244 #ifdef DEBUG
245  std::cout<<" Phias,phibs,phiai,phibi "<<theHICConst->phias[26]<<" "<<theHICConst->phibs[26]<<" "<<
246  theHICConst->phiai[26]<<" "<<theHICConst->phibi[26]<<" "<<theHICConst->ptbmax<<std::endl;
247  std::cout<<" ptmin= "<<ptmin<<" ptmax "<<ptmax<<std::endl;
248  std::cout<<" ptboun "<<theHICConst->ptboun<<" "<<theHICConst->step<<std::endl;
249 #endif
250  imax = (int)((ptmax-theHICConst->ptboun)/theHICConst->step)+1;
251  imin = (int)((ptmin-theHICConst->ptboun)/theHICConst->step)+1;
252  if(imin > imax) {
253 #ifdef DEBUG
254  std::cout<<" imin>imax "<<imin<<" "<<imax<<std::endl;
255 #endif
256  return pair<TrajectoryMeasurement,bool>(tm,good);}
257  if(imax < 1) {
258 #ifdef DEBUG
259  std::cout<<"imax < 1 "<<imax<<std::endl;
260 #endif
261  return pair<TrajectoryMeasurement,bool>(tm,good);}
262 
263  imin1 = max(imin,imin0);
264  imax1 = min(imax,imax0);
265  if(imin1 > imax1) {
266 #ifdef DEBUG
267  std::cout<<" imin,imax "<<imin<<" "<<imax<<std::endl;
268  std::cout<<" imin,imax "<<imin0<<" "<<imax0<<std::endl;
269  std::cout<<" imin1>imax1 "<<imin1<<" "<<imax1<<std::endl;
270 #endif
271  return pair<TrajectoryMeasurement,bool>(tm,good);
272  }
273 
274 //
275 // Define new trajectory.
276 //
277  double ptnew = theHICConst->ptboun + theHICConst->step * (imax1 + imin1)/2. - theHICConst->step/2.; // recalculated PT of track
278 
279  //
280  // new theta angle of track
281  //
282 
283  double dfmax = 1./((double)(theHICConst->phias[26])+(double)(theHICConst->phibs[26])*(ptnew-theHICConst->ptbmax));
284  double dfmin = 1./((double)(theHICConst->phiai[26])+(double)(theHICConst->phibi[26])*(ptnew-theHICConst->ptbmax));
285  double dfcalc = fabs(dfmax+dfmin)/2.;
286  double phinew = phi+aCharge*dfcalc;
287 
288  //
289  // Recalculate phi, and Z.
290  //
291 
292  double rad = 100.*ptnew/(0.3*4.);
293  double alf = 2.*asin(realhit.perp()/rad);
294  double alfnew = phinew - aCharge*alf;
295 
296  //
297  // Fill GlobalPoint,GlobalVector
298  //
299 
300  double delx = realhit.z()-theHICConst->zvert;
301  double delr = sqrt( realhit.y()*realhit.y()+realhit.x()*realhit.x() );
302  double theta = atan2(delr,delx);
303 
304 // std::cout<<" Point 3 "<<std::endl;
305 //
306 // Each trajectory in tracker starts from real point
307 // GlobalPoint xnew0( realhit.perp()*cos(phinew), realhit.perp()*sin(phinew), realhit.z() );
308 
309  GlobalPoint xnew0( realhit.x(), realhit.y(), realhit.z() );
310 
311  GlobalVector pnew0(ptnew*cos(alfnew),ptnew*sin(alfnew),ptnew/tan(theta));
312 
314  m(0,0) = 0.5*ptnew; m(1,1) = theHICConst->phiro[12];
315  m(2,2) = theHICConst->tetro[12];
316  m(3,3) = theHICConst->phiro[12];
317  m(4,4) = theHICConst->tetro[12];
318 
320  ( GlobalTrajectoryParameters( xnew0, pnew0, (int)aCharge, &(*magfield) ),
322 
323  float estimate = 1.;
324  TrajectoryMeasurement newtm(tm.forwardPredictedState(), updatedTsosOnDet, rh, estimate, dl );
325  good=true;
326  pair<TrajectoryMeasurement,bool> newtmr(newtm,good);
327  // std::cout<<" Barrel newtm estimate= "<<newtmr.first.estimate()<<" "<<newtmr.second<<std::endl;
328  return newtmr;
329 }
float phias[28]
Definition: HICConst.h:30
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
float ptbmax
Definition: HICConst.h:17
T perp() const
Definition: PV3DBase.h:71
const GlobalTrajectoryParameters & parameters() const
float zvert
Definition: HICConst.h:25
TrajectoryStateOnSurface forwardPredictedState() const
Access to forward predicted state (from fitter or builder)
FreeTrajectoryState * freeTrajectoryState(bool withErrors=true) const
float phibs[28]
Definition: HICConst.h:31
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Phi< T > phi() const
Definition: PV3DBase.h:68
Geom::Theta< T > theta() const
T y() const
Definition: PV3DBase.h:62
float phiai[28]
Definition: HICConst.h:32
ConstRecHitPointer recHit() const
#define min(a, b)
Definition: mlp_lapack.h:161
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
const Double_t pi
const T & max(const T &a, const T &b)
T sqrt(T t)
Definition: SSEVec.h:46
T z() const
Definition: PV3DBase.h:63
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
float step
Definition: HICConst.h:18
const DetLayer * layer() const
float ptboun
Definition: HICConst.h:16
float phiro[14]
Definition: HICConst.h:82
double ptmin
Definition: HydjetWrapper.h:86
float tetro[14]
Definition: HICConst.h:83
tuple cout
Definition: gather_cfg.py:121
T x() const
Definition: PV3DBase.h:61
float phibi[28]
Definition: HICConst.h:33
Definition: DDAxes.h:10
pair< TrajectoryMeasurement, bool > cms::DiMuonSeedGeneratorHIC::forwardUpdateSeed ( const FreeTrajectoryState FTSOLD,
const TrajectoryMeasurement tm 
) const
private

Definition at line 331 of file DiMuonSeedGeneratorHIC.cc.

References GlobalTrajectoryParameters::charge(), funct::cos(), gather_cfg::cout, PV3DBase< T, PVType, FrameType >::eta(), TrajectoryMeasurement::forwardPredictedState(), TrajectoryStateOnSurface::freeTrajectoryState(), TrajectoryMeasurement::layer(), m, HLT_ES_cff::magfield, GlobalTrajectoryParameters::momentum(), FreeTrajectoryState::parameters(), PV3DBase< T, PVType, FrameType >::perp(), phi, PV3DBase< T, PVType, FrameType >::phi(), pi, GlobalTrajectoryParameters::position(), ptmin, TrajectoryMeasurement::recHit(), funct::sin(), mathSSE::sqrt(), GeometricSearchDet::surface(), funct::tan(), theta(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

335 {
336  bool good=false;
337 #ifdef DEBUG
338  std::cout<<" DiMuonSeedGeneratorHIC::forwardUpdateSeed::EndcapSeed::start "<<std::endl;
339 #endif
340  const DetLayer* dl = tm.layer();
341 // std::cout<<" EndcapSeed 0"<<std::endl;
343 // std::cout<<" EndcapSeed 1"<<std::endl;
344  if(!(rh->isValid()))
345  {
346 #ifdef DEBUG
347  std::cout<<" DiMuonSeedGeneratorHIC::forwardUpdateSeed::EndcapSeed::EndcapSeed::hit is not valid "<<std::endl;
348 #endif
349 
350  return pair<TrajectoryMeasurement,bool>(tm,good);
351  }
352 
353 #ifdef DEBUG
354  std::cout<<" DiMuonSeedGeneratorHIC::forwardUpdateSeed::EndcapSeed::EndcapSeed::valid "<<std::endl;
355 #endif
356 
358 
359 //
360 // Define local variables.
361 //
362 
363  double phi = FTSOLD.parameters().position().phi();
364  double aCharge = FTS.parameters().charge();
365  //AlgebraicSymMatrix55 e = FTS.curvilinearError().matrix();
366  double pt = FTS.parameters().momentum().perp();
367  // double pz = FTS.parameters().momentum().z();
368  // double dpt = 0.6*pt;
369 
370 // std::cout<<" Point 0 "<<std::endl;
371  double pi=4.*atan(1.);
372  double twopi=8.*atan(1.);
373 
374 
375  GlobalPoint realhit = rh->globalPosition();
376 
377 // std::cout<<" Point 1 "<<std::endl;
378 
379  double df = fabs(realhit.phi() - phi);
380 
381  if(df > pi) df = twopi-df;
382 
383 #ifdef DEBUG
384  cout<<" DiMuonSeedGeneratorHIC::forwardUpdateSeed::phipred::phihit::df "<<phi<<" "<<realhit.phi()<<" "<<df<<endl;
385 #endif
386 
387  //
388  // calculate the new Pl
389  //
390 
391  double delx = realhit.z() - theHICConst->zvert;
392  double delr = sqrt(realhit.y()*realhit.y()+realhit.x()*realhit.x());
393  double theta = atan2( delr, delx );
394  double ptmin = 0.;
395  double ptmax = 0.;
396  double ptnew = 0.;
397  double pznew = 0.;
398 
399 // old ok double pznew = abs((aCharge*theHicConst->forwparam[1])/(df-theHicConst->forwparam[0]));
400 
401  if( fabs(FTSOLD.parameters().momentum().eta()) > 1.9 )
402  {
403 #ifdef DEBUG
404  cout<<" First parametrization "<<df<<endl;
405 #endif
406  pznew = fabs(( df - 0.0191878 )/(-0.0015952))/3.;
407 
408  if( df > 0.1 ) pznew = 5.;
409  if( fabs(pznew)<3.) pznew = 3.;
410 
411  if( FTSOLD.parameters().position().z() < 0. ) pznew = (-1)*pznew;
412  ptnew = pznew * tan( theta );
413  }
414  if( fabs(FTSOLD.parameters().momentum().eta()) > 1.7 && fabs(FTSOLD.parameters().momentum().eta()) < 1.9 )
415  {
416 #ifdef DEBUG
417  cout<<" Second parametrization "<<df<<endl;
418 #endif
419  pznew = fabs(( df - 0.38 )/(-0.009))/3.;
420  if( fabs(pznew)<2.) pznew = 2.;
421 
422  if( FTSOLD.parameters().position().z() < 0. ) pznew = (-1)*pznew;
423  ptnew = pznew * tan( theta );
424  }
425  if( fabs(FTSOLD.parameters().momentum().eta()) > 1.6 && fabs(FTSOLD.parameters().momentum().eta()) < 1.7 )
426  {
427 #ifdef DEBUG
428  cout<<" Third parametrization "<<df<<endl;
429 #endif
430  pznew = fabs(( df - 0.9 )/(-0.02))/3.;
431  if( fabs(pznew)<1.) pznew = 1.;
432  if( FTSOLD.parameters().position().z() < 0. ) pznew = (-1)*pznew;
433  ptnew = pznew * tan( theta );
434  }
435  if( fabs(FTSOLD.parameters().momentum().eta()) > 0.7 && fabs(FTSOLD.parameters().momentum().eta()) < 1.6 )
436  {
437 #ifdef DEBUG
438  cout<<" Forth parametrization "<<df<<endl;
439 #endif
440  double dfinv = 0.;
441  if( df < 0.0000001 ) {
442  dfinv = 1000000.;
443  }
444  else
445  {
446  dfinv = 1/df;
447  }
448  ptmin = (dfinv - 4.)/0.7 + 3.;
449  if( ptmin < 2. ) ptmin = 2.;
450  ptmax = (dfinv - 0.5)/0.3 + 3.;
451  ptnew = ( ptmin + ptmax )/2.;
452  pznew = ptnew/tan( theta );
453 
454 // std::cout<<" Point 6 "<<std::endl;
455 #ifdef DEBUG
456  std::cout<<" Paramters of algorithm "<<df<<" "<<theHICConst->forwparam[1]<<" "<<theHICConst->forwparam[0]<<std::endl;
457  std::cout<<" dfinv "<<dfinv<<" ptmax "<<ptmax<<" ptmin "<<ptmin<<std::endl;
458 // std::cout<<" check "<<pt<<" "<<ptnew<<" "<<dpt<<" pz "<<pznew<<" "<<pz<<std::endl;
459 #endif
460  }
461  //
462  // Check if it is valid
463  //
464  if( (pt - ptnew)/pt < -2 || (pt - ptnew)/pt > 1 )
465  {
466 #ifdef DEBUG
467  cout<<" Return fake 0 pt::ptnew "<<pt<<" "<<ptnew<<endl;
468 #endif
469  return pair<TrajectoryMeasurement,bool>(tm,good); // bad rhit
470  }
471  // cout<<" Start recalculation 0 "<<endl;
472  //
473  // Recalculate phi, and Z.
474  //
475  double alf = theHICConst->atra * ( realhit.z() - theHICConst->zvert )/fabs(pznew);
476  double alfnew = realhit.phi() + aCharge*alf;
477  GlobalPoint xnew0(realhit.x(), realhit.y(), realhit.z());
478  GlobalVector pnew0( ptnew*cos(alfnew), ptnew*sin(alfnew), pznew );
479 #ifdef DEBUG
480  cout<<" Start recalculation 1 FTSOLD eta, r hit, pt "<<FTSOLD.parameters().momentum().eta()<<" "<<realhit.perp()<<
481  " "<<FTSOLD.parameters().momentum().perp()<<endl;
482 #endif
483  if( fabs(FTSOLD.parameters().momentum().eta()) < 1.7 && fabs(FTSOLD.parameters().momentum().eta()) > 0.8 )
484  {
485  if( realhit.perp() < 80. ) {
486 // if( realhit.perp() < 72. ) {
487 #ifdef DEBUG
488  cout<<" Return fake 1 "<<realhit.perp()<<endl;
489 #endif
490  return pair<TrajectoryMeasurement,bool>(tm,good);
491  }
492  }
493 // std::cout<<" Point 9 "<<std::endl;
494 
495  if( FTSOLD.parameters().momentum().perp() > 2.0){
496  if( fabs(FTSOLD.parameters().momentum().eta()) < 2.0 && fabs(FTSOLD.parameters().momentum().eta()) >= 1.7 )
497  {
498  if( realhit.perp() > 100. || realhit.perp() < 60. ) {
499 #ifdef DEBUG
500  cout<<" Return fake 2 "<<endl;
501 #endif
502  return pair<TrajectoryMeasurement,bool>(tm,good);
503  }
504  }
505  if( fabs(FTSOLD.parameters().momentum().eta()) < 2.4 && fabs(FTSOLD.parameters().momentum().eta()) >= 2.0 )
506  {
507  if( realhit.perp() > 75. || realhit.perp() < 40. ) {
508 // if( realhit.perp() > 82. || realhit.perp() < 40. ) {
509 #ifdef DEBUG
510  cout<<" Return fake 3 "<<endl;
511 #endif
512  return pair<TrajectoryMeasurement,bool>(tm,good);
513  }
514  }
515 
516  }
517  else // pt<2
518  {
519  if( fabs(FTSOLD.parameters().momentum().eta()) < 2.0 && fabs(FTSOLD.parameters().momentum().eta()) >= 1.7 )
520  {
521  if( realhit.perp() > 84. || realhit.perp() < 40. ) {
522 #ifdef DEBUG
523  cout<<" Return fake 4 "<<endl;
524 #endif
525  return pair<TrajectoryMeasurement,bool>(tm,good);
526  }
527  }
528  if( fabs(FTSOLD.parameters().momentum().eta()) < 2.4 && fabs(FTSOLD.parameters().momentum().eta()) >= 2.0 )
529  {
530  if( realhit.perp() > 84. || realhit.perp() < 40. ) {
531 #ifdef DEBUG
532  cout<<" Return fake 5 "<<endl;
533 #endif
534  return pair<TrajectoryMeasurement,bool>(tm,good);
535  }
536  }
537  } // pt ><2
538 #ifdef DEBUG
539  cout<<" Create new TM "<<endl;
540 #endif
542  m(0,0) = fabs(0.5*pznew);
543  m(1,1) = theHICConst->phiro[13];
544  m(2,2) = theHICConst->tetro[13];
545  m(3,3) = theHICConst->phiro[13];
546  m(4,4) = theHICConst->tetro[13];
547 
549  (GlobalTrajectoryParameters( xnew0, pnew0, (int)aCharge, &(*magfield) ),
551 
552  float estimate=1.;
553  TrajectoryMeasurement newtm(tm.forwardPredictedState(), updatedTsosOnDet, rh,estimate, dl);
554  good=true;
555  pair<TrajectoryMeasurement,bool> newtmr(newtm,good);
556 #ifdef DEBUG
557  std::cout<<" Endcap newtm estimate= "<<newtmr.first.estimate()<<" "<<newtmr.second<<" pt "<<pnew0.perp()<<" pz "<<pnew0.z()<<std::endl;
558 #endif
559  return newtmr;
560 }
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
T perp() const
Definition: PV3DBase.h:71
const GlobalTrajectoryParameters & parameters() const
float zvert
Definition: HICConst.h:25
TrajectoryStateOnSurface forwardPredictedState() const
Access to forward predicted state (from fitter or builder)
FreeTrajectoryState * freeTrajectoryState(bool withErrors=true) const
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Phi< T > phi() const
Definition: PV3DBase.h:68
Geom::Theta< T > theta() const
T y() const
Definition: PV3DBase.h:62
float forwparam[2]
Definition: HICConst.h:37
ConstRecHitPointer recHit() const
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
const Double_t pi
T sqrt(T t)
Definition: SSEVec.h:46
T z() const
Definition: PV3DBase.h:63
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
const DetLayer * layer() const
float phiro[14]
Definition: HICConst.h:82
T eta() const
Definition: PV3DBase.h:75
double ptmin
Definition: HydjetWrapper.h:86
float tetro[14]
Definition: HICConst.h:83
tuple cout
Definition: gather_cfg.py:121
float atra
Definition: HICConst.h:26
T x() const
Definition: PV3DBase.h:61
Definition: DDAxes.h:10
map< DetLayer *, DiMuonSeedGeneratorHIC::SeedContainer > cms::DiMuonSeedGeneratorHIC::produce ( const edm::Event e,
const edm::EventSetup c,
FreeTrajectoryState theFtsTracker,
TrajectoryStateOnSurface newtsos,
FreeTrajectoryState theFtsMuon,
const TransientTrackingRecHitBuilder RecHitBuilder,
const MeasurementTracker measurementTracker,
std::vector< DetLayer * > *  theDetLayer 
)
virtual

Definition at line 38 of file DiMuonSeedGeneratorHIC.cc.

References gather_cfg::cout, edm::EventSetup::get(), PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), edm::ESHandle< class >::product(), cms::HICSeedMeasurementEstimator::set(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by cms::HITrackVertexMaker::produceTracks().

44  {
45 
46 
47  theMeasurementTracker = measurementTracker;
49 
50  // cout<<" Point 0 "<<endl;
51 
52  std::map<DetLayer*,DiMuonSeedGeneratorHIC::SeedContainer> seedMap;
53 // SeedContainer seedContainer;
54 
58 
59  if(TTRHbuilder == 0){
61  iSetup.get<TransientRecHitRecord>().get(builderName,theBuilderHandle);
62  TTRHbuilder = theBuilderHandle.product();
63  }
64 // cout<<" Point 1 "<<endl;
65 // int npair=0;
66 //
67 // For each fts do a cycle on possible layers.
68 //
69  int nSig =3;
70  bool itrust=true;
71  HICSeedMeasurementEstimator theEstimator(itrust,nSig);
72 
73  // cout<<" Point 2 "<<endl;
74 
75  double phipred=0.; double zpred=0.; //double phiupd=0.; double zupd=0.;
76 
77  for( vector<DetLayer* >::const_iterator ml=theDetLayer->begin(); ml != theDetLayer->end(); ml++)
78  {
79 //
80 // For each layer, we have its own seed container
81 //
82  SeedContainer seedContainer;
83 
84  const BarrelDetLayer* bl = dynamic_cast<const BarrelDetLayer*>(*ml);
85  const ForwardDetLayer* fl = dynamic_cast<const ForwardDetLayer*>(*ml);
86  if( bl != 0 )
87  {
88  // The last layer for barrel
89  phipred = (double)theHICConst->phicut[12];
90  //phiupd = (double)theHICConst->phiro[12];
91  zpred = (double)theHICConst->zcut[12];
92  //zupd = (double)theHICConst->tetro[12];
93  // cout<<" DiMuonSeedGenerator::propagate to barrel layer surface "<<bl->specificSurface().radius()<<endl;
94  }
95  else
96  {
97  if ( fl != 0 )
98  {
99 
100  // The last layer for endcap
101  phipred = (double)theHICConst->phicutf[13];
102  //phiupd = (double)theHICConst->phirof[13];
103  zpred = (double)theHICConst->tetcutf[13];
104  //zupd = (double)theHICConst->tetrof[13];
105 
106  // cout<<" DiMuonSeedGenerator::propagate to endcap layer surface "<<fl->position().z()<<" Mult="<<
107 // theLowMult<<endl;
108  } // end fl
109  }// end else
110 // ==========================================
111  theEstimator.set(phipred, zpred);
112 #ifdef DEBUG
113  std::cout<<" DiMuonSeedGenerator::estimator::set cuts "<<std::endl;
114 #endif
115  std::vector<TrajectoryMeasurement> vTM = theLayerMeasurements->measurements((**ml),newtsos, *thePropagator, theEstimator);
116 #ifdef DEBUG
117  std::cout<<" DiMuonSeedGenerator::Size of compatible TM found by measurements "<<vTM.size()<<std::endl;
118 #endif
119 
120 // int measnum = 0;
121 
122  for(std::vector<TrajectoryMeasurement>::iterator it=vTM.begin(); it!=vTM.end(); it++)
123  {
124 
125 #ifdef DEBUG
126  const TransientTrackingRecHit::ConstRecHitPointer rh = (*it).recHit();
127  if(!(rh->isValid())) {
128  cout<<" DiMuonSeedGenerator::rechit not valid "<<endl;
129  } else {
130  GlobalPoint realhit = (*rh).globalPosition();
131  cout<<" DiMuonSeedGenerator::Compatible TM: "<<realhit.perp()<<" "
132  <<realhit.phi()<<" "<<realhit.z()<<endl;
133  }
134 #endif
135 
136  pair<TrajectoryMeasurement,bool> newtmr;
137 
138  if( bl != 0 )
139  {
140 #ifdef DEBUG
141  cout<<" DiMuonSeedGenerator::Barrel seed "<<endl;
142 #endif
143  newtmr = barrelUpdateSeed(theFtsMuon,(*it));
144 
145  }
146  else
147  {
148 #ifdef DEBUG
149  cout<<" DiMuonSeedGenerator::Endcap seed "<<endl;
150 #endif
151  newtmr = forwardUpdateSeed(theFtsMuon,(*it));
152  }
153 #ifdef DEBUG
154  cout<<" DiMuonSeedGenerator::Estimate seed "<<newtmr.first.estimate()<<" True or false "<<newtmr.second<<endl;
155 #endif
156  if(newtmr.second) seedContainer.push_back(DiMuonTrajectorySeed(newtmr.first,theFtsMuon,theLowMult));
157  }
158  seedMap[*ml] = seedContainer;
159  }
160  delete theLayerMeasurements;
161  return seedMap;
162 
163 }
std::vector< TrajectoryMeasurement > measurements(const DetLayer &layer, const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
T perp() const
Definition: PV3DBase.h:71
Geom::Phi< T > phi() const
Definition: PV3DBase.h:68
std::vector< BarrelDetLayer * > const & barrelLayers() const
const TransientTrackingRecHitBuilder * TTRHbuilder
const LayerMeasurements * theLayerMeasurements
T z() const
Definition: PV3DBase.h:63
std::vector< ForwardDetLayer * > const & negForwardLayers() const
float phicut[13]
Definition: HICConst.h:76
std::vector< ForwardDetLayer * > fpos
std::vector< BarrelDetLayer * > bl
std::vector< ForwardDetLayer * > const & posForwardLayers() const
const GeometricSearchTracker * theTracker
T const * product() const
Definition: ESHandle.h:62
std::vector< ForwardDetLayer * > fneg
const MeasurementTracker * theMeasurementTracker
float zcut[13]
Definition: HICConst.h:77
std::pair< TrajectoryMeasurement, bool > forwardUpdateSeed(const FreeTrajectoryState &, const TrajectoryMeasurement &) const
float phicutf[14]
Definition: HICConst.h:91
float tetcutf[14]
Definition: HICConst.h:92
std::vector< const DetLayer * > theDetLayer
tuple cout
Definition: gather_cfg.py:121
std::pair< TrajectoryMeasurement, bool > barrelUpdateSeed(const FreeTrajectoryState &, const TrajectoryMeasurement &) const
std::vector< TrajectorySeed > SeedContainer

Member Data Documentation

TrackerLayerIdAccessor cms::DiMuonSeedGeneratorHIC::acc
private

Definition at line 110 of file DiMuonSeedGeneratorHIC.h.

std::vector<LayerWithHits*> cms::DiMuonSeedGeneratorHIC::allLayersWithHits
private

Definition at line 108 of file DiMuonSeedGeneratorHIC.h.

std::vector<BarrelDetLayer*> cms::DiMuonSeedGeneratorHIC::bl
private

Definition at line 103 of file DiMuonSeedGeneratorHIC.h.

std::string cms::DiMuonSeedGeneratorHIC::builderName
private

Definition at line 100 of file DiMuonSeedGeneratorHIC.h.

std::vector<ForwardDetLayer*> cms::DiMuonSeedGeneratorHIC::fneg
private

Definition at line 105 of file DiMuonSeedGeneratorHIC.h.

std::vector<ForwardDetLayer*> cms::DiMuonSeedGeneratorHIC::fpos
private

Definition at line 104 of file DiMuonSeedGeneratorHIC.h.

bool cms::DiMuonSeedGeneratorHIC::isFirstCall
private

Definition at line 109 of file DiMuonSeedGeneratorHIC.h.

const MagneticField* cms::DiMuonSeedGeneratorHIC::magfield
private

Definition at line 123 of file DiMuonSeedGeneratorHIC.h.

edm::InputTag cms::DiMuonSeedGeneratorHIC::rphirecHitsTag
private

Definition at line 121 of file DiMuonSeedGeneratorHIC.h.

std::vector<const DetLayer*> cms::DiMuonSeedGeneratorHIC::theDetLayer
private

Definition at line 106 of file DiMuonSeedGeneratorHIC.h.

FreeTrajectoryState cms::DiMuonSeedGeneratorHIC::theFtsMuon
private

Definition at line 97 of file DiMuonSeedGeneratorHIC.h.

FreeTrajectoryState cms::DiMuonSeedGeneratorHIC::theFtsTracker
private

Definition at line 96 of file DiMuonSeedGeneratorHIC.h.

const HICConst* cms::DiMuonSeedGeneratorHIC::theHICConst
private

Definition at line 98 of file DiMuonSeedGeneratorHIC.h.

const LayerMeasurements* cms::DiMuonSeedGeneratorHIC::theLayerMeasurements
private

Definition at line 126 of file DiMuonSeedGeneratorHIC.h.

int cms::DiMuonSeedGeneratorHIC::theLowMult
private

Definition at line 101 of file DiMuonSeedGeneratorHIC.h.

const MeasurementTracker* cms::DiMuonSeedGeneratorHIC::theMeasurementTracker
private

Definition at line 125 of file DiMuonSeedGeneratorHIC.h.

Propagator* cms::DiMuonSeedGeneratorHIC::thePropagator
private

Definition at line 99 of file DiMuonSeedGeneratorHIC.h.

const GeometricSearchTracker* cms::DiMuonSeedGeneratorHIC::theTracker
private

Definition at line 124 of file DiMuonSeedGeneratorHIC.h.

const TransientTrackingRecHitBuilder* cms::DiMuonSeedGeneratorHIC::TTRHbuilder
private

Definition at line 122 of file DiMuonSeedGeneratorHIC.h.