61 HepMC::GenVertex::particles_in_const_iterator,
62 HepMC::GenVertex::particles_out_const_iterator,
63 HepMC::GenVertex::particles_out_const_iterator)
const;
69 classifier_(
config, consumesCollector()) {}
84 edm::LogPrint(
"TrackHistoryAnalyzer") << std::endl <<
"History for track #" <<
index <<
" : ";
92 for (std::size_t hindex = 0; hindex < simParticles.size(); hindex++) {
101 if (!simVertexes.empty()) {
102 for (std::size_t hindex = 0; hindex < simVertexes.size(); hindex++) {
104 <<
" simVertex [" << hindex
105 <<
"] : " <<
vertexString(simVertexes[hindex]->sourceTracks(), simVertexes[hindex]->daughterTracks());
108 edm::LogPrint(
"TrackHistoryAnalyzer") <<
" simVertex no found";
114 for (std::size_t hindex = 0; hindex <
genParticles.size(); hindex++) {
123 if (!genVertexes.empty()) {
124 for (std::size_t hindex = 0; hindex < genVertexes.size(); hindex++) {
125 edm::LogPrint(
"TrackHistoryAnalyzer") <<
" genVertex [" << hindex <<
"] : " 126 <<
vertexString(genVertexes[hindex]->particles_in_const_begin(),
127 genVertexes[hindex]->particles_in_const_end(),
128 genVertexes[hindex]->particles_out_const_begin(),
129 genVertexes[hindex]->particles_out_const_end());
132 edm::LogPrint(
"TrackHistoryAnalyzer") <<
" genVertex no found";
150 std::ostringstream vDescription;
157 vDescription << pid->name();
159 vDescription <<
pdgId;
161 vDescription <<
pdgId;
163 return vDescription.str();
170 std::ostringstream vDescription;
172 for (std::size_t
j = 0;
j <
in.size();
j++) {
181 vDescription << pid->name();
183 vDescription <<
in[
j]->pdgId();
185 vDescription <<
in[
j]->pdgId();
187 if (
j ==
in.size() - 1)
193 vDescription <<
"->";
195 for (std::size_t
j = 0;
j <
out.size();
j++) {
204 vDescription << pid->name();
206 vDescription <<
out[
j]->pdgId();
208 vDescription <<
out[
j]->pdgId();
210 if (
j ==
out.size() - 1)
216 return vDescription.str();
220 HepMC::GenVertex::particles_in_const_iterator in_end,
221 HepMC::GenVertex::particles_out_const_iterator out_begin,
222 HepMC::GenVertex::particles_out_const_iterator out_end)
const {
225 std::ostringstream vDescription;
229 HepMC::GenVertex::particles_in_const_iterator
in, itmp;
231 for (
in = in_begin;
in != in_end;
in++,
j++) {
240 vDescription << pid->name();
242 vDescription << (*in)->pdg_id();
244 vDescription << (*in)->pdg_id();
248 if (++itmp == in_end)
254 vDescription <<
"->";
257 HepMC::GenVertex::particles_out_const_iterator
out, otmp;
259 for (
out = out_begin;
out != out_end;
out++,
j++) {
268 vDescription << pid->name();
270 vDescription << (*out)->pdg_id();
272 vDescription << (*out)->pdg_id();
276 if (++otmp == out_end)
282 return vDescription.str();
const edm::ESGetToken< ParticleDataTable, PDTRecord > pdtToken_
void endRun(const edm::Run &, const edm::EventSetup &) override
GenVertexTrail const & genVertexTrail() const
Return all generated vertex in the history.
void analyze(const edm::Event &, const edm::EventSetup &) override
SimVertexTrail const & simVertexTrail() const
Return all the simulated vertices in the history.
std::string vertexString(const TrackingParticleRefVector &, const TrackingParticleRefVector &) const
SimParticleTrail const & simParticleTrail() const
Return all the simulated particle in the history.
void beginRun(const edm::Run &, const edm::EventSetup &) override
std::vector< const HepMC::GenParticle * > GenParticleTrail
HepMC::GenParticle trail type.
TrackHistory const & history() const
Returns a reference to the track history used in the classification.
~TrackHistoryAnalyzer() override=default
bool is(Category category) const
Returns track flag for a given category.
TrackHistoryAnalyzer(const edm::ParameterSet &)
#define DEFINE_FWK_MODULE(type)
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)
const edm::EDGetTokenT< edm::View< reco::Track > > trkToken_
HepPDT::ParticleData ParticleData
Log< level::Warning, true > LogPrint
TrackClassifier classifier_
Get track history and classify it in function of their .
TrackClassifier const & evaluate(reco::TrackBaseRef const &)
Classify the RecoTrack in categories.
GenParticleTrail const & genParticleTrail() const
Return all generated particle (HepMC::GenParticle) in the history.
edm::ESHandle< ParticleDataTable > pdt_
std::string particleString(int) const
std::vector< TrackingVertexRef > SimVertexTrail
SimVertex trail type.
std::vector< TrackingParticleRef > SimParticleTrail
SimParticle trail type.