only for ZGolden evaluated zMassSa for the mu+sta pdf, see zmumuSaMassHistogram.cc
I fill the dau1 with positive and dau2 with negatove values for the pt, in order to flag the muons used for building zMassSa
254 std::cout <<
">>> No beam spot found !!!" << std::endl;
258 std::cout <<
">>> No primary verteces found !!!" << std::endl;
262 for (
unsigned int c = 0;
c <
size; ++
c) {
265 bool isMCMatchTrue =
false;
269 isMCMatchTrue =
true;
271 unsigned int zSize = zColl->
size();
272 unique_ptr<vector<edm::EventNumber_t> >
event(
new vector<edm::EventNumber_t>);
273 unique_ptr<vector<unsigned int> >
run(
new vector<unsigned int>);
274 unique_ptr<vector<unsigned int> >
lumi(
new vector<unsigned int>);
275 unique_ptr<vector<float> >
zMass(
new vector<float>);
276 unique_ptr<vector<float> > zMassSa(
new vector<float>);
277 unique_ptr<vector<float> > zPt(
new vector<float>);
278 unique_ptr<vector<float> > zEta(
new vector<float>);
279 unique_ptr<vector<float> > zPhi(
new vector<float>);
280 unique_ptr<vector<float> > zY(
new vector<float>);
281 unique_ptr<vector<float> > zDau1Pt(
new vector<float>);
282 unique_ptr<vector<float> > zDau2Pt(
new vector<float>);
283 unique_ptr<vector<float> > zDau1SaPt(
new vector<float>);
284 unique_ptr<vector<float> > zDau2SaPt(
new vector<float>);
285 unique_ptr<vector<unsigned int> > zDau1HLTBit(
new vector<unsigned int>);
286 unique_ptr<vector<unsigned int> > zDau2HLTBit(
new vector<unsigned int>);
287 unique_ptr<vector<int> > zDau1Q(
new vector<int>);
288 unique_ptr<vector<int> > zDau2Q(
new vector<int>);
289 unique_ptr<vector<float> > zDau1Eta(
new vector<float>);
290 unique_ptr<vector<float> > zDau2Eta(
new vector<float>);
291 unique_ptr<vector<float> > zDau1SaEta(
new vector<float>);
292 unique_ptr<vector<float> > zDau2SaEta(
new vector<float>);
293 unique_ptr<vector<float> > zDau1Phi(
new vector<float>);
294 unique_ptr<vector<float> > zDau2Phi(
new vector<float>);
295 unique_ptr<vector<float> > zDau1SaPhi(
new vector<float>);
296 unique_ptr<vector<float> > zDau2SaPhi(
new vector<float>);
297 unique_ptr<vector<float> > zDau1Iso(
new vector<float>);
298 unique_ptr<vector<float> > zDau2Iso(
new vector<float>);
299 unique_ptr<vector<float> > zDau1TrkIso(
new vector<float>);
300 unique_ptr<vector<float> > zDau2TrkIso(
new vector<float>);
301 unique_ptr<vector<float> > zDau1EcalIso(
new vector<float>);
302 unique_ptr<vector<float> > zDau2EcalIso(
new vector<float>);
303 unique_ptr<vector<float> > zDau1HcalIso(
new vector<float>);
304 unique_ptr<vector<float> > zDau2HcalIso(
new vector<float>);
305 unique_ptr<vector<float> > zDau1MuEnergyEm(
new vector<float>);
306 unique_ptr<vector<float> > zDau2MuEnergyEm(
new vector<float>);
307 unique_ptr<vector<float> > zDau1MuEnergyHad(
new vector<float>);
308 unique_ptr<vector<float> > zDau2MuEnergyHad(
new vector<float>);
309 unique_ptr<vector<float> > vtxNormChi2(
new vector<float>);
310 unique_ptr<vector<unsigned int> > zDau1NofHit(
new vector<unsigned int>);
311 unique_ptr<vector<unsigned int> > zDau2NofHit(
new vector<unsigned int>);
312 unique_ptr<vector<unsigned int> > zDau1NofHitTk(
new vector<unsigned int>);
313 unique_ptr<vector<unsigned int> > zDau2NofHitTk(
new vector<unsigned int>);
314 unique_ptr<vector<unsigned int> > zDau1NofHitSta(
new vector<unsigned int>);
315 unique_ptr<vector<unsigned int> > zDau2NofHitSta(
new vector<unsigned int>);
316 unique_ptr<vector<unsigned int> > zDau1NofMuChambers(
new vector<unsigned int>);
317 unique_ptr<vector<unsigned int> > zDau2NofMuChambers(
new vector<unsigned int>);
318 unique_ptr<vector<unsigned int> > zDau1NofMuMatches(
new vector<unsigned int>);
319 unique_ptr<vector<unsigned int> > zDau2NofMuMatches(
new vector<unsigned int>);
320 unique_ptr<vector<float> > zDau1Chi2(
new vector<float>);
321 unique_ptr<vector<float> > zDau2Chi2(
new vector<float>);
322 unique_ptr<vector<float> > zDau1TrkChi2(
new vector<float>);
323 unique_ptr<vector<float> > zDau2TrkChi2(
new vector<float>);
324 unique_ptr<vector<float> > zDau1dxyFromBS(
new vector<float>);
325 unique_ptr<vector<float> > zDau2dxyFromBS(
new vector<float>);
326 unique_ptr<vector<float> > zDau1dzFromBS(
new vector<float>);
327 unique_ptr<vector<float> > zDau2dzFromBS(
new vector<float>);
328 unique_ptr<vector<float> > zDau1dxyFromPV(
new vector<float>);
329 unique_ptr<vector<float> > zDau2dxyFromPV(
new vector<float>);
330 unique_ptr<vector<float> > zDau1dzFromPV(
new vector<float>);
331 unique_ptr<vector<float> > zDau2dzFromPV(
new vector<float>);
332 unique_ptr<vector<float> > trueZMass(
new vector<float>);
333 unique_ptr<vector<float> > trueZPt(
new vector<float>);
334 unique_ptr<vector<float> > trueZEta(
new vector<float>);
335 unique_ptr<vector<float> > trueZPhi(
new vector<float>);
336 unique_ptr<vector<float> > trueZY(
new vector<float>);
337 event->push_back(evt.
id().
event());
340 for (
unsigned int i = 0;
i < zSize; ++
i) {
343 zMass->push_back(
z.mass());
344 zPt->push_back(
z.pt());
345 zEta->push_back(
z.eta());
346 zPhi->push_back(
z.phi());
347 zY->push_back(
z.rapidity());
348 vtxNormChi2->push_back(
z.vertexNormalizedChi2());
351 zDau1Pt->push_back(dau1->
pt());
352 zDau2Pt->push_back(dau2->
pt());
353 zDau1Q->push_back(dau1->
charge());
354 zDau2Q->push_back(dau2->
charge());
355 zDau1Eta->push_back(dau1->
eta());
356 zDau2Eta->push_back(dau2->
eta());
357 zDau1Phi->push_back(dau1->
phi());
358 zDau2Phi->push_back(dau2->
phi());
363 const Candidate *m1 = &*mr1, *m2 = &*mr2;
458 zDau1Iso->push_back(iso1);
459 zDau2Iso->push_back(iso2);
460 zDau1TrkIso->push_back(trkIso1);
461 zDau2TrkIso->push_back(trkIso2);
462 zDau1EcalIso->push_back(ecalIso1);
463 zDau2EcalIso->push_back(ecalIso2);
464 zDau1HcalIso->push_back(hcalIso1);
465 zDau2HcalIso->push_back(hcalIso2);
471 trueZMass->push_back(
z.mass());
472 trueZPt->push_back(
z.pt());
473 trueZEta->push_back(
z.eta());
474 trueZPhi->push_back(
z.phi());
475 trueZY->push_back(
z.rapidity());
477 trueZMass->push_back(-100);
478 trueZPt->push_back(-100);
479 trueZEta->push_back(-100);
480 trueZPhi->push_back(-100);
481 trueZY->push_back(-100);
485 const pat::Muon *mu1 = dynamic_cast<const pat::Muon *>(m1);
489 zDau1NofHitTk->push_back(mu1->
innerTrack()->numberOfValidHits());
490 zDau1NofHitSta->push_back(mu1->
outerTrack()->numberOfValidHits());
491 zDau1Chi2->push_back(mu1->
normChi2());
493 zDau1TrkChi2->push_back(mu1TrkRef->normalizedChi2());
494 zDau1dxyFromBS->push_back(mu1TrkRef->dxy(beamSpotHandle->
position()));
495 zDau1dzFromBS->push_back(mu1TrkRef->dz(beamSpotHandle->
position()));
496 zDau1dxyFromPV->push_back(mu1TrkRef->dxy(
primaryVertices->begin()->position()));
497 zDau1dzFromPV->push_back(mu1TrkRef->dz(
primaryVertices->begin()->position()));
504 zDau1NofHit->push_back(mu1StaRef->numberOfValidHits());
505 zDau1NofHitTk->push_back(0);
506 zDau1NofHitSta->push_back(mu1StaRef->numberOfValidHits());
507 zDau1Chi2->push_back(mu1StaRef->normalizedChi2());
508 zDau1TrkChi2->push_back(0);
509 zDau1dxyFromBS->push_back(mu1StaRef->dxy(beamSpotHandle->
position()));
510 zDau1dzFromBS->push_back(mu1StaRef->dz(beamSpotHandle->
position()));
511 zDau1dxyFromPV->push_back(mu1StaRef->dxy(
primaryVertices->begin()->position()));
512 zDau1dzFromPV->push_back(mu1StaRef->dz(
primaryVertices->begin()->position()));
513 zDau1MuEnergyEm->push_back(-1);
514 zDau1MuEnergyHad->push_back(-1);
518 zDau1NofHit->push_back(mu1TrkRef->numberOfValidHits());
519 zDau1NofHitTk->push_back(mu1TrkRef->numberOfValidHits());
520 zDau1NofHitSta->push_back(0);
521 zDau1Chi2->push_back(mu1TrkRef->normalizedChi2());
522 zDau1TrkChi2->push_back(mu1TrkRef->normalizedChi2());
523 zDau1dxyFromBS->push_back(mu1TrkRef->dxy(beamSpotHandle->
position()));
524 zDau1dzFromBS->push_back(mu1TrkRef->dz(beamSpotHandle->
position()));
525 zDau1dxyFromPV->push_back(mu1TrkRef->dxy(
primaryVertices->begin()->position()));
526 zDau1dzFromPV->push_back(mu1TrkRef->dz(
primaryVertices->begin()->position()));
537 int dimTrig1 = mu1HLTMatches.size();
539 zDau1HLTBit->push_back(1);
541 zDau1HLTBit->push_back(0);
543 const pat::Muon *mu2 = dynamic_cast<const pat::Muon *>(m2);
544 if (mu2 !=
nullptr) {
547 zDau2NofHitTk->push_back(mu2->
innerTrack()->numberOfValidHits());
548 zDau2NofHitSta->push_back(mu2->
outerTrack()->numberOfValidHits());
549 zDau2Chi2->push_back(mu2->
normChi2());
551 zDau1TrkChi2->push_back(mu2TrkRef->normalizedChi2());
552 zDau2dxyFromBS->push_back(mu2TrkRef->dxy(beamSpotHandle->
position()));
553 zDau2dzFromBS->push_back(mu2TrkRef->dz(beamSpotHandle->
position()));
554 zDau2dxyFromPV->push_back(mu2TrkRef->dxy(
primaryVertices->begin()->position()));
555 zDau2dzFromPV->push_back(mu2TrkRef->dz(
primaryVertices->begin()->position()));
560 zDau2HLTBit->push_back(0);
562 zDau2NofHit->push_back(mu2StaRef->numberOfValidHits());
563 zDau2NofHitTk->push_back(0);
564 zDau2NofHitSta->push_back(mu2StaRef->numberOfValidHits());
565 zDau2Chi2->push_back(mu2StaRef->normalizedChi2());
566 zDau2TrkChi2->push_back(0);
567 zDau2dxyFromBS->push_back(mu2StaRef->dxy(beamSpotHandle->
position()));
568 zDau2dzFromBS->push_back(mu2StaRef->dz(beamSpotHandle->
position()));
569 zDau2dxyFromPV->push_back(mu2StaRef->dxy(
primaryVertices->begin()->position()));
570 zDau2dzFromPV->push_back(mu2StaRef->dz(
primaryVertices->begin()->position()));
571 zDau1MuEnergyEm->push_back(-1);
572 zDau1MuEnergyHad->push_back(-1);
576 zDau2NofHit->push_back(mu2TrkRef->numberOfValidHits());
577 zDau2NofHitSta->push_back(0);
578 zDau2NofHitTk->push_back(mu2TrkRef->numberOfValidHits());
579 zDau2Chi2->push_back(mu2TrkRef->normalizedChi2());
580 zDau2TrkChi2->push_back(mu2TrkRef->normalizedChi2());
581 zDau2dxyFromBS->push_back(mu2TrkRef->dxy(beamSpotHandle->
position()));
582 zDau2dzFromBS->push_back(mu2TrkRef->dz(beamSpotHandle->
position()));
583 zDau2dxyFromPV->push_back(mu2TrkRef->dxy(
primaryVertices->begin()->position()));
584 zDau2dzFromPV->push_back(mu2TrkRef->dz(
primaryVertices->begin()->position()));
591 int dimTrig2 = mu2HLTMatches.size();
593 zDau2HLTBit->push_back(1);
595 zDau2HLTBit->push_back(0);
606 zDau1SaEta->push_back(stAloneTrack1->eta());
607 zDau2SaEta->push_back(stAloneTrack2->eta());
608 zDau1SaPhi->push_back(stAloneTrack1->phi());
609 zDau2SaPhi->push_back(stAloneTrack2->phi());
611 momentum = stAloneTrack1->momentum();
615 zDau1SaPt->push_back(stAloneTrack1->pt());
616 zDau2SaPt->push_back(-stAloneTrack2->pt());
618 momentum = stAloneTrack2->momentum();
622 zDau1SaPt->push_back(-stAloneTrack1->pt());
623 zDau2SaPt->push_back(stAloneTrack2->pt());
628 zMassSa->push_back(
mass);
639 zDau2NofHit->push_back(mu2TrkRef->numberOfValidHits());
640 zDau2NofHitTk->push_back(mu2TrkRef->numberOfValidHits());
641 zDau2NofHitSta->push_back(0);
642 zDau2NofMuChambers->push_back(0);
643 zDau2NofMuMatches->push_back(0);
644 zDau2Chi2->push_back(mu2TrkRef->normalizedChi2());
645 zDau2dxyFromBS->push_back(mu2TrkRef->dxy(beamSpotHandle->
position()));
646 zDau2dzFromBS->push_back(mu2TrkRef->dz(beamSpotHandle->
position()));
647 zDau2dxyFromPV->push_back(mu2TrkRef->dxy(
primaryVertices->begin()->position()));
648 zDau2dzFromPV->push_back(mu2TrkRef->dz(
primaryVertices->begin()->position()));
649 zDau1MuEnergyEm->push_back(-1);
650 zDau1MuEnergyHad->push_back(-1);