28 LogDebug(
"ConversionVertexFinder") <<
"ConversionVertexFinder CTOR " <<
"\n";
34 kcvFitter_->setParameters(
conf_);
40 LogDebug(
"ConversionVertexFinder") <<
"ConversionVertexFinder DTOR " <<
"\n";
48 if ( pair.size() < 2)
return found;
50 float sigma = 0.00000001;
53 float mass = 0.000511;
58 std::vector<RefCountedKinematicParticle> particles;
60 particles.push_back(pFactory.
particle (pair[0],mass,chi,ndf,sigma,*pair[0].innermostMeasurementState().freeState()));
61 particles.push_back(pFactory.
particle (pair[1],mass,chi,ndf,sigma,*pair[1].innermostMeasurementState().freeState()));
85 if( oldTree->isValid() ) {
88 if( gamma_dec_vertex->vertexIsValid())
89 std::cout << gamma_dec_vertex->chiSquared() <<
" " << gamma_dec_vertex->degreesOfFreedom() << std::endl;
90 std::cout << oldTree->currentParticle()->currentState().globalMomentum() <<
91 oldTree->currentParticle()->currentState().globalPosition()<< std::endl;
92 std::vector<RefCountedKinematicParticle> fStates=oldTree->finalStateParticles();
93 for (
unsigned int kk=0;
kk<fStates.size();
kk++) {
94 std::cout << fStates[
kk]->currentState().globalMomentum() <<
95 fStates[
kk]->currentState().globalPosition() << std::endl;
96 std::cout << fStates[
kk]->currentState().kinematicParametersError().matrix()<<std::endl;
100 if( myTree->isValid() ) {
103 if( gamma_dec_vertex->vertexIsValid())
104 std::cout << gamma_dec_vertex->chiSquared() <<
" " << gamma_dec_vertex->degreesOfFreedom() << std::endl;
105 std::cout << myTree->currentParticle()->currentState().globalMomentum() <<
106 myTree->currentParticle()->currentState().globalPosition()<< std::endl;
107 std::vector<RefCountedKinematicParticle> fStates=myTree->finalStateParticles();
108 for (
unsigned int kk=0;
kk<fStates.size();
kk++) {
109 std::cout << fStates[
kk]->currentState().globalMomentum() <<
110 fStates[
kk]->currentState().globalPosition() << std::endl;
111 std::cout << fStates[
kk]->currentState().kinematicParametersError().matrix()<<std::endl;
115 #endif // TemplateKineFitDebug
119 if( myTree->isValid() ) {
120 myTree->movePointerToTheTop();
122 if (the_photon->currentState().isValid()){
125 gamma_dec_vertex = myTree->currentDecayVertex();
126 if( gamma_dec_vertex->vertexIsValid() ){
127 const float chi2Prob =
ChiSquaredProbability(gamma_dec_vertex->chiSquared(), gamma_dec_vertex->degreesOfFreedom());
130 the_vertex = *gamma_dec_vertex;
142 LogDebug(
"ConversionVertexFinder") <<
"ConversionVertexFinder run pair size " << pair.size() <<
"\n";
153 const std::string
metname =
"ConversionVertexFinder| ConversionVertexFinder";
156 transientVtx = fitter.
vertex(pair);
161 edm::LogWarning(metname) <<
"cms::Exception caught in ConversionVertexFinder::run\n"
ConversionVertexFinder(const edm::ParameterSet &config)
T getParameter(std::string const &) const
RefCountedKinematicTree fit(std::vector< RefCountedKinematicParticle > part)
const std::string metname
virtual std::string explainSelf() const
double minChiSqImprovement_
virtual CachingVertex< 5 > vertex(const std::vector< reco::TransientTrack > &tracks) const
void setParameters(const edm::ParameterSet &pSet)
TransientVertex run(std::vector< reco::TransientTrack > pair)
float ChiSquaredProbability(double chiSquared, double nrDOF)
RefCountedKinematicTree fit(std::vector< RefCountedKinematicParticle > part)
~ConversionVertexFinder()
KinematicConstrainedVertexFitter * kcvFitter_
RefCountedKinematicParticle particle(const reco::TransientTrack &initialTrack, const ParticleMass &massGuess, float chiSquared, float degreesOfFr, float &m_sigma) const