45 <<
"Initializing KVF TEST analyser - Output file: " <<
outputFile_ <<
"\n";
75 cout <<
"Reconstructing event number: " << iEvent.
id() <<
"\n";
83 <<
"Couln't find track collection: " << iEvent.
id()
88 <<
"Found: " << (*tks).size() <<
" reconstructed tracks" <<
"\n";
89 cout <<
"got " << (*tks).size() <<
" tracks " << endl;
96 vector<TransientTrack> t_tks = (*theB).build(tks);
98 cout <<
"Found: " << t_tks.size() <<
" reconstructed tracks" <<
"\n";
101 if (t_tks.size() > 3) {
110 vector<TransientTrack> ttv;
111 ttv.push_back(t_tks[0]); ttv.push_back(t_tks[1]); ttv.push_back(t_tks[2]);ttv.push_back(t_tks[3]);
130 float muon_sigma = 0.0000001;
131 float kaon_sigma = 0.000016;
138 vector<RefCountedKinematicParticle> muonParticles;
139 vector<RefCountedKinematicParticle> phiParticles;
140 vector<RefCountedKinematicParticle> allParticles;
141 muonParticles.push_back(pFactory.
particle (ttMuPlus,muon_mass,chi,ndf,muon_sigma));
142 muonParticles.push_back(pFactory.
particle (ttMuMinus,muon_mass,chi,ndf,muon_sigma));
143 allParticles.push_back(pFactory.
particle (ttMuPlus,muon_mass,chi,ndf,muon_sigma));
144 allParticles.push_back(pFactory.
particle (ttMuMinus,muon_mass,chi,ndf,muon_sigma));
146 phiParticles.push_back(pFactory.
particle (ttKPlus,kaon_mass,chi,ndf,kaon_sigma));
147 phiParticles.push_back(pFactory.
particle (ttKMinus,kaon_mass,chi,ndf,kaon_sigma));
148 allParticles.push_back(pFactory.
particle (ttKPlus,kaon_mass,chi,ndf,kaon_sigma));
149 allParticles.push_back(pFactory.
particle (ttKMinus,kaon_mass,chi,ndf,kaon_sigma));
157 cout <<
"Simple vertex fit with KinematicParticleVertexFitter:\n";
176 cout <<
"\nGlobal fit done:\n";
189 float jp_m_sigma = 0.00004;
193 jpTree = csFitter.
fit(jpsi_c2,jpTree);
197 jpTree->movePointerToTheTop();
199 phiParticles.push_back(jpsi_part);
205 cout <<
"Sequential fit done:\n";
228 cout <<
"Exception during event number: " << iEvent.
id()
229 <<
"\n" << err.what() <<
"\n";
236 if (myVertex->vertexIsValid()) {
237 cout <<
"Decay vertex: " << myVertex->position() <<myVertex->chiSquared()<<
" "<<myVertex->degreesOfFreedom()<<endl;
238 }
else cout <<
"Decay vertex Not valid\n";
243 cout <<
"Particle: \n";
249 cout <<
"Momentum at vertex: " << myParticle->currentState().globalMomentum ()<<endl;
250 cout <<
"Parameters at vertex: " << myParticle->currentState().kinematicParameters().vector()<<endl;
255 if (!myTree->isValid()) {
256 cout <<
"Tree is invalid. Fit failed.\n";
261 myTree->movePointerToTheTop();
273 vector< RefCountedKinematicParticle > bs_children = myTree->finalStateParticles();
275 for (
unsigned int i=0;
i< bs_children.size();++
i) {
280 bool child = myTree->movePointerToTheFirstChild();
282 if(child)
while (myTree->movePointerToTheNextChild()) {
310 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
#define DEFINE_FWK_MODULE(type)
edm::ParameterSet kvfPSet
def setup(process, global_tag, zero_tesla=False)
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
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