ATLAS Offline Software
JetConstituentIterator.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
7 
9  const ISignalState* sig = dynamic_cast<const ISignalState*>(constit);
10  if( sig ) return sig->signalState();
11  return P4SignalState::UNKNOWN;
12 }
13 
15 
16  if( m_actual != m_end) { // check current iterator is valid
17  if( ! (*m_actual) ) {// check the pointer is valid (may be not if ElementLink broken)
18  m_actual++;
19  while ( m_actual != m_end){
20  // loop till next valid pointer
21  if( *m_actual ) break;
22  m_actual++;
23  }
24  if (m_actual == m_end) return ;
25  }
26 
27  CLHEP::HepLorentzVector myVector = (*m_actual)->hlv();
28 
29  // if user requested a signal state try to get it.
30  if(m_use_signal_state) {
31  const ISignalState* sigStateObject = dynamic_cast<const ISignalState*>(*m_actual);
32  if( sigStateObject ){
33 
34  // Obtain the hlv at the desired state
35  myVector = sigStateObject->hlv(m_defState);
36  }
37  }
38  // set the 4 Momentum
39  set4Mom( myVector ) ;
40  }
41 }
42 
44  if(m_use_signal_state) return m_curState;
45  else return m_defState;
46 }
47 
49  // remember internal members
50  P4SignalState::State tmp_sstate = m_defState;
51  bool tmp_use_sstate = m_use_signal_state;
52  // change temporally the internal
54  // now update 4 momentum
55  update_hlv();
56 
57  // reset internals :
58  m_use_signal_state = tmp_use_sstate;
59  m_defState = tmp_sstate;
60  m_curState = s;
61 }
62 
ISignalState::hlv
virtual CLHEP::HepLorentzVector hlv(P4SignalState::State s) const =0
obtain the CLHEP HepLorentzVector
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
ISignalState
Definition: ISignalState.h:42
P4SignalState::UNKNOWN
@ UNKNOWN
Definition: ISignalState.h:29
JetConstituentIterator::m_curState
P4SignalState::State m_curState
Definition: JetConstituentIterator.h:110
JetConstituentIterator::m_defState
P4SignalState::State m_defState
Definition: JetConstituentIterator.h:109
JetConstituentIterator::getSignalState
P4SignalState::State getSignalState()
get current signal state of the iterator
Definition: JetConstituentIterator.cxx:43
python.BuildSignatureFlags.sig
sig
Definition: BuildSignatureFlags.py:218
JetConstituentIterator.h
JetConstituentIterator::m_end
base_it m_end
Definition: JetConstituentIterator.h:106
JetConstituentIterator::setSignalState
void setSignalState(P4SignalState::State s)
set current signal state of the iterator
Definition: JetConstituentIterator.cxx:48
ISignalState.h
JetConstituentIterator::update_hlv
void update_hlv()
Definition: JetConstituentIterator.cxx:14
P4SignalState::State
State
Definition: ISignalState.h:28
INavigable4Momentum
Definition: INavigable4Momentum.h:21
JetConstituentIterator::m_actual
base_it m_actual
Definition: JetConstituentIterator.h:105
JetConstituentIterator::m_use_signal_state
bool m_use_signal_state
Definition: JetConstituentIterator.h:108
P4PxPyPzE::set4Mom
virtual void set4Mom(const I4Momentum &theI4Mom)
set all 4-mom from another I4Momentum reference
Definition: P4PxPyPzE.h:147