|
|
Go to the documentation of this file.
6 #include "HepPDT/ParticleID.hh"
10 #define update(a, b) \
20 quality_(
config, collector),
160 const SimTrack *assocTrack = &(*tpr->g4Track_begin());
163 GlobalPoint(tpr->vertex().x(), tpr->vertex().y(), tpr->vertex().z()),
178 double dxySim = -
v.x() *
sin(
p.phi()) +
v.y() *
cos(
p.phi());
181 double dzSim =
v.z() - (
v.x() *
p.x() +
v.y() *
p.y()) *
p.z() /
p.perp2();
223 for (
unsigned int j = 0;
j <
layer.hits.size();
j++) {
244 flags_[
Light] = !pid.hasCharm() && !pid.hasBottom();
258 for (TrackHistory::RecoGenParticleTrail::const_iterator iparticle = recoGenParticleTrail.begin();
259 iparticle != recoGenParticleTrail.end();
278 std::set<int> daughterIds;
279 size_t ndau = (*iparticle)->numberOfDaughters();
280 for (
size_t i = 0;
i < ndau; ++
i) {
281 daughterIds.insert((*iparticle)->daughter(
i)->pdgId());
308 for (TrackHistory::SimParticleTrail::const_iterator iparticle = simParticleTrail.begin();
309 iparticle != simParticleTrail.end();
323 for (its = parentVertex->sourceTracks_begin(); its != parentVertex->sourceTracks_end(); ++its) {
324 for (itd = parentVertex->daughterTracks_begin(); itd != parentVertex->daughterTracks_end(); ++itd)
334 if (its != parentVertex->sourceTracks_end())
340 unsigned int processG4 = 0;
343 if (parentVertex->nG4Vertices() > 0) {
344 processG4 = (*(parentVertex->g4Vertices_begin())).processType();
390 int daughtId =
abs((*iparticle)->pdgId());
425 double const mm = 0.1;
427 double oldX = genpv.
x;
428 double oldY = genpv.
y;
429 double oldZ = genpv.
z;
432 for (TrackHistory::GenParticleTrail::const_reverse_iterator iparticle = genParticleTrail.rbegin();
433 iparticle != genParticleTrail.rend();
436 HepMC::GenVertex *
parent = (*iparticle)->production_vertex();
438 HepMC::ThreeVector
p =
parent->point3d();
440 double distance2 =
pow(
p.x() * mm - genpv.
x, 2) +
pow(
p.y() * mm - genpv.
y, 2) +
pow(
p.z() * mm - genpv.
z, 2);
441 double difference2 =
pow(
p.x() * mm - oldX, 2) +
pow(
p.y() * mm - oldY, 2) +
pow(
p.z() * mm - oldZ, 2);
460 for (TrackHistory::SimParticleTrail::const_reverse_iterator iparticle = simParticleTrail.rbegin();
461 iparticle != simParticleTrail.rend();
466 double distance2 =
pow(
p.x() - genpv.
x, 2) +
pow(
p.y() - genpv.
y, 2) +
pow(
p.z() - genpv.
z, 2);
467 double difference2 =
pow(
p.x() - oldX, 2) +
pow(
p.y() - oldY, 2) +
pow(
p.z() - oldZ, 2);
495 return part->charge() != 0;
511 for (HepMC::GenEvent::vertex_const_iterator ivertex =
event->vertices_begin(); ivertex !=
event->vertices_end();
513 bool hasParentVertex =
false;
517 for (HepMC::GenVertex::particle_iterator iparent = (*ivertex)->particles_begin(
HepMC::parents);
520 if ((*iparent)->production_vertex()) {
521 hasParentVertex =
true;
530 HepMC::FourVector
pos = (*ivertex)->position();
532 double const mm = 0.1;
536 std::vector<GeneratedPrimaryVertex>::iterator ientry =
genpvs_.begin();
539 for (; ientry !=
genpvs_.end(); ++ientry) {
540 double distance2 =
pow(
pv.x - ientry->x, 2) +
pow(
pv.y - ientry->y, 2) +
pow(
pv.z - ientry->z, 2);
550 ientry->genVertex.push_back((*ivertex)->barcode());
553 for (HepMC::GenVertex::particle_iterator idecendants = (*ivertex)->particles_begin(HepMC::descendants);
554 idecendants != (*ivertex)->particles_end(HepMC::descendants);
557 if (
find(ientry->finalstateParticles.begin(), ientry->finalstateParticles.end(), (*idecendants)->barcode()) ==
558 ientry->finalstateParticles.end()) {
559 ientry->finalstateParticles.push_back((*idecendants)->barcode());
560 HepMC::FourVector
m = (*idecendants)->momentum();
562 ientry->ptot.setPx(ientry->ptot.px() +
m.px());
563 ientry->ptot.setPy(ientry->ptot.py() +
m.py());
564 ientry->ptot.setPz(ientry->ptot.pz() +
m.pz());
565 ientry->ptot.setE(ientry->ptot.e() +
m.e());
566 ientry->ptsq +=
m.perp() *
m.perp();
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoHandToken_
edm::ESHandle< MagneticField > magneticField_
unsigned int numberOfLayers() const
Return the number of layers with simulated and/or reconstructed hits.
T const * product() const
GlobalVector momentum() const
TrackClassifier(edm::ParameterSet const &, edm::ConsumesCollector &&)
Constructor by ParameterSet.
const math::XYZTLorentzVectorD & momentum() const
std::vector< TrackingParticleRef > SimParticleTrail
SimParticle trail type.
edm::Handle< reco::BeamSpot > beamSpot_
const reco::GenParticle * recoGenParticle() const
double z0() const
z coordinate
const TrackerTopology * tTopo_
void newEvent(const edm::Event &, const edm::EventSetup &)
Pre-process event information (for accessing reconstruction information)
Flags flags_
Flag containers.
std::vector< const HepMC::GenParticle * > GenParticleTrail
HepMC::GenParticle trail type.
const RecoGenParticleTrail & recoGenParticleTrail() const
Return all reco::GenParticle in the history.
std::vector< const reco::GenParticle * > RecoGenParticleTrail
reco::GenParticle trail type.
unsigned int minTrackerSimHits_
const reco::TrackBaseRef & recoTrack() const
Return a reference to the reconstructed track.
GlobalPoint position() const
Global3DVector GlobalVector
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
const edm::InputTag beamSpotLabel_
HepPDT::ParticleData ParticleData
const Layer & layer(unsigned int index) const
Return information about the given layer by index.
Sin< T >::type sin(const T &t)
const edm::InputTag hepMCLabel_
Auxiliary class holding simulated primary vertices.
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magneticFieldToken_
Cos< T >::type cos(const T &t)
bool isCharged(const HepMC::GenParticle *)
edm::Handle< edm::HepMCProduct > mcInformation_
void processesAtSimulation()
Get information about conversion and other interactions.
const TrackClassifier & evaluate(reco::TrackBaseRef const &)
Classify the RecoTrack in categories.
edm::ESGetToken< TransientTrackBuilder, TransientTrackRecord > transientTrackBuilderToken_
const GenParticleTrail & genParticleTrail() const
Return all generated particle (HepMC::GenParticle) in the history.
unsigned int numberOfInnerLayers_
void hadronFlavor()
Get hadron flavor of the initial hadron.
Global3DPoint GlobalPoint
constexpr std::array< uint8_t, layerIndexSize > layer
std::vector< GeneratedPrimaryVertex > genpvs_
void processesAtGenerator()
Get all the information related to decay process.
int pdgId() const final
PDG identifier.
bool isNonnull() const
Checks for non-null.
void newEvent(edm::Event const &, edm::EventSetup const &)
Pre-process event information (for accessing reconstraction information)
int event() const
get the contents of the subdetector field (should be protected?)
edm::ESHandle< ParticleDataTable > particleDataTable_
void reset()
Reset the categories flags.
void vertexInformation()
Get geometrical information about the vertices.
void qualityInformation(reco::TrackBaseRef const &)
Classify all the tracks by their reconstruction quality.
const HepMC::GenEvent * GetEvent() const
void newEvent(const edm::Event &, const edm::EventSetup &)
Pre-process event information (for accessing reconstruction information)
void evaluate(SimParticleTrail const &, reco::TrackBaseRef const &, const TrackerTopology *tTopo)
Compute information about the track reconstruction quality.
double vertexClusteringSqDistance_
math::XYZPoint Point
point in the space
double x0() const
x coordinate
const TrackingParticleRef & simParticle() const
Return the initial tracking particle from the history.
const SimParticleTrail & simParticleTrail() const
Return all the simulated particle in the history.
bool isNonnull() const
Checks for non-null.
void reconstructionInformation(reco::TrackBaseRef const &)
edm::ESHandle< TransientTrackBuilder > transientTrackBuilder_
double longLivedDecayLength_
void simulationInformation()
Get all the information related to the simulation details.
const unsigned int processId(unsigned int g4ProcessId) const
bool evaluate(TrackingParticleRef tpr)
Evaluate track history using a TrackingParticleRef.
Power< A, B >::type pow(const A &a, const B &b)
const G4toCMSLegacyProcTypeMap g4toCMSProcMap_
Abs< T >::type abs(const T &t)
const FreeTrajectoryState & theState() const
double y0() const
y coordinate
Get track history and classify it in function of their .
void genPrimaryVertices()
math::XYZPointD Point
point in the space
bool isFinalstateParticle(const HepMC::GenParticle *)
void depth(int d)
Set the depth of the history.
int bunchCrossing() const
get the detector field from this detid