33 double CElecPtMin = ps.
getParameter<
double>(
"CElecPtMin");
34 double CEB_siEiE = ps.
getParameter<
double>(
"CEB_sigmaIEtaIEta");
35 double CEB_dPhiIn = ps.
getParameter<
double>(
"CEB_deltaPhiIn");
36 double CEB_dEtaIn = ps.
getParameter<
double>(
"CEB_deltaEtaIn");
37 double CEB_EcalIso = ps.
getParameter<
double>(
"CEB_EcalIso");
38 double CEB_HcalIso = ps.
getParameter<
double>(
"CEB_HcalIso");
39 double CEB_TrckIso = ps.
getParameter<
double>(
"CEB_TrckIso");
40 double CEE_siEiE = ps.
getParameter<
double>(
"CEE_sigmaIEtaIEta");
41 double CEE_dPhiIn = ps.
getParameter<
double>(
"CEE_deltaPhiIn");
42 double CEE_dEtaIn = ps.
getParameter<
double>(
"CEE_deltaEtaIn");
43 double CEE_EcalIso = ps.
getParameter<
double>(
"CEE_EcalIso");
44 double CEE_HcalIso = ps.
getParameter<
double>(
"CEE_HcalIso");
45 double CEE_TrckIso = ps.
getParameter<
double>(
"CEE_TrckIso");
77 t_ = fs->
make<TTree>(
"ErsatzMEt",
"Data on ErsatzMEt");
81 t_->Branch(
"nTags", &
nTags_,
"nTags/I");
106 t_->Branch(
"CaloMEt", &
CaloMEt_,
"CaloMEt/D");
108 t_->Branch(
"T1MEt", &
T1MEt_,
"T1MEt/D");
110 t_->Branch(
"PfMEt", &
PfMEt_,
"PfMEt/D");
112 t_->Branch(
"TcMEt", &
TcMEt_,
"TcMEt/D");
116 t_->Branch(
"tag_q",
tag_q_,
"tag_q[4]/I");
117 t_->Branch(
"tag_pt",
tag_pt_,
"tag_pt[4]/D");
118 t_->Branch(
"tag_eta",
tag_eta_,
"tag_eta[4]/D");
119 t_->Branch(
"tag_phi",
tag_phi_,
"tag_phi[4]/D");
129 t_->Branch(
"tag_hoe",
tag_hoe_,
"tag_hoe[4]/D");
130 t_->Branch(
"tag_eop",
tag_eop_,
"tag_eop[4]/D");
131 t_->Branch(
"tag_pin",
tag_pin_,
"tag_pin[4]/D");
138 t_->Branch(
"probe_q",
probe_q_,
"probe_q[4]/I");
159 t_->Branch(
"Z_m",
Z_m_,
"Z_m[4]/D");
160 t_->Branch(
"Z_pt",
Z_pt_,
"Z_pt[4]/D");
161 t_->Branch(
"Z_eta",
Z_eta_,
"Z_eta[4]/D");
162 t_->Branch(
"Z_y",
Z_y_,
"Z_y[4]/D");
163 t_->Branch(
"Z_phi",
Z_phi_,
"Z_phi[4]/D");
164 t_->Branch(
"Z_rescM",
Z_rescM_,
"Z_rescM[4]/D");
165 t_->Branch(
"Z_rescPt",
Z_rescPt_,
"Z_rescPt[4]/D");
167 t_->Branch(
"Z_rescY",
Z_rescY_,
"Z_rescY[4]/D");
188 t_->Branch(
"McZ_m", &
McZ_m_,
"McZ_m/D");
190 t_->Branch(
"McZ_Pt", &
McZ_pt_,
"McZ_Pt/D");
191 t_->Branch(
"McZ_y", &
McZ_y_,
"McZ_y/D");
192 t_->Branch(
"McZ_Eta", &
McZ_eta_,
"McZ_Eta/D");
193 t_->Branch(
"McZ_Phi", &
McZ_phi_,
"McZ_Phi/D");
285 edm::LogDebug_(
"",
"",180)<<
"Initialisation of array index "<<
i <<
" completed.";
311 std::vector<math::XYZTLorentzVector>McElecs,McElecsFinalState;
312 std::vector<math::XYZTLorentzVector> McElecsResc;
318 for(reco::GenParticleCollection::const_iterator McP = McCand->begin(); McP != McCand->end(); ++McP)
323 McElecs.push_back(McP->p4());
326 std::cout <<
"Found electron, ID = "<< McP->pdgId() <<
"\t status = "<< McP->status()<<std::endl;
327 if(McP->status() != 1)
331 while(McPD->
status() != 1)
335 <<
"\tNumber of Daughters = "<< n <<std::endl;
336 for(
int j = 0; j <
n; ++ j)
339 std::cout <<
"Daughter "<< j <<
"\t id = "<< d->
pdgId() << std::endl;
348 McElecsFinalState.push_back(McPD->
p4());
349 }
else McElecsFinalState.push_back(McP->p4());
358 McElecsResc.resize(2);
363 ROOT::Math::Boost CoMBoost(Zboson.BoostToCM());
370 double E_W = RescZboson.E();
371 ROOT::Math::Boost BackToLab(RescZboson.Px()/E_W, RescZboson.Py()/E_W, RescZboson.Pz()/E_W);
373 RescMcElec0 = BackToLab(RescMcElec0);
378 RescMcElec1 = BackToLab(RescMcElec1);
382 McElecsResc[0] = RescMcElec0;
383 McElecsResc[1] = RescMcElec1;
385 edm::LogDebug_(
"",
"", 307)<<
"McElecsResc[0] + McElecsResc[1] = ("<<sum.Px()<<
", "<<sum.Py()<<
", " 386 <<sum.Pz()<<
", "<<sum.E()<<
")";
393 for(
unsigned int itrig = 0; itrig < HltRes->
size(); ++itrig)
396 edm::LogInfo(
"")<< itrig <<
" : Name = "<< nom <<
"\t Accepted = "<< HltRes->
accept(itrig);
400 if(HltRes->
accept(34) !=0)
402 std::vector<reco::GsfElectronRef> UniqueElectrons;
404 edm::LogDebug_(
"",
"ErsatzMEt",192)<<
"Unique electron size = "<<UniqueElectrons.size();
405 std::vector<reco::GsfElectronRef> SelectedElectrons;
407 std::cout <<
"Filter Id = " << fId << std::endl;
409 nTags_ = SelectedElectrons.size();
417 for(std::vector<reco::GsfElectronRef>::const_iterator elec = SelectedElectrons.begin();
418 elec != SelectedElectrons.end(); ++elec)
420 for(
int m = 0;
m < 2; ++
m)
422 double dRLimit = 99.;
436 std::map<reco::GsfElectronRef, reco::GsfElectronRef>
TagProbePairs;
437 TagProbePairs =
probeFinder(SelectedElectrons, pElectrons);
439 edm::LogDebug_(
"",
"ErsatzMEt", 209)<<
"Number of tag-probe pairs = "<< TagProbePairs.size();
441 if(!TagProbePairs.empty())
444 const reco::MET calomet = *(caloMEtCollection->begin());
454 const reco::MET pfmet = *(pfMEtCollection->begin());
459 const reco::MET tcmet = *(tcMEtCollection->begin());
465 for(std::map<reco::GsfElectronRef, reco::GsfElectronRef>::const_iterator it = TagProbePairs.begin();
466 it != TagProbePairs.end(); ++it)
479 + it->first->isolationVariables04().hcalDepth2TowerSumEt;
508 + it->second->isolationVariables04().hcalDepth2TowerSumEt;
528 double dRLimit = 0.2;
529 for(
unsigned int mcEId = 0; mcEId < McElecs.size(); ++mcEId)
618 std::map<reco::GsfElectronRef, reco::GsfElectronRef>
ErsatzMEt::probeFinder(
const std::vector<reco::GsfElectronRef>& tags,
622 std::map<reco::GsfElectronRef, reco::GsfElectronRef> TagProbes;
623 for(std::vector<reco::GsfElectronRef>::const_iterator tagelec = tags.begin(); tagelec != tags.end(); ++tagelec)
626 std::pair<reco::GsfElectronRef, reco::GsfElectronRef> TagProbePair;
627 int nProbesPerTag = 0;
629 for(reco::GsfElectronCollection::const_iterator probeelec = probeCands->begin(); probeelec != probeCands->end(); ++probeelec)
632 double probeScEta = probe->superCluster()->eta();
633 if(probe->superCluster() != tag->superCluster() && fabs(probeScEta) < 2.5)
635 if(fabs(probeScEta) < 1.4442 || fabs(probeScEta) > 1.560)
640 TagProbePair = std::make_pair(tag, probe);
648 if(nProbesPerTag == 1) TagProbes.insert(TagProbePair);
658 const math::XYZPoint ZVertex(elec->TrackPositionAtVtx().X(), elec->TrackPositionAtVtx().Y(),elec->TrackPositionAtVtx().Z());
668 edm::LogDebug_(
"ersatzFabrikV1",
"", 569)<<
"elec = ("<< elec->p4().Px() <<
", "<< elec->p4().Py()<<
", "<< elec->p4().Pz() <<
", "<< elec->p4().E()<<
")";
670 edm::LogDebug_(
"ersatzFabrikV1",
"", 569)<<
"Z pt = "<< Zboson.Pt() <<
"Z boson mass = " << Zboson.M();
671 edm::LogDebug_(
"ersatzFabrikV1",
"", 570)<<
"Z boson in lab frame = ("<<Zboson.Px()<<
", "<<Zboson.Py()<<
", " 672 <<Zboson.Pz()<<
", "<<Zboson.E()<<
")";
674 edm::LogDebug_(
"ersatzFabrikV1",
"", 573)<<
"W boson in lab frame = ("<<RescZboson.Px()<<
", "<<RescZboson.Py()<<
", " 675 <<RescZboson.Pz()<<
", "<<RescZboson.E()<<
")";
676 ROOT::Math::Boost BoostToZRestFrame(Zboson.BoostToCM());
677 edm::LogDebug_(
"ersatzFabrikV1",
"", 576)<<
"Electron in lab frame = ("<< boost_ele.Px()<<
", "<< boost_ele.Py()<<
", " 678 << boost_ele.Pz()<<
", "<< boost_ele.E()<<
")";
679 edm::LogDebug_(
"ersatzFabrikV1",
"", 578)<<
"Ersatz Neutrino in lab frame = ("<< boost_nu.Px()<<
", "<< boost_nu.Py()<<
", " 680 << boost_nu.Pz()<<
", "<< boost_nu.E()<<
")";
681 boost_ele = BoostToZRestFrame(boost_ele);
682 boost_nu = BoostToZRestFrame(boost_nu);
683 edm::LogDebug_(
"ersatzFabrikV1",
"", 582)<<
"Electron in Z rest frame = ("<<boost_ele.Px()<<
", "<<boost_ele.Py()<<
", " 684 <<boost_ele.Pz()<<
", "<<boost_ele.E()<<
")";
685 edm::LogDebug_(
"ersatzFabrikV1",
"", 584)<<
"Ersatz Neutrino in Z rest frame = ("<<boost_nu.Px()<<
", "<<boost_nu.Py()<<
", " 686 <<boost_nu.Pz()<<
", "<<boost_nu.E()<<
")";
690 double E_W = RescZboson.E();
691 ROOT::Math::Boost BackToLab(RescZboson.Px()/E_W, RescZboson.Py()/E_W, RescZboson.Pz()/E_W);
693 boost_ele = BackToLab(boost_ele);
695 boost_nu = BackToLab(boost_nu);
697 edm::LogDebug_(
"ersatzFabrikV1",
"", 597)<<
"Electron back in lab frame = ("<<boost_ele.Px()<<
", "<<boost_ele.Py()<<
", " 698 <<boost_ele.Pz()<<
", "<<boost_ele.E()<<
")";
699 edm::LogDebug_(
"ersatzFabrikV1",
"", 599)<<
"Ersatz Neutrino back in lab frame = ("<<boost_nu.Px()<<
", "<<boost_nu.Py()<<
", " 700 <<boost_nu.Pz()<<
", "<<boost_nu.E()<<
")";
701 edm::LogDebug_(
"ersatzFabrikV1",
"", 601)<<
"boost_ele + boost_nu = ("<<sum.Px()<<
", "<<sum.Py()<<
", " 702 <<sum.Pz()<<
", "<<sum.E()<<
")";
704 nu.SetXYZT(nu.X(), nu.Y(), 0., nu.T());
705 ele.SetXYZT(ele.X(), ele.Y(), 0., ele.T());
706 boost_ele.SetXYZT(boost_ele.X(), boost_ele.Y(), 0., boost_ele.T());
707 metVec = met.
p4() + nu + ele - boost_ele;
814 boost_elec = tag->p4();
815 edm::LogDebug_(
"ersatzFabrikV1",
"", 858)<<
"boost_elec = ("<< boost_elec.Px() <<
", "<< boost_elec.Py()<<
", "<< boost_elec.Pz() <<
", "<< boost_elec.E()<<
")";
816 boost_nu = probe->p4();
817 edm::LogDebug_(
"ersatzFabrikV1",
"", 860)<<
"boost_nu = ("<< boost_nu.Px() <<
", "<< boost_nu.Py()<<
", "<< boost_nu.Pz() <<
", "<< boost_nu.E()<<
")";
819 edm::LogDebug_(
"ersatzFabrikV1",
"", 862)<<
"Zboson = ("<< Zboson.Px() <<
", "<< Zboson.Py()<<
", "<< Zboson.Pz() <<
", "<< Zboson.E()<<
")";
821 edm::LogDebug_(
"ersatzFabrikV1",
"", 864)<<
"RescZboson = ("<< RescZboson.Px() <<
", "<< RescZboson.Py()<<
", "<< RescZboson.Pz() <<
", "<< RescZboson.E()<<
")";
822 ROOT::Math::Boost BoostToZRestFrame(Zboson.BoostToCM());
823 elec = BoostToZRestFrame(boost_elec);
824 edm::LogDebug_(
"ersatzFabrikV1",
"", 867)<<
"boost_elec (in Z rest frame) = ("<< elec.Px() <<
", "<< elec.Py()<<
", "<< elec.Pz() <<
", "<< elec.E()<<
")";
825 nu = BoostToZRestFrame(boost_nu);
826 edm::LogDebug_(
"ersatzFabrikV1",
"", 869)<<
"boost_nu (in Z rest frame) = ("<< nu.Px() <<
", "<< nu.Py()<<
", "<< nu.Pz() <<
", "<< nu.E()<<
")";
828 edm::LogDebug_(
"ersatzFabrikV1",
"", 871)<<
"elec (in Z rest frame) = ("<< elec.Px() <<
", "<< elec.Py()<<
", "<< elec.Pz() <<
", "<< elec.E()<<
")";
830 edm::LogDebug_(
"ersatzFabrikV1",
"", 873)<<
"nu (in Z rest frame) = ("<< nu.Px() <<
", "<< nu.Py()<<
", "<< nu.Pz() <<
", "<< nu.E()<<
")";
831 ROOT::Math::Boost BoostBackToLab(RescZboson.Px()/RescZboson.E(), RescZboson.Py()/RescZboson.E(), RescZboson.Pz()/RescZboson.E());
833 elec = BoostBackToLab(elec);
834 edm::LogDebug_(
"ersatzFabrikV1",
"", 877)<<
"elec = ("<< elec.Px() <<
", "<< elec.Py()<<
", "<< elec.Pz() <<
", "<< elec.E()<<
")";
835 nu = BoostBackToLab(nu);
836 edm::LogDebug_(
"ersatzFabrikV1",
"", 879)<<
"nu = ("<< nu.Px() <<
", "<< nu.Py()<<
", "<< nu.Pz() <<
", "<< nu.E()<<
")";
854 elec.SetXYZT(elec.X(), elec.Y(), 0., elec.T());
855 nu.SetXYZT(nu.X(), nu.Y(), 0., nu.T());
856 boost_elec.SetXYZT(boost_elec.X(), boost_elec.Y(), 0., boost_elec.T());
857 metVec = met.
p4() + nu + elec - boost_elec;
constexpr double deltaPhi(double phi1, double phi2)
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
std::vector< double > CutVector_
T getParameter(std::string const &) const
double probe_d_MCE_SCE_[4]
ErsatzMEt(const edm::ParameterSet &)
edm::EDGetTokenT< trigger::TriggerEvent > TriggerEvent_
std::vector< reco::GsfElectronRef > uniqueElectronFinder(edm::Handle< reco::GsfElectronCollection > &pElectrons)
double ErsatzV3CaloMt_[4]
double ErsatzV3_rescMesc_[4]
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< TagProbePair > TagProbePairs
edm::ParameterSet hyb_fCorrPSet_
#define DEFINE_FWK_MODULE(type)
virtual const Candidate * daughter(size_type i) const =0
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
bool accept() const
Has at least one path accepted the event?
double ErsatzV4_rescMesc_[4]
edm::InputTag TriggerPath_
trigger::size_type filterIndex(const edm::InputTag &filterTag) const
find index of filter in data-member vector from filter tag
double probe_sc_nClus_[4]
math::XYZTLorentzVector DetectorVector(const reco::SuperClusterRef &sc)
reco::SuperCluster fEtaScCorr(const reco::SuperCluster &sc)
edm::EDGetTokenT< reco::GenMETCollection > GenMEtCollection_
double pt() const final
transverse momentum
virtual const Candidate * mother(size_type i=0) const =0
return pointer to mother
T * make(const Args &...args) const
make new ROOT object
double McProbe_rescEta_[4]
double McElecProbe_dEta_[4]
std::vector< reco::MET > METCollection
collection of MET objects
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
double ErsatzV4CaloMEt_[4]
double eta() const
pseudorapidity of cluster centroid
VDouble InvariantMass(Tau)
double McElecProbe_dR_[4]
double ErsatzV2CaloMEt_[4]
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
virtual int status() const =0
status word
edm::ParameterSet m5x5_fCorrPSet_
double ErsatzV2_rescMesc_[4]
double ErsatzV1PfMEtPhi_[4]
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector
virtual int pdgId() const =0
PDG identifier.
unsigned int size() const
Get number of paths stored.
double McProbe_rescPt_[4]
reco::SuperCluster fBremScCorr(const reco::SuperCluster &sc, const edm::ParameterSet &ps)
Cos< T >::type cos(const T &t)
const Point & vertex() const override
vertex position (overwritten by PF...)
Abs< T >::type abs(const T &t)
double ErsatzV1CaloMEt_[4]
double energy() const
cluster energy
const LorentzVector & p4() const final
four-momentum Lorentz vector
double McElec_rescEta_[4]
math::XYZTLorentzVector PhysicsVectorRaw(const math::XYZPoint &vertex, const reco::SuperCluster &sc)
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
edm::ESHandle< CaloGeometry > geoHandle_
edm::EDGetTokenT< reco::PFMETCollection > PfMEtCollection_
double ErsatzV3CaloMEt_[4]
double rawEnergy() const
raw uncorrected energy (sum of energies of component BasicClusters)
bool isInFiducial(double)
std::vector< reco::CaloMET > CaloMETCollection
collection of CaloMET objects
T const * product() const
edm::EDGetTokenT< edm::TriggerResults > TriggerResults_
std::vector< reco::GsfElectronRef > electronSelector(const std::vector< reco::GsfElectronRef > &electrons, const edm::Handle< trigger::TriggerEvent > &pHLT, const int filterId, const std::vector< double > &Cuts)
std::string const & triggerName(unsigned int index) const
XYZPointD XYZPoint
point in space with cartesian internal representation
size_t clustersSize() const
number of BasicCluster constituents
double ErsatzV4CaloMEtPhi_[4]
void analyze(const edm::Event &, const edm::EventSetup &) override
double ErsatzV4CaloMt_[4]
edm::EDGetTokenT< reco::SuperClusterCollection > HybridScCollection_
double ErsatzV1T1MEtPhi_[4]
edm::EDGetTokenT< reco::GsfElectronCollection > ElectronCollection_
edm::EDGetTokenT< reco::GenParticleCollection > MCTruthCollection_
edm::EDGetTokenT< reco::CaloMETCollection > CaloMEtCollection_
double ErsatzV3CaloMEtPhi_[4]
std::vector< reco::PFMET > PFMETCollection
collection of PFMET objects
edm::EDGetTokenT< reco::SuperClusterCollection > M5x5ScCollection_
double ErsatzV1TcMEtPhi_[4]
reco::MET ersatzFabrik(const reco::GsfElectronRef &, const reco::SuperCluster &, const reco::MET &, const int)
double McElecProbe_dPhi_[4]
edm::EDGetTokenT< reco::METCollection > TcMEtCollection_
double phi() const
azimuthal angle of cluster centroid
double ErsatzV2CaloMEtPhi_[4]
std::map< reco::GsfElectronRef, reco::GsfElectronRef > probeFinder(const std::vector< reco::GsfElectronRef > &, const edm::Handle< reco::GsfElectronCollection >)
double McElec_rescPhi_[4]
virtual size_type numberOfDaughters() const =0
number of daughters
double ErsatzV1CaloMt_[4]
double phi() const final
momentum azimuthal angle
double ErsatzV1CaloMEtPhi_[4]
double ErsatzV2CaloMt_[4]
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
edm::ESHandle< CaloTopology > pTopology_
double McProbe_rescPhi_[4]
double ErsatzV1_rescMesc_[4]