28 LogDebug(
"ConversionVertexFinder") <<
"ConversionVertexFinder CTOR " <<
"\n";
34 kcvFitter_->setParameters(
conf_);
40 LogDebug(
"ConversionVertexFinder") <<
"ConversionVertexFinder DTOR " <<
"\n";
46 std::vector<reco::TransientTrack> pair = _pair;
49 if ( pair.size() < 2)
return found;
51 float sigma = 0.00000001;
54 float mass = 0.000511;
59 std::vector<RefCountedKinematicParticle> particles;
61 particles.push_back(pFactory.
particle (pair[0],mass,chi,ndf,sigma,*pair[0].innermostMeasurementState().freeState()));
62 particles.push_back(pFactory.
particle (pair[1],mass,chi,ndf,sigma,*pair[1].innermostMeasurementState().freeState()));
86 if( oldTree->isValid() ) {
89 if( gamma_dec_vertex->vertexIsValid())
90 std::cout << gamma_dec_vertex->chiSquared() <<
" " << gamma_dec_vertex->degreesOfFreedom() << std::endl;
91 std::cout << oldTree->currentParticle()->currentState().globalMomentum() <<
92 oldTree->currentParticle()->currentState().globalPosition()<< std::endl;
93 std::vector<RefCountedKinematicParticle> fStates=oldTree->finalStateParticles();
94 for (
unsigned int kk=0; kk<fStates.size(); kk++) {
95 std::cout << fStates[kk]->currentState().globalMomentum() <<
96 fStates[kk]->currentState().globalPosition() << std::endl;
97 std::cout << fStates[kk]->currentState().kinematicParametersError().matrix()<<std::endl;
101 if( myTree->isValid() ) {
104 if( gamma_dec_vertex->vertexIsValid())
105 std::cout << gamma_dec_vertex->chiSquared() <<
" " << gamma_dec_vertex->degreesOfFreedom() << std::endl;
106 std::cout << myTree->currentParticle()->currentState().globalMomentum() <<
107 myTree->currentParticle()->currentState().globalPosition()<< std::endl;
108 std::vector<RefCountedKinematicParticle> fStates=myTree->finalStateParticles();
109 for (
unsigned int kk=0; kk<fStates.size(); kk++) {
110 std::cout << fStates[kk]->currentState().globalMomentum() <<
111 fStates[kk]->currentState().globalPosition() << std::endl;
112 std::cout << fStates[kk]->currentState().kinematicParametersError().matrix()<<std::endl;
116 #endif // TemplateKineFitDebug
120 if( myTree->isValid() ) {
121 myTree->movePointerToTheTop();
123 if (the_photon->currentState().isValid()){
126 gamma_dec_vertex = myTree->currentDecayVertex();
127 if( gamma_dec_vertex->vertexIsValid() ){
128 const float chi2Prob =
ChiSquaredProbability(gamma_dec_vertex->chiSquared(), gamma_dec_vertex->degreesOfFreedom());
131 the_vertex = *gamma_dec_vertex;
143 LogDebug(
"ConversionVertexFinder") <<
"ConversionVertexFinder run pair size " << pair.size() <<
"\n";
157 transientVtx = fitter.
vertex(pair);
162 edm::LogWarning(metname) <<
"cms::Exception caught in ConversionVertexFinder::run\n"
ConversionVertexFinder(const edm::ParameterSet &config)
T getParameter(std::string const &) const
RefCountedKinematicTree fit(const std::vector< RefCountedKinematicParticle > &part)
TransientVertex run(const std::vector< reco::TransientTrack > &pair)
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)
float ChiSquaredProbability(double chiSquared, double nrDOF)
~ConversionVertexFinder()
KinematicConstrainedVertexFitter * kcvFitter_
RefCountedKinematicParticle particle(const reco::TransientTrack &initialTrack, const ParticleMass &massGuess, float chiSquared, float degreesOfFr, float &m_sigma) const
RefCountedKinematicTree fit(const std::vector< RefCountedKinematicParticle > &part)