66 HepMC::GenVertex::particles_in_const_iterator,
67 HepMC::GenVertex::particles_in_const_iterator,
68 HepMC::GenVertex::particles_out_const_iterator,
69 HepMC::GenVertex::particles_out_const_iterator
99 std::cout << std::endl <<
"History for track #" <<
index <<
" : " << std::endl;
108 for (std::size_t hindex=0; hindex<simParticles.size(); hindex++)
110 std::cout <<
" simParticles [" << hindex <<
"] : " 119 if ( !simVertexes.empty() )
121 for (std::size_t hindex=0; hindex<simVertexes.size(); hindex++)
123 std::cout <<
" simVertex [" << hindex <<
"] : " 125 simVertexes[hindex]->sourceTracks(),
126 simVertexes[hindex]->daughterTracks()
132 std::cout <<
" simVertex no found" << std::endl;
138 for (std::size_t hindex=0; hindex<
genParticles.size(); hindex++)
140 std::cout <<
" genParticles [" << hindex <<
"] : " 149 if ( !genVertexes.empty() )
151 for (std::size_t hindex=0; hindex<genVertexes.size(); hindex++)
153 std::cout <<
" genVertex [" << hindex <<
"] : " 155 genVertexes[hindex]->particles_in_const_begin(),
156 genVertexes[hindex]->particles_in_const_end(),
157 genVertexes[hindex]->particles_out_const_begin(),
158 genVertexes[hindex]->particles_out_const_end()
164 std::cout <<
" genVertex no found" << std::endl;
193 std::ostringstream vDescription;
197 if (particleType.isValid())
199 pid =
pdt_->particle(particleType);
201 vDescription << pid->name();
203 vDescription <<
pdgId;
206 vDescription <<
pdgId;
208 return vDescription.str();
219 std::ostringstream vDescription;
221 for (std::size_t j = 0; j < in.
size(); j++)
223 if (!j) vDescription <<
"(";
227 if (particleType.isValid())
229 pid =
pdt_->particle(particleType);
231 vDescription << pid->name();
233 vDescription << in[j]->pdgId();
236 vDescription << in[j]->pdgId();
238 if (j == in.
size() - 1) vDescription <<
")";
239 else vDescription <<
",";
242 vDescription <<
"->";
244 for (std::size_t j = 0; j < out.
size(); j++)
246 if (!j) vDescription <<
"(";
250 if (particleType.isValid())
252 pid =
pdt_->particle(particleType);
254 vDescription << pid->name();
256 vDescription << out[j]->pdgId();
259 vDescription << out[j]->pdgId();
261 if (j == out.
size() - 1) vDescription <<
")";
262 else vDescription <<
",";
265 return vDescription.str();
270 HepMC::GenVertex::particles_in_const_iterator in_begin,
271 HepMC::GenVertex::particles_in_const_iterator in_end,
272 HepMC::GenVertex::particles_out_const_iterator out_begin,
273 HepMC::GenVertex::particles_out_const_iterator out_end
278 std::ostringstream vDescription;
282 HepMC::GenVertex::particles_in_const_iterator
in, itmp;
284 for (in = in_begin; in != in_end; in++, j++)
286 if (!j) vDescription <<
"(";
294 vDescription << pid->name();
296 vDescription << (*in)->pdg_id();
299 vDescription << (*in)->pdg_id();
303 if (++itmp == in_end) vDescription <<
")";
304 else vDescription <<
",";
307 vDescription <<
"->";
310 HepMC::GenVertex::particles_out_const_iterator
out, otmp;
312 for (out = out_begin; out != out_end; out++, j++)
314 if (!j) vDescription <<
"(";
322 vDescription << pid->name();
324 vDescription << (*out)->pdg_id();
327 vDescription << (*out)->pdg_id();
331 if (++otmp == out_end) vDescription <<
")";
332 else vDescription <<
",";
335 return vDescription.str();
T getUntrackedParameter(std::string const &, T const &) const
std::string vertexString(const TrackingParticleRefVector &, const TrackingParticleRefVector &) const
#define DEFINE_FWK_MODULE(type)
~TrackHistoryAnalyzer() override
SimVertexTrail const & simVertexTrail() const
Return all the simulated vertices in the history.
void analyze(const edm::Event &, const edm::EventSetup &) override
std::string particleString(int) const
def setup(process, global_tag, zero_tesla=False)
TrackHistory const & history() const
Returns a reference to the track history used in the classification.
void getData(T &iHolder) const
std::vector< const HepMC::GenParticle * > GenParticleTrail
HepMC::GenParticle trail type.
TrackClassifier const & evaluate(reco::TrackBaseRef const &)
Classify the RecoTrack in categories.
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
TrackHistoryAnalyzer(const edm::ParameterSet &)
This class traces the simulated and generated history of a given track.
std::vector< const HepMC::GenVertex * > GenVertexTrail
GenVertex trail type.
void newEvent(edm::Event const &, edm::EventSetup const &)
Pre-process event information (for accessing reconstraction information)
HepPDT::ParticleData ParticleData
bool is(Category category) const
Returns track flag for a given category.
TrackClassifier classifier_
Get track history and classify it in function of their .
SimParticleTrail const & simParticleTrail() const
Return all the simulated particle in the history.
edm::InputTag trackProducer_
edm::ESHandle< ParticleDataTable > pdt_
size_type size() const
Size of the RefVector.
GenVertexTrail const & genVertexTrail() const
Return all generated vertex in the history.
std::vector< TrackingVertexRef > SimVertexTrail
SimVertex trail type.
virtual void beginRun(const edm::Run &, const edm::EventSetup &)
GenParticleTrail const & genParticleTrail() const
Return all generated particle (HepMC::GenParticle) in the history.
std::vector< TrackingParticleRef > SimParticleTrail
SimParticle trail type.