File indexing completed on 2024-04-06 12:31:05
0001
0002 #ifndef VertexClassifier_h
0003 #define VertexClassifier_h
0004
0005 #include "FWCore/Framework/interface/ConsumesCollector.h"
0006 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0007 #include "FWCore/Utilities/interface/InputTag.h"
0008
0009 #include "DataFormats/BeamSpot/interface/BeamSpot.h"
0010
0011 #include "SimGeneral/HepPDTRecord/interface/ParticleDataTable.h"
0012
0013 #include "SimTracker/TrackHistory/interface/CMSProcessTypes.h"
0014 #include "SimTracker/TrackHistory/interface/VertexCategories.h"
0015 #include "SimTracker/TrackHistory/interface/VertexHistory.h"
0016
0017
0018 class VertexClassifier : public VertexCategories {
0019 public:
0020
0021 typedef VertexCategories Categories;
0022
0023
0024 VertexClassifier(edm::ParameterSet const &pset, edm::ConsumesCollector);
0025
0026 virtual ~VertexClassifier() {}
0027
0028
0029 virtual void newEvent(edm::Event const &, edm::EventSetup const &);
0030
0031
0032 VertexClassifier const &evaluate(reco::VertexBaseRef const &);
0033
0034
0035 VertexClassifier const &evaluate(TrackingVertexRef const &);
0036
0037
0038 VertexClassifier const &evaluate(reco::VertexRef const &vertex) { return evaluate(reco::VertexBaseRef(vertex)); }
0039
0040
0041 VertexHistory const &history() const { return tracer_; }
0042
0043 private:
0044 VertexHistory tracer_;
0045
0046 const G4toCMSLegacyProcTypeMap g4toCMSProcMap_;
0047
0048 const edm::InputTag hepMCLabel_;
0049
0050 double longLivedDecayLength_;
0051 double vertexClusteringDistance_;
0052
0053 edm::Handle<edm::HepMCProduct> mcInformation_;
0054
0055 edm::ESHandle<ParticleDataTable> particleDataTable_;
0056 edm::ESGetToken<ParticleDataTable, edm::DefaultRecord> particleDataTableToken_;
0057
0058
0059 void reconstructionInformation(reco::TrackBaseRef const &);
0060
0061
0062 void simulationInformation();
0063
0064
0065 void processesAtGenerator();
0066
0067
0068 void processesAtSimulation();
0069
0070
0071 void vertexInformation();
0072
0073
0074 struct GeneratedPrimaryVertex {
0075 GeneratedPrimaryVertex(double x1, double y1, double z1) : x(x1), y(y1), z(z1), ptsq(0), nGenTrk(0) {}
0076
0077 bool operator<(GeneratedPrimaryVertex const &reference) const { return ptsq < reference.ptsq; }
0078
0079 double x, y, z;
0080 double ptsq;
0081 int nGenTrk;
0082
0083 HepMC::FourVector ptot;
0084
0085 std::vector<int> finalstateParticles;
0086 std::vector<int> simTrackIndex;
0087 std::vector<int> genVertex;
0088 };
0089
0090 std::vector<GeneratedPrimaryVertex> genpvs_;
0091
0092
0093 bool isFinalstateParticle(const HepMC::GenParticle *);
0094 bool isCharged(const HepMC::GenParticle *);
0095 void genPrimaryVertices();
0096 };
0097
0098 #endif