ATLAS Offline Software
Nav4MomWrapper.h
Go to the documentation of this file.
1 
3 /*
4  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // Nav4MomWrapper.h
8 // Header file for class Nav4MomWrapper
9 // Author: S.Binet<binet@cern.ch>
11 #ifndef NAVFOURMOM_NAV4MOMWRAPPER_H
12 #define NAVFOURMOM_NAV4MOMWRAPPER_H
13 
14 // STL includes
15 
16 // CLHEP includes
17 #include "CLHEP/Vector/LorentzVector.h"
18 
19 // Gaudi includes
20 
21 // EventKernel includes
23 
24 // Navigation includes
25 #include "Navigation/NavWrapper.h"
26 
27 // Forward declaration
28 
29 template<class Navigable_t,
30  class P4Momentum_t>
31 class Nav4MomWrapper : virtual public INavigable4Momentum,
32  public NavWrapper<Navigable_t>,
33  public P4Momentum_t
34 {
35 
37  // Public typedefs:
39  public:
40 
44 
48 
50  // Public methods:
52  public:
53 
57 
61 
65 
68  Nav4MomWrapper( const double p1, const double p2,
69  const double p3, const double p4 );
70  explicit Nav4MomWrapper( const CLHEP::HepLorentzVector& hlv );
71  explicit Nav4MomWrapper( const P4Momentum_t& rhs );
72  explicit Nav4MomWrapper( const I4Momentum & rhs );
73  explicit Nav4MomWrapper( const I4Momentum * const rhs );
74 
75 
78  virtual ~Nav4MomWrapper();
79 
81  // Const methods:
83 
86  const navigable_type& navigableBase() const;
87 
90  const momentum_type& momentumBase() const;
91 
95  void fillToken( INavigationToken & thisToken ) const;
96  void fillToken( INavigationToken & thisToken,
97  const std::any& weight ) const;
98 
106  double px() const;
107 
109  double py() const;
110 
112  double pz() const;
113 
115  double m() const;
116 
118  double m2() const;
119 
121  double p() const;
122 
124  double p2() const;
125 
127  double eta() const;
128 
130  double rapidity() const;
131 
133  double phi() const;
134 
136  double e() const;
137 
139  double et() const;
140 
142  double pt() const;
143 
145  double iPt() const;
146 
148  double cosPhi() const;
149 
151  double sinPhi() const;
152 
154  double cosTh() const;
155 
157  double sinTh() const;
158 
160  double cotTh() const;
161 
163  double tanTh() const;
164 
166  CLHEP::HepLorentzVector hlv() const;
167 
168  virtual const I4MomentumError* errors() const;
169 
172 
173 
175  virtual void set4Mom (const I4Momentum * const theI4Mom ) ;
176 
178  virtual void set4Mom (const I4Momentum & theI4Mom) ;
179 
181  virtual void set4Mom (const CLHEP::HepLorentzVector & theHlv ) ;
182 
183 
185  std::ostream& dump( std::ostream& out ) const;
186 
190  // Non-const methods:
193 
197 
201 
203  // Protected data:
205  protected:
206 
207 };
208 
210 // Inline methods:
212 
213 template<class Navigable_t, class P4Momentum_t>
214 inline
215 Nav4MomWrapper<Navigable_t,
218  NavWrapper<Navigable_t>( ),
219  P4Momentum_t( )
220 {}
221 
222 template<class Navigable_t, class P4Momentum_t>
223 inline
224 Nav4MomWrapper<Navigable_t,
226  IAthenaBarCode(rhs),
227  INavigable(rhs),
228  I4Momentum(rhs),
230  NavWrapper<Navigable_t>( rhs ),
231  P4Momentum_t( rhs.momentumBase() )
232 {}
233 
234 template<class Navigable_t, class P4Momentum_t>
235 inline
236 Nav4MomWrapper<Navigable_t,
237  P4Momentum_t>::Nav4MomWrapper( const CLHEP::HepLorentzVector& hlv ) :
239  NavWrapper<Navigable_t>( ),
240  P4Momentum_t( )
241 {
243 }
244 
245 template<class Navigable_t, class P4Momentum_t>
246 inline
247 Nav4MomWrapper<Navigable_t,
250  NavWrapper<Navigable_t>( ),
251  P4Momentum_t( i4mom )
252 {}
253 
254 template<class Navigable_t, class P4Momentum_t>
255 inline
256 Nav4MomWrapper<Navigable_t,
257  P4Momentum_t>&
258 Nav4MomWrapper<Navigable_t,
259  P4Momentum_t>::operator=( const Nav4MomWrapper& rhs )
260 {
261  if ( this != &rhs ) {
262  INavigable4Momentum::operator=( rhs );
264  P4Momentum_t::operator=( rhs );
265  }
266  return *this;
267 }
268 
269 template<class Navigable_t, class P4Momentum_t>
270 inline
271 Nav4MomWrapper<Navigable_t,
273  const double p2,
274  const double p3,
275  const double p4 ) :
277  NavWrapper<Navigable_t>( ),
278  P4Momentum_t( p1, p2, p3, p4 )
279 {}
280 
281 template<class Navigable_t, class P4Momentum_t>
282 inline
283 Nav4MomWrapper<Navigable_t,
284  P4Momentum_t>::Nav4MomWrapper( const I4Momentum* const i4mom ) :
286  NavWrapper<Navigable_t>( ),
287  P4Momentum_t( i4mom )
288 {}
289 
290 template<class Navigable_t, class P4Momentum_t>
291 inline
292 Nav4MomWrapper<Navigable_t,
295  NavWrapper<Navigable_t>( ),
296  P4Momentum_t( rhs )
297 {}
298 
299 template<class Navigable_t, class P4Momentum_t>
300 inline
301 Nav4MomWrapper<Navigable_t,
302  P4Momentum_t>::~Nav4MomWrapper()
303 {}
304 
305 // getters
306 
307 template<class Navigable_t, class P4Momentum_t>
308 inline
310 Nav4MomWrapper<Navigable_t,
311  P4Momentum_t>::navigableBase() const
312 {
313  return *this;
314 }
315 
316 template<class Navigable_t, class P4Momentum_t>
317 inline
318 const P4Momentum_t&
319 Nav4MomWrapper<Navigable_t,
320  P4Momentum_t>::momentumBase() const
321 {
322  return *this;
323 }
324 
325 template<class Navigable_t, class P4Momentum_t>
326 inline
327 void
328 Nav4MomWrapper<Navigable_t,
329  P4Momentum_t>::fillToken( INavigationToken& thisToken ) const
330 {
331  return NavWrapper<Navigable_t>::fillToken(thisToken);
332 }
333 
334 template<class Navigable_t, class P4Momentum_t>
335 inline
336 void
337 Nav4MomWrapper<Navigable_t,
338  P4Momentum_t>::fillToken( INavigationToken& thisToken,
339  const std::any& weight ) const
340 {
341  return NavWrapper<Navigable_t>::fillToken(thisToken, weight);
342 }
343 
344 template<class Navigable_t, class P4Momentum_t>
345 inline
346 double
348 {
349  return P4Momentum_t::px();
350 }
351 
352 template<class Navigable_t, class P4Momentum_t>
353 inline
354 double
356 {
357  return P4Momentum_t::py();
358 }
359 
360 template<class Navigable_t, class P4Momentum_t>
361 inline
362 double
364 {
365  return P4Momentum_t::pz();
366 }
367 
368 template<class Navigable_t, class P4Momentum_t>
369 inline
370 double
372 {
373  return P4Momentum_t::m();
374 }
375 
376 template<class Navigable_t, class P4Momentum_t>
377 inline
378 double
380 {
381  return P4Momentum_t::m2();
382 }
383 
384 template<class Navigable_t, class P4Momentum_t>
385 inline
386 double
388 {
389  return P4Momentum_t::p();
390 }
391 
392 template<class Navigable_t, class P4Momentum_t>
393 inline
394 double
396 {
397  return P4Momentum_t::p2();
398 }
399 
400 template<class Navigable_t, class P4Momentum_t>
401 inline
402 double
404 {
405  return P4Momentum_t::eta();
406 }
407 
408 template<class Navigable_t, class P4Momentum_t>
409 inline
410 double
412 {
413  return P4Momentum_t::rapidity();
414 }
415 
416 template<class Navigable_t, class P4Momentum_t>
417 inline
418 double
420 {
421  return P4Momentum_t::phi();
422 }
423 
424 template<class Navigable_t, class P4Momentum_t>
425 inline
426 double
428 {
429  return P4Momentum_t::e();
430 }
431 
432 template<class Navigable_t, class P4Momentum_t>
433 inline
434 double
436 {
437  return P4Momentum_t::et();
438 }
439 
440 template<class Navigable_t, class P4Momentum_t>
441 inline
442 double
444 {
445  return P4Momentum_t::pt();
446 }
447 
448 template<class Navigable_t, class P4Momentum_t>
449 inline
450 double
452 {
453  return P4Momentum_t::iPt();
454 }
455 
456 template<class Navigable_t, class P4Momentum_t>
457 inline
458 double
460 {
461  return P4Momentum_t::cosPhi();
462 }
463 
464 template<class Navigable_t, class P4Momentum_t>
465 inline
466 double
468 {
469  return P4Momentum_t::sinPhi();
470 }
471 
472 template<class Navigable_t, class P4Momentum_t>
473 inline
474 double
476 {
477  return P4Momentum_t::cosTh();
478 }
479 
480 template<class Navigable_t, class P4Momentum_t>
481 inline
482 double
484 {
485  return P4Momentum_t::sinTh();
486 }
487 
488 template<class Navigable_t, class P4Momentum_t>
489 inline
490 double
492 {
493  return P4Momentum_t::cotTh();
494 }
495 
496 template<class Navigable_t, class P4Momentum_t>
497 inline
498 double
500 {
501  return P4Momentum_t::tanTh();
502 }
503 
504 template<class Navigable_t, class P4Momentum_t>
505 inline
506 const I4MomentumError*
508 {
509  return P4Momentum_t::errors();
510 }
511 
512 template<class Navigable_t, class P4Momentum_t>
513 inline
514 CLHEP::HepLorentzVector
516 {
517  return P4Momentum_t::hlv();
518 }
519 
520 template<class Navigable_t, class P4Momentum_t>
521 inline
524 {
525  return P4Momentum_t::kind();
526 }
527 
528 
529 
530 template<class Navigable_t, class P4Momentum_t>
531 inline
532 void
534 {
535  return P4Momentum_t::set4Mom(theI4Mom);
536 }
537 
538 template<class Navigable_t, class P4Momentum_t>
539 inline void
541 {
542  return P4Momentum_t::set4Mom(theI4Mom);
543 }
544 
545 template<class Navigable_t, class P4Momentum_t>
546 inline
547 void
548 Nav4MomWrapper<Navigable_t,P4Momentum_t>::set4Mom (const CLHEP::HepLorentzVector & theHlv )
549 {
550  return P4Momentum_t::set4Mom(theHlv);
551 }
552 
553 
554 
555 template<class Navigable_t, class P4Momentum_t>
556 inline
557 std::ostream&
559 {
560  return P4Momentum_t::dump( out );
561 }
562 
563 // --------------------
564 // non-const interface
565 // --------------------
566 
567 template<class Navigable_t, class P4Momentum_t>
568 inline
570 Nav4MomWrapper<Navigable_t,
571  P4Momentum_t>::navigableBase()
572 {
573  return *this;
574 }
575 
576 template<class Navigable_t, class P4Momentum_t>
577 inline
579 Nav4MomWrapper<Navigable_t,
580  P4Momentum_t>::momentumBase()
581 {
582  return *this;
583 }
584 
585 #endif //> NAVFOURMOM_NAV4MOMWRAPPER_H
Nav4MomWrapper::et
double et() const
transverse energy defined to be e*sin(theta)
Definition: Nav4MomWrapper.h:435
Nav4MomWrapper::Nav4MomWrapper
Nav4MomWrapper(const double p1, const double p2, const double p3, const double p4)
Constructor with parameters:
Definition: Nav4MomWrapper.h:272
Nav4MomWrapper::py
double py() const
y component of momentum
Definition: Nav4MomWrapper.h:355
Nav4MomWrapper::cosTh
double cosTh() const
cosinus theta
Definition: Nav4MomWrapper.h:475
Nav4MomWrapper::m
double m() const
mass
Definition: Nav4MomWrapper.h:371
Nav4MomWrapper::rapidity
double rapidity() const
rapidity
Definition: Nav4MomWrapper.h:411
Nav4MomWrapper::momentumBase
const momentum_type & momentumBase() const
access to underlying base type (I4Momentum-like)
Definition: Nav4MomWrapper.h:320
I4Momentum
Definition: I4Momentum.h:31
Nav4MomWrapper::momentumBase
momentum_type & momentumBase()
access to underlying base type (I4Momentum-like)
Definition: Nav4MomWrapper.h:580
P4PxPyPzEBase::p
virtual double p() const
momentum magnitude
Definition: P4PxPyPzEBase.cxx:68
Nav4MomWrapper::m2
double m2() const
mass squared
Definition: Nav4MomWrapper.h:379
Nav4MomWrapper::sinTh
double sinTh() const
sinus theta
Definition: Nav4MomWrapper.h:483
P4PxPyPzE::e
virtual double e() const
get energy data member
Definition: P4PxPyPzE.h:132
Nav4MomWrapper::e
double e() const
energy
Definition: Nav4MomWrapper.h:427
Nav4MomWrapper::iPt
double iPt() const
inverse of transverse momentum
Definition: Nav4MomWrapper.h:451
P4PxPyPzE::py
virtual double py() const
get py data member
Definition: P4PxPyPzE.h:126
Nav4MomWrapper::Nav4MomWrapper
Nav4MomWrapper(const CLHEP::HepLorentzVector &hlv)
Definition: Nav4MomWrapper.h:237
INavigable4Momentum.h
NavWrapper.h
Nav4MomWrapper::pz
double pz() const
z component of momentum
Definition: Nav4MomWrapper.h:363
Nav4MomWrapper::cosPhi
double cosPhi() const
cosine phi
Definition: Nav4MomWrapper.h:459
P4PxPyPzEBase::eta
virtual double eta() const
pseudo rapidity
Definition: P4PxPyPzEBase.cxx:32
P4PxPyPzE::errors
virtual const I4MomentumError * errors() const
Access to errors, if available; returns 0 if no errors.
Definition: P4PxPyPzE.cxx:7
Nav4MomWrapper::fillToken
void fillToken(INavigationToken &thisToken, const std::any &weight) const
Visitor handler including a relational parameter.
Definition: Nav4MomWrapper.h:338
Nav4MomWrapper::errors
virtual const I4MomentumError * errors() const
Access to errors, if available; returns 0 if no errors.
Definition: Nav4MomWrapper.h:507
Nav4MomWrapper::hlv
CLHEP::HepLorentzVector hlv() const
CLHEP HepLorentzVector.
Definition: Nav4MomWrapper.h:515
TRTCalib_cfilter.p1
p1
Definition: TRTCalib_cfilter.py:130
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
NavWrapper::fillToken
virtual void fillToken(INavigationToken &navToken) const
Visitor handler without relational parameter.
Definition: NavWrapper.h:50
P4PxPyPzEBase::et
virtual double et() const
transverse energy defined to be e*sin(theta)
Definition: P4PxPyPzEBase.cxx:125
P4PxPyPzE::pz
virtual double pz() const
get pz data member
Definition: P4PxPyPzE.h:129
Nav4MomWrapper::navigableBase
navigable_type & navigableBase()
access to underlying base type (INavigable-like)
Definition: Nav4MomWrapper.h:571
P4PxPyPzEBase::sinTh
virtual double sinTh() const
sinus theta
Definition: P4PxPyPzEBase.cxx:106
Nav4MomWrapper::dump
std::ostream & dump(std::ostream &out) const
Print I4Momentum content.
Definition: Nav4MomWrapper.h:558
Nav4MomWrapper::px
double px() const
x component of momentum
Definition: Nav4MomWrapper.h:347
I4Momentum::Kind
Kind
Definition: I4Momentum.h:33
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:189
Nav4MomWrapper::Nav4MomWrapper
Nav4MomWrapper(const P4Momentum_t &rhs)
Definition: Nav4MomWrapper.h:293
TRTCalib_cfilter.p2
p2
Definition: TRTCalib_cfilter.py:131
P4PxPyPzEBase::p2
virtual double p2() const
square of momentum magnitude
Definition: P4PxPyPzEBase.cxx:59
Nav4MomWrapper::pt
double pt() const
transverse momentum
Definition: Nav4MomWrapper.h:443
Nav4MomWrapper::set4Mom
virtual void set4Mom(const I4Momentum *const theI4Mom)
set 4Momentum (will throw exception if cannot be implemented)
Definition: Nav4MomWrapper.h:533
P4PxPyPzEBase::m
virtual double m() const
mass
Definition: P4PxPyPzEBase.cxx:25
I4MomentumError
Definition: I4MomentumError.h:28
Nav4MomWrapper::operator=
Nav4MomWrapper & operator=(const Nav4MomWrapper &rhs)
Assignment operator:
Definition: Nav4MomWrapper.h:259
P4PxPyPzEBase::cosPhi
virtual double cosPhi() const
cosinus phi
Definition: P4PxPyPzEBase.cxx:77
P4PxPyPzEBase::pt
virtual double pt() const
transverse momentum
Definition: P4PxPyPzEBase.cxx:114
Nav4MomWrapper::tanTh
double tanTh() const
tan theta
Definition: Nav4MomWrapper.h:499
Nav4MomWrapper
Definition: Nav4MomWrapper.h:34
Nav4MomWrapper::kind
I4Momentum::Kind kind() const
makes the underlying type of the implementation available (P4XYZ)
Definition: Nav4MomWrapper.h:523
Nav4MomWrapper::eta
double eta() const
pseudo rapidity
Definition: Nav4MomWrapper.h:403
INavigationToken
Definition: INavigationToken.h:24
P4PxPyPzEBase::cosTh
virtual double cosTh() const
cosinus theta
Definition: P4PxPyPzEBase.cxx:98
Nav4MomWrapper::momentum_type
P4Momentum_t momentum_type
publish the type of the base class (ie: 'traits-itize' it)
Definition: Nav4MomWrapper.h:47
Nav4MomWrapper::navigable_type
NavWrapper< Navigable_t > navigable_type
publish the type of the base class (ie: 'traits-itize' it)
Definition: Nav4MomWrapper.h:43
INavigable
Definition: INavigable.h:18
Nav4MomWrapper::sinPhi
double sinPhi() const
sine phi
Definition: Nav4MomWrapper.h:467
Nav4MomWrapper::set4Mom
virtual void set4Mom(const I4Momentum &theI4Mom)
set 4Momentum (will throw exception if cannot be implemented)
Definition: Nav4MomWrapper.h:540
Nav4MomWrapper::Nav4MomWrapper
Nav4MomWrapper(const Nav4MomWrapper &rhs)
Copy constructor:
Definition: Nav4MomWrapper.h:225
P4ImplPxPyPzE
Definition: P4ImplPxPyPzE.h:32
P4PxPyPzEBase::rapidity
virtual double rapidity() const
rapidity
Definition: P4PxPyPzEBase.cxx:136
IAthenaBarCode
Definition: AthenaKernel/AthenaKernel/IAthenaBarCode.h:48
NavWrapper
Wrapper for Navigable implementation.
Definition: NavWrapper.h:15
Nav4MomWrapper::phi
double phi() const
phi in [-pi,pi[
Definition: Nav4MomWrapper.h:419
Nav4MomWrapper::navigableBase
const navigable_type & navigableBase() const
access to underlying base type (INavigable-like)
Definition: Nav4MomWrapper.h:311
Nav4MomWrapper::set4Mom
virtual void set4Mom(const CLHEP::HepLorentzVector &theHlv)
set 4Momentum (will throw exception if cannot be implemented)
Definition: Nav4MomWrapper.h:548
P4PxPyPzEBase::iPt
virtual double iPt() const
inverse of transverse momentum
Definition: P4PxPyPzEBase.cxx:131
Nav4MomWrapper::Nav4MomWrapper
Nav4MomWrapper(const I4Momentum *const rhs)
Definition: Nav4MomWrapper.h:284
P4PxPyPzE
Definition: P4PxPyPzE.h:29
P4PxPyPzEBase::tanTh
virtual double tanTh() const
tan theta
Definition: P4PxPyPzEBase.cxx:87
P4PxPyPzEBase::hlv
virtual CLHEP::HepLorentzVector hlv() const
CLHEP HepLorentzVector.
Definition: P4PxPyPzEBase.cxx:147
P4PxPyPzE::px
virtual double px() const
get px data member
Definition: P4PxPyPzE.h:122
Nav4MomWrapper::fillToken
void fillToken(INavigationToken &thisToken) const
Definition: Nav4MomWrapper.h:329
INavigable4Momentum
Definition: INavigable4Momentum.h:21
P4PxPyPzEBase::cotTh
virtual double cotTh() const
cottan theta
Definition: P4PxPyPzEBase.cxx:92
Nav4MomWrapper::cotTh
double cotTh() const
cottan theta
Definition: Nav4MomWrapper.h:491
Nav4MomWrapper::p
double p() const
momentum magnitude
Definition: Nav4MomWrapper.h:387
P4PxPyPzE::set4Mom
virtual void set4Mom(const I4Momentum &theI4Mom)
set all 4-mom from another I4Momentum reference
Definition: P4PxPyPzE.h:147
Nav4MomWrapper::Nav4MomWrapper
Nav4MomWrapper()
Default constructor:
Definition: Nav4MomWrapper.h:216
P4PxPyPzEBase::sinPhi
virtual double sinPhi() const
sinus phi
Definition: P4PxPyPzEBase.cxx:82
P4PxPyPzEBase::kind
virtual I4Momentum::Kind kind() const
tells what kind of P4XYZT this is
Definition: P4PxPyPzEBase.h:59
P4PxPyPzEBase::phi
virtual double phi() const
phi in [-pi,pi[
Definition: P4PxPyPzEBase.cxx:50
TRTCalib_cfilter.p3
p3
Definition: TRTCalib_cfilter.py:132
Nav4MomWrapper::p2
double p2() const
square of momentum magnitude
Definition: Nav4MomWrapper.h:395
Nav4MomWrapper::Nav4MomWrapper
Nav4MomWrapper(const I4Momentum &rhs)
Definition: Nav4MomWrapper.h:248
P4PxPyPzEBase::m2
virtual double m2() const
mass squared
Definition: P4PxPyPzEBase.cxx:14
P4PxPyPzEBase::dump
virtual std::ostream & dump(std::ostream &out) const
Print I4Momentum content.
Definition: P4PxPyPzEBase.cxx:152
Nav4MomWrapper::~Nav4MomWrapper
virtual ~Nav4MomWrapper()
Destructor:
Definition: Nav4MomWrapper.h:302