LocalKsSelector Class Reference

#include <LocalKsSelector.h>

Inheritance diagram for LocalKsSelector:

DCSelectionFunction< CDKs > unary_function List of all members.

Public Member Functions

 LocalKsSelector ()
bool operator() (CDKs &aKs)
bool operator() (CDKs &iArg) const

Private Member Functions

 LocalKsSelector (const LocalKsSelector &)
const LocalKsSelectoroperator= (const LocalKsSelector &)

Private Attributes

double m_minMass
double m_maxMass
double m_maxChisq
bool m_doSecondaryVFit
double m_maxVFitChisq
double m_minFlightSig

Detailed Description

Definition at line 7 of file LocalKsSelector.h.


Constructor & Destructor Documentation

LocalKsSelector::LocalKsSelector (  ) 

Definition at line 12 of file LocalKsSelector.cxx.

References m_doSecondaryVFit, m_maxChisq, m_maxMass, m_maxVFitChisq, m_minFlightSig, and m_minMass.

00013 {
00014    IJobOptionsSvc* jobSvc;
00015    Gaudi::svcLocator()->service("JobOptionsSvc", jobSvc);
00016 
00017    PropertyMgr m_propMgr;
00018 
00019    m_propMgr.declareProperty("KsMinMassCut",  m_minMass = 0.470 );
00020    m_propMgr.declareProperty("KsMaxMassCut",  m_maxMass = 0.528 );
00021    m_propMgr.declareProperty("KsMaxChisq",    m_maxChisq = 100 );
00022 
00023    m_propMgr.declareProperty("DoSecondaryVFit",   m_doSecondaryVFit = false );
00024    m_propMgr.declareProperty("KsMaxVFitChisq",    m_maxVFitChisq = 100 );
00025    m_propMgr.declareProperty("KsMinFlightSig",    m_minFlightSig = 2.0 );
00026 
00027    jobSvc->setMyProperties("LocalKsSelector", &m_propMgr);
00028 }

LocalKsSelector::LocalKsSelector ( const LocalKsSelector  )  [private]


Member Function Documentation

bool DCSelectionFunction< CDKs >::operator() ( CDKs iArg  )  const [inline, inherited]

Definition at line 78 of file DCSelectionFunction.h.

00078                                        {
00079          return const_cast<DCSelectionFunction<Arg> *>(this)->operator()(iArg);
00080       }

bool LocalKsSelector::operator() ( CDKs aKs  )  [virtual]

Implements DCSelectionFunction< CDKs >.

Definition at line 30 of file LocalKsSelector.cxx.

References TrackPool::AddTrack(), VertexFit::AddVertex(), VertexFit::BuildVirtualParticle(), EvtRecVeeVertex::chi2(), SecondVertexFit::chisq(), SecondVertexFit::decayLength(), SecondVertexFit::decayLengthError(), SecondVertexFit::Fit(), VertexFit::Fit(), RecMdcKalTrack::getZError(), RecMdcKalTrack::getZHelix(), SecondVertexFit::init(), VertexFit::init(), SecondVertexFit::instance(), VertexFit::instance(), IVertexDbSvc::isVertexValid(), m_doSecondaryVFit, m_maxChisq, m_maxMass, m_maxVFitChisq, m_minFlightSig, m_minMass, EvtRecVeeVertex::mass(), mass, EvtRecTrack::mdcKalTrack(), CDKs::navKshort(), EvtRecVeeVertex::pairDaughters(), IVertexDbSvc::PrimaryVertex(), VertexParameter::setEvx(), SecondVertexFit::setPrimaryVertex(), CDCandidate::setUserTag(), SecondVertexFit::setVpar(), VertexParameter::setVx(), IVertexDbSvc::SigmaPrimaryVertex(), VertexFit::Swim(), EvtRecVeeVertex::vertexId(), VertexFit::vpar(), and VertexFit::wVirtualTrack().

00030                                            {
00031 
00032   aKs.setUserTag(1);
00033   EvtRecVeeVertex* ks = const_cast<EvtRecVeeVertex*>( aKs.navKshort() );
00034 
00035    if ( ks->vertexId() != 310 ) return false;
00036 
00037    double mass = ks->mass();
00038    if ((mass <= m_minMass)||(mass >= m_maxMass)) return false;
00039    if ( ks->chi2() >= m_maxChisq ) return false;
00040 
00041    if(mass < 0.487 || mass > 0.511)
00042      aKs.setUserTag(2);
00043 
00044    if( !m_doSecondaryVFit ) return true;
00045 
00046    // --------------------------------------------------
00047    // Do a secondary vertex fit and check the flight significance
00048    // --------------------------------------------------
00049 
00050    EvtRecTrack* veeTrack1 = ks->pairDaughters().first;
00051    RecMdcKalTrack* veeKalTrack1 = veeTrack1->mdcKalTrack();
00052    WTrackParameter veeInitialWTrack1 = WTrackParameter(0.13957018, veeKalTrack1->getZHelix(), veeKalTrack1->getZError());
00053 
00054    EvtRecTrack* veeTrack2 = ks->pairDaughters().second;
00055    RecMdcKalTrack* veeKalTrack2 = veeTrack2->mdcKalTrack();
00056    WTrackParameter veeInitialWTrack2 = WTrackParameter(0.13957018, veeKalTrack2->getZHelix(), veeKalTrack2->getZError());
00057 
00058    VertexParameter wideVertex;
00059    HepPoint3D vWideVertex(0., 0., 0.);
00060    HepSymMatrix evWideVertex(3, 0);
00061 
00062    evWideVertex[0][0] = 1.0e12;
00063    evWideVertex[1][1] = 1.0e12;
00064    evWideVertex[2][2] = 1.0e12;
00065 
00066    wideVertex.setVx(vWideVertex);
00067    wideVertex.setEvx(evWideVertex);
00068 
00069    // First, perform a vertex fit
00070    VertexFit* vtxfit = VertexFit::instance();
00071    vtxfit->init();
00072 
00073    // add the daughters
00074    vtxfit->AddTrack(0,veeInitialWTrack1);
00075    vtxfit->AddTrack(1,veeInitialWTrack2);
00076    vtxfit->AddVertex(0,wideVertex,0,1);
00077 
00078    // do the fit
00079    vtxfit->Fit(0);
00080    vtxfit->Swim(0);
00081    vtxfit->BuildVirtualParticle(0);
00082 
00083    // Now perform the secondary vertex fit
00084    SecondVertexFit* svtxfit = SecondVertexFit::instance();
00085    svtxfit->init();
00086 
00087    // add the primary vertex
00088    VertexParameter beamSpot;
00089    HepPoint3D vBeamSpot(0., 0., 0.);
00090    HepSymMatrix evBeamSpot(3, 0);
00091 
00092    IVertexDbSvc*  vtxsvc;
00093    Gaudi::svcLocator()->service("VertexDbSvc", vtxsvc);
00094    if(vtxsvc->isVertexValid()){
00095      double* dbv = vtxsvc->PrimaryVertex();
00096      double*  vv = vtxsvc->SigmaPrimaryVertex();
00097      for (unsigned int ivx = 0; ivx < 3; ivx++){
00098        vBeamSpot[ivx] = dbv[ivx];
00099        evBeamSpot[ivx][ivx] = vv[ivx] * vv[ivx];
00100      }
00101    }
00102    else{
00103      cout << "KSSELECTOR ERROR:  Could not find a vertex from VertexDbSvc" << endl;
00104      return false;
00105    }
00106 
00107    beamSpot.setVx(vBeamSpot);
00108    beamSpot.setEvx(evBeamSpot);
00109 
00110    VertexParameter primaryVertex(beamSpot);
00111    svtxfit->setPrimaryVertex(primaryVertex);
00112 
00113    // add the secondary vertex
00114    svtxfit->setVpar(vtxfit->vpar(0));
00115 
00116    // add the Ks or lambda
00117    svtxfit->AddTrack(0,vtxfit->wVirtualTrack(0));
00118 
00119    // do the second vertex fit
00120    // if the fit fails, the default values will not be changed
00121    if( !svtxfit->Fit() ) return false;
00122 
00123    // save the new ks parameters
00124    double vfitlength = svtxfit->decayLength();
00125    double vfiterror = svtxfit->decayLengthError();
00126    double vfitchi2 = svtxfit->chisq();
00127    double flightsig = 0;
00128    if( vfiterror != 0 )
00129      flightsig = vfitlength/vfiterror;
00130 
00131    // if the ks does not meet the criteria, the information from
00132    // the secondary vertex fit will not be filled (default = -999)
00133    if( vfitchi2 > m_maxVFitChisq ) return false;
00134    if( flightsig < m_minFlightSig ) return false;
00135     
00136    return true;
00137 }

const LocalKsSelector& LocalKsSelector::operator= ( const LocalKsSelector  )  [private]


Member Data Documentation

bool LocalKsSelector::m_doSecondaryVFit [private]

Definition at line 24 of file LocalKsSelector.h.

Referenced by LocalKsSelector(), and operator()().

double LocalKsSelector::m_maxChisq [private]

Definition at line 22 of file LocalKsSelector.h.

Referenced by LocalKsSelector(), and operator()().

double LocalKsSelector::m_maxMass [private]

Definition at line 21 of file LocalKsSelector.h.

Referenced by LocalKsSelector(), and operator()().

double LocalKsSelector::m_maxVFitChisq [private]

Definition at line 25 of file LocalKsSelector.h.

Referenced by LocalKsSelector(), and operator()().

double LocalKsSelector::m_minFlightSig [private]

Definition at line 26 of file LocalKsSelector.h.

Referenced by LocalKsSelector(), and operator()().

double LocalKsSelector::m_minMass [private]

Definition at line 20 of file LocalKsSelector.h.

Referenced by LocalKsSelector(), and operator()().


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