56 HepMC::GenVertex::particles_in_const_iterator,
57 HepMC::GenVertex::particles_out_const_iterator,
58 HepMC::GenVertex::particles_out_const_iterator)
const;
79 for (std::size_t
index = 0;
index < vertexCollection->size();
index++) {
80 std::cout << std::endl <<
"History for vertex #" <<
index <<
" : " << std::endl;
88 for (std::size_t hindex = 0; hindex < simParticles.size(); hindex++) {
97 if (!simVertexes.empty()) {
98 for (std::size_t hindex = 0; hindex < simVertexes.size(); hindex++) {
99 std::cout <<
" simVertex [" << hindex <<
"] : " 100 <<
vertexString(simVertexes[hindex]->sourceTracks(), simVertexes[hindex]->daughterTracks())
104 std::cout <<
" simVertex no found" << std::endl;
110 for (std::size_t hindex = 0; hindex <
genParticles.size(); hindex++) {
119 if (!genVertexes.empty()) {
120 for (std::size_t hindex = 0; hindex < genVertexes.size(); hindex++) {
121 std::cout <<
" genVertex [" << hindex <<
"] : " 122 <<
vertexString(genVertexes[hindex]->particles_in_const_begin(),
123 genVertexes[hindex]->particles_in_const_end(),
124 genVertexes[hindex]->particles_out_const_begin(),
125 genVertexes[hindex]->particles_out_const_end())
129 std::cout <<
" genVertex no found" << std::endl;
131 std::cout <<
" fake vertex" << std::endl;
148 std::ostringstream vDescription;
152 if (particleType.isValid()) {
153 pid =
pdt_->particle(particleType);
155 vDescription << pid->name();
157 vDescription <<
pdgId;
159 vDescription <<
pdgId;
161 return vDescription.str();
168 std::ostringstream vDescription;
170 for (std::size_t j = 0; j < in.
size(); j++) {
176 if (particleType.isValid()) {
177 pid =
pdt_->particle(particleType);
179 vDescription << pid->name();
181 vDescription << in[j]->pdgId();
183 vDescription << in[j]->pdgId();
185 if (j == in.
size() - 1)
191 vDescription <<
"->";
193 for (std::size_t j = 0; j < out.
size(); j++) {
199 if (particleType.isValid()) {
200 pid =
pdt_->particle(particleType);
202 vDescription << pid->name();
204 vDescription << out[j]->pdgId();
206 vDescription << out[j]->pdgId();
208 if (j == out.
size() - 1)
214 return vDescription.str();
218 HepMC::GenVertex::particles_in_const_iterator in_end,
219 HepMC::GenVertex::particles_out_const_iterator out_begin,
220 HepMC::GenVertex::particles_out_const_iterator out_end)
const {
223 std::ostringstream vDescription;
227 HepMC::GenVertex::particles_in_const_iterator
in, itmp;
229 for (in = in_begin; in != in_end; in++, j++) {
238 vDescription << pid->name();
240 vDescription << (*in)->pdg_id();
242 vDescription << (*in)->pdg_id();
246 if (++itmp == in_end)
252 vDescription <<
"->";
255 HepMC::GenVertex::particles_out_const_iterator
out, otmp;
257 for (out = out_begin; out != out_end; out++, j++) {
266 vDescription << pid->name();
268 vDescription << (*out)->pdg_id();
270 vDescription << (*out)->pdg_id();
274 if (++otmp == out_end)
280 return vDescription.str();
This class traces the simulated and generated history of a given track.
T getUntrackedParameter(std::string const &, T const &) const
edm::InputTag vertexProducer_
VertexHistory const & history() const
Returns a reference to the vertex history used in the classification.
std::string vertexString(const TrackingParticleRefVector &, const TrackingParticleRefVector &) const
SimVertexTrail const & simVertexTrail() const
Return all the simulated vertices in the history.
def setup(process, global_tag, zero_tesla=False)
Get track history and classify it in function of their .
virtual void beginRun(const edm::Run &, const edm::EventSetup &)
void analyze(const edm::Event &, const edm::EventSetup &) override
std::vector< const HepMC::GenParticle * > GenParticleTrail
HepMC::GenParticle trail type.
VertexClassifier classifier_
bool getData(T &iHolder) const
#define DEFINE_FWK_MODULE(type)
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
edm::ESHandle< ParticleDataTable > pdt_
std::string particleString(int) const
bool is(Category category) const
Returns track flag for a given category.
std::vector< const HepMC::GenVertex * > GenVertexTrail
GenVertex trail type.
HepPDT::ParticleData ParticleData
VertexHistoryAnalyzer(const edm::ParameterSet &)
SimParticleTrail const & simParticleTrail() const
Return all the simulated particle in the history.
VertexClassifier const & evaluate(reco::VertexBaseRef const &)
Classify the RecoVertex in categories.
size_type size() const
Size of the RefVector.
virtual void newEvent(edm::Event const &, edm::EventSetup const &)
Pre-process event information (for accessing reconstraction information)
GenVertexTrail const & genVertexTrail() const
Return all generated vertex in the history.
std::vector< TrackingVertexRef > SimVertexTrail
SimVertex trail type.
GenParticleTrail const & genParticleTrail() const
Return all generated particle (HepMC::GenParticle) in the history.
std::vector< TrackingParticleRef > SimParticleTrail
SimParticle trail type.