File indexing completed on 2024-04-06 12:31:05
0001 #ifndef VertexHistory_h
0002 #define VertexHistory_h
0003
0004 #include "DataFormats/VertexReco/interface/Vertex.h"
0005 #include "DataFormats/VertexReco/interface/VertexFwd.h"
0006
0007 #include "FWCore/Framework/interface/ConsumesCollector.h"
0008 #include "FWCore/Framework/interface/ESHandle.h"
0009 #include "FWCore/Framework/interface/Event.h"
0010 #include "FWCore/Framework/interface/EventSetup.h"
0011 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0012
0013 #include "SimDataFormats/Associations/interface/VertexAssociation.h"
0014 #include "SimTracker/TrackHistory/interface/HistoryBase.h"
0015 #include "SimTracker/TrackHistory/interface/Utils.h"
0016
0017
0018 class VertexHistory : public HistoryBase {
0019 public:
0020
0021
0022
0023
0024
0025 VertexHistory(const edm::ParameterSet &, edm::ConsumesCollector);
0026
0027
0028 void newEvent(const edm::Event &, const edm::EventSetup &);
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038 bool evaluate(TrackingVertexRef tvr) {
0039 if (enableSimToReco_) {
0040 std::pair<reco::VertexBaseRef, double> result = match(tvr, simToReco_, bestMatchByMaxValue_);
0041 recovertex_ = result.first;
0042 quality_ = result.second;
0043 }
0044 return HistoryBase::evaluate(tvr);
0045 }
0046
0047
0048
0049
0050
0051
0052
0053 bool evaluate(reco::VertexBaseRef);
0054
0055
0056 const reco::VertexBaseRef &recoVertex() const { return recovertex_; }
0057
0058
0059 double quality() const { return quality_; }
0060
0061 private:
0062 bool bestMatchByMaxValue_;
0063
0064 bool enableRecoToSim_, enableSimToReco_;
0065
0066 double quality_;
0067
0068 edm::InputTag vertexProducer_;
0069
0070 edm::InputTag trackingTruth_;
0071
0072 edm::InputTag vertexAssociator_;
0073
0074 reco::VertexBaseRef recovertex_;
0075
0076 reco::VertexRecoToSimCollection recoToSim_;
0077
0078 reco::VertexSimToRecoCollection simToReco_;
0079 };
0080
0081 #endif