41 edm::LogInfo(
"RecoVertex/KineExample") <<
"Initializing KVF TEST analyser - Output file: " <<
outputFile_ <<
"\n";
64 cout <<
"Reconstructing event number: " << iEvent.
id() <<
"\n";
71 cout <<
"Couln't find track collection: " << iEvent.
id() <<
"\n";
73 edm::LogInfo(
"RecoVertex/KineExample") <<
"Found: " << (*tks).size() <<
" reconstructed tracks" 75 cout <<
"got " << (*tks).size() <<
" tracks " << endl;
82 vector<TransientTrack> t_tks = (*theB).build(tks);
84 cout <<
"Found: " << t_tks.size() <<
" reconstructed tracks" 88 if (t_tks.size() > 3) {
96 vector<TransientTrack> ttv;
97 ttv.push_back(t_tks[0]);
98 ttv.push_back(t_tks[1]);
99 ttv.push_back(t_tks[2]);
100 ttv.push_back(t_tks[3]);
104 cout <<
"KVF failed\n";
120 float muon_sigma = 0.0000001;
121 float kaon_sigma = 0.000016;
128 vector<RefCountedKinematicParticle> muonParticles;
129 vector<RefCountedKinematicParticle> phiParticles;
130 vector<RefCountedKinematicParticle> allParticles;
131 muonParticles.push_back(pFactory.
particle(ttMuPlus, muon_mass, chi, ndf, muon_sigma));
132 muonParticles.push_back(pFactory.
particle(ttMuMinus, muon_mass, chi, ndf, muon_sigma));
133 allParticles.push_back(pFactory.
particle(ttMuPlus, muon_mass, chi, ndf, muon_sigma));
134 allParticles.push_back(pFactory.
particle(ttMuMinus, muon_mass, chi, ndf, muon_sigma));
136 phiParticles.push_back(pFactory.
particle(ttKPlus, kaon_mass, chi, ndf, kaon_sigma));
137 phiParticles.push_back(pFactory.
particle(ttKMinus, kaon_mass, chi, ndf, kaon_sigma));
138 allParticles.push_back(pFactory.
particle(ttKPlus, kaon_mass, chi, ndf, kaon_sigma));
139 allParticles.push_back(pFactory.
particle(ttKMinus, kaon_mass, chi, ndf, kaon_sigma));
147 cout <<
"Simple vertex fit with KinematicParticleVertexFitter:\n";
166 cout <<
"\nGlobal fit done:\n";
179 float jp_m_sigma = 0.00004;
183 jpTree = csFitter.
fit(jpsi_c2, jpTree);
187 jpTree->movePointerToTheTop();
189 phiParticles.push_back(jpsi_part);
195 cout <<
"Sequential fit done:\n";
214 cout <<
"Exception during event number: " << iEvent.
id() <<
"\n" << err.what() <<
"\n";
219 if (myVertex->vertexIsValid()) {
220 cout <<
"Decay vertex: " << myVertex->position() << myVertex->chiSquared() <<
" " << myVertex->degreesOfFreedom()
223 cout <<
"Decay vertex Not valid\n";
227 cout <<
"Particle: \n";
233 cout <<
"Momentum at vertex: " << myParticle->currentState().globalMomentum() << endl;
234 cout <<
"Parameters at vertex: " << myParticle->currentState().kinematicParameters().vector() << endl;
238 if (!myTree->isValid()) {
239 cout <<
"Tree is invalid. Fit failed.\n";
244 myTree->movePointerToTheTop();
256 vector<RefCountedKinematicParticle> bs_children = myTree->finalStateParticles();
258 for (
unsigned int i = 0;
i < bs_children.size(); ++
i) {
263 bool child = myTree->movePointerToTheFirstChild();
266 while (myTree->movePointerToTheNextChild()) {
293 return *(tPC.begin());
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::TrackCollection > token_tracks
T getUntrackedParameter(std::string const &, T const &) const
RefCountedKinematicTree fit(const std::vector< RefCountedKinematicParticle > &part)
void printout(const RefCountedKinematicVertex &myVertex) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::ParameterSet kvfPSet
void analyze(const edm::Event &, const edm::EventSetup &) override
KineExample(const edm::ParameterSet &)
std::vector< RefCountedKinematicTree > fit(KinematicConstraint *cs, const std::vector< RefCountedKinematicTree > &trees) const
#define DEFINE_FWK_MODULE(type)
edm::EDGetTokenT< TrackingVertexCollection > token_VertexTruth
GlobalPoint position() const
CachingVertex< 5 > vertex(const std::vector< reco::TransientTrack > &tracks) const override
RefCountedKinematicTree fit(const std::vector< RefCountedKinematicParticle > &particles) const
TrackingVertex getSimVertex(const edm::Event &iEvent) const
T const * product() const
std::vector< TrackingVertex > TrackingVertexCollection
RefCountedKinematicParticle particle(const reco::TransientTrack &initialTrack, const ParticleMass &massGuess, float chiSquared, float degreesOfFr, float &m_sigma) const
void beginRun(edm::Run const &, edm::EventSetup const &) override