CMS 3D CMS Logo

NewMuonTrackValidator.cc
Go to the documentation of this file.
5 
18 
19 #include "TMath.h"
20 #include <TF1.h>
21 
22 using namespace std;
23 using namespace edm;
24 
26 
27  for (unsigned int ww=0;ww<associators.size();ww++){
28  for (unsigned int www=0;www<label.size();www++){
29 
30  ibooker.cd();
31  InputTag algo = label[www];
32  string dirName=dirName_;
33  if (algo.process()!="")
34  dirName+=algo.process()+"_";
35  if(algo.label()!="")
36  dirName+=algo.label();
37  if(algo.instance()!="")
38  dirName+=("_"+algo.instance());
39  if (dirName.find("Tracks")<dirName.length()){
40  dirName.replace(dirName.find("Tracks"),6,"Trks");
41  }
42  if (dirName.find("UpdatedAtVtx")<dirName.length()){
43  dirName.replace(dirName.find("UpdatedAtVtx"),12,"UpdAtVtx");
44  }
45  string assoc= associators[ww];
46  if (assoc.find("tpToTkmuTrackAssociation")<assoc.length()){
47  dirName+="_TkAsso";
48  }
49  std::replace(dirName.begin(), dirName.end(), ':', '_');
50  ibooker.setCurrentFolder(dirName);
51 
52  h_tracks.push_back( ibooker.book1D("Ntracks","Number of reconstructed tracks",100,-0.5,99.5) );
53  h_fakes.push_back( ibooker.book1D("Nfakes","Number of fake reco tracks",20,-0.5,19.5) );
54  h_charge.push_back( ibooker.book1D("Ncharge","track charge",3,-1.5,1.5) );
55 
56  h_recoeta.push_back( ibooker.book1D("num_reco_eta","N of reco track vs eta",nintEta,minEta,maxEta) );
57  h_assoceta.push_back( ibooker.book1D("num_assoSimToReco_eta","N of associated tracks (simToReco) vs eta",nintEta,minEta,maxEta) );
58  h_assoc2eta.push_back( ibooker.book1D("num_assoRecoToSim_eta","N of associated (recoToSim) tracks vs eta",nintEta,minEta,maxEta) );
59  h_simuleta.push_back( ibooker.book1D("num_simul_eta","N of simulated tracks vs eta",nintEta,minEta,maxEta) );
60  h_misideta.push_back( ibooker.book1D("num_chargemisid_eta","N of associated (simToReco) tracks with charge misID vs eta",nintEta,minEta,maxEta) );
61 
62  h_recopT.push_back( ibooker.book1D("num_reco_pT","N of reco track vs pT",nintPt,minPt,maxPt) );
63  h_assocpT.push_back( ibooker.book1D("num_assoSimToReco_pT","N of associated tracks (simToReco) vs pT",nintPt,minPt,maxPt) );
64  h_assoc2pT.push_back( ibooker.book1D("num_assoRecoToSim_pT","N of associated (recoToSim) tracks vs pT",nintPt,minPt,maxPt) );
65  h_simulpT.push_back( ibooker.book1D("num_simul_pT","N of simulated tracks vs pT",nintPt,minPt,maxPt) );
66  h_misidpT.push_back( ibooker.book1D("num_chargemisid_pT","N of associated (simToReco) tracks with charge misID vs pT",nintPt,minPt,maxPt) );
67 
68  h_recophi.push_back( ibooker.book1D("num_reco_phi","N of reco track vs phi",nintPhi,minPhi,maxPhi) );
69  h_assocphi.push_back( ibooker.book1D("num_assoSimToReco_phi","N of associated tracks (simToReco) vs phi",nintPhi,minPhi,maxPhi) );
70  h_assoc2phi.push_back( ibooker.book1D("num_assoRecoToSim_phi","N of associated (recoToSim) tracks vs phi",nintPhi,minPhi,maxPhi) );
71  h_simulphi.push_back( ibooker.book1D("num_simul_phi","N of simulated tracks vs phi",nintPhi,minPhi,maxPhi) );
72  h_misidphi.push_back( ibooker.book1D("num_chargemisid_phi","N of associated (simToReco) tracks with charge misID vs phi",nintPhi,minPhi,maxPhi) );
73 
74  h_recohit.push_back( ibooker.book1D("num_reco_hit","N of reco tracks vs N SimHits",nintNHit,minNHit,maxNHit) );
75  h_assochit.push_back( ibooker.book1D("num_assoSimToReco_hit","N of associated tracks (simToReco) vs N SimHits",nintNHit,minNHit,maxNHit) );
76  h_assoc2hit.push_back( ibooker.book1D("num_assoRecoToSim_hit","N of associated (recoToSim) tracks vs N Rechits",nintNHit,minNHit,maxNHit) );
77  h_simulhit.push_back( ibooker.book1D("num_simul_hit","N of simulated tracks vs N SimHits",nintNHit,minNHit,maxNHit) );
78  h_misidhit.push_back( ibooker.book1D("num_chargemisid_hit","N of associated (recoToSim) tracks with charge misID vs N RecHits",nintNHit,minNHit,maxNHit) );
79 
80  h_recodxy.push_back( ibooker.book1D("num_reco_dxy","N of reco track vs dxy",nintDxy,minDxy,maxDxy) );
81  h_assocdxy.push_back( ibooker.book1D("num_assoSimToReco_dxy","N of associated tracks (simToReco) vs dxy",nintDxy,minDxy,maxDxy) );
82  h_assoc2dxy.push_back( ibooker.book1D("num_assoRecoToSim_dxy","N of associated (recoToSim) tracks vs dxy",nintDxy,minDxy,maxDxy) );
83  h_simuldxy.push_back( ibooker.book1D("num_simul_dxy","N of simulated tracks vs dxy",nintDxy,minDxy,maxDxy) );
84  h_misiddxy.push_back( ibooker.book1D("num_chargemisid_dxy","N of associated (simToReco) tracks with charge misID vs dxy",nintDxy,minDxy,maxDxy) );
85  h_recodz.push_back( ibooker.book1D("num_reco_dz","N of reco track vs dz",nintDz,minDz,maxDz) );
86  h_assocdz.push_back( ibooker.book1D("num_assoSimToReco_dz","N of associated tracks (simToReco) vs dz",nintDz,minDz,maxDz) );
87  h_assoc2dz.push_back( ibooker.book1D("num_assoRecoToSim_dz","N of associated (recoToSim) tracks vs dz",nintDz,minDz,maxDz) );
88  h_simuldz.push_back( ibooker.book1D("num_simul_dz","N of simulated tracks vs dz",nintDz,minDz,maxDz) );
89  h_misiddz.push_back( ibooker.book1D("num_chargemisid_dz","N of associated (simToReco) tracks with charge misID vs dz",nintDz,minDz,maxDz) );
90 
91  h_assocRpos.push_back( ibooker.book1D("num_assoSimToReco_Rpos","N of associated tracks (simToReco) vs Radius",nintRpos,minRpos,maxRpos) );
92  h_simulRpos.push_back( ibooker.book1D("num_simul_Rpos","N of simulated tracks vs Radius",nintRpos,minRpos,maxRpos) );
93 
94  h_assocZpos.push_back( ibooker.book1D("num_assoSimToReco_Zpos","N of associated tracks (simToReco) vs Z",nintZpos,minZpos,maxZpos) );
95  h_simulZpos.push_back( ibooker.book1D("num_simul_Zpos","N of simulated tracks vs Z",nintZpos,minZpos,maxZpos) );
96 
97  h_recopu.push_back( ibooker.book1D("num_reco_pu","N of reco track vs pu",nintPU,minPU,maxPU) );
98  h_assocpu.push_back( ibooker.book1D("num_assoSimToReco_pu","N of associated tracks (simToReco) vs pu",nintPU,minPU,maxPU) );
99  h_assoc2pu.push_back( ibooker.book1D("num_assoRecoToSim_pu","N of associated (recoToSim) tracks vs pu",nintPU,minPU,maxPU) );
100  h_simulpu.push_back( ibooker.book1D("num_simul_pu","N of simulated tracks vs pu",nintPU,minPU,maxPU) );
101  h_misidpu.push_back( ibooker.book1D("num_chargemisid_pu","N of associated (simToReco) charge misIDed tracks vs pu",nintPU,minPU,maxPU) );
102 
103  h_nchi2.push_back( ibooker.book1D("chi2","Track normalized #chi^{2}", 80, 0., 20.) );
104  h_nchi2_prob.push_back( ibooker.book1D("chi2prob", "Probability of track normalized #chi^{2}",100,0.,1.) );
105 
106  chi2_vs_nhits.push_back( ibooker.book2D("chi2_vs_nhits","#chi^{2} vs nhits",nintNHit,minNHit,maxNHit,20,0.,10.) );
107  chi2_vs_eta.push_back( ibooker.book2D("chi2_vs_eta","chi2_vs_eta",nintEta,minEta,maxEta, 40, 0., 20. ));
108  chi2_vs_phi.push_back( ibooker.book2D("chi2_vs_phi","#chi^{2} vs #phi",nintPhi,minPhi,maxPhi, 40, 0., 20. ) );
109 
110  h_nhits.push_back( ibooker.book1D("nhits", "Number of hits per track", nintNHit,minNHit,maxNHit ) );
111  nhits_vs_eta.push_back( ibooker.book2D("nhits_vs_eta","Number of Hits vs eta",nintEta,minEta,maxEta,nintNHit,minNHit,maxNHit) );
112  nhits_vs_phi.push_back( ibooker.book2D("nhits_vs_phi","#hits vs #phi",nintPhi,minPhi,maxPhi,nintNHit,minNHit,maxNHit) );
113 
114  if (do_MUOhitsPlots) {
115  nDThits_vs_eta.push_back( ibooker.book2D("nDThits_vs_eta","Number of DT hits vs eta",nintEta,minEta,maxEta,nintDTHit,minDTHit,maxDTHit) );
116  nCSChits_vs_eta.push_back( ibooker.book2D("nCSChits_vs_eta","Number of CSC hits vs eta",nintEta,minEta,maxEta,nintCSCHit,minCSCHit,maxCSCHit) );
117  nRPChits_vs_eta.push_back( ibooker.book2D("nRPChits_vs_eta","Number of RPC hits vs eta",nintEta,minEta,maxEta,nintRPCHit,minRPCHit,maxRPCHit) );
118  if (useGEMs_)
119  nGEMhits_vs_eta.push_back( ibooker.book2D("nGEMhits_vs_eta","Number of GEM hits vs eta",nintEta,minEta,maxEta,nintNHit,minNHit,maxNHit) );
120  if(useME0_)
121  nME0hits_vs_eta.push_back( ibooker.book2D("nME0hits_vs_eta","Number of ME0 hits vs eta",nintEta,minEta,maxEta,nintNHit,minNHit,maxNHit) );
122 
123  }
124 
125  if (do_TRKhitsPlots) {
126  nTRK_LayersWithMeas_vs_eta.push_back(ibooker.book2D("nTRK_LayersWithMeas_vs_eta","# TRK Layers with measurement vs eta",
128  nPixel_LayersWithMeas_vs_eta.push_back(ibooker.book2D("nPixel_LayersWithMeas_vs_eta","Number of Pixel Layers with measurement vs eta",
130  h_nmisslayers_inner.push_back( ibooker.book1D("nTRK_misslayers_inner", "Number of missing inner TRK layers", nintLayers,minLayers,maxLayers ) );
131  h_nmisslayers_outer.push_back( ibooker.book1D("nTRK_misslayers_outer", "Number of missing outer TRK layers", nintLayers,minLayers,maxLayers ) );
132  h_nlosthits.push_back( ibooker.book1D("nlosthits", "Number of lost hits per track", 6,-0.5,5.5 ) );
133  nlosthits_vs_eta.push_back( ibooker.book2D("nlosthits_vs_eta","Number of lost hits per track vs eta",nintEta,minEta,maxEta,6,-0.5,5.5) );
134  }
135 
136  ptres_vs_eta.push_back(ibooker.book2D("ptres_vs_eta","p_{T} Relative Residual vs #eta",
138  ptres_vs_phi.push_back( ibooker.book2D("ptres_vs_phi","p_{T} Relative Residual vs #phi",
140  ptres_vs_pt.push_back(ibooker.book2D("ptres_vs_pt","p_{T} Relative Residual vs p_{T}",
142  h_ptpull.push_back( ibooker.book1D("ptpull", "p_{T} Pull", 100, -10., 10.) );
143  ptpull_vs_eta.push_back(ibooker.book2D("ptpull_vs_eta","p_{T} Pull vs #eta",nintEta,minEta,maxEta,100,-10.,10.));
144  ptpull_vs_phi.push_back(ibooker.book2D("ptpull_vs_phi","p_{T} Pull vs #phi",nintPhi,minPhi,maxPhi,100,-10.,10.));
145  h_qoverppull.push_back( ibooker.book1D("qoverppull","q/p Pull", 100, -10., 10.) );
146 
147  h_etaRes.push_back( ibooker.book1D("etaRes", "#eta residual", etaRes_nbin, etaRes_rangeMin, etaRes_rangeMax) );
148  etares_vs_eta.push_back( ibooker.book2D("etares_vs_eta","#eta Residual vs #eta",
150 
151  thetaCotres_vs_eta.push_back(ibooker.book2D("thetaCotres_vs_eta","cot(#theta) Residual vs #eta",
153  thetaCotres_vs_pt.push_back(ibooker.book2D("thetaCotres_vs_pt","cot(#theta) Residual vs p_{T}",
155  h_thetapull.push_back( ibooker.book1D("thetapull","#theta Pull",100,-10.,10.) );
156  thetapull_vs_eta.push_back(ibooker.book2D("thetapull_vs_eta","#theta Pull vs #eta",nintEta,minEta,maxEta,100,-10,10));
157  thetapull_vs_phi.push_back(ibooker.book2D("thetapull_vs_phi","#theta Pull vs #phi",nintPhi,minPhi,maxPhi,100,-10,10));
158 
159  phires_vs_eta.push_back(ibooker.book2D("phires_vs_eta","#phi Residual vs #eta",
161  phires_vs_pt.push_back(ibooker.book2D("phires_vs_pt","#phi Residual vs p_{T}",
163  phires_vs_phi.push_back(ibooker.book2D("phires_vs_phi","#phi Residual vs #phi",
165  h_phipull.push_back( ibooker.book1D("phipull","#phi Pull",100,-10.,10.) );
166  phipull_vs_eta.push_back(ibooker.book2D("phipull_vs_eta","#phi Pull vs #eta",nintEta,minEta,maxEta,100,-10,10));
167  phipull_vs_phi.push_back(ibooker.book2D("phipull_vs_phi","#phi Pull vs #phi",nintPhi,minPhi,maxPhi,100,-10,10));
168 
169  dxyres_vs_eta.push_back(ibooker.book2D("dxyres_vs_eta","dxy Residual vs #eta",
171  dxyres_vs_pt.push_back( ibooker.book2D("dxyres_vs_pt","dxy Residual vs p_{T}",
173  h_dxypull.push_back( ibooker.book1D("dxypull","dxy Pull",100,-10.,10.) );
174  dxypull_vs_eta.push_back(ibooker.book2D("dxypull_vs_eta","dxy Pull vs #eta",nintEta,minEta,maxEta,100,-10,10));
175 
176  dzres_vs_eta.push_back(ibooker.book2D("dzres_vs_eta","dz Residual vs #eta",
178  dzres_vs_pt.push_back(ibooker.book2D("dzres_vs_pt","dz Residual vs p_{T}",
180  h_dzpull.push_back( ibooker.book1D("dzpull","dz Pull",100,-10.,10.) );
181  dzpull_vs_eta.push_back(ibooker.book2D("dzpull_vs_eta","dz Pull vs #eta",nintEta,minEta,maxEta,100,-10,10));
182 
183  nRecHits_vs_nSimHits.push_back( ibooker.book2D("nRecHits_vs_nSimHits","nRecHits vs nSimHits",nintNHit,minNHit,maxNHit, nintNHit,minNHit,maxNHit ));
184 
185  if (MABH) {
186  h_PurityVsQuality.push_back
187  (ibooker.book2D("PurityVsQuality","Purity vs Quality (MABH)",20,0.01,1.01,20,0.01,1.01) );
188  }
189 
190  if (associators[ww]=="trackAssociatorByChi2"){
191  h_assochi2.push_back( ibooker.book1D("assocChi2","track association #chi^{2}",1000,0.,100.) );
192  h_assochi2_prob.push_back(ibooker.book1D("assocChi2_prob","probability of association #chi^{2}",100,0.,1.));
193  } else if (associators[ww]=="trackAssociatorByHits"){
194  h_assocFraction.push_back( ibooker.book1D("assocFraction","fraction of shared hits",22,0.,1.1) );
195  h_assocSharedHit.push_back(ibooker.book1D("assocSharedHit","number of shared hits",41,-0.5,40.5));
196  }
197 
198  if (useLogPt) {
199  BinLogX(h_simulpT.back()->getTH1F());
200  BinLogX(h_assocpT.back()->getTH1F());
201  BinLogX(h_recopT.back()->getTH1F());
202  BinLogX(h_assoc2pT.back()->getTH1F());
203  BinLogX(h_misidpT.back()->getTH1F());
204 
205  BinLogX(phires_vs_pt.back()->getTH2F());
206  BinLogX(thetaCotres_vs_pt.back()->getTH2F());
207  BinLogX(dxyres_vs_pt.back()->getTH2F());
208  BinLogX(dzres_vs_pt.back()->getTH2F());
209  BinLogX(ptres_vs_pt.back()->getTH2F());
210  }
211 
212  } //for (unsigned int www=0;www<label.size();www++)
213  } //for (unsigned int ww=0;ww<associators.size();ww++)
214 
215 }
216 
218  using namespace reco;
219 
220  edm::LogInfo("NewMuonTrackValidator") << "\n====================================================" << "\n"
221  << "Analyzing new event" << "\n"
222  << "====================================================\n" << "\n";
223 
225  int PU_NumInteractions(-1);
226 
227  edm::ESHandle<ParametersDefinerForTP> Lhc_parametersDefinerTP;
228  std::unique_ptr<ParametersDefinerForTP> Cosmic_parametersDefinerTP;
229 
230  if(parametersDefiner=="LhcParametersDefinerForTP") {
231  setup.get<TrackAssociatorRecord>().get(parametersDefiner, Lhc_parametersDefinerTP);
232 
233  // PileupSummaryInfo is contained only in collision events
234  event.getByToken(pileupinfo_Token,puinfoH);
235  for (std::vector<PileupSummaryInfo>::const_iterator puInfoIt = puinfoH->begin(); puInfoIt != puinfoH->end(); ++puInfoIt) {
236  if (puInfoIt->getBunchCrossing()==0) {
237  PU_NumInteractions = puInfoIt->getPU_NumInteractions();
238  break;
239  }
240  }
241 
242  }
243  else if(parametersDefiner=="CosmicParametersDefinerForTP") {
244  edm::ESHandle<CosmicParametersDefinerForTP> _Cosmic_parametersDefinerTP;
245  setup.get<TrackAssociatorRecord>().get(parametersDefiner, _Cosmic_parametersDefinerTP);
246 
247  //Since we modify the object, we must clone it
248  Cosmic_parametersDefinerTP = _Cosmic_parametersDefinerTP->clone();
249 
251  //warning: make sure the TP collection used in the map is the same used here
252  event.getByToken(_simHitTpMapTag,simHitsTPAssoc);
253  Cosmic_parametersDefinerTP->initEvent(simHitsTPAssoc);
254  cosmictpSelector.initEvent(simHitsTPAssoc);
255  }
256  else {
257  edm::LogError("NewMuonTrackValidator")
258  << "Unexpected label: parametersDefiner = "<< parametersDefiner.c_str() << "\n";
259  }
260 
261  edm::Handle<TrackingParticleCollection> TPCollectionHeff ;
262  event.getByToken(tp_effic_Token,TPCollectionHeff);
263  TrackingParticleCollection const & tPCeff = *(TPCollectionHeff.product());
264 
265  edm::Handle<TrackingParticleCollection> TPCollectionHfake ;
266  event.getByToken(tp_fake_Token,TPCollectionHfake);
267 
268  edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
269  event.getByToken(bsSrc_Token,recoBeamSpotHandle);
270  reco::BeamSpot bs = *recoBeamSpotHandle;
271 
272  std::vector<const reco::TrackToTrackingParticleAssociator*> associator;
273  if (UseAssociators) {
275  for (auto const& associatorName : associators) {
276  event.getByLabel(associatorName,theAssociator);
277  associator.push_back( theAssociator.product() );
278  }
279  }
280 
281  int w=0;
282  for (unsigned int ww=0;ww<associators.size();ww++) {
283  for (unsigned int www=0;www<label.size();www++) {
284  //
285  //get collections from the event
286  //
288  unsigned int trackCollectionSize = 0;
289 
290  reco::RecoToSimCollection recSimColl;
291  reco::SimToRecoCollection simRecColl;
292 
293  // account for missing track collections (HLT case)
294  if (!event.getByToken(track_Collection_Token[www], trackCollection) && ignoremissingtkcollection_) {
295  recSimColl.post_insert();
296  simRecColl.post_insert();
297  }
298 
299  //associate tracks to TrackingParticles
300  else {
301  trackCollectionSize = trackCollection->size();
302 
303  if(UseAssociators) {
304  edm::LogVerbatim("NewMuonTrackValidator") << "Analyzing "
305  << label[www].process()<<":"
306  << label[www].label()<<":"
307  << label[www].instance()<<" with "
308  << associators[ww].c_str() <<"\n";
309 
310  LogTrace("NewMuonTrackValidator") << "Calling associateRecoToSim method" << "\n";
311  recSimColl = std::move(associator[ww]->associateRecoToSim(trackCollection,
312  TPCollectionHfake));
313  LogTrace("NewMuonTrackValidator") << "Calling associateSimToReco method" << "\n";
314  simRecColl = std::move(associator[ww]->associateSimToReco(trackCollection,
315  TPCollectionHeff));
316  } else {
317  edm::LogVerbatim("NewMuonTrackValidator") << "Analyzing "
318  << label[www].process()<<":"
319  << label[www].label()<<":"
320  << label[www].instance()<<" with "
321  << associatormap.process()<<":"
322  << associatormap.label()<<":"
323  << associatormap.instance()<<"\n";
324 
325  Handle<reco::SimToRecoCollection > simtorecoCollectionH;
326  event.getByToken(simToRecoCollection_Token,simtorecoCollectionH);
327  simRecColl = *simtorecoCollectionH.product();
328 
329  Handle<reco::RecoToSimCollection > recotosimCollectionH;
330  event.getByToken(recoToSimCollection_Token,recotosimCollectionH);
331  recSimColl = *recotosimCollectionH.product();
332  }
333  }
334 
335  //
336  //fill simulation histograms
337  //
338  edm::LogVerbatim("NewMuonTrackValidator") << "\n# of TrackingParticles: " << tPCeff.size() << "\n";
339  int ats = 0;
340  int st = 0;
341  for (TrackingParticleCollection::size_type i=0; i<tPCeff.size(); i++){
342  bool TP_is_matched = false;
343  bool isChargeOK = true;
344  double quality = 0.;
345 
346  TrackingParticleRef tpr(TPCollectionHeff, i);
347  TrackingParticle* tp = const_cast<TrackingParticle*>(tpr.get());
348 
349  TrackingParticle::Vector momentumTP;
350  TrackingParticle::Point vertexTP;
351  double dxySim = 0;
352  double dzSim = 0;
353 
354  //If the TrackingParticle is collision-like, get the momentum and vertex at production state
355  //and the impact parameters w.r.t. PCA
356  if(parametersDefiner=="LhcParametersDefinerForTP")
357  {
358  LogTrace("NewMuonTrackValidator") <<"TrackingParticle "<< i;
359  if(! tpSelector(*tp)) continue;
360  momentumTP = tp->momentum();
361  vertexTP = tp->vertex();
362  TrackingParticle::Vector momentum = Lhc_parametersDefinerTP->momentum(event,setup,tpr);
363  TrackingParticle::Point vertex = Lhc_parametersDefinerTP->vertex(event,setup,tpr);
364  dxySim = TrackingParticleIP::dxy(vertex, momentum, bs.position());
365  dzSim = TrackingParticleIP::dz(vertex, momentum, bs.position());
366  }
367  //for cosmics get the momentum and vertex at PCA
368  else if(parametersDefiner=="CosmicParametersDefinerForTP")
369  {
370  edm::LogVerbatim("NewMuonTrackValidator") <<"TrackingParticle "<< i;
371  if(! cosmictpSelector(tpr,&bs,event,setup)) continue;
372  momentumTP = Cosmic_parametersDefinerTP->momentum(event,setup,tpr);
373  vertexTP = Cosmic_parametersDefinerTP->vertex(event,setup,tpr);
374  dxySim = TrackingParticleIP::dxy(vertexTP, momentumTP, bs.position());
375  dzSim = TrackingParticleIP::dz(vertexTP, momentumTP, bs.position());
376  }
377  edm::LogVerbatim("NewMuonTrackValidator") <<"--------------------Selected TrackingParticle #"<<tpr.key();
378  edm::LogVerbatim("NewMuonTrackValidator") <<"momentumTP: pt = "<<sqrt(momentumTP.perp2())<<", pz = "<<momentumTP.z()
379  <<", \t vertexTP: radius = "<<sqrt(vertexTP.perp2())<< ", z = "<<vertexTP.z() <<"\n";
380  st++;
381 
382  double TPeta = momentumTP.eta();
383  double xTPeta = getEta(TPeta); // may be |eta| in histos according to useFabsEta
384  double TPpt = sqrt(momentumTP.perp2());
385  double xTPpt = getPt(TPpt); // may be 1/pt in histos according to useInvPt
386  double TPphi = momentumTP.phi();
387  double TPrpos = sqrt(vertexTP.perp2());
388  double TPzpos = vertexTP.z();
389 
390  // Number of counted SimHits depend on the selection of tracker and muon detectors (via cfg parameters)
391  int nSimHits = 0;
392  if (usetracker && usemuon) {
393  nSimHits= tpr.get()->numberOfHits();
394  }
395  else if (!usetracker && usemuon) {
396  nSimHits= tpr.get()->numberOfHits() - tpr.get()->numberOfTrackerHits();
397  }
398  else if (usetracker && !usemuon) {
399  nSimHits=tpr.get()->numberOfTrackerHits();
400  }
401  edm::LogVerbatim("NewMuonTrackValidator") << "\t N simhits = "<< nSimHits<<"\n";
402 
403  int assoc_recoTrack_NValidHits = 0;
404  if(simRecColl.find(tpr) != simRecColl.end()) {
405  auto const & rt = simRecColl[tpr];
406  if (!rt.empty()) {
407  RefToBase<Track> assoc_recoTrack = rt.begin()->first;
408  edm::LogVerbatim("NewMuonTrackValidator")<<"-----------------------------associated Track #"<<assoc_recoTrack.key();
409  TP_is_matched = true;
410  ats++;
411  if (assoc_recoTrack->charge() != tpr->charge()) isChargeOK = false;
412  quality = rt.begin()->second;
413  assoc_recoTrack_NValidHits = assoc_recoTrack->numberOfValidHits();
414  edm::LogVerbatim("NewMuonTrackValidator") << "TrackingParticle #" <<tpr.key()
415  << " with pt=" << sqrt(momentumTP.perp2())
416  << " associated with quality:" << quality <<"\n";
417  }
418  } else {
419  edm::LogVerbatim("NewMuonTrackValidator")
420  << "TrackingParticle #" << tpr.key()
421  << " with pt,eta,phi: "
422  << sqrt(momentumTP.perp2()) << " , "<< momentumTP.eta() << " , "<< momentumTP.phi() << " , "
423  << " NOT associated to any reco::Track" << "\n";
424  }
425 
426  // histos for efficiency vs eta
427 
428  fillPlotNoFlow(h_simuleta[w], xTPeta);
429  if (TP_is_matched) {
430  fillPlotNoFlow(h_assoceta[w], xTPeta);
431  if (!isChargeOK) fillPlotNoFlow(h_misideta[w], xTPeta);
432  }
433 
434  // histos for efficiency vs phi
435  fillPlotNoFlow(h_simulphi[w], TPphi);
436  if (TP_is_matched) {
437  fillPlotNoFlow(h_assocphi[w], TPphi);
438  if (!isChargeOK) fillPlotNoFlow(h_misidphi[w], TPphi);
439  }
440 
441  // histos for efficiency vs pT
442  fillPlotNoFlow(h_simulpT[w], xTPpt);
443  if (TP_is_matched) {
444  fillPlotNoFlow(h_assocpT[w], xTPpt);
445  if (!isChargeOK) fillPlotNoFlow(h_misidpT[w], xTPpt);
446  }
447 
448  // histos for efficiency vs dxy
449  fillPlotNoFlow(h_simuldxy[w], dxySim);
450  if (TP_is_matched) {
451  fillPlotNoFlow(h_assocdxy[w], dxySim);
452  if (!isChargeOK) fillPlotNoFlow(h_misiddxy[w], dxySim);
453  }
454 
455  // histos for efficiency vs dz
456  fillPlotNoFlow(h_simuldz[w], dzSim);
457  if (TP_is_matched) {
458  fillPlotNoFlow(h_assocdz[w], dzSim);
459  if (!isChargeOK) fillPlotNoFlow(h_misiddz[w], dzSim);
460  }
461 
462  // histos for efficiency vs Radius
463  fillPlotNoFlow(h_simulRpos[w], TPrpos);
464  if (TP_is_matched) fillPlotNoFlow(h_assocRpos[w], TPrpos);
465 
466  // histos for efficiency vs z position
467  fillPlotNoFlow(h_simulZpos[w], TPzpos);
468  if (TP_is_matched) fillPlotNoFlow(h_assocZpos[w], TPzpos);
469 
470  // histos for efficiency vs Number of Hits
471  fillPlotNoFlow(h_simulhit[w], nSimHits );
472  if (TP_is_matched) {
473  fillPlotNoFlow(h_assochit[w], nSimHits );
474  nRecHits_vs_nSimHits[w]->Fill(nSimHits, assoc_recoTrack_NValidHits);
475 
476  // charge misid is more useful w.r.t. nRecHits (filled after)
477  //if (!isChargeOK) fillPlotNoFlow(h_misidhit[w], nSimHits);
478  }
479 
480  // histos for efficiency vs PileUp
481  fillPlotNoFlow(h_simulpu[w], PU_NumInteractions);
482  if (TP_is_matched) {
483  fillPlotNoFlow(h_assocpu[w], PU_NumInteractions);
484  if (!isChargeOK) fillPlotNoFlow(h_misidpu[w], PU_NumInteractions);
485  }
486 
487  } // End for (TrackingParticleCollection::size_type i=0; i<tPCeff.size(); i++){
488 
489  //
490  //fill reconstructed track histograms
491  //
492  edm::LogVerbatim("NewMuonTrackValidator") << "\n# of reco::Tracks with "
493  << label[www].process()<<":"
494  << label[www].label()<<":"
495  << label[www].instance()
496  << ": " << trackCollectionSize << "\n";
497 
498  int at = 0;
499  int rT = 0;
500  for(edm::View<Track>::size_type i=0; i<trackCollectionSize; ++i) {
501  bool Track_is_matched = false;
502  bool isChargeOK = true;
503  RefToBase<Track> track(trackCollection, i);
504  rT++;
505 
506  std::vector<std::pair<TrackingParticleRef, double> > tp;
508 
509  // new logic (bidirectional)
511  edm::LogVerbatim("NewMuonTrackValidator")<<"----------------------------------------Track #"<< track.key();
512 
513  if(recSimColl.find(track) != recSimColl.end()) {
514  tp = recSimColl[track];
515  if (!tp.empty()) {
516  tpr = tp.begin()->first;
517  // RtS and StR must associate the same pair !
518  if(simRecColl.find(tpr) != simRecColl.end()) {
519  auto const & assoc_track_checkback = simRecColl[tpr].begin()->first;
520 
521  if ( assoc_track_checkback.key() == track.key() ) {
522  edm::LogVerbatim("NewMuonTrackValidator")<<"------------------associated TrackingParticle #"<<tpr.key();
523  Track_is_matched = true;
524  at++;
525  if (track->charge() != tpr->charge()) isChargeOK = false;
526  double Purity = tp.begin()->second;
527  double Quality = simRecColl[tpr].begin()->second;
528  edm::LogVerbatim("NewMuonTrackValidator") << "reco::Track #" << track.key() << " with pt=" << track->pt()
529  << " associated with purity:" << Purity <<"\n";
530  if (MABH) h_PurityVsQuality[w]->Fill(Quality,Purity);
531  }
532  }
533  }
534  }
535 
536  if (!Track_is_matched)
537  edm::LogVerbatim("NewMuonTrackValidator")
538  << "reco::Track #" << track.key() << " with pt=" << track->pt() << " NOT associated to any TrackingParticle" << "\n";
539  }
540  // old logic, valid for cosmics 2-legs reco (bugged for collision scenario)
541  else {
542  if(recSimColl.find(track) != recSimColl.end()){
543  tp = recSimColl[track];
544  if (!tp.empty()) {
545  tpr = tp.begin()->first;
546  Track_is_matched = true;
547  at++;
548  if (track->charge() != tpr->charge()) isChargeOK = false;
549  edm::LogVerbatim("NewMuonTrackValidator") << "reco::Track #" << track.key() << " with pt=" << track->pt()
550  << " associated with quality:" << tp.begin()->second <<"\n";
551  }
552  } else {
553  edm::LogVerbatim("NewMuonTrackValidator") << "reco::Track #" << track.key() << " with pt=" << track->pt()
554  << " NOT associated to any TrackingParticle" << "\n";
555  }
556  }
557 
558  //
559  int nRecHits = track->numberOfValidHits();
560  edm::LogVerbatim("NewMuonTrackValidator") << "\t N valid rechits = "<< nRecHits <<"\n";
561 
562  double etaRec = track->eta();
563  double xetaRec = getEta(etaRec);
564 
565  double ptRec = track->pt();
566  double xptRec = getPt(ptRec);
567 
568  double qoverpRec = track->qoverp();
569  double phiRec = track->phi();
570  double thetaRec = track->theta();
571  double dxyRec = track->dxy(bs.position());
572  double dzRec = track->dz(bs.position());
573 
574  double qoverpError = track->qoverpError();
575  double ptError = track->ptError();
576  double thetaError = track->thetaError();
577  double phiError = track->phiError();
578  double dxyError = track->dxyError();
579  double dzError = track->dzError();
580 
581  // histos for fake rate vs eta
582  fillPlotNoFlow(h_recoeta[w], xetaRec);
583  if (Track_is_matched) {
584  fillPlotNoFlow(h_assoc2eta[w], xetaRec);
585  }
586 
587  // histos for fake rate vs phi
588  fillPlotNoFlow(h_recophi[w], phiRec);
589  if (Track_is_matched) {
590  fillPlotNoFlow(h_assoc2phi[w], phiRec);
591  }
592 
593  // histos for fake rate vs pT
594  fillPlotNoFlow(h_recopT[w], xptRec);
595  if (Track_is_matched) {
596  fillPlotNoFlow(h_assoc2pT[w], xptRec);
597  }
598 
599  // histos for fake rate vs dxy
600  fillPlotNoFlow(h_recodxy[w], dxyRec);
601  if (Track_is_matched) {
602  fillPlotNoFlow(h_assoc2dxy[w], dxyRec);
603  }
604 
605  // histos for fake rate vs dz
606  fillPlotNoFlow(h_recodz[w], dzRec);
607  if (Track_is_matched) {
608  fillPlotNoFlow(h_assoc2dz[w], dzRec);
609  }
610 
611  // histos for fake rate vs Number of RecHits in track
612  fillPlotNoFlow(h_recohit[w], nRecHits);
613  if (Track_is_matched) {
614  fillPlotNoFlow(h_assoc2hit[w], nRecHits);
615  // charge misid w.r.t. nRecHits
616  if (!isChargeOK) fillPlotNoFlow(h_misidhit[w], nRecHits);
617  }
618 
619  // histos for fake rate vs Number of PU interactions
620  fillPlotNoFlow(h_recopu[w], PU_NumInteractions);
621  if (Track_is_matched) {
622  fillPlotNoFlow(h_assoc2pu[w], PU_NumInteractions);
623  }
624 
625  // Fill other histos
626  TrackingParticle* tpp = const_cast<TrackingParticle*>(tpr.get());
627  // TrackingParticle parameters at point of closest approach to the beamline
628  TrackingParticle::Vector momentumTP;
629  TrackingParticle::Point vertexTP;
630 
631  if (parametersDefiner=="LhcParametersDefinerForTP") {
632  // following reco plots are made only from tracks associated to selected signal TPs
633  if (! (Track_is_matched && tpSelector(*tpp)) ) continue;
634  else {
635  momentumTP = Lhc_parametersDefinerTP->momentum(event,setup,tpr) ;
636  vertexTP = Lhc_parametersDefinerTP->vertex(event,setup,tpr);
637  }
638  }
639  else if (parametersDefiner=="CosmicParametersDefinerForTP") {
640  // following reco plots are made only from tracks associated to selected signal TPs
641  if (! (Track_is_matched && cosmictpSelector(tpr,&bs,event,setup)) ) continue;
642  else {
643  momentumTP = Cosmic_parametersDefinerTP->momentum(event,setup,tpr) ;
644  vertexTP = Cosmic_parametersDefinerTP->vertex(event,setup,tpr);
645  }
646  }
647 
648  if (associators[ww]=="trackAssociatorByChi2"){
649  //association chi2
650  double assocChi2 = -tp.begin()->second;//in association map is stored -chi2
651  h_assochi2[www]->Fill(assocChi2);
652  h_assochi2_prob[www]->Fill(TMath::Prob((assocChi2)*5,5));
653  }
654  else if (associators[ww]=="trackAssociatorByHits"){
655  double fraction = tp.begin()->second;
656  h_assocFraction[www]->Fill(fraction);
657  h_assocSharedHit[www]->Fill(fraction*nRecHits);
658  }
659 
660  h_charge[w]->Fill(track->charge());
661 
662  // Hits
663  h_nhits[w]->Fill(nRecHits);
664  nhits_vs_eta[w]->Fill(xetaRec, nRecHits);
665  nhits_vs_phi[w]->Fill(phiRec, nRecHits);
666 
667  if (do_MUOhitsPlots) {
668  nDThits_vs_eta[w]->Fill(xetaRec,track->hitPattern().numberOfValidMuonDTHits());
669  nCSChits_vs_eta[w]->Fill(xetaRec,track->hitPattern().numberOfValidMuonCSCHits());
670  nRPChits_vs_eta[w]->Fill(xetaRec,track->hitPattern().numberOfValidMuonRPCHits());
671  if(useGEMs_) nGEMhits_vs_eta[w]->Fill(xetaRec,track->hitPattern().numberOfValidMuonGEMHits());
672  if(useME0_) nME0hits_vs_eta[w]->Fill(xetaRec,track->hitPattern().numberOfValidMuonME0Hits());
673  }
674 
675  if (do_TRKhitsPlots) {
676  nTRK_LayersWithMeas_vs_eta[w]->Fill(xetaRec,track->hitPattern().trackerLayersWithMeasurement());
677  nPixel_LayersWithMeas_vs_eta[w]->Fill(xetaRec,track->hitPattern().pixelLayersWithMeasurement());
678  h_nlosthits[w]->Fill(track->numberOfLostHits());
679  h_nmisslayers_inner[w]->Fill(track->hitPattern().numberOfLostHits(reco::HitPattern::MISSING_INNER_HITS));
680  h_nmisslayers_outer[w]->Fill(track->hitPattern().numberOfLostHits(reco::HitPattern::MISSING_OUTER_HITS));
681  nlosthits_vs_eta[w]->Fill(xetaRec,track->numberOfLostHits());
682  }
683 
684  // normalized chi2
685  h_nchi2[w]->Fill(track->normalizedChi2());
686  h_nchi2_prob[w]->Fill(TMath::Prob(track->chi2(),(int)track->ndof()));
687  chi2_vs_nhits[w]->Fill(nRecHits, track->normalizedChi2());
688  chi2_vs_eta[w]->Fill(xetaRec, track->normalizedChi2());
689  chi2_vs_phi[w]->Fill(phiRec,track->normalizedChi2());
690 
691  double ptSim = sqrt(momentumTP.perp2());
692  double xptSim = getPt(ptSim);
693  double qoverpSim = tpr->charge() /
694  sqrt(momentumTP.x()*momentumTP.x()+momentumTP.y()*momentumTP.y()+momentumTP.z()*momentumTP.z());
695  double etaSim = momentumTP.eta();
696  double thetaSim = momentumTP.theta();
697  double phiSim = momentumTP.phi();
698  double dxySim = TrackingParticleIP::dxy(vertexTP, momentumTP, bs.position());
699  double dzSim = TrackingParticleIP::dz(vertexTP, momentumTP, bs.position());
700 
701  double etares = etaRec - etaSim;
702  double ptRelRes = (ptRec - ptSim) / ptSim; // relative residual -> resolution
703  double ptPull = (ptRec - ptSim) / ptError;
704  double qoverpPull = (qoverpRec-qoverpSim) / qoverpError;
705  double thetaPull = (thetaRec - thetaSim) / thetaError;
706  double phiDiff = phiRec - phiSim;
707  if (abs(phiDiff) > M_PI) {
708  if (phiDiff >0.) phiDiff = phiDiff - 2.*M_PI;
709  else phiDiff = phiDiff + 2.*M_PI;
710  }
711  double phiPull = phiDiff / phiError;
712  double dxyPull = (dxyRec-dxySim) / dxyError;
713  double dzPull = (dzRec-dzSim) / dzError;
714 
715  h_etaRes[w]->Fill(etares);
716  etares_vs_eta[w]->Fill(xetaRec, etares);
717 
718  ptres_vs_eta[w]->Fill(xetaRec,ptRelRes);
719  ptres_vs_pt[w]->Fill(xptSim,ptRelRes);
720  ptres_vs_phi[w]->Fill(phiRec,ptRelRes);
721  h_ptpull[w]->Fill(ptPull);
722  ptpull_vs_eta[w]->Fill(xetaRec,ptPull);
723  ptpull_vs_phi[w]->Fill(phiRec,ptPull);
724  h_qoverppull[w]->Fill(qoverpPull);
725 
726  thetaCotres_vs_eta[w]->Fill(xetaRec, cos(thetaRec)/sin(thetaRec) - cos(thetaSim)/sin(thetaSim));
727  thetaCotres_vs_pt[w]->Fill(xptSim, cos(thetaRec)/sin(thetaRec) - cos(thetaSim)/sin(thetaSim));
728  h_thetapull[w]->Fill(thetaPull);
729  thetapull_vs_eta[w]->Fill(xetaRec,thetaPull);
730  thetapull_vs_phi[w]->Fill(phiRec,thetaPull);
731 
732  phires_vs_eta[w]->Fill(xetaRec,phiDiff);
733  phires_vs_pt[w]->Fill(xptSim,phiDiff);
734  phires_vs_phi[w]->Fill(phiRec,phiDiff);
735  h_phipull[w]->Fill(phiPull);
736  phipull_vs_eta[w]->Fill(xetaRec,phiPull);
737  phipull_vs_phi[w]->Fill(phiRec,phiPull);
738 
739  dxyres_vs_eta[w]->Fill(xetaRec,dxyRec-dxySim);
740  dxyres_vs_pt[w]->Fill(xptSim,dxyRec-dxySim);
741  h_dxypull[w]->Fill(dxyPull);
742  dxypull_vs_eta[w]->Fill(xetaRec,dxyPull);
743 
744  dzres_vs_eta[w]->Fill(xetaRec,dzRec-dzSim);
745  dzres_vs_pt[w]->Fill(xptSim,dzRec-dzSim);
746  h_dzpull[w]->Fill(dzPull);
747  dzpull_vs_eta[w]->Fill(xetaRec,dzPull);
748 
749  double contrib_Qoverp = qoverpPull*qoverpPull/5;
750  double contrib_dxy = dxyPull*dxyPull/5;
751  double contrib_dz = dzPull*dzPull/5;
752  double contrib_theta = thetaPull*thetaPull/5;
753  double contrib_phi = phiPull*phiPull/5;
754  double assoChi2 = contrib_Qoverp+contrib_dxy+contrib_dz+contrib_theta+contrib_phi;
755 
756  edm::LogVerbatim("NewMuonTrackValidator") << "normalized Chi2 (track 5-dofs matching) = "<<assoChi2 <<"\n"
757  << "\t contrib_Qoverp = " << contrib_Qoverp << "\n"
758  << "\t contrib_theta = " << contrib_theta << "\n"
759  << "\t contrib_phi = " << contrib_phi << "\n"
760  << "\t contrib_dxy = " << contrib_dxy << "\n"
761  << "\t contrib_dz = " << contrib_dz << "\n";
762 
763  edm::LogVerbatim("NewMuonTrackValidator") << "ptRec = " << ptRec << "\n"
764  << "etaRec = " << etaRec << "\n"
765  << "qoverpRec = " << qoverpRec << "\n"
766  << "thetaRec = " << thetaRec << "\n"
767  << "phiRec = " << phiRec << "\n"
768  << "dxyRec = " << dxyRec << "\n"
769  << "dzRec = " << dzRec << "\n"
770  << "" << "\n"
771  << "qoverpError = " << qoverpError << "\n"
772  << "thetaError = " << thetaError << "\n"
773  << "phiError = " << phiError << "\n"
774  << "dxyError = " << dxyError << "\n"
775  << "dzError = " << dzError << "\n"
776  << "" << "\n"
777  << "ptSim = " << ptSim << "\n"
778  << "etaSim = " << etaSim << "\n"
779  << "qoverpSim = " << qoverpSim << "\n"
780  << "thetaSim = " << thetaSim << "\n"
781  << "phiSim = " << phiSim << "\n"
782  << "dxySim = " << dxySim << "\n"
783  << "dzSim = " << dzSim << "\n";
784  } // End of for(edm::View<Track>::size_type i=0; i<trackCollectionSize; ++i) {
785 
786  h_tracks[w]->Fill(at);
787  h_fakes[w]->Fill(rT-at);
788  edm::LogVerbatim("NewMuonTrackValidator") << "Total Simulated: " << st << "\n"
789  << "Total Associated (simToReco): " << ats << "\n"
790  << "Total Reconstructed: " << rT << "\n"
791  << "Total Associated (recoToSim): " << at << "\n"
792  << "Total Fakes: " << rT-at << "\n";
793  w++;
794  } // End of for (unsigned int www=0;www<label.size();www++){
795  } //END of for (unsigned int ww=0;ww<associators.size();ww++){
796 }
double qoverp() const
q / p
Definition: TrackBase.h:573
unsigned int size_type
Definition: View.h:90
const double w
Definition: UKUtility.cc:23
std::vector< TrackingParticle > TrackingParticleCollection
Vector momentum() const
spatial momentum vector
const_iterator end() const
last iterator over the map (read only)
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
Definition: TrackBase.h:561
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:519
double theta() const
polar angle
Definition: TrackBase.h:579
double dxyError() const
error on dxy
Definition: TrackBase.h:796
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
const_iterator find(const key_type &k) const
find element with specified reference key
def replace(string, replacements)
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:1
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:645
unsigned short numberOfLostHits() const
number of cases where track crossed a layer without getting a hit.
Definition: TrackBase.h:826
double maxEta
key_type key() const
Accessor for product key.
Definition: Ref.h:265
int pixelLayersWithMeasurement() const
Definition: HitPattern.cc:499
void analyze(const edm::Event &, const edm::EventSetup &) override
Method called before the event loop.
uint16_t size_type
int trackerLayersWithMeasurement() const
Definition: HitPattern.cc:518
int numberOfValidMuonCSCHits() const
Definition: HitPattern.h:883
int numberOfValidMuonRPCHits() const
Definition: HitPattern.h:888
math::XYZPointD Point
point in the space
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:651
double chi2() const
chi-squared of the fit
Definition: TrackBase.h:549
auto dz(const T_Vertex &vertex, const T_Momentum &momentum, const T_Point &point)
size_t key() const
Definition: RefToBase.h:250
void post_insert()
post insert action
double ndof() const
number of degrees of freedom of the fit
Definition: TrackBase.h:555
T sqrt(T t)
Definition: SSEVec.h:18
double pt() const
track transverse momentum
Definition: TrackBase.h:621
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
double ptError() const
error on Pt (set to 1000 TeV if charge==0 for safety)
Definition: TrackBase.h:763
double phiError() const
error on phi
Definition: TrackBase.h:790
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:118
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
virtual TrackingParticle::Vector momentum(const edm::Event &iEvent, const edm::EventSetup &iSetup, const Charge ch, const Point &vtx, const LorentzVector &lv) const
unsigned short numberOfValidHits() const
number of valid hits found
Definition: TrackBase.h:820
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:245
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Method called at the end of the event loop.
#define LogTrace(id)
#define M_PI
double qoverpError() const
error on signed transverse curvature
Definition: TrackBase.h:757
double dz() const
dz parameter (= dsz/cos(lambda)). This is the track z0 w.r.t (0,0,0) only if the refPoint is close to...
Definition: TrackBase.h:609
double dzError() const
error on dz
Definition: TrackBase.h:814
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:279
T const * product() const
Definition: Handle.h:81
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:136
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:446
const T & get() const
Definition: EventSetup.h:58
int numberOfLostHits(HitCategory category) const
Definition: HitPattern.h:902
std::string const & label() const
Definition: InputTag.h:36
Point vertex() const
Parent vertex position.
std::string const & process() const
Definition: InputTag.h:40
std::unique_ptr< ParametersDefinerForTP > clone() const override
int numberOfValidMuonGEMHits() const
Definition: HitPattern.h:893
fixed size matrix
HLT enums.
auto dxy(const T_Vertex &vertex, const T_Momentum &momentum, const T_Point &point)
int numberOfValidMuonME0Hits() const
Definition: HitPattern.h:898
int numberOfValidMuonDTHits() const
Definition: HitPattern.h:878
Monte Carlo truth information used for tracking validation.
int charge() const
track electric charge
Definition: TrackBase.h:567
const Point & position() const
position
Definition: BeamSpot.h:62
const_iterator begin() const
first iterator over the map (read only)
math::XYZVectorD Vector
point in the space
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
Definition: TrackBase.h:591
std::string const & instance() const
Definition: InputTag.h:37
def move(src, dest)
Definition: eostools.py:510
Definition: event.py:1
Definition: Run.h:43
double thetaError() const
error on theta
Definition: TrackBase.h:772
virtual TrackingParticle::Point vertex(const edm::Event &iEvent, const edm::EventSetup &iSetup, const Charge ch, const Point &vtx, const LorentzVector &lv) const