60 HepMC::GenVertex::particles_in_const_iterator,
61 HepMC::GenVertex::particles_out_const_iterator,
62 HepMC::GenVertex::particles_out_const_iterator)
const;
85 std::cout << std::endl <<
"History for track #" <<
index <<
" : " << std::endl;
93 for (std::size_t hindex = 0; hindex < simParticles.size(); hindex++) {
102 if (!simVertexes.empty()) {
103 for (std::size_t hindex = 0; hindex < simVertexes.size(); hindex++) {
104 std::cout <<
" simVertex [" << hindex <<
"] : " 105 <<
vertexString(simVertexes[hindex]->sourceTracks(), simVertexes[hindex]->daughterTracks())
109 std::cout <<
" simVertex no found" << std::endl;
115 for (std::size_t hindex = 0; hindex <
genParticles.size(); hindex++) {
124 if (!genVertexes.empty()) {
125 for (std::size_t hindex = 0; hindex < genVertexes.size(); hindex++) {
126 std::cout <<
" genVertex [" << hindex <<
"] : " 127 <<
vertexString(genVertexes[hindex]->particles_in_const_begin(),
128 genVertexes[hindex]->particles_in_const_end(),
129 genVertexes[hindex]->particles_out_const_begin(),
130 genVertexes[hindex]->particles_out_const_end())
134 std::cout <<
" genVertex no found" << std::endl;
153 std::ostringstream vDescription;
157 if (particleType.isValid()) {
158 pid =
pdt_->particle(particleType);
160 vDescription << pid->name();
162 vDescription <<
pdgId;
164 vDescription <<
pdgId;
166 return vDescription.str();
173 std::ostringstream vDescription;
175 for (std::size_t j = 0; j < in.
size(); j++) {
181 if (particleType.isValid()) {
182 pid =
pdt_->particle(particleType);
184 vDescription << pid->name();
186 vDescription << in[j]->pdgId();
188 vDescription << in[j]->pdgId();
190 if (j == in.
size() - 1)
196 vDescription <<
"->";
198 for (std::size_t j = 0; j < out.
size(); j++) {
204 if (particleType.isValid()) {
205 pid =
pdt_->particle(particleType);
207 vDescription << pid->name();
209 vDescription << out[j]->pdgId();
211 vDescription << out[j]->pdgId();
213 if (j == out.
size() - 1)
219 return vDescription.str();
223 HepMC::GenVertex::particles_in_const_iterator in_end,
224 HepMC::GenVertex::particles_out_const_iterator out_begin,
225 HepMC::GenVertex::particles_out_const_iterator out_end)
const {
228 std::ostringstream vDescription;
232 HepMC::GenVertex::particles_in_const_iterator
in, itmp;
234 for (in = in_begin; in != in_end; in++, j++) {
243 vDescription << pid->name();
245 vDescription << (*in)->pdg_id();
247 vDescription << (*in)->pdg_id();
251 if (++itmp == in_end)
257 vDescription <<
"->";
260 HepMC::GenVertex::particles_out_const_iterator
out, otmp;
262 for (out = out_begin; out != out_end; out++, j++) {
271 vDescription << pid->name();
273 vDescription << (*out)->pdg_id();
275 vDescription << (*out)->pdg_id();
279 if (++otmp == out_end)
285 return vDescription.str();
T getUntrackedParameter(std::string const &, T const &) const
std::string vertexString(const TrackingParticleRefVector &, const TrackingParticleRefVector &) const
~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.
std::vector< const HepMC::GenParticle * > GenParticleTrail
HepMC::GenParticle trail type.
bool getData(T &iHolder) const
TrackClassifier const & evaluate(reco::TrackBaseRef const &)
Classify the RecoTrack in categories.
#define DEFINE_FWK_MODULE(type)
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.