CMS 3D CMS Logo

ValidationMisalignedTracker.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: ValidationMisalignedTracker
4 // Class: ValidationMisalignedTracker
5 //
13 //
14 // Original Author: Nicola De Filippis
15 // Created: Thu Dec 14 13:13:32 CET 2006
16 // $Id: ValidationMisalignedTracker.cc,v 1.8 2013/01/07 20:46:23 wmtan Exp $
17 //
18 //
19 
21 
22 // user include files
23 
28 
34 
35 //
36 // constructors and destructor
37 //
39  : geomToken_(esConsumes()), magFieldToken_(esConsumes()) {
40  //now do what ever initialization is needed
41  mzmu = 0., recmzmu = 0., ptzmu = 0., recptzmu = 0., etazmu = 0., recetazmu = 0., thetazmu = 0., recthetazmu = 0.,
42  phizmu = 0., recphizmu = 0.;
43  recenezmu = 0., enezmu = 0., pLzmu = 0., recpLzmu = 0., yzmu = 0., recyzmu = 0., mxptmu = 0., recmxptmu = 0.,
44  minptmu = 0., recminptmu = 0.;
45  // mzele=0.,recmzele=0.
46 
47  flag = 0, flagrec = 0, count = 0, countrec = 0;
48  nAssoc = 0;
49 
50  for (int i = 0; i < 2; i++) {
51  countpart[i] = 0;
52  countpartrec[i] = 0;
53  for (int j = 0; j < 2; j++) {
54  ene[i][j] = 0.;
55  p[i][j] = 0.;
56  px[i][j] = 0.;
57  py[i][j] = 0.;
58  pz[i][j] = 0.;
59  ptmu[i][j] = 0.;
60  recene[i][j] = 0.;
61  recp[i][j] = 0.;
62  recpx[i][j] = 0.;
63  recpy[i][j] = 0.;
64  recpz[i][j] = 0.;
65  recptmu[i][j] = 0.;
66  }
67  }
68 
69  eventCount_ = 0;
70 
71  selection_eff = iConfig.getUntrackedParameter<bool>("selection_eff", false);
72  selection_fake = iConfig.getUntrackedParameter<bool>("selection_fake", true);
73  ZmassSelection_ = iConfig.getUntrackedParameter<bool>("ZmassSelection", false);
74  simobject = iConfig.getUntrackedParameter<std::string>("simobject", "g4SimHits");
75  trackassociator = iConfig.getUntrackedParameter<std::string>("TrackAssociator", "ByHits");
76  associators = iConfig.getParameter<std::vector<std::string> >("associators");
77  label = iConfig.getParameter<std::vector<edm::InputTag> >("label");
78  label_tp_effic = iConfig.getParameter<edm::InputTag>("label_tp_effic");
79  label_tp_fake = iConfig.getParameter<edm::InputTag>("label_tp_fake");
80 
81  rootfile_ = iConfig.getUntrackedParameter<std::string>("rootfile", "myroot.root");
82  file_ = new TFile(rootfile_.c_str(), "RECREATE");
83 
84  // initialize the tree
85  tree_eff = new TTree("EffTracks", "Efficiency Tracks Tree");
86 
87  tree_eff->Branch("Run", &irun, "irun/i");
88  tree_eff->Branch("Event", &ievt, "ievt/i");
89 
90  // SimTrack
91  tree_eff->Branch("TrackID", &trackType, "trackType/i");
92  tree_eff->Branch("pt", &pt, "pt/F");
93  tree_eff->Branch("eta", &eta, "eta/F");
94  tree_eff->Branch("CotTheta", &cottheta, "cottheta/F");
95  tree_eff->Branch("phi", &phi, "phi/F");
96  tree_eff->Branch("d0", &d0, "d0/F");
97  tree_eff->Branch("z0", &z0, "z0/F");
98  tree_eff->Branch("nhit", &nhit, "nhit/i");
99 
100  // RecTrack
101  tree_eff->Branch("recpt", &recpt, "recpt/F");
102  tree_eff->Branch("receta", &receta, "receta/F");
103  tree_eff->Branch("CotRecTheta", &reccottheta, "reccottheta/F");
104  tree_eff->Branch("recphi", &recphi, "recphi/F");
105  tree_eff->Branch("recd0", &recd0, "recd0/F");
106  tree_eff->Branch("recz0", &recz0, "recz0/F");
107  tree_eff->Branch("nAssoc", &nAssoc, "nAssoc/i");
108  tree_eff->Branch("recnhit", &recnhit, "recnhit/i");
109  tree_eff->Branch("CHISQ", &recchiq, "recchiq/F");
110 
111  tree_eff->Branch("reseta", &reseta, "reseta/F");
112  tree_eff->Branch("respt", &respt, "respt/F");
113  tree_eff->Branch("resd0", &resd0, "resd0/F");
114  tree_eff->Branch("resz0", &resz0, "resz0/F");
115  tree_eff->Branch("resphi", &resphi, "resphi/F");
116  tree_eff->Branch("rescottheta", &rescottheta, "rescottheta/F");
117  tree_eff->Branch("eff", &eff, "eff/F");
118 
119  // Invariant masses, pt of Z
120  tree_eff->Branch("mzmu", &mzmu, "mzmu/F");
121  tree_eff->Branch("ptzmu", &ptzmu, "ptzmu/F");
122  tree_eff->Branch("pLzmu", &pLzmu, "pLzmu/F");
123  tree_eff->Branch("enezmu", &enezmu, "enezmu/F");
124  tree_eff->Branch("etazmu", &etazmu, "etazmu/F");
125  tree_eff->Branch("thetazmu", &thetazmu, "thetazmu/F");
126  tree_eff->Branch("phizmu", &phizmu, "phizmu/F");
127  tree_eff->Branch("yzmu", &yzmu, "yzmu/F");
128  tree_eff->Branch("mxptmu", &mxptmu, "mxptmu/F");
129  tree_eff->Branch("minptmu", &minptmu, "minptmu/F");
130 
131  tree_eff->Branch("recmzmu", &recmzmu, "recmzmu/F");
132  tree_eff->Branch("recptzmu", &recptzmu, "recptzmu/F");
133  tree_eff->Branch("recpLzmu", &recpLzmu, "recpLzmu/F");
134  tree_eff->Branch("recenezmu", &recenezmu, "recenezmu/F");
135  tree_eff->Branch("recetazmu", &recetazmu, "recetazmu/F");
136  tree_eff->Branch("recthetazmu", &recthetazmu, "recthetazmu/F");
137  tree_eff->Branch("recphizmu", &recphizmu, "recphizmu/F");
138  tree_eff->Branch("recyzmu", &recyzmu, "recyzmu/F");
139  tree_eff->Branch("recmxptmu", &recmxptmu, "recmxptmu/F");
140  tree_eff->Branch("recminptmu", &recminptmu, "recminptmu/F");
141 
142  //tree->Branch("mzele",&ntmzele,"ntmzele/F");
143  //tree->Branch("recmzele",&ntmzeleRec,"ntmzeleRec/F");
144  tree_eff->Branch("chi2Associator", &recchiq, "recchiq/F");
145 
146  // Fake
147 
148  tree_fake = new TTree("FakeTracks", "Fake Rate Tracks Tree");
149 
150  tree_fake->Branch("Run", &irun, "irun/i");
151  tree_fake->Branch("Event", &ievt, "ievt/i");
152 
153  // SimTrack
154  tree_fake->Branch("fakeTrackID", &faketrackType, "faketrackType/i");
155  tree_fake->Branch("fakept", &fakept, "fakept/F");
156  tree_fake->Branch("fakeeta", &fakeeta, "fakeeta/F");
157  tree_fake->Branch("fakeCotTheta", &fakecottheta, "fakecottheta/F");
158  tree_fake->Branch("fakephi", &fakephi, "fakephi/F");
159  tree_fake->Branch("faked0", &faked0, "faked0/F");
160  tree_fake->Branch("fakez0", &fakez0, "fakez0/F");
161  tree_fake->Branch("fakenhit", &fakenhit, "fakenhit/i");
162 
163  // RecTrack
164  tree_fake->Branch("fakerecpt", &fakerecpt, "fakerecpt/F");
165  tree_fake->Branch("fakereceta", &fakereceta, "fakereceta/F");
166  tree_fake->Branch("fakeCotRecTheta", &fakereccottheta, "fakereccottheta/F");
167  tree_fake->Branch("fakerecphi", &fakerecphi, "fakerecphi/F");
168  tree_fake->Branch("fakerecd0", &fakerecd0, "fakerecd0/F");
169  tree_fake->Branch("fakerecz0", &fakerecz0, "fakerecz0/F");
170  tree_fake->Branch("fakenAssoc", &fakenAssoc, "fakenAssoc/i");
171  tree_fake->Branch("fakerecnhit", &fakerecnhit, "fakerecnhit/i");
172  tree_fake->Branch("fakeCHISQ", &fakerecchiq, "fakerecchiq/F");
173 
174  tree_fake->Branch("fakereseta", &fakereseta, "fakereseta/F");
175  tree_fake->Branch("fakerespt", &fakerespt, "fakerespt/F");
176  tree_fake->Branch("fakeresd0", &fakeresd0, "fakeresd0/F");
177  tree_fake->Branch("fakeresz0", &fakeresz0, "fakeresz0/F");
178  tree_fake->Branch("fakeresphi", &fakeresphi, "fakeresphi/F");
179  tree_fake->Branch("fakerescottheta", &fakerescottheta, "fakerescottheta/F");
180  tree_fake->Branch("fake", &fake, "fake/F");
181 
182  // Invariant masses, pt of Z
183  tree_fake->Branch("fakemzmu", &fakemzmu, "fakemzmu/F");
184  tree_fake->Branch("fakeptzmu", &fakeptzmu, "fakeptzmu/F");
185  tree_fake->Branch("fakepLzmu", &fakepLzmu, "fakepLzmu/F");
186  tree_fake->Branch("fakeenezmu", &fakeenezmu, "fakeenezmu/F");
187  tree_fake->Branch("fakeetazmu", &fakeetazmu, "fakeetazmu/F");
188  tree_fake->Branch("fakethetazmu", &fakethetazmu, "fakethetazmu/F");
189  tree_fake->Branch("fakephizmu", &fakephizmu, "fakephizmu/F");
190  tree_fake->Branch("fakeyzmu", &fakeyzmu, "fakeyzmu/F");
191  tree_fake->Branch("fakemxptmu", &fakemxptmu, "fakemxptmu/F");
192  tree_fake->Branch("fakeminptmu", &fakeminptmu, "fakeminptmu/F");
193 
194  tree_fake->Branch("fakerecmzmu", &fakerecmzmu, "fakerecmzmu/F");
195  tree_fake->Branch("fakerecptzmu", &fakerecptzmu, "fakerecptzmu/F");
196  tree_fake->Branch("fakerecpLzmu", &fakerecpLzmu, "fakerecpLzmu/F");
197  tree_fake->Branch("fakerecenezmu", &fakerecenezmu, "fakerecenezmu/F");
198  tree_fake->Branch("fakerecetazmu", &fakerecetazmu, "fakerecetazmu/F");
199  tree_fake->Branch("fakerecthetazmu", &fakerecthetazmu, "fakerecthetazmu/F");
200  tree_fake->Branch("fakerecphizmu", &fakerecphizmu, "fakerecphizmu/F");
201  tree_fake->Branch("fakerecyzmu", &fakerecyzmu, "fakerecyzmu/F");
202  tree_fake->Branch("fakerecmxptmu", &fakerecmxptmu, "fakerecmxptmu/F");
203  tree_fake->Branch("fakerecminptmu", &fakerecminptmu, "fakerecminptmu/F");
204 
205  tree_fake->Branch("fakechi2Associator", &fakerecchiq, "fakerecchiq/F");
206 }
207 
209  std::cout << "ValidationMisalignedTracker::endJob Processed " << eventCount_ << " events" << std::endl;
210 
211  // store the tree in the output file
212  file_->Write();
213 
214  // Closing the file deletes the tree.
215  file_->Close();
216  tree_eff = nullptr;
217  tree_fake = nullptr;
218 }
219 
220 //
221 // member functions
222 //
223 
224 // ------------ method called to for each event ------------
226  std::vector<const reco::TrackToTrackingParticleAssociator*> associatore;
227 
228  {
230  for (unsigned int w = 0; w < associators.size(); w++) {
231  iEvent.getByLabel(associators[w], theAssociator);
232  associatore.push_back(theAssociator.product());
233  }
234  }
235 
236  edm::LogInfo("Tracker Misalignment Validation") << "\n Starting!";
237 
238  // Monte Carlo Z selection
239  skip = false;
240  std::vector<int> indmu;
241 
244  iEvent.getByLabel("source", evt);
245  bool accepted = false;
246  bool foundmuons = false;
247  HepMC::GenEvent* myGenEvent = new HepMC::GenEvent(*(evt->GetEvent()));
248 
249  for (HepMC::GenEvent::particle_iterator p = myGenEvent->particles_begin(); p != myGenEvent->particles_end(); ++p) {
250  if (!accepted && ((*p)->pdg_id() == 23) && (*p)->status() == 3) {
251  accepted = true;
252  for (HepMC::GenVertex::particle_iterator aDaughter = (*p)->end_vertex()->particles_begin(HepMC::descendants);
253  aDaughter != (*p)->end_vertex()->particles_end(HepMC::descendants);
254  aDaughter++) {
255  if (abs((*aDaughter)->pdg_id()) == 13) {
256  foundmuons = true;
257  if ((*aDaughter)->status() != 1) {
258  for (HepMC::GenVertex::particle_iterator byaDaughter =
259  (*aDaughter)->end_vertex()->particles_begin(HepMC::descendants);
260  byaDaughter != (*aDaughter)->end_vertex()->particles_end(HepMC::descendants);
261  byaDaughter++) {
262  if ((*byaDaughter)->status() == 1 && abs((*byaDaughter)->pdg_id()) == 13) {
263  indmu.push_back((*byaDaughter)->barcode());
264  std::cout << "Stable muon from Z with charge " << (*byaDaughter)->pdg_id() << " and index "
265  << (*byaDaughter)->barcode() << std::endl;
266  }
267  }
268  } else {
269  indmu.push_back((*aDaughter)->barcode());
270  std::cout << "Stable muon from Z with charge " << (*aDaughter)->pdg_id() << " and index "
271  << (*aDaughter)->barcode() << std::endl;
272  }
273  }
274  }
275  if (!foundmuons) {
276  std::cout << "No muons from Z ...skip event" << std::endl;
277  skip = true;
278  }
279  }
280  }
281  if (!accepted) {
282  std::cout << "No Z particles in the event ...skip event" << std::endl;
283  skip = true;
284  }
285  } else {
286  skip = false;
287  }
288 
289  //
290  // Retrieve tracker geometry from event setup
291  //
292  const TrackerGeometry* trackerGeometry = &iSetup.getData(geomToken_);
293  auto testGeomDet = trackerGeometry->detsTOB().front();
294  std::cout << testGeomDet->position() << std::endl;
295 
296  //Dump Run and Event
297  irun = iEvent.id().run();
298  ievt = iEvent.id().event();
299 
300  // Reset tree variables
301  int countpart[2] = {0, 0}, countpartrec[2] = {0, 0}, flag = 0, flagrec = 0, count = 0, countrec = 0;
302  //int countsim=0;
303  float ene[2][2], px[2][2], py[2][2], pz[2][2], ptmu[2][2];
304  float recene[2][2], recp[2][2], recpx[2][2], recpy[2][2], recpz[2][2], recptmu[2][2];
305 
306  for (int i = 0; i < 2; i++) {
307  for (int j = 0; j < 2; j++) {
308  ene[i][j] = 0.;
309  px[i][j] = 0.;
310  py[i][j] = 0.;
311  pz[i][j] = 0.;
312  ptmu[i][j] = 0.;
313  recene[i][j] = 0.;
314  recp[i][j] = 0.;
315  recpx[i][j] = 0.;
316  recpy[i][j] = 0.;
317  recpz[i][j] = 0.;
318  recptmu[i][j] = 0.;
319  }
320  }
321 
323  iEvent.getByLabel(label_tp_effic, TPCollectionHeff);
324  const TrackingParticleCollection tPCeff = *(TPCollectionHeff.product());
325 
326  edm::Handle<TrackingParticleCollection> TPCollectionHfake;
327  iEvent.getByLabel(label_tp_fake, TPCollectionHfake);
328  const TrackingParticleCollection tPCfake = *(TPCollectionHfake.product());
329 
330  int w = 0;
331  for (unsigned int ww = 0; ww < associators.size(); ww++) {
332  //
333  //get collections from the event
334  //
335 
336  edm::InputTag algo = label[0];
337 
339  iEvent.getByLabel(algo, trackCollection);
340  const edm::View<reco::Track> tC = *(trackCollection.product());
341 
342  //associate tracks
343  LogTrace("TrackValidator") << "Calling associateRecoToSim method"
344  << "\n";
345  reco::RecoToSimCollection recSimColl = associatore[ww]->associateRecoToSim(trackCollection, TPCollectionHfake);
346 
347  LogTrace("TrackValidator") << "Calling associateSimToReco method"
348  << "\n";
349  reco::SimToRecoCollection simRecColl = associatore[ww]->associateSimToReco(trackCollection, TPCollectionHeff);
350 
351  //
352  //compute number of tracks per eta interval
353  //
354 
355  if (selection_eff && !skip) {
356  std::cout << "Computing Efficiency" << std::endl;
357 
358  edm::LogVerbatim("TrackValidator") << "\n# of TrackingParticles (before cuts): " << tPCeff.size() << "\n";
359  int ats = 0;
360  int st = 0;
361  for (TrackingParticleCollection::size_type i = 0; i < tPCeff.size(); i++) {
362  // Initialize variables
363  eta = 0., theta = 0., phi = 0., pt = 0., cottheta = 0., costheta = 0.;
364  d0 = 0., z0 = 0.;
365  nhit = 0;
366  receta = 0., rectheta = 0., recphi = 0., recpt = 0., reccottheta = 0., recd0 = 0., recz0 = 0.;
367  respt = 0., resd0 = 0., resz0 = 0., reseta = 0., resphi = 0., rescottheta = 0.;
368  recchiq = 0.;
369  recnhit = 0;
370  trackType = 0;
371  eff = 0;
372 
373  // typedef edm::Ref<TrackingParticleCollection> TrackingParticleRef;
374  TrackingParticleRef tp(TPCollectionHeff, i);
375  if (tp->charge() == 0)
376  continue;
377  st++;
378  //pt=sqrt(tp->momentum().perp2());
379  //eta=tp->momentum().eta();
380  //vpos=tp->vertex().perp2()));
381 
382  const SimTrack* simulatedTrack = &(*tp->g4Track_begin());
383 
384  const MagneticField* theMF = &iSetup.getData(magFieldToken_);
385  FreeTrajectoryState ftsAtProduction(
386  GlobalPoint(tp->vertex().x(), tp->vertex().y(), tp->vertex().z()),
387  GlobalVector(
388  simulatedTrack->momentum().x(), simulatedTrack->momentum().y(), simulatedTrack->momentum().z()),
389  TrackCharge(tp->charge()),
390  theMF);
391  TSCPBuilderNoMaterial tscpBuilder;
392  TrajectoryStateClosestToPoint tsAtClosestApproach =
393  tscpBuilder(ftsAtProduction, GlobalPoint(0, 0, 0)); //as in TrackProducerAlgorithm
394  GlobalPoint v = tsAtClosestApproach.theState().position();
395  GlobalVector p = tsAtClosestApproach.theState().momentum();
396 
397  // double qoverpSim = tsAtClosestApproach.charge()/p.mag();
398  // double lambdaSim = M_PI/2-p.theta();
399  // double phiSim = p.phi();
400  double dxySim = (-v.x() * sin(p.phi()) + v.y() * cos(p.phi()));
401  double dszSim = v.z() * p.perp() / p.mag() - (v.x() * p.x() + v.y() * p.y()) / p.perp() * p.z() / p.mag();
402  d0 = float(-dxySim);
403  z0 = float(dszSim * p.mag() / p.perp());
404 
405  if (abs(simulatedTrack->type()) == 13 && simulatedTrack->genpartIndex() != -1) {
406  std::cout << " TRACCIA SIM DI MUONI " << std::endl;
407  std::cout << "Gen part " << simulatedTrack->genpartIndex() << std::endl;
408  trackType = simulatedTrack->type();
409  theta = simulatedTrack->momentum().theta();
410  costheta = cos(theta);
411  cottheta = 1. / tan(theta);
412 
413  eta = simulatedTrack->momentum().eta();
414  phi = simulatedTrack->momentum().phi();
415  pt = simulatedTrack->momentum().pt();
416  nhit = tp->matchedHit();
417 
418  std::cout << "3) Before assoc: SimTrack of type = " << simulatedTrack->type() << " ,at eta = " << eta
419  << " ,with pt at vertex = " << simulatedTrack->momentum().pt() << " GeV/c"
420  << " ,d0 =" << d0 << " ,z0 =" << z0 << " ,nhit=" << nhit << std::endl;
421 
422  if (ZmassSelection_) {
423  if (abs(trackType) == 13 &&
424  (simulatedTrack->genpartIndex() == indmu[0] || simulatedTrack->genpartIndex() == indmu[1])) {
425  std::cout << " TRACK sim of muons from Z " << std::endl;
426  flag = 0;
427  count = countpart[0];
428  countpart[0]++;
429  } else if (abs(trackType) == 11) {
430  //std::cout << " TRACCIA SIM DI ELETTRONI " << std::endl;
431  flag = 1;
432  count = countpart[1];
433  countpart[1]++;
434  }
435 
436  px[flag][count] = simulatedTrack->momentum().x();
437  py[flag][count] = simulatedTrack->momentum().y();
438  pz[flag][count] = simulatedTrack->momentum().z();
439  ptmu[flag][count] = simulatedTrack->momentum().pt();
440  ene[flag][count] = simulatedTrack->momentum().e();
441  }
442 
443  std::vector<std::pair<edm::RefToBase<reco::Track>, double> > rt;
444  if (simRecColl.find(tp) != simRecColl.end()) {
445  rt = simRecColl[tp];
446  if (!rt.empty()) {
447  edm::RefToBase<reco::Track> t = rt.begin()->first;
448  ats++;
449 
450  // bool flagptused=false;
451  // for (unsigned int j=0;j<ptused.size();j++){
452  // if (fabs(t->pt()-ptused[j])<0.001) {
453  // flagptused=true;
454  // }
455  // }
456 
457  edm::LogVerbatim("TrackValidator") << "TrackingParticle #" << st << " with pt=" << t->pt()
458  << " associated with quality:" << rt.begin()->second << "\n";
459  std::cout << "Reconstructed Track:" << t->pt() << std::endl;
460  std::cout << "\tpT: " << t->pt() << std::endl;
461  std::cout << "\timpact parameter:d0: " << t->d0() << std::endl;
462  std::cout << "\timpact parameter:z0: " << t->dz() << std::endl;
463  std::cout << "\tAzimuthal angle of point of closest approach:" << t->phi() << std::endl;
464  std::cout << "\tcharge: " << t->charge() << std::endl;
465  std::cout << "\teta: " << t->eta() << std::endl;
466  std::cout << "\tnormalizedChi2: " << t->normalizedChi2() << std::endl;
467 
468  recnhit = t->numberOfValidHits();
469  recchiq = t->normalizedChi2();
470  rectheta = t->theta();
471  reccottheta = 1. / tan(rectheta);
472  //receta=-log(tan(rectheta/2.));
473  receta = t->momentum().eta();
474  // reccostheta=cos(matchedrectrack->momentum().theta());
475  recphi = t->phi();
476  recpt = t->pt();
477  ptused.push_back(recpt);
478  recd0 = t->d0();
479  recz0 = t->dz();
480 
481  std::cout << "5) After call to associator: the best match has " << recnhit << " hits, Chi2 = " << recchiq
482  << ", pt at vertex = " << recpt << " GeV/c, "
483  << ", recd0 = " << recd0 << ", recz0= " << recz0 << std::endl;
484 
485  respt = recpt - pt;
486  resd0 = recd0 - d0;
487  resz0 = recz0 - z0;
488  reseta = receta - eta;
489  resphi = recphi - phi;
491  eff = 1;
492 
493  std::cout << "6) Transverse momentum residual=" << respt << " ,d0 residual=" << resd0
494  << " ,z0 residual=" << resz0 << " with eff=" << eff << std::endl;
495 
496  if (ZmassSelection_) {
497  if (abs(trackType) == 13) {
498  std::cout << " TRACCIA RECO DI MUONI " << std::endl;
499  flagrec = 0;
500  countrec = countpartrec[0];
501  countpartrec[0]++;
502  } else if (abs(trackType) == 11) {
503  std::cout << " TRACCIA RECO DI ELETTRONI " << std::endl;
504  flagrec = 1;
505  countrec = countpartrec[1];
506  countpartrec[1]++;
507  }
508 
509  recp[flagrec][countrec] = sqrt(t->momentum().mag2());
510  recpx[flagrec][countrec] = t->momentum().x();
511  recpy[flagrec][countrec] = t->momentum().y();
512  recpz[flagrec][countrec] = t->momentum().z();
514  sqrt((t->momentum().x() * t->momentum().x()) + (t->momentum().y() * t->momentum().y()));
515  if (abs(trackType) == 13)
516  recene[flagrec][countrec] = sqrt(recp[flagrec][countrec] * recp[flagrec][countrec] + 0.105 * 0.105);
517  if (abs(trackType) == 11)
518  recene[flagrec][countrec] = sqrt(recp[flagrec][countrec] * recp[flagrec][countrec] + 0.0005 * 0.0005);
519  }
520 
521  std::cout << "7) Transverse momentum reconstructed =" << recpt << " at eta= " << receta
522  << " and phi= " << recphi << std::endl;
523  }
524  } else {
525  edm::LogVerbatim("TrackValidator")
526  << "TrackingParticle #" << st << " with pt=" << sqrt(tp->momentum().perp2())
527  << " NOT associated to any reco::Track"
528  << "\n";
529  receta = -100.;
530  recphi = -100.;
531  recpt = -100.;
532  recd0 = -100.;
533  recz0 = -100;
534  respt = -100.;
535  resd0 = -100.;
536  resz0 = -100.;
537  resphi = -100.;
538  reseta = -100.;
539  rescottheta = -100.;
540  recnhit = 100;
541  recchiq = -100;
542  eff = 0;
543  flagrec = 100;
544  }
545 
546  std::cout << "Eff=" << eff << std::endl;
547 
548  // simulated muons
549 
550  std::cout << "Flag is" << flag << std::endl;
551  std::cout << "RecFlag is" << flagrec << std::endl;
552 
553  if (countpart[0] == 2 && flag == 0) {
554  mzmu =
555  sqrt((ene[0][0] + ene[0][1]) * (ene[0][0] + ene[0][1]) - (px[0][0] + px[0][1]) * (px[0][0] + px[0][1]) -
556  (py[0][0] + py[0][1]) * (py[0][0] + py[0][1]) - (pz[0][0] + pz[0][1]) * (pz[0][0] + pz[0][1]));
557  std::cout << "Mzmu " << mzmu << std::endl;
558  ptzmu = sqrt((px[0][0] + px[0][1]) * (px[0][0] + px[0][1]) + (py[0][0] + py[0][1]) * (py[0][0] + py[0][1]));
559 
560  pLzmu = pz[0][0] + pz[0][1];
561  enezmu = ene[0][0] + ene[0][1];
562  phizmu = atan2((py[0][0] + py[0][1]), (px[0][0] + px[0][1]));
563  thetazmu = atan2(ptzmu, (pz[0][0] + pz[0][1]));
564  etazmu = -log(tan(thetazmu * 3.14 / 360.));
565  yzmu = 0.5 * log((enezmu + pLzmu) / (enezmu - pLzmu));
566  mxptmu = std::max(ptmu[0][0], ptmu[0][1]);
567  minptmu = std::min(ptmu[0][0], ptmu[0][1]);
568  } else {
569  mzmu = -100.;
570  ptzmu = -100.;
571  pLzmu = -100.;
572  enezmu = -100.;
573  etazmu = -100.;
574  phizmu = -100.;
575  thetazmu = -100.;
576  yzmu = -100.;
577  mxptmu = -100.;
578  minptmu = -100.;
579  }
580 
581  // reconstructed muons
582  if (countpartrec[0] == 2 && flagrec == 0) {
583  recmzmu = sqrt((recene[0][0] + recene[0][1]) * (recene[0][0] + recene[0][1]) -
584  (recpx[0][0] + recpx[0][1]) * (recpx[0][0] + recpx[0][1]) -
585  (recpy[0][0] + recpy[0][1]) * (recpy[0][0] + recpy[0][1]) -
586  (recpz[0][0] + recpz[0][1]) * (recpz[0][0] + recpz[0][1]));
587  std::cout << "RecMzmu " << recmzmu << std::endl;
588  recptzmu = sqrt((recpx[0][0] + recpx[0][1]) * (recpx[0][0] + recpx[0][1]) +
589  (recpy[0][0] + recpy[0][1]) * (recpy[0][0] + recpy[0][1]));
590 
591  recpLzmu = recpz[0][0] + recpz[0][1];
592  recenezmu = recene[0][0] + recene[0][1];
593  recphizmu = atan2((recpy[0][0] + recpy[0][1]), (recpx[0][0] + recpx[0][1]));
594  recthetazmu = atan2(recptzmu, (recpz[0][0] + recpz[0][1]));
595  recetazmu = -log(tan(recthetazmu * 3.14 / 360.));
596  recyzmu = 0.5 * log((recenezmu + recpLzmu) / (recenezmu - recpLzmu));
597  recmxptmu = std::max(recptmu[0][0], recptmu[0][1]);
598  recminptmu = std::min(recptmu[0][0], recptmu[0][1]);
599  } else {
600  recmzmu = -100.;
601  recptzmu = -100.;
602  recpLzmu = -100.;
603  recenezmu = -100.;
604  recetazmu = -100.;
605  recphizmu = -100.;
606  recthetazmu = -100.;
607  recyzmu = -100.;
608  recmxptmu = -100;
609  recminptmu = -100.;
610  }
611 
612  tree_eff->Fill();
613 
614  } // end of loop on muons
615  } // end of loop for tracking particle
616  } // end of loop for efficiency
617 
618  //
619  // Fake Rate
620  //
621  if (selection_fake) {
622  std::cout << "Computing Fake Rate" << std::endl;
623 
624  fakeeta = 0., faketheta = 0., fakephi = 0., fakept = 0., fakecottheta = 0., fakecostheta = 0.;
625  faked0 = 0., fakez0 = 0.;
626  fakenhit = 0;
627  fakereceta = 0., fakerectheta = 0., fakerecphi = 0., fakerecpt = 0., fakereccottheta = 0., fakerecd0 = 0.,
628  fakerecz0 = 0.;
629  fakerespt = 0., fakeresd0 = 0., fakeresz0 = 0., fakereseta = 0., fakeresphi = 0., fakerescottheta = 0.;
630  fakerecchiq = 0.;
631  fakerecnhit = 0;
632  faketrackType = 0;
633  fake = 0;
634 
635  // int at=0;
636  int rT = 0;
637  for (reco::TrackCollection::size_type i = 0; i < tC.size(); ++i) {
639  rT++;
640 
641  fakeeta = 0., faketheta = 0., fakephi = 0., fakept = 0., fakecottheta = 0., fakecostheta = 0.;
642  faked0 = 0., fakez0 = 0.;
643  fakenhit = 0;
644  fakereceta = 0., fakerectheta = 0., fakerecphi = 0., fakerecpt = 0., fakereccottheta = 0., fakerecd0 = 0.,
645  fakerecz0 = 0.;
646  fakerespt = 0., fakeresd0 = 0., fakeresz0 = 0., fakereseta = 0., fakeresphi = 0., fakerescottheta = 0.;
647  fakerecchiq = 0.;
648  fakerecnhit = 0;
649  faketrackType = 0;
650  fake = 0;
651 
652  fakerecnhit = track->numberOfValidHits();
653  fakerecchiq = track->normalizedChi2();
654  fakerectheta = track->theta();
655  fakereccottheta = 1. / tan(rectheta);
656  //fakereceta=-log(tan(rectheta/2.));
657  fakereceta = track->momentum().eta();
658  // fakereccostheta=cos(track->momentum().theta());
659  fakerecphi = track->phi();
660  fakerecpt = track->pt();
661  fakerecd0 = track->d0();
662  fakerecz0 = track->dz();
663 
664  std::cout << "1) Before assoc: TkRecTrack at eta = " << fakereceta << std::endl;
665  std::cout << "Track number " << i << std::endl;
666  std::cout << "\tPT: " << track->pt() << std::endl;
667  std::cout << "\timpact parameter:d0: " << track->d0() << std::endl;
668  std::cout << "\timpact parameter:z0: " << track->dz() << std::endl;
669  std::cout << "\tAzimuthal angle of point of closest approach:" << track->phi() << std::endl;
670  std::cout << "\tcharge: " << track->charge() << std::endl;
671  std::cout << "\teta: " << track->eta() << std::endl;
672  std::cout << "\tnormalizedChi2: " << track->normalizedChi2() << std::endl;
673 
674  std::vector<std::pair<TrackingParticleRef, double> > tp;
675 
676  //Compute fake rate vs eta
677  if (recSimColl.find(track) != recSimColl.end()) {
678  tp = recSimColl[track];
679  if (!tp.empty()) {
680  edm::LogVerbatim("TrackValidator") << "reco::Track #" << rT << " with pt=" << track->pt()
681  << " associated with quality:" << tp.begin()->second << "\n";
682 
683  TrackingParticleRef tpr = tp.begin()->first;
684  const SimTrack* fakeassocTrack = &(*tpr->g4Track_begin());
685 
686  const MagneticField* theMF = &iSetup.getData(magFieldToken_);
687  FreeTrajectoryState ftsAtProduction(
688  GlobalPoint(tpr->vertex().x(), tpr->vertex().y(), tpr->vertex().z()),
689  GlobalVector(
690  fakeassocTrack->momentum().x(), fakeassocTrack->momentum().y(), fakeassocTrack->momentum().z()),
691  TrackCharge(tpr->charge()),
692  theMF);
693  TSCPBuilderNoMaterial tscpBuilder;
694  TrajectoryStateClosestToPoint tsAtClosestApproach =
695  tscpBuilder(ftsAtProduction, GlobalPoint(0, 0, 0)); //as in TrackProducerAlgorithm
696  GlobalPoint v = tsAtClosestApproach.theState().position();
697  GlobalVector p = tsAtClosestApproach.theState().momentum();
698 
699  // double qoverpSim = tsAtClosestApproach.charge()/p.mag();
700  // double lambdaSim = M_PI/2-p.theta();
701  // double phiSim = p.phi();
702  double dxySim = (-v.x() * sin(p.phi()) + v.y() * cos(p.phi()));
703  double dszSim = v.z() * p.perp() / p.mag() - (v.x() * p.x() + v.y() * p.y()) / p.perp() * p.z() / p.mag();
704  faked0 = float(-dxySim);
705  fakez0 = float(dszSim * p.mag() / p.perp());
706 
707  faketrackType = fakeassocTrack->type();
708  faketheta = fakeassocTrack->momentum().theta();
709  fakecottheta = 1. / tan(faketheta);
710  fakeeta = fakeassocTrack->momentum().eta();
711  fakephi = fakeassocTrack->momentum().phi();
712  fakept = fakeassocTrack->momentum().pt();
713  fakenhit = tpr->matchedHit();
714 
715  std::cout << "4) After call to associator: the best SimTrack match is of type" << fakeassocTrack->type()
716  << " ,at eta = " << fakeeta << " and phi = " << fakephi << " ,with pt at vertex = " << fakept
717  << " GeV/c"
718  << " ,d0 global = " << faked0 << " ,z0 = " << fakez0 << std::endl;
719  fake = 1;
720 
724  fakereseta = -log(tan(fakerectheta / 2.)) - (-log(tan(faketheta / 2.)));
727  }
728  } else {
729  edm::LogVerbatim("TrackValidator")
730  << "reco::Track #" << rT << " with pt=" << track->pt() << " NOT associated to any TrackingParticle"
731  << "\n";
732 
733  fakeeta = -100.;
734  faketheta = -100;
735  fakephi = -100.;
736  fakept = -100.;
737  faked0 = -100.;
738  fakez0 = -100;
739  fakerespt = -100.;
740  fakeresd0 = -100.;
741  fakeresz0 = -100.;
742  fakeresphi = -100.;
743  fakereseta = -100.;
744  fakerescottheta = -100.;
745  fakenhit = 100;
746  fake = 0;
747  }
748 
749  tree_fake->Fill();
750  }
751 
752  } // End of loop on fakerate
753 
754  w++;
755 
756  } // End of loop on associators
757 }
758 
759 // ------------ method called once each job just after ending the event loop ------------
760 void ValidationMisalignedTracker::endJob() { std::cout << "\t Misalignment analysis completed \n" << std::endl; }
761 
Vector3DBase
Definition: Vector3DBase.h:8
ValidationMisalignedTracker::fakemxptmu
float fakemxptmu
Definition: ValidationMisalignedTracker.h:81
ValidationMisalignedTracker::z0
float z0
Definition: ValidationMisalignedTracker.h:72
ValidationMisalignedTracker::enezmu
float enezmu
Definition: ValidationMisalignedTracker.h:64
ValidationMisalignedTracker::fakerecptzmu
float fakerecptzmu
Definition: ValidationMisalignedTracker.h:79
ValidationMisalignedTracker::nAssoc
int nAssoc
Definition: ValidationMisalignedTracker.h:75
FreeTrajectoryState::momentum
GlobalVector momentum() const
Definition: FreeTrajectoryState.h:68
ValidationMisalignedTracker::ZmassSelection_
bool ZmassSelection_
Definition: ValidationMisalignedTracker.h:52
CoreSimTrack::momentum
const math::XYZTLorentzVectorD & momentum() const
Definition: CoreSimTrack.h:19
ValidationMisalignedTracker::cottheta
float cottheta
Definition: ValidationMisalignedTracker.h:72
edm::AssociationMap::find
const_iterator find(const key_type &k) const
find element with specified reference key
Definition: AssociationMap.h:173
mps_fire.i
i
Definition: mps_fire.py:428
FreeTrajectoryState.h
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11779
MessageLogger.h
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
ValidationMisalignedTracker::label_tp_fake
edm::InputTag label_tp_fake
Definition: ValidationMisalignedTracker.h:102
TrackCharge
int TrackCharge
Definition: TrackCharge.h:4
ValidationMisalignedTracker::fakerecz0
float fakerecz0
Definition: ValidationMisalignedTracker.h:90
ValidationMisalignedTracker::recphizmu
float recphizmu
Definition: ValidationMisalignedTracker.h:63
edm::Handle::product
T const * product() const
Definition: Handle.h:70
ValidationMisalignedTracker::theta
float theta
Definition: ValidationMisalignedTracker.h:72
ValidationMisalignedTracker::mxptmu
float mxptmu
Definition: ValidationMisalignedTracker.h:64
ValidationMisalignedTracker::fakerecmxptmu
float fakerecmxptmu
Definition: ValidationMisalignedTracker.h:81
ValidationMisalignedTracker::yzmu
float yzmu
Definition: ValidationMisalignedTracker.h:64
ValidationMisalignedTracker::fakeminptmu
float fakeminptmu
Definition: ValidationMisalignedTracker.h:81
min
T min(T a, T b)
Definition: MathUtil.h:58
ValidationMisalignedTracker::fakeresphi
float fakeresphi
Definition: ValidationMisalignedTracker.h:93
ValidationMisalignedTracker::fakerecthetazmu
float fakerecthetazmu
Definition: ValidationMisalignedTracker.h:79
ValidationMisalignedTracker::reccottheta
float reccottheta
Definition: ValidationMisalignedTracker.h:74
ValidationMisalignedTracker::recz0
float recz0
Definition: ValidationMisalignedTracker.h:74
ValidationMisalignedTracker::irun
int irun
Definition: ValidationMisalignedTracker.h:61
ValidationMisalignedTracker::fakeresz0
float fakeresz0
Definition: ValidationMisalignedTracker.h:93
ValidationMisalignedTracker::fakerecpt
float fakerecpt
Definition: ValidationMisalignedTracker.h:90
gather_cfg.cout
cout
Definition: gather_cfg.py:144
hcal_runs.rt
rt
Definition: hcal_runs.py:76
ValidationMisalignedTracker::phizmu
float phizmu
Definition: ValidationMisalignedTracker.h:63
ValidationMisalignedTracker::countpartrec
int countpartrec[2]
Definition: ValidationMisalignedTracker.h:65
ValidationMisalignedTracker::associators
std::vector< std::string > associators
Definition: ValidationMisalignedTracker.h:98
ValidationMisalignedTracker::fakepLzmu
float fakepLzmu
Definition: ValidationMisalignedTracker.h:81
ValidationMisalignedTracker::fakerecnhit
int fakerecnhit
Definition: ValidationMisalignedTracker.h:91
ValidationMisalignedTracker::faketrackType
int faketrackType
Definition: ValidationMisalignedTracker.h:87
ValidationMisalignedTracker::mzmu
float mzmu
Definition: ValidationMisalignedTracker.h:63
ValidationMisalignedTracker::respt
float respt
Definition: ValidationMisalignedTracker.h:77
ValidationMisalignedTracker::fakerecd0
float fakerecd0
Definition: ValidationMisalignedTracker.h:90
ValidationMisalignedTracker::fakecottheta
float fakecottheta
Definition: ValidationMisalignedTracker.h:88
ValidationMisalignedTracker::fakeetazmu
float fakeetazmu
Definition: ValidationMisalignedTracker.h:79
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
FreeTrajectoryState::position
GlobalPoint position() const
Definition: FreeTrajectoryState.h:67
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
GlobalVector
Global3DVector GlobalVector
Definition: GlobalVector.h:10
findQualityFiles.v
v
Definition: findQualityFiles.py:179
ValidationMisalignedTracker::recptmu
float recptmu[2][2]
Definition: ValidationMisalignedTracker.h:69
ValidationMisalignedTracker::fakerecchiq
float fakerecchiq
Definition: ValidationMisalignedTracker.h:92
ValidationMisalignedTracker::fakeptzmu
float fakeptzmu
Definition: ValidationMisalignedTracker.h:79
edm::Handle< reco::TrackToTrackingParticleAssociator >
ValidationMisalignedTracker::recyzmu
float recyzmu
Definition: ValidationMisalignedTracker.h:64
ValidationMisalignedTracker::rescottheta
float rescottheta
Definition: ValidationMisalignedTracker.h:77
ValidationMisalignedTracker::fakerecmzmu
float fakerecmzmu
Definition: ValidationMisalignedTracker.h:79
HepMC::GenEvent
Definition: hepmc_rootio.cc:9
ValidationMisalignedTracker.h
edm::Ref< TrackingParticleCollection >
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
ValidationMisalignedTracker::recmxptmu
float recmxptmu
Definition: ValidationMisalignedTracker.h:64
ValidationMisalignedTracker::fakeenezmu
float fakeenezmu
Definition: ValidationMisalignedTracker.h:81
ValidationMisalignedTracker::resphi
float resphi
Definition: ValidationMisalignedTracker.h:77
ValidationMisalignedTracker::recminptmu
float recminptmu
Definition: ValidationMisalignedTracker.h:64
ValidationMisalignedTracker::fakerecminptmu
float fakerecminptmu
Definition: ValidationMisalignedTracker.h:81
cmsdt::algo
algo
Definition: constants.h:164
edm::AssociationMap::end
const_iterator end() const
last iterator over the map (read only)
Definition: AssociationMap.h:171
MakerMacros.h
ValidationMisalignedTracker::tree_fake
TTree * tree_fake
Definition: ValidationMisalignedTracker.h:58
TrackerGeometry::detsTOB
const DetContainer & detsTOB() const
Definition: TrackerGeometry.cc:179
ValidationMisalignedTracker::recenezmu
float recenezmu
Definition: ValidationMisalignedTracker.h:64
ValidationMisalignedTracker::eta
float eta
Definition: ValidationMisalignedTracker.h:72
trigger::size_type
uint16_t size_type
Definition: TriggerTypeDefs.h:18
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Track.h
ValidationMisalignedTracker::faked0
float faked0
Definition: ValidationMisalignedTracker.h:88
ValidationMisalignedTracker::pz
float pz[2][2]
Definition: ValidationMisalignedTracker.h:68
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
ValidationMisalignedTracker::fakerescottheta
float fakerescottheta
Definition: ValidationMisalignedTracker.h:93
ValidationMisalignedTracker::fakereseta
float fakereseta
Definition: ValidationMisalignedTracker.h:93
ValidationMisalignedTracker::trackType
int trackType
Definition: ValidationMisalignedTracker.h:71
w
const double w
Definition: UKUtility.cc:23
ValidationMisalignedTracker::phi
float phi
Definition: ValidationMisalignedTracker.h:72
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
ValidationMisalignedTracker::countpart
int countpart[2]
Definition: ValidationMisalignedTracker.h:65
ValidationMisalignedTracker::fakeeta
float fakeeta
Definition: ValidationMisalignedTracker.h:88
ValidationMisalignedTracker::countrec
int countrec
Definition: ValidationMisalignedTracker.h:66
ValidationMisalignedTracker::simobject
std::string simobject
Definition: ValidationMisalignedTracker.h:51
ValidationMisalignedTracker::fakenAssoc
int fakenAssoc
Definition: ValidationMisalignedTracker.h:91
ValidationMisalignedTracker::fakerectheta
float fakerectheta
Definition: ValidationMisalignedTracker.h:90
ValidationMisalignedTracker::fakethetazmu
float fakethetazmu
Definition: ValidationMisalignedTracker.h:79
ValidationMisalignedTracker::fakephi
float fakephi
Definition: ValidationMisalignedTracker.h:88
ValidationMisalignedTracker::recnhit
int recnhit
Definition: ValidationMisalignedTracker.h:75
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
ValidationMisalignedTracker::flag
int flag
Definition: ValidationMisalignedTracker.h:66
Point3DBase< float, GlobalTag >
ValidationMisalignedTracker::fakeyzmu
float fakeyzmu
Definition: ValidationMisalignedTracker.h:81
cmsswSequenceInfo.tp
tp
Definition: cmsswSequenceInfo.py:17
ValidationMisalignedTracker::fakereceta
float fakereceta
Definition: ValidationMisalignedTracker.h:90
ValidationMisalignedTracker::faketheta
float faketheta
Definition: ValidationMisalignedTracker.h:88
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::View::size
size_type size() const
ValidationMisalignedTracker::fakereccottheta
float fakereccottheta
Definition: ValidationMisalignedTracker.h:90
ValidationMisalignedTracker::label
std::vector< edm::InputTag > label
Definition: ValidationMisalignedTracker.h:100
edm::View
Definition: CaloClusterFwd.h:14
ValidationMisalignedTracker::selection_fake
bool selection_fake
Definition: ValidationMisalignedTracker.h:52
TrackToTrackingParticleAssociator.h
ValidationMisalignedTracker::receta
float receta
Definition: ValidationMisalignedTracker.h:74
ValidationMisalignedTracker::ene
float ene[2][2]
Definition: ValidationMisalignedTracker.h:68
edm::ParameterSet
Definition: ParameterSet.h:47
ValidationMisalignedTracker::fakept
float fakept
Definition: ValidationMisalignedTracker.h:88
ValidationMisalignedTracker::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: ValidationMisalignedTracker.cc:225
duplicaterechits_cfi.trackCollection
trackCollection
Definition: duplicaterechits_cfi.py:4
Event.h
ValidationMisalignedTracker::skip
bool skip
Definition: ValidationMisalignedTracker.h:55
ValidationMisalignedTracker::fakerecenezmu
float fakerecenezmu
Definition: ValidationMisalignedTracker.h:81
ValidationMisalignedTracker::rootfile_
std::string rootfile_
Definition: ValidationMisalignedTracker.h:53
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
edm::AssociationMap< edm::OneToManyWithQualityGeneric< edm::View< reco::Track >, TrackingParticleCollection, double > >
ValidationMisalignedTracker::magFieldToken_
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magFieldToken_
Definition: ValidationMisalignedTracker.h:49
ValidationMisalignedTracker::count
int count
Definition: ValidationMisalignedTracker.h:66
funct::tan
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
ValidationMisalignedTracker::ievt
int ievt
Definition: ValidationMisalignedTracker.h:61
ValidationMisalignedTracker::fakemzmu
float fakemzmu
Definition: ValidationMisalignedTracker.h:79
iEvent
int iEvent
Definition: GenABIO.cc:224
ValidationMisalignedTracker::recpt
float recpt
Definition: ValidationMisalignedTracker.h:74
ValidationMisalignedTracker::pLzmu
float pLzmu
Definition: ValidationMisalignedTracker.h:64
ValidationMisalignedTracker::reseta
float reseta
Definition: ValidationMisalignedTracker.h:77
ValidationMisalignedTracker::recptzmu
float recptzmu
Definition: ValidationMisalignedTracker.h:63
ValidationMisalignedTracker::resz0
float resz0
Definition: ValidationMisalignedTracker.h:77
CoreSimTrack::type
int type() const
particle type (HEP PDT convension)
Definition: CoreSimTrack.h:22
edm::EventSetup
Definition: EventSetup.h:57
ValidationMisalignedTracker::fakerecphizmu
float fakerecphizmu
Definition: ValidationMisalignedTracker.h:79
edm::HepMCProduct::GetEvent
const HepMC::GenEvent * GetEvent() const
Definition: HepMCProduct.h:34
TrajectoryStateClosestToPoint
Definition: TrajectoryStateClosestToPoint.h:18
ValidationMisalignedTracker::endJob
void endJob() override
Definition: ValidationMisalignedTracker.cc:760
TSCPBuilderNoMaterial.h
ValidationMisalignedTracker::label_tp_effic
edm::InputTag label_tp_effic
Definition: ValidationMisalignedTracker.h:101
ValidationMisalignedTracker::eff
float eff
Definition: ValidationMisalignedTracker.h:77
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:120
ValidationMisalignedTracker::fake
float fake
Definition: ValidationMisalignedTracker.h:93
ValidationMisalignedTracker::recene
float recene[2][2]
Definition: ValidationMisalignedTracker.h:69
ValidationMisalignedTracker::trackassociator
std::string trackassociator
Definition: ValidationMisalignedTracker.h:51
TrackingParticle.h
ValidationMisalignedTracker::fakerecpLzmu
float fakerecpLzmu
Definition: ValidationMisalignedTracker.h:81
ValidationMisalignedTracker::nhit
int nhit
Definition: ValidationMisalignedTracker.h:73
ValidationMisalignedTracker::geomToken_
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_
Definition: ValidationMisalignedTracker.h:48
ValidationMisalignedTracker::rectheta
float rectheta
Definition: ValidationMisalignedTracker.h:74
TSCPBuilderNoMaterial
Definition: TSCPBuilderNoMaterial.h:17
ValidationMisalignedTracker::recpy
float recpy[2][2]
Definition: ValidationMisalignedTracker.h:69
ValidationMisalignedTracker::resd0
float resd0
Definition: ValidationMisalignedTracker.h:77
ValidationMisalignedTracker::ptmu
float ptmu[2][2]
Definition: ValidationMisalignedTracker.h:68
ValidationMisalignedTracker::flagrec
int flagrec
Definition: ValidationMisalignedTracker.h:66
ValidationMisalignedTracker::d0
float d0
Definition: ValidationMisalignedTracker.h:72
FreeTrajectoryState
Definition: FreeTrajectoryState.h:27
ValidationMisalignedTracker::pt
float pt
Definition: ValidationMisalignedTracker.h:72
SimTrack
Definition: SimTrack.h:6
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
ValidationMisalignedTracker::ptzmu
float ptzmu
Definition: ValidationMisalignedTracker.h:63
ValidationMisalignedTracker::ValidationMisalignedTracker
ValidationMisalignedTracker(const edm::ParameterSet &)
Definition: ValidationMisalignedTracker.cc:38
TrackingParticleCollection
std::vector< TrackingParticle > TrackingParticleCollection
Definition: TrackingParticleFwd.h:8
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::RefToBase< reco::Track >
ValidationMisalignedTracker::thetazmu
float thetazmu
Definition: ValidationMisalignedTracker.h:63
ValidationMisalignedTracker::recp
float recp[2][2]
Definition: ValidationMisalignedTracker.h:69
ValidationMisalignedTracker::fakeresd0
float fakeresd0
Definition: ValidationMisalignedTracker.h:93
ValidationMisalignedTracker::costheta
float costheta
Definition: ValidationMisalignedTracker.h:72
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17
ValidationMisalignedTracker::etazmu
float etazmu
Definition: ValidationMisalignedTracker.h:63
ValidationMisalignedTracker::fakerecphi
float fakerecphi
Definition: ValidationMisalignedTracker.h:90
ValidationMisalignedTracker::ptused
std::vector< float > ptused
Definition: ValidationMisalignedTracker.h:105
ValidationMisalignedTracker::~ValidationMisalignedTracker
~ValidationMisalignedTracker() override
Definition: ValidationMisalignedTracker.cc:208
ValidationMisalignedTracker::fakecostheta
float fakecostheta
Definition: ValidationMisalignedTracker.h:88
ValidationMisalignedTracker::recmzmu
float recmzmu
Definition: ValidationMisalignedTracker.h:63
ValidationMisalignedTracker::recetazmu
float recetazmu
Definition: ValidationMisalignedTracker.h:63
ValidationMisalignedTracker::selection_eff
bool selection_eff
Definition: ValidationMisalignedTracker.h:52
ValidationMisalignedTracker::eventCount_
int eventCount_
Definition: ValidationMisalignedTracker.h:56
ValidationMisalignedTracker::file_
TFile * file_
Definition: ValidationMisalignedTracker.h:59
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
ValidationMisalignedTracker::fakenhit
int fakenhit
Definition: ValidationMisalignedTracker.h:89
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:224
ValidationMisalignedTracker::fakez0
float fakez0
Definition: ValidationMisalignedTracker.h:88
ValidationMisalignedTracker
Definition: ValidationMisalignedTracker.h:37
ValidationMisalignedTracker::fakerecetazmu
float fakerecetazmu
Definition: ValidationMisalignedTracker.h:79
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
TrajectoryStateClosestToPoint::theState
const FreeTrajectoryState & theState() const
Definition: TrajectoryStateClosestToPoint.h:96
ValidationMisalignedTracker::fakerespt
float fakerespt
Definition: ValidationMisalignedTracker.h:93
ValidationMisalignedTracker::minptmu
float minptmu
Definition: ValidationMisalignedTracker.h:64
ValidationMisalignedTracker::recthetazmu
float recthetazmu
Definition: ValidationMisalignedTracker.h:63
ValidationMisalignedTracker::recd0
float recd0
Definition: ValidationMisalignedTracker.h:74
edm::Event
Definition: Event.h:73
SimTrack::genpartIndex
int genpartIndex() const
index of the corresponding Generator particle in the Event container (-1 if no Genpart)
Definition: SimTrack.h:34
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
MagneticField
Definition: MagneticField.h:19
ValidationMisalignedTracker::recpx
float recpx[2][2]
Definition: ValidationMisalignedTracker.h:69
ValidationMisalignedTracker::recpz
float recpz[2][2]
Definition: ValidationMisalignedTracker.h:69
ValidationMisalignedTracker::fakephizmu
float fakephizmu
Definition: ValidationMisalignedTracker.h:79
SimTrackContainer.h
ValidationMisalignedTracker::tree_eff
TTree * tree_eff
Definition: ValidationMisalignedTracker.h:57
edm::InputTag
Definition: InputTag.h:15
ValidationMisalignedTracker::recchiq
float recchiq
Definition: ValidationMisalignedTracker.h:76
ValidationMisalignedTracker::p
float p[2][2]
Definition: ValidationMisalignedTracker.h:68
ValidationMisalignedTracker::fakerecyzmu
float fakerecyzmu
Definition: ValidationMisalignedTracker.h:81
ValidationMisalignedTracker::recphi
float recphi
Definition: ValidationMisalignedTracker.h:74
ValidationMisalignedTracker::recpLzmu
float recpLzmu
Definition: ValidationMisalignedTracker.h:64
ValidationMisalignedTracker::px
float px[2][2]
Definition: ValidationMisalignedTracker.h:68
TrackerGeometry
Definition: TrackerGeometry.h:14
ValidationMisalignedTracker::py
float py[2][2]
Definition: ValidationMisalignedTracker.h:68