85 #include "TDirectory.h"
95 class ParticlePtGreater {
98 return p1->momentum().perp() >
p2->momentum().perp();
102 class ParticlePGreater {
105 return p1->momentum().rho() >
p2->momentum().rho();
122 double deltaPhi(
double v1,
double v2);
123 double deltaR(
double eta1,
double phi1,
double eta2,
double phi2);
319 : ptMin_(iConfig.getUntrackedParameter<double>(
"PTMin", 1.0)),
320 etaMax_(iConfig.getUntrackedParameter<double>(
"MaxChargedHadronEta", 2.5)),
321 pCutIsolate_(iConfig.getUntrackedParameter<double>(
"PMaxIsolation", 20.0)),
322 a_Isolation_(iConfig.getUntrackedParameter<
bool>(
"UseConeIsolation",
false)),
323 genSrc_(iConfig.getUntrackedParameter(
"GenSrc",
std::
string(
"generatorSmeared"))),
324 useHepMC_(iConfig.getUntrackedParameter<
bool>(
"UseHepMC",
false)),
325 a_coneR_(iConfig.getUntrackedParameter<double>(
"ConeRadius", 34.98)),
326 a_mipR_(iConfig.getUntrackedParameter<double>(
"ConeRadiusMIP", 14.0)),
327 debugL1Info_(iConfig.getUntrackedParameter<
bool>(
"DebugL1Info",
false)),
328 verbosity_(iConfig.getUntrackedParameter<
int>(
"Verbosity", 0)) {
345 tok_L1GTrorsrc_ = consumes<L1GlobalTriggerReadoutRecord>(L1GTReadoutRcdSource_);
346 tok_L1GTobjmap_ = consumes<L1GlobalTriggerObjectMapRecord>(L1GTObjectMapRcdSource_);
347 tok_L1extMusrc_ = consumes<l1extra::L1MuonParticleCollection>(L1extraMuonSource_);
348 tok_L1Em_ = consumes<l1extra::L1EmParticleCollection>(L1extraIsoEmSource_);
349 tok_L1extNonIsoEm_ = consumes<l1extra::L1EmParticleCollection>(L1extraNonIsoEmSource_);
350 tok_L1extTauJet_ = consumes<l1extra::L1JetParticleCollection>(L1extraTauJetSource_);
351 tok_L1extCenJet_ = consumes<l1extra::L1JetParticleCollection>(L1extraCenJetSource_);
352 tok_L1extFwdJet_ = consumes<l1extra::L1JetParticleCollection>(L1extraFwdJetSource_);
354 if (!strcmp(
"Dummy",
genSrc_.c_str())) {
388 descriptions.
add(
"isolatedGenParticles", desc);
435 <<
"not found\n --> returning false by "
439 edm::LogVerbatim(
"IsoTrack") <<
"\nL1GlobalTriggerObjectMapRecord with \n\n"
440 <<
"not found\n --> returning false by "
446 unsigned int numberTriggerBits = dWord.size();
451 edm::LogVerbatim(
"IsoTrack") <<
"\nNumber of Trigger bits " << numberTriggerBits <<
"\n";
455 const std::vector<L1GlobalTriggerObjectMap> &objMapVec = gtOMRec->
gtObjectMap();
456 for (std::vector<L1GlobalTriggerObjectMap>::const_iterator itMap = objMapVec.begin(); itMap != objMapVec.end();
459 int itrig = (*itMap).algoBitNumber();
473 for (
unsigned int iBit = 0; iBit < numberTriggerBits; ++iBit) {
474 bool accept = dWord[iBit];
488 l1extra::L1JetParticleCollection::const_iterator
itr;
489 for (
itr = l1TauHandle->begin();
itr != l1TauHandle->end(); ++
itr) {
495 <<
" " <<
itr->phi();
502 for (
itr = l1CenJetHandle->begin();
itr != l1CenJetHandle->end(); ++
itr) {
508 <<
itr->eta() <<
" " <<
itr->phi();
514 for (
itr = l1FwdJetHandle->begin();
itr != l1FwdJetHandle->end(); ++
itr) {
520 <<
itr->eta() <<
" " <<
itr->phi();
524 l1extra::L1EmParticleCollection::const_iterator itrEm;
527 for (itrEm = l1IsoEmHandle->begin(); itrEm != l1IsoEmHandle->end(); ++itrEm) {
532 edm::LogVerbatim(
"IsoTrack") <<
"isoEm p/pt " << itrEm->momentum() <<
" " << itrEm->pt() <<
" eta/phi "
533 << itrEm->eta() <<
" " << itrEm->phi();
539 for (itrEm = l1NonIsoEmHandle->begin(); itrEm != l1NonIsoEmHandle->end(); ++itrEm) {
544 edm::LogVerbatim(
"IsoTrack") <<
"nonIsoEm p/pt " << itrEm->momentum() <<
" " << itrEm->pt() <<
" eta/phi "
545 << itrEm->eta() <<
" " << itrEm->phi();
550 l1extra::L1MuonParticleCollection::const_iterator itrMu;
553 for (itrMu = l1MuHandle->begin(); itrMu != l1MuHandle->end(); ++itrMu) {
558 edm::LogVerbatim(
"IsoTrack") <<
"l1muon p/pt " << itrMu->momentum() <<
" " << itrMu->pt() <<
" eta/phi "
559 << itrMu->eta() <<
" " << itrMu->phi();
572 for (
unsigned int indx = 0; indx < trackIDs.size(); ++indx) {
573 int charge = trackIDs[indx].charge;
574 HepMC::GenEvent::particle_const_iterator
p = trackIDs[indx].trkItr;
576 (*p)->momentum().px(), (*p)->momentum().py(), (*p)->momentum().pz(), (*p)->momentum().e());
578 edm::LogVerbatim(
"IsoTrack") <<
"trkIndx " << indx <<
" pdgid " << trackIDs[indx].pdgId <<
" charge " <<
charge
579 <<
" momVec " << momVec;
584 posVec =
GlobalPoint(0.1 * (*p)->production_vertex()->position().x(),
585 0.1 * (*p)->production_vertex()->position().y(),
586 0.1 * (*p)->production_vertex()->position().z());
587 posECAL = trackIDs[indx].pointECAL;
588 fillTrack(posVec, momVec, posECAL, trackIDs[indx].
pdgId, trackIDs[indx].okECAL,
true);
590 edm::LogVerbatim(
"IsoTrack") <<
"posECAL " << posECAL <<
" okECAL " << trackIDs[indx].okECAL <<
"okHCAL "
591 << trackIDs[indx].okHCAL;
592 if (trackIDs[indx].okECAL) {
609 trackIDs[indx].directionECAL,
618 trackIDs[indx].directionECAL,
621 if (trackIDs[indx].okHCAL) {
632 trackIDs[indx].directionHCAL,
641 trackIDs[indx].directionHCAL,
646 bool saveTrack =
true;
656 fillTrack(posVec, momVec, posECAL, 0,
false,
false);
662 HepMC::GenEvent::particle_const_iterator
p;
663 for (
p = myGenEvent->particles_begin(), indx = 0;
p != myGenEvent->particles_end(); ++
p, ++indx) {
664 int pdgId = ((*p)->pdg_id());
667 double pp = (*p)->momentum().rho();
668 double eta = (*p)->momentum().eta();
673 std::vector<spr::propagatedGenParticleID> trackIDs =
676 for (
unsigned int indx = 0; indx < trackIDs.size(); ++indx) {
677 int charge = trackIDs[indx].charge;
678 reco::GenParticleCollection::const_iterator
p = trackIDs[indx].trkItr;
682 edm::LogVerbatim(
"IsoTrack") <<
"trkIndx " << indx <<
" pdgid " << trackIDs[indx].pdgId <<
" charge " <<
charge
683 <<
" momVec " << momVec;
688 edm::LogVerbatim(
"IsoTrack") <<
" pt " << momVec.Pt() <<
" eta " << momVec.eta();
690 posVec =
GlobalPoint(
p->vertex().x(),
p->vertex().y(),
p->vertex().z());
691 posECAL = trackIDs[indx].pointECAL;
693 edm::LogVerbatim(
"IsoTrack") <<
"posECAL " << posECAL <<
" okECAL " << trackIDs[indx].okECAL <<
"okHCAL "
694 << trackIDs[indx].okHCAL;
695 fillTrack(posVec, momVec, posECAL, trackIDs[indx].
pdgId, trackIDs[indx].okECAL,
true);
696 if (trackIDs[indx].okECAL) {
722 trackIDs[indx].directionECAL,
731 trackIDs[indx].directionECAL,
734 if (trackIDs[indx].okHCAL) {
749 trackIDs[indx].directionHCAL,
758 trackIDs[indx].directionHCAL,
763 bool saveTrack =
true;
773 fillTrack(posVec, momVec, posECAL, 0,
false,
false);
779 reco::GenParticleCollection::const_iterator
p;
784 double pp = (
p->momentum()).
R();
785 double eta = (
p->momentum()).Eta();
801 double tempgen_TH[
NPBins_ + 1] = {0.0, 5.0, 12.0, 300.0};
805 double tempgen_Eta[
NEtaBins_ + 1] = {0.0, 0.5, 1.1, 1.7, 2.3};
824 return std::sqrt(deta * deta + dphi * dphi);
830 return deta * deta + dphi * dphi;
842 double phi1 = momVec.phi();
843 double phi2 = (posECAL - posVec).
phi();
845 double deta = momVec.eta() - (posECAL - posVec).
eta();
1043 h_NEventProc = fs->
make<TH1I>(
"h_NEventProc",
"h_NEventProc", 2, -0.5, 0.5);
1044 h_L1AlgoNames = fs->
make<TH1I>(
"h_L1AlgoNames",
"h_L1AlgoNames:Bin Labels", 128, -0.5, 127.5);
1046 double pBin[
PBins_ + 1] = {0.0, 2.0, 4.0, 6.0, 8.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0,
1047 70.0, 80.0, 90.0, 100.0, 150.0, 200.0, 250.0, 300.0, 350.0, 400.0, 450.0,
1048 500.0, 550.0, 600.0, 650.0, 700.0, 750.0, 800.0, 850.0, 900.0, 950.0, 1000.0};
1049 double etaBin[
EtaBins_ + 1] = {-3.0, -2.9, -2.8, -2.7, -2.6, -2.5, -2.4, -2.3, -2.2, -2.1, -2.0, -1.9, -1.8,
1050 -1.7, -1.6, -1.5, -1.4, -1.3, -1.2, -1.1, -1.0, -0.9, -0.8, -0.7, -0.6, -0.5,
1051 -0.4, -0.3, -0.2, -0.1, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8,
1052 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1,
1053 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0};
1055 "electron",
"positron",
"#gamma",
"#pi^+",
"#pi^-",
"K^+",
"K^-",
"p",
"n",
"pbar",
"nbar",
"K^0_L"};
1059 sprintf(
name,
"pEta%d",
i);
1060 sprintf(
title,
"#eta vs momentum for %s", particle[
i].c_str());
1065 tree_ = fs->
make<TTree>(
"tree_",
"tree");
1222 t_muEneR =
new std::vector<double>();
1435 tree_->Branch(
"t_muEneR",
"std::vector<double>", &
t_muEneR);
1707 int partID[
Particles] = {11, -11, 21, 211, -211, 321, -321, 2212, 2112, -2212, -2112, 130};
1709 for (
int ik = 0; ik <
Particles; ++ik) {
1710 if (
pdgId == partID[ik]) {