CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TrackAssociatorByChi2.h
Go to the documentation of this file.
1 #ifndef TrackAssociatorByChi2_h
2 #define TrackAssociatorByChi2_h
3 
24 
25 #include<map>
26 
27 //Note that the Association Map is filled with -ch2 and not chi2 because it is ordered using std::greater:
28 //the track with the lowest association chi2 will be the first in the output map.
29 
31 
32  public:
33  typedef std::map<double, SimTrack> Chi2SimMap;
34  typedef std::pair< reco::Track, Chi2SimMap> RecoToSimPair;
35  typedef std::vector< RecoToSimPair > RecoToSimPairAssociation;
36 
39  chi2cut(conf.getParameter<double>("chi2cut")),
40  onlyDiagonal(conf.getParameter<bool>("onlyDiagonal")),
41  bsSrc(conf.getParameter<edm::InputTag>("beamSpot")) {
42  theMF=mF;
43  if (onlyDiagonal)
44  edm::LogInfo("TrackAssociator") << " ---- Using Off Diagonal Covariance Terms = 0 ---- " << "\n";
45  else
46  edm::LogInfo("TrackAssociator") << " ---- Using Off Diagonal Covariance Terms != 0 ---- " << "\n";
47  }
48 
50  TrackAssociatorByChi2(const edm::ESHandle<MagneticField> mF, double chi2Cut, bool onlyDiag, edm::InputTag beamspotSrc){
51  chi2cut=chi2Cut;
52  onlyDiagonal=onlyDiag;
53  theMF=mF;
54  bsSrc = beamspotSrc;
55  }
56 
59 
61  double compareTracksParam(reco::TrackCollection::const_iterator,
62  edm::SimTrackContainer::const_iterator,
66  const reco::BeamSpot&) const;
67 
70  const edm::SimTrackContainer&,
72  const reco::BeamSpot&) const;
73 
75  double associateRecoToSim(reco::TrackCollection::const_iterator,
76  TrackingParticleCollection::const_iterator,
77  const reco::BeamSpot&) const;
78 
80  std::pair<bool,reco::TrackBase::ParameterVector> parametersAtClosestApproach(Basic3DVector<double>,// vertex
81  Basic3DVector<double>,// momAtVtx
82  float,// charge
83  const reco::BeamSpot&) const;//beam spot
87  const edm::Event * event = 0,
88  const edm::EventSetup * setup = 0 ) const ;
92  const edm::Event * event = 0,
93  const edm::EventSetup * setup = 0 ) const ;
94 
98  const edm::Event * event = 0,
99  const edm::EventSetup * setup = 0) const {
101  }
102 
106  const edm::Event * event = 0,
107  const edm::EventSetup * setup = 0) const {
109  }
110  private:
112  double chi2cut;
115 };
116 
117 #endif
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:15
virtual reco::SimToRecoCollection associateSimToReco(edm::Handle< edm::View< reco::Track > > &tCH, edm::Handle< TrackingParticleCollection > &tPCH, const edm::Event *event=0, const edm::EventSetup *setup=0) const
compare reco to sim the handle of reco::Track and TrackingParticle collections
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:10
std::pair< bool, reco::TrackBase::ParameterVector > parametersAtClosestApproach(Basic3DVector< double >, Basic3DVector< double >, float, const reco::BeamSpot &) const
propagate the track parameters of TrackinParticle from production vertex to the point of closest appr...
std::pair< reco::Track, Chi2SimMap > RecoToSimPair
double compareTracksParam(reco::TrackCollection::const_iterator, edm::SimTrackContainer::const_iterator, const math::XYZTLorentzVectorD, GlobalVector, reco::TrackBase::CovarianceMatrix, const reco::BeamSpot &) const
compare reco::TrackCollection and edm::SimTrackContainer iterators: returns the chi2 ...
~TrackAssociatorByChi2()
Destructor.
TrackAssociatorByChi2(const edm::ESHandle< MagneticField > mF, edm::ParameterSet conf)
Constructor with PSet.
reco::SimToRecoCollection associateSimToReco(const edm::RefToBaseVector< reco::Track > &, const edm::RefVector< TrackingParticleCollection > &, const edm::Event *event=0, const edm::EventSetup *setup=0) const
Association Sim To Reco with Collections.
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
double associateRecoToSim(reco::TrackCollection::const_iterator, TrackingParticleCollection::const_iterator, const reco::BeamSpot &) const
compare reco::TrackCollection and TrackingParticleCollection iterators: returns the chi2 ...
virtual reco::RecoToSimCollection associateRecoToSim(edm::Handle< edm::View< reco::Track > > &tCH, edm::Handle< TrackingParticleCollection > &tPCH, const edm::Event *event=0, const edm::EventSetup *setup=0) const
compare reco to sim the handle of reco::Track and TrackingParticle collections
edm::ESHandle< MagneticField > theMF
tuple conf
Definition: dbtoconf.py:185
std::vector< SimVertex > SimVertexContainer
reco::RecoToSimCollection associateRecoToSim(edm::Handle< edm::View< reco::Track > > &tCH, edm::Handle< TrackingParticleCollection > &tPCH, const edm::Event *event=0, const edm::EventSetup *setup=0) const
compare reco to sim the handle of reco::Track and TrackingParticle collections
std::map< double, SimTrack > Chi2SimMap
std::vector< RecoToSimPair > RecoToSimPairAssociation
reco::SimToRecoCollection associateSimToReco(edm::Handle< edm::View< reco::Track > > &tCH, edm::Handle< TrackingParticleCollection > &tPCH, const edm::Event *event=0, const edm::EventSetup *setup=0) const
compare reco to sim the handle of reco::Track and TrackingParticle collections
TrackAssociatorByChi2(const edm::ESHandle< MagneticField > mF, double chi2Cut, bool onlyDiag, edm::InputTag beamspotSrc)
Constructor with magnetic field, double, bool and InputTag.
std::vector< SimTrack > SimTrackContainer
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
math::Error< dimension >::type CovarianceMatrix
5 parameter covariance matrix
Definition: TrackBase.h:72