CDDecay Class Reference

#include <CDDecay.h>

Inheritance diagram for CDDecay:

CDCandidate dchain::ReferenceCount CDEta CDKs CDLambda CDPi0 List of all members.

Public Types

typedef CDCandidate CandidateClass
typedef CDDecay DecayEvidence
typedef std::pair< vector<
const EvtRecTrack * >, vector<
const EvtRecTrack * > > 
TracksAndShowers

Public Member Functions

 CDDecay (const CDDecay &aOtherCDDecay)
 CDDecay (const CDCandidate &aProduct)
 CDDecay (const CDDecay &aProducts, const CDCandidate &aAdditionalProduct)
virtual ~CDDecay ()
void addChild (const CDCandidate &aAdditionalProduct)
void setKinematicData (const DecayChain::KinematicData &aKinematicData)
virtual bool builtFromCDDecay (void) const
virtual const CDDecaydecay (void) const
uint32_t numberChildren () const
void iterateChildren (void(*analyze)(const CDCandidate &)) const
void iterateChildren (DCAnalysisFunction< CDCandidate > &analyze) const
const CDCandidatechild (unsigned int aPosition) const
const std::vector< dchain::ReferenceHolder<
CDCandidate > > & 
children () const
void setUserTag (int tag)
CDCandidatesetP4 (const HepLorentzVector &aMomentum)
int userTag () const
double mass () const
int charge () const
double energy () const
const Hep3Vector & momentum () const
const HepLorentzVector & p4 () const
const DecayChain::KinematicDatakinematicData () const
TracksAndShowers finalChildren () const
virtual DBCandidate::Hypo hypo () const
virtual bool builtFromTrack () const
virtual const EvtRecTracktrack () const
virtual bool builtFromCDPhoton () const
virtual const EvtRecTrackphoton () const
virtual bool builtFromCDPi0 () const
virtual const EvtRecPi0navPi0 () const
virtual bool builtFromCDEta () const
virtual const EvtRecEtaToGGnavEta () const
virtual bool builtFromCDKs () const
virtual const EvtRecVeeVertexnavKshort () const
virtual bool builtFromCDLambda () const
virtual const EvtRecVeeVertexnavLambda () const
bool overlap (const CDCandidate &aOtherCDCandidate) const
const CDFootPrintfootPrint () const
void addLink () const
void dropLink () const

Protected Member Functions

 CDDecay ()
virtual DecayChain::KinematicDatadefaultKinematicData () const
void setCDFootPrint (const CDFootPrint &aCDFootPrint)
void recurseNode (TracksAndShowers &final, const CDCandidate &cand) const

Private Member Functions

const CDDecayoperator= (const CDDecay &aOtherCDDecay)

Private Attributes

std::vector< dchain::ReferenceHolder<
CDCandidate > > & 
m_children

Detailed Description

Definition at line 110 of file CDDecay.h.


Member Typedef Documentation

typedef CDCandidate CDDecay::CandidateClass

Definition at line 116 of file CDDecay.h.

typedef CDDecay CDCandidate::DecayEvidence [inherited]

Definition at line 129 of file CDCandidate.h.

typedef std::pair< vector<const EvtRecTrack*>, vector<const EvtRecTrack*> > CDCandidate::TracksAndShowers [inherited]

Definition at line 131 of file CDCandidate.h.


Constructor & Destructor Documentation

CDDecay::CDDecay ( const CDDecay aOtherCDDecay  ) 

Definition at line 126 of file CDDecay.cxx.

00126                                                :
00127 #ifdef EXTEND
00128     m_kmfit_chisq(aOtherCDDecay.chisq()),
00129     m_vxfit_chisq(aOtherCDDecay.vchisq()),
00130 #endif
00131     CDCandidate( aOtherCDDecay ) ,
00132     m_children( *new vector< ReferenceHolder< CDCandidate > >( aOtherCDDecay.children() ) )
00133 {
00134 }

CDDecay::CDDecay ( const CDCandidate aProduct  )  [explicit]

Definition at line 136 of file CDDecay.cxx.

00136                                               :
00137 #ifdef EXTEND
00138     m_kmfit_chisq(500000.),
00139     m_vxfit_chisq(500000.),
00140 #endif
00141     CDCandidate( aProduct.footPrint() ) ,
00142     m_children( *new vector< ReferenceHolder<CDCandidate> >
00143             ( 1, ReferenceHolder<CDCandidate>(&aProduct ) ) )
00144 {
00145 }

CDDecay::CDDecay ( const CDDecay aProducts,
const CDCandidate aAdditionalProduct 
)

Definition at line 147 of file CDDecay.cxx.

References m_children.

00147                                                                                   :
00148 #ifdef EXTEND
00149     m_kmfit_chisq(500000.),
00150     m_vxfit_chisq(500000.),
00151 #endif
00152     CDCandidate( aProducts.footPrint() + aAdditionalProduct.footPrint() ) ,
00153     m_children(  *new vector< ReferenceHolder<CDCandidate> >( aProducts.children() ) )
00154 {
00155     m_children.push_back( ReferenceHolder<CDCandidate>(&aAdditionalProduct) ) ;
00156 }

CDDecay::~CDDecay (  )  [virtual]

Definition at line 158 of file CDDecay.cxx.

References m_children.

00159 {
00160     delete &m_children ;
00161 }

CDDecay::CDDecay (  )  [protected]

Definition at line 163 of file CDDecay.cxx.

00163                  :
00164 #ifdef EXTEND
00165     m_kmfit_chisq(500000.),
00166     m_vxfit_chisq(500000.),
00167 #endif
00168     CDCandidate( CDFootPrint() ),
00169     m_children( *new vector< ReferenceHolder<CDCandidate> > )
00170 {
00171 }
//


Member Function Documentation

void CDDecay::addChild ( const CDCandidate aAdditionalProduct  ) 

Definition at line 187 of file CDDecay.cxx.

References CDCandidate::footPrint(), m_children, and CDCandidate::setCDFootPrint().

Referenced by CDEta::CDEta(), CDKs::CDKs(), CDLambda::CDLambda(), and CDPi0::CDPi0().

00188 {
00189     setCDFootPrint( footPrint() + aAdditionalProduct.footPrint() );
00190     m_children.push_back( ReferenceHolder<CDCandidate>(&aAdditionalProduct) ) ;
00191 }

void dchain::ReferenceCount::addLink (  )  const [inline, inherited]

Definition at line 107 of file ReferenceCount.h.

References dchain::ReferenceCount::m_linkCount.

00108 {
00109    //if (m_linkCount==0xFFFFFFFF) {
00110    //   throw TooManyReferencesException();
00111    //}
00112    ++m_linkCount ;
00113 }

bool CDDecay::builtFromCDDecay ( void   )  const [virtual]

Reimplemented from CDCandidate.

Definition at line 203 of file CDDecay.cxx.

00204 {
00205     return ( !false ) ;
00206 }

bool CDCandidate::builtFromCDEta (  )  const [virtual, inherited]

Reimplemented in CDEta.

Definition at line 287 of file CDCandidate.cxx.

00288 {
00289    return ( false ) ;
00290 }

bool CDCandidate::builtFromCDKs (  )  const [virtual, inherited]

Reimplemented in CDKs.

Definition at line 307 of file CDCandidate.cxx.

00308 {
00309    return ( false ) ;
00310 }

bool CDCandidate::builtFromCDLambda (  )  const [virtual, inherited]

Reimplemented in CDLambda.

Definition at line 327 of file CDCandidate.cxx.

00328 {
00329    return ( false ) ;
00330 }

bool CDCandidate::builtFromCDPhoton (  )  const [virtual, inherited]

Reimplemented in CDPhoton.

Definition at line 247 of file CDCandidate.cxx.

Referenced by CDCandidate::recurseNode().

00248 {
00249    return ( false ) ;
00250 }

bool CDCandidate::builtFromCDPi0 (  )  const [virtual, inherited]

Reimplemented in CDPi0.

Definition at line 267 of file CDCandidate.cxx.

00268 {
00269    return ( false ) ;
00270 }

bool CDCandidate::builtFromTrack (  )  const [virtual, inherited]

Reimplemented in CDChargedVisible< H >.

Definition at line 227 of file CDCandidate.cxx.

Referenced by CDCandidate::recurseNode().

00228 {
00229    return ( false ) ;
00230 }

int CDCandidate::charge (  )  const [inherited]

Definition at line 154 of file CDCandidate.cxx.

References DecayChain::KinematicData::charge(), and CDCandidate::kinematicData().

Referenced by defaultKinematicData(), and CDChargedVisible< H >::defaultKinematicData().

00155 {
00156    return kinematicData()->charge();
00157 }

const CDCandidate & CDDecay::child ( unsigned int  aPosition  )  const

Definition at line 247 of file CDDecay.cxx.

References m_children.

Referenced by defaultKinematicData(), and iterateChildren().

00248 {
00249     if ( aPosition >= m_children.size() ) {
00250         std::cerr << "Trying to access an invalid Child" << std::endl ;
00251         return ( *(m_children[ 0 ]) ) ;
00252     }
00253     return ( *(m_children[ aPosition ]) ) ;
00254 }

const vector< ReferenceHolder< CDCandidate > > & CDDecay::children (  )  const

Definition at line 256 of file CDDecay.cxx.

References m_children.

Referenced by CDCandidate::recurseNode().

00257 {
00258     return ( m_children ) ;
00259 }

const CDDecay & CDDecay::decay ( void   )  const [virtual]

Reimplemented from CDCandidate.

Definition at line 208 of file CDDecay.cxx.

00209 {
00210     return ( *this ) ;
00211 }

KinematicData * CDDecay::defaultKinematicData (  )  const [protected, virtual]

Implements CDCandidate.

Reimplemented in CDEta, CDKs, CDLambda, and CDPi0.

Definition at line 262 of file CDDecay.cxx.

References CDCandidate::charge(), child(), m_children, CDCandidate::p4(), DecayChain::KinematicData::setCharge(), DecayChain::KinematicData::setP4(), DecayChain::KinematicData::setUserTag(), and CDCandidate::userTag().

00263 {
00264     int    userTag   = 1 ;
00265     double energySum = 0 ;
00266     int    chargeSum = 0 ;
00267     HepLorentzVector p4( 0.0 , 0.0 , 0.0, 0.0 ) ;
00268     vector< ReferenceHolder<CDCandidate> >::const_iterator finished( m_children.end() ) ;
00269     for ( vector< ReferenceHolder<CDCandidate> >::const_iterator child( m_children.begin() ) ;
00270             child != finished ;
00271             ++child ) {
00272         userTag &= (*(*child)).userTag();
00273         chargeSum += (*(*child)).charge() ;
00274         p4 += (*(*child)).p4() ;
00275     }
00276 
00277     KinematicData* tmp = new KinematicData();
00278 
00279     tmp->setUserTag( userTag );
00280     tmp->setCharge( chargeSum );
00281     tmp->setP4( p4 );
00282 
00283     return tmp;
00284 }

void dchain::ReferenceCount::dropLink (  )  const [inline, inherited]

Definition at line 115 of file ReferenceCount.h.

References dchain::ReferenceCount::m_linkCount.

00116 {
00117    --m_linkCount ;
00118    if ( 0 == m_linkCount ) {
00119 // It is necessary to throw away the 'const' so that the object
00120 //   can be deleted
00121       delete const_cast<ReferenceCount*>(this) ;
00122    }
00123 }

double CDCandidate::energy (  )  const [inherited]

Definition at line 163 of file CDCandidate.cxx.

References DecayChain::KinematicData::energy(), and CDCandidate::kinematicData().

Referenced by NeutralDSelector::operator()(), DsSelector::operator()(), and ChargedDSelector::operator()().

00164 {
00165    return kinematicData()->energy();
00166 }

CDCandidate::TracksAndShowers CDCandidate::finalChildren (  )  const [inherited]

Definition at line 193 of file CDCandidate.cxx.

References CDCandidate::recurseNode().

00194 {
00195    TracksAndShowers blocks;
00196    recurseNode(blocks, *this);
00197    return blocks;
00198 }

const CDFootPrint & CDCandidate::footPrint (  )  const [inherited]

Definition at line 375 of file CDCandidate.cxx.

References CDCandidate::m_footPrint.

Referenced by addChild(), CDCandidate::operator=(), and CDCandidate::overlap().

00376 {
00377    return ( m_footPrint ) ;
00378 }

DBCandidate::Hypo CDCandidate::hypo (  )  const [inline, virtual, inherited]

Reimplemented in CDChargedVisible< H >, and CDPhoton.

Definition at line 212 of file CDCandidate.h.

References DBCandidate::kMaxHypo.

00213 {
00214     return DBCandidate::kMaxHypo;
00215 }

void CDDecay::iterateChildren ( DCAnalysisFunction< CDCandidate > &  analyze  )  const

Definition at line 237 of file CDDecay.cxx.

References child(), and m_children.

00238 {
00239     vector< ReferenceHolder<CDCandidate> >::const_iterator finished ( m_children.end() ) ;
00240     for ( vector< ReferenceHolder<CDCandidate> >::const_iterator child ( m_children.begin() ) ;
00241             child != finished ;
00242             ++child ) {
00243         analyze( (*(*child)) ) ;
00244     }
00245 }

void CDDecay::iterateChildren ( void(*)(const CDCandidate &)  analyze  )  const

Definition at line 224 of file CDDecay.cxx.

References child(), and m_children.

00225 {
00226     vector< ReferenceHolder<CDCandidate> >::const_iterator finished( m_children.end() ) ;
00227     for ( vector< ReferenceHolder<CDCandidate> >::const_iterator child( m_children.begin() ) ;
00228             child != finished ;
00229             ++child ) {
00230         analyze( (*(*child)) ) ;
00231     }
00232 }

const KinematicData * CDCandidate::kinematicData (  )  const [inherited]

Definition at line 185 of file CDCandidate.cxx.

References CDCandidate::modifiableKinematicData().

Referenced by CDCandidate::CDCandidate(), CDCandidate::charge(), CDCandidate::energy(), CDCandidate::mass(), CDCandidate::momentum(), CDCandidate::operator=(), CDCandidate::p4(), and CDCandidate::userTag().

00186 {
00187    // Cast away `const' to pick up the function.
00188    // This is safe as the result is being returned as a `const'
00189    return ( (*(CDCandidate*)this).modifiableKinematicData() );
00190 }

double CDCandidate::mass (  )  const [inherited]

Definition at line 145 of file CDCandidate.cxx.

References CDCandidate::kinematicData(), and DecayChain::KinematicData::mass().

Referenced by CDKs::defaultKinematicData(), CDChargedVisible< H >::defaultKinematicData(), NeutralDSelector::operator()(), LocalRhotoPiPiSelector::operator()(), LocalEtatoPiPiPi0Selector::operator()(), LocalEptoRhoGamSelector::operator()(), LocalEptoPiPiEtaSelector::operator()(), LocalEptoPiPiEta3PiSelector::operator()(), DsSelector::operator()(), and ChargedDSelector::operator()().

00146 {
00147    return kinematicData()->mass();
00148 }

const Hep3Vector & CDCandidate::momentum (  )  const [inherited]

Definition at line 172 of file CDCandidate.cxx.

References CDCandidate::kinematicData(), and DecayChain::KinematicData::p4().

Referenced by NeutralDSelector::operator()(), DsSelector::operator()(), and ChargedDSelector::operator()().

00173 {
00174    return kinematicData()->p4();
00175 }

const EvtRecEtaToGG * CDCandidate::navEta (  )  const [virtual, inherited]

Reimplemented in CDEta.

Definition at line 296 of file CDCandidate.cxx.

Referenced by NeutralDReconstruction::execute(), and DsReconstruction::execute().

00297 {
00298    std::cerr << "No NavCDEta for this CDCandidate" << std::endl ;
00299    exit( 1 ) ;
00300    return ( (EvtRecEtaToGG*)0 ) ;
00301 }

const EvtRecVeeVertex * CDCandidate::navKshort (  )  const [virtual, inherited]

Reimplemented in CDKs.

Definition at line 316 of file CDCandidate.cxx.

00317 {
00318    std::cerr << "No NavKs for this CDCandidate" << std::endl ;
00319    exit( 1 ) ;
00320    return ( (EvtRecVeeVertex*)0 ) ;
00321 }

const EvtRecVeeVertex * CDCandidate::navLambda (  )  const [virtual, inherited]

Reimplemented in CDLambda.

Definition at line 336 of file CDCandidate.cxx.

00337 {
00338    std::cerr << "No NavLambda for this CDCandidate" << std::endl ;
00339    exit( 1 ) ;
00340    return ( (EvtRecVeeVertex*)0 ) ;
00341 }

const EvtRecPi0 * CDCandidate::navPi0 (  )  const [virtual, inherited]

Reimplemented in CDPi0.

Definition at line 276 of file CDCandidate.cxx.

Referenced by DsReconstruction::execute().

00277 {
00278    std::cerr << "No NavCDPi0 for this CDCandidate" << std::endl ;
00279    exit( 1 ) ;
00280    return ( (EvtRecPi0*)0 ) ;
00281 }

uint32_t CDDecay::numberChildren (  )  const

Definition at line 216 of file CDDecay.cxx.

References m_children.

00217 {
00218     return ( m_children.size() ) ;
00219 }

const CDDecay& CDDecay::operator= ( const CDDecay aOtherCDDecay  )  [private]

bool CDCandidate::overlap ( const CDCandidate aOtherCDCandidate  )  const [inherited]

Definition at line 367 of file CDCandidate.cxx.

References CDCandidate::footPrint(), CDCandidate::m_footPrint, and CDFootPrint::overlap().

00368 {
00369    return ( m_footPrint.overlap( aOtherCDCandidate.footPrint() ) ) ;
00370 }

const HepLorentzVector & CDCandidate::p4 (  )  const [inherited]

Definition at line 177 of file CDCandidate.cxx.

References CDCandidate::kinematicData(), and DecayChain::KinematicData::p4().

Referenced by defaultKinematicData().

00178 {
00179    return kinematicData()->p4();
00180 }

const EvtRecTrack * CDCandidate::photon (  )  const [virtual, inherited]

Reimplemented in CDPhoton.

Definition at line 256 of file CDCandidate.cxx.

Referenced by NeutralDReconstruction::execute(), DsReconstruction::execute(), and CDCandidate::recurseNode().

00257 {
00258    std::cerr << "No NavShower for this CDCandidate" << std::endl ;
00259    exit( 1 ) ;
00260    return ( (EvtRecTrack*)0 ) ;
00261 }

void CDCandidate::recurseNode ( TracksAndShowers final,
const CDCandidate cand 
) const [protected, inherited]

Definition at line 201 of file CDCandidate.cxx.

References CDCandidate::builtFromCDPhoton(), CDCandidate::builtFromTrack(), children(), CDCandidate::decay(), first, CDCandidate::photon(), EvtCyclic3::second(), and CDCandidate::track().

Referenced by CDCandidate::finalChildren().

00203 {
00204    if(cand.builtFromTrack())
00205    {
00206       final.first.push_back( cand.track() );
00207       return;
00208    }
00209    if(cand.builtFromCDPhoton())
00210    {
00211       final.second.push_back( cand.photon() );
00212       return;
00213    }
00214    const DecayEvidence& decay = cand.decay();
00215    const vector< ReferenceHolder<CDCandidate> >& children = decay.children();
00216    vector< ReferenceHolder<CDCandidate> >::const_iterator lastChild = children.end();
00217    for(vector<ReferenceHolder<CDCandidate> >::const_iterator child = children.begin();
00218        child != lastChild; ++child)
00219    {
00220       recurseNode(final, **child);
00221    }
00222 }

void CDCandidate::setCDFootPrint ( const CDFootPrint aCDFootPrint  )  [protected, inherited]

Definition at line 117 of file CDCandidate.cxx.

References CDCandidate::m_footPrint.

Referenced by addChild().

00118 {
00119    m_footPrint = aCDFootPrint ;
00120 }

void CDDecay::setKinematicData ( const DecayChain::KinematicData aKinematicData  ) 

Reimplemented from CDCandidate.

Definition at line 193 of file CDDecay.cxx.

References CDCandidate::setKinematicData().

00194 {
00195     // Call setKinematicData of my super-class
00196     CDCandidate::setKinematicData( aKinematicData );
00197 }

CDCandidate & CDCandidate::setP4 ( const HepLorentzVector &  aMomentum  )  [inherited]

Definition at line 88 of file CDCandidate.cxx.

References CDCandidate::modifiableKinematicData(), and DecayChain::KinematicData::setP4().

00089 {
00090    this->modifiableKinematicData()->setP4( aMomentum ) ;
00091    return( *this ) ;
00092 }

void CDCandidate::setUserTag ( int  tag  )  [inherited]

Definition at line 81 of file CDCandidate.cxx.

References CDCandidate::modifiableKinematicData(), and DecayChain::KinematicData::setUserTag().

Referenced by LocalRhotoPiPiSelector::operator()(), LocalPionSelector::operator()(), LocalPi0Selector::operator()(), LocalPhotonSelector::operator()(), LocalKsSelector::operator()(), LocalKaonSelector::operator()(), LocalEtatoPiPiPi0Selector::operator()(), LocalEtatoGGSelector::operator()(), LocalEptoRhoGamSelector::operator()(), LocalEptoPiPiEtaSelector::operator()(), and LocalEptoPiPiEta3PiSelector::operator()().

00082 {
00083     this->modifiableKinematicData()->setUserTag( tag );
00084 }

const EvtRecTrack * CDCandidate::track (  )  const [virtual, inherited]

Reimplemented in CDChargedVisible< H >.

Definition at line 236 of file CDCandidate.cxx.

Referenced by NeutralDReconstruction::execute(), DsReconstruction::execute(), and CDCandidate::recurseNode().

00237 {
00238    std::cerr << "No navtrack for this CDCandidate" << std::endl ;
00239    exit( 1 ) ;
00240    return ( (EvtRecTrack*)0 ) ;
00241 }

int CDCandidate::userTag (  )  const [inherited]

Definition at line 137 of file CDCandidate.cxx.

References CDCandidate::kinematicData(), and DecayChain::KinematicData::userTag().

Referenced by defaultKinematicData(), LocalPionSelector::operator()(), and LocalKaonSelector::operator()().

00138 {
00139     return kinematicData()->userTag();
00140 }


Member Data Documentation

std::vector< dchain::ReferenceHolder<CDCandidate> >& CDDecay::m_children [private]

Definition at line 167 of file CDDecay.h.

Referenced by addChild(), CDDecay(), child(), children(), defaultKinematicData(), iterateChildren(), numberChildren(), and ~CDDecay().


Generated on Tue Nov 29 23:18:02 2016 for BOSS_7.0.2 by  doxygen 1.4.7