CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
MTVHistoProducerAlgoForTracker.h
Go to the documentation of this file.
1 #ifndef Validation_RecoTrack_MTVHistoProducerAlgoForTracker_h
2 #define Validation_RecoTrack_MTVHistoProducerAlgoForTracker_h
3 
4 /* \author B.Mangano, UCSD
5  *
6  * Concrete class implementing the MTVHistoProducerAlgo interface.
7  * To be used within the MTV to fill histograms for Tracker tracks.
8  */
9 
12 
20 
22 
26 
28 
30  //sim
33 
34  //1D
58 
70  std::vector<METype> h_con_eta, h_con_vertcount, h_con_zpos;
71 
76 
78 
81 
82  std::vector<std::vector<METype>> h_reco_mva, h_assoc2_mva;
83  std::vector<std::vector<METype>> h_reco_mvacut, h_assoc_mvacut, h_assoc2_mvacut, h_simul2_mvacut;
84  std::vector<std::vector<METype>> h_reco_mva_hp, h_assoc2_mva_hp;
86 
89 
90  // dE/dx
91  // in the future these might become an array
92  std::vector<std::vector<METype>> h_dedx_estim;
93  std::vector<std::vector<METype>> h_dedx_nom;
94  std::vector<std::vector<METype>> h_dedx_sat;
95 
96  //2D
97  std::vector<METype> nrec_vs_nsim;
98  std::vector<METype> nrecHit_vs_nsimHit_sim2rec;
99  std::vector<METype> nrecHit_vs_nsimHit_rec2sim;
100  std::vector<METype> h_duplicates_oriAlgo_vs_oriAlgo;
101 
102  //assoc hits
103  std::vector<METype> h_assocFraction, h_assocSharedHit;
104 
105  //#hit vs eta: to be used with doProfileX
110 
111  //---- second set of histograms (originally not used by the SeedGenerator)
112  //1D
114 
115  //2D
116  std::vector<METype> chi2_vs_nhits, etares_vs_eta;
117  std::vector<METype> h_ptshifteta;
119 
120  //Profile2D
121  std::vector<METype> ptmean_vs_eta_phi, phimean_vs_eta_phi;
122 
123  //assoc chi2
124  std::vector<METype> h_assochi2, h_assochi2_prob;
125 
126  //chi2 and # lost hits vs eta: to be used with doProfileX
130 
131  //resolution of track params: to be used with fitslicesytool
134 
135  //pulls of track params vs eta: to be used with fitslicesytool
139 };
140 
142 public:
144 
145  MTVHistoProducerAlgoForTracker(const edm::ParameterSet& pset, const bool doSeedPlots);
147 
148  static std::unique_ptr<RecoTrackSelectorBase> makeRecoTrackSelectorFromTPSelectorParameters(
149  const edm::ParameterSet& pset);
150 
153  void bookSimTrackHistos(DQMStore::IBooker& ibook, Histograms& histograms, bool doResolutionPlots);
155  void bookRecoHistos(DQMStore::IBooker& ibook, Histograms& histograms, bool doResolutionPlots);
159  void bookMVAHistos(DQMStore::IBooker& ibook, Histograms& histograms, size_t nMVAs);
160 
163  const TrackingParticle::Point& vertex,
164  int bx) const;
165  void fill_simTrackBased_histos(const Histograms& histograms, int numSimTracks) const;
166 
168  int count,
169  const TrackingParticle& tp,
170  const TrackingParticle::Vector& momentumTP,
171  const TrackingParticle::Point& vertexTP,
172  double dxy,
173  double dz,
174  double dxyPV,
175  double dzPV,
176  int nSimHits,
177  int nSimLayers,
178  int nSimPixelLayers,
179  int nSimStripMonoAndStereoLayers,
180  const reco::Track* track,
181  int numVertices,
182  double dR,
183  double dR_jet,
184  const math::XYZPoint* pvPosition,
185  const TrackingVertex::LorentzVector* simPVPosition,
186  const math::XYZPoint& bsPosition,
187  const std::vector<float>& mvas,
188  unsigned int selectsLoose,
189  unsigned int selectsHP) const;
190 
192  int count,
193  const reco::GenParticle& tp,
194  const TrackingParticle::Vector& momentumTP,
195  const TrackingParticle::Point& vertexTP,
196  double dxy,
197  double dz,
198  int nSimHits,
199  const reco::Track* track,
200  int numVertices) const;
201 
203  int count,
204  const reco::Track& track1,
205  const reco::Track& track2) const;
206 
208  int count,
209  const reco::Track& track,
210  const TrackerTopology& ttopo,
211  const math::XYZPoint& bsPosition,
212  const math::XYZPoint* pvPosition,
213  const TrackingVertex::LorentzVector* simPVPosition,
214  bool isMatched,
215  bool isSigMatched,
216  bool isChargeMatched,
217  int numAssocRecoTracks,
218  int numVertices,
219  int nSimHits,
220  double sharedFraction,
221  double dR,
222  double dR_jet,
223  const std::vector<float>& mvas,
224  unsigned int selectsLoose,
225  unsigned int selectsHP) const;
226 
228  int count,
229  const edm::RefToBase<reco::Track>& trackref,
230  const std::vector<const edm::ValueMap<reco::DeDxData>*>& v_dEdx) const;
231 
233 
235  int count,
236  int assTracks,
237  int numRecoTracks,
238  int numRecoTracksSelected,
239  int numSimTracksSelected) const;
240 
242  int count,
243  const TrackingParticle::Vector& momentumTP,
244  const TrackingParticle::Point& vertexTP,
245  int chargeTP,
246  const reco::Track& track,
247  const math::XYZPoint& bsPosition) const;
248 
249  void fill_seed_histos(const Histograms& histograms, int count, int seedsFitFailed, int seedsTotal) const;
250 
251 private:
253  void getRecoMomentum(const reco::Track& track,
254  double& pt,
255  double& ptError,
256  double& qoverp,
257  double& qoverpError,
258  double& lambda,
259  double& lambdaError,
260  double& phi,
261  double& phiError) const;
263  void getRecoMomentum(const reco::GsfTrack& gsfTrack,
264  double& pt,
265  double& ptError,
266  double& qoverp,
267  double& qoverpError,
268  double& lambda,
269  double& lambdaError,
270  double& phi,
271  double& phiError) const;
272 
273  double getEta(double eta) const;
274 
275  double getPt(double pt) const;
276 
277  unsigned int getSeedingLayerSetBin(const reco::Track& track, const TrackerTopology& ttopo) const;
278 
279  //private data members
280  std::unique_ptr<TrackingParticleSelector> generalTpSelector;
281  std::unique_ptr<TrackingParticleSelector> TpSelectorForEfficiencyVsEta;
282  std::unique_ptr<TrackingParticleSelector> TpSelectorForEfficiencyVsPhi;
283  std::unique_ptr<TrackingParticleSelector> TpSelectorForEfficiencyVsPt;
284  std::unique_ptr<TrackingParticleSelector> TpSelectorForEfficiencyVsVTXR;
285  std::unique_ptr<TrackingParticleSelector> TpSelectorForEfficiencyVsVTXZ;
286 
287  std::unique_ptr<RecoTrackSelectorBase> trackSelectorVsEta;
288  std::unique_ptr<RecoTrackSelectorBase> trackSelectorVsPhi;
289  std::unique_ptr<RecoTrackSelectorBase> trackSelectorVsPt;
290 
291  std::unique_ptr<GenParticleCustomSelector> generalGpSelector;
292  std::unique_ptr<GenParticleCustomSelector> GpSelectorForEfficiencyVsEta;
293  std::unique_ptr<GenParticleCustomSelector> GpSelectorForEfficiencyVsPhi;
294  std::unique_ptr<GenParticleCustomSelector> GpSelectorForEfficiencyVsPt;
295  std::unique_ptr<GenParticleCustomSelector> GpSelectorForEfficiencyVsVTXR;
296  std::unique_ptr<GenParticleCustomSelector> GpSelectorForEfficiencyVsVTXZ;
297 
298  double minEta, maxEta;
299  int nintEta;
301  double minPt, maxPt;
302  int nintPt;
303  bool useInvPt;
304  bool useLogPt;
305  double minHit, maxHit;
306  int nintHit;
307  double minPu, maxPu;
308  int nintPu;
311  double minPhi, maxPhi;
312  int nintPhi;
313  double minDxy, maxDxy;
314  int nintDxy;
315  double minDz, maxDz;
316  int nintDz;
317  double dxyDzZoom;
321  double minZpos, maxZpos;
322  int nintZpos;
323  double mindr, maxdr;
324  int nintdr;
325  double mindrj, maxdrj;
326  int nintdrj;
327  double minChi2, maxChi2;
328  int nintChi2;
329  double minDeDx, maxDeDx;
330  int nintDeDx;
335  double minPVz, maxPVz;
336  int nintPVz;
337  double minMVA, maxMVA;
338  int nintMVA;
339 
340  const bool doSeedPlots_;
341  const bool doMTDPlots_;
342  const bool doDzPVcutPlots_;
343 
344  //
355 
356  double maxDzpvCum;
360 
361  std::vector<std::string> seedingLayerSetNames;
362  using SeedingLayerId =
363  std::tuple<SeedingLayerSetsBuilder::SeedingLayerId, bool>; // last bool for strip mono (true) or not (false)
364  using SeedingLayerSetId = std::array<SeedingLayerId, 4>;
365  std::map<SeedingLayerSetId, unsigned int> seedingLayerSetToBin;
366 };
367 
368 #endif
void fill_trackBased_histos(const Histograms &histograms, int count, int assTracks, int numRecoTracks, int numRecoTracksSelected, int numSimTracksSelected) const
void fill_generic_simTrack_histos(const Histograms &histograms, const TrackingParticle::Vector &, const TrackingParticle::Point &vertex, int bx) const
std::vector< std::vector< METype > > h_assoc2_mva_vs_eta_hp
std::vector< std::vector< METype > > h_assoc_mvacut
std::unique_ptr< TrackingParticleSelector > TpSelectorForEfficiencyVsPt
std::vector< std::vector< METype > > h_fake_mva_vs_pt_hp
std::unique_ptr< TrackingParticleSelector > TpSelectorForEfficiencyVsEta
void fill_seed_histos(const Histograms &histograms, int count, int seedsFitFailed, int seedsTotal) const
std::vector< std::vector< METype > > h_assoc2_mva_vs_pt
std::unique_ptr< GenParticleCustomSelector > GpSelectorForEfficiencyVsVTXR
std::vector< std::vector< METype > > h_assoc2_mva_hp
void getRecoMomentum(const reco::Track &track, double &pt, double &ptError, double &qoverp, double &qoverpError, double &lambda, double &lambdaError, double &phi, double &phiError) const
retrieval of reconstructed momentum components from reco::Track (== mean values for GSF) ...
std::unique_ptr< TrackingParticleSelector > TpSelectorForEfficiencyVsVTXR
std::map< SeedingLayerSetId, unsigned int > seedingLayerSetToBin
std::vector< std::vector< METype > > h_assoc2_mva_vs_eta
void fill_ResoAndPull_recoTrack_histos(const Histograms &histograms, int count, const TrackingParticle::Vector &momentumTP, const TrackingParticle::Point &vertexTP, int chargeTP, const reco::Track &track, const math::XYZPoint &bsPosition) const
std::vector< std::vector< METype > > h_reco_mva
std::unique_ptr< GenParticleCustomSelector > GpSelectorForEfficiencyVsVTXZ
std::vector< std::vector< METype > > h_assoc2_mva_vs_pt_hp
void fill_generic_recoTrack_histos(const Histograms &histograms, int count, const reco::Track &track, const TrackerTopology &ttopo, const math::XYZPoint &bsPosition, const math::XYZPoint *pvPosition, const TrackingVertex::LorentzVector *simPVPosition, bool isMatched, bool isSigMatched, bool isChargeMatched, int numAssocRecoTracks, int numVertices, int nSimHits, double sharedFraction, double dR, double dR_jet, const std::vector< float > &mvas, unsigned int selectsLoose, unsigned int selectsHP) const
std::vector< std::vector< METype > > h_dedx_estim
std::unique_ptr< GenParticleCustomSelector > GpSelectorForEfficiencyVsPt
void bookSimHistos(DQMStore::IBooker &ibook, Histograms &histograms)
std::vector< std::vector< METype > > h_simul2_mvacut_hp
void bookSimTrackPVAssociationHistos(DQMStore::IBooker &ibook, Histograms &histograms)
std::unique_ptr< RecoTrackSelectorBase > trackSelectorVsPhi
unsigned int getSeedingLayerSetBin(const reco::Track &track, const TrackerTopology &ttopo) const
void fill_simTrackBased_histos(const Histograms &histograms, int numSimTracks) const
std::vector< std::vector< METype > > h_reco_mva_hp
std::vector< std::vector< METype > > h_fake_mva_vs_pt
void fill_recoAssociated_simTrack_histos(const Histograms &histograms, int count, const TrackingParticle &tp, const TrackingParticle::Vector &momentumTP, const TrackingParticle::Point &vertexTP, double dxy, double dz, double dxyPV, double dzPV, int nSimHits, int nSimLayers, int nSimPixelLayers, int nSimStripMonoAndStereoLayers, const reco::Track *track, int numVertices, double dR, double dR_jet, const math::XYZPoint *pvPosition, const TrackingVertex::LorentzVector *simPVPosition, const math::XYZPoint &bsPosition, const std::vector< float > &mvas, unsigned int selectsLoose, unsigned int selectsHP) const
std::unique_ptr< GenParticleCustomSelector > GpSelectorForEfficiencyVsPhi
math::XYZPointD Point
point in the space
math::XYZTLorentzVectorD LorentzVector
std::tuple< SeedingLayerSetsBuilder::SeedingLayerId, bool > SeedingLayerId
std::vector< std::vector< METype > > h_assoc_mvacut_hp
std::unique_ptr< GenParticleCustomSelector > GpSelectorForEfficiencyVsEta
std::unique_ptr< TrackingParticleSelector > generalTpSelector
void fill_simAssociated_recoTrack_histos(const Histograms &histograms, int count, const reco::Track &track) const
std::unique_ptr< RecoTrackSelectorBase > trackSelectorVsPt
void bookRecoPVAssociationHistos(DQMStore::IBooker &ibook, Histograms &histograms)
bool isMatched(TrackingRecHit const &hit)
void fill_dedx_recoTrack_histos(const Histograms &histograms, int count, const edm::RefToBase< reco::Track > &trackref, const std::vector< const edm::ValueMap< reco::DeDxData > * > &v_dEdx) const
MTVHistoProducerAlgoForTracker(const edm::ParameterSet &pset, const bool doSeedPlots)
std::array< SeedingLayerId, 4 > SeedingLayerSetId
std::vector< std::vector< METype > > h_fake_mva_vs_eta_hp
void fill_duplicate_histos(const Histograms &histograms, int count, const reco::Track &track1, const reco::Track &track2) const
std::unique_ptr< TrackingParticleSelector > TpSelectorForEfficiencyVsPhi
std::vector< std::vector< METype > > h_fake_mva_vs_eta
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
std::vector< std::vector< METype > > h_assoc2_mva
std::unique_ptr< TrackingParticleSelector > TpSelectorForEfficiencyVsVTXZ
std::vector< std::string > seedingLayerSetNames
void bookSimTrackHistos(DQMStore::IBooker &ibook, Histograms &histograms, bool doResolutionPlots)
void bookRecodEdxHistos(DQMStore::IBooker &ibook, Histograms &histograms)
Monte Carlo truth information used for tracking validation.
std::vector< std::vector< METype > > h_dedx_nom
std::vector< std::vector< METype > > h_reco_mvacut
std::unique_ptr< GenParticleCustomSelector > generalGpSelector
std::vector< std::vector< METype > > h_dedx_sat
math::XYZVectorD Vector
point in the space
void bookRecoHistos(DQMStore::IBooker &ibook, Histograms &histograms, bool doResolutionPlots)
std::unique_ptr< RecoTrackSelectorBase > trackSelectorVsEta
static std::unique_ptr< RecoTrackSelectorBase > makeRecoTrackSelectorFromTPSelectorParameters(const edm::ParameterSet &pset)
std::vector< std::vector< METype > > h_assoc2_mvacut
void bookSeedHistos(DQMStore::IBooker &ibook, Histograms &histograms)
void bookMVAHistos(DQMStore::IBooker &ibook, Histograms &histograms, size_t nMVAs)
std::vector< std::vector< METype > > h_simul2_mvacut
std::vector< std::vector< METype > > h_reco_mvacut_hp
std::vector< std::vector< METype > > h_assoc2_mvacut_hp