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.";
377 std::vector<math::XYZTLorentzVector>McElecs,McElecsFinalState;
378 std::vector<math::XYZTLorentzVector> McElecsResc;
384 for(reco::GenParticleCollection::const_iterator McP = McCand->begin(); McP != McCand->end(); ++McP)
387 if(
abs(McP->pdgId())==11 &&
abs(mum->
pdgId()) == 23)
389 McElecs.push_back(McP->p4());
390 if(
abs(mum->
pdgId() == 23)) Zboson = mum->
p4();
392 std::cout <<
"Found electron, ID = "<< McP->pdgId() <<
"\t status = "<< McP->status()<<std::endl;
393 if(McP->status() != 1)
397 while(McPD->
status() != 1)
401 <<
"\tNumber of Daughters = "<< n <<std::endl;
402 for(
int j = 0;
j <
n; ++
j)
414 McElecsFinalState.push_back(McPD->
p4());
415 }
else McElecsFinalState.push_back(McP->p4());
424 McElecsResc.resize(2);
429 ROOT::Math::Boost CoMBoost(Zboson.BoostToCM());
436 double E_W = RescZboson.E();
437 ROOT::Math::Boost BackToLab(RescZboson.Px()/E_W, RescZboson.Py()/E_W, RescZboson.Pz()/E_W);
439 RescMcElec0 = BackToLab(RescMcElec0);
444 RescMcElec1 = BackToLab(RescMcElec1);
448 McElecsResc[0] = RescMcElec0;
449 McElecsResc[1] = RescMcElec1;
451 edm::LogDebug_(
"",
"", 307)<<
"McElecsResc[0] + McElecsResc[1] = ("<<sum.Px()<<
", "<<sum.Py()<<
", "
452 <<sum.Pz()<<
", "<<sum.E()<<
")";
459 for(
unsigned int itrig = 0; itrig < HltRes->
size(); ++itrig)
462 edm::LogInfo(
"")<< itrig <<
" : Name = "<< nom <<
"\t Accepted = "<< HltRes->
accept(itrig);
466 if(HltRes->
accept(34) !=0)
468 std::vector<reco::GsfElectronRef> UniqueElectrons;
470 edm::LogDebug_(
"",
"ErsatzMEt",192)<<
"Unique electron size = "<<UniqueElectrons.size();
471 std::vector<reco::GsfElectronRef> SelectedElectrons;
472 const unsigned int fId = pHLT->filterIndex(
TriggerPath_);
473 std::cout <<
"Filter Id = " << fId << std::endl;
475 nTags_ = SelectedElectrons.size();
483 for(std::vector<reco::GsfElectronRef>::const_iterator elec = SelectedElectrons.begin();
484 elec != SelectedElectrons.end(); ++elec)
486 for(
int m = 0;
m < 2; ++
m)
488 double dRLimit = 99.;
502 std::map<reco::GsfElectronRef, reco::GsfElectronRef>
TagProbePairs;
503 TagProbePairs =
probeFinder(SelectedElectrons, pElectrons);
505 edm::LogDebug_(
"",
"ErsatzMEt", 209)<<
"Number of tag-probe pairs = "<< TagProbePairs.size();
507 if(!TagProbePairs.empty())
510 const reco::MET calomet = *(caloMEtCollection->begin());
520 const reco::MET pfmet = *(pfMEtCollection->begin());
525 const reco::MET tcmet = *(tcMEtCollection->begin());
531 for(std::map<reco::GsfElectronRef, reco::GsfElectronRef>::const_iterator it = TagProbePairs.begin();
532 it != TagProbePairs.end(); ++it)
545 + it->first->isolationVariables04().hcalDepth2TowerSumEt;
574 + it->second->isolationVariables04().hcalDepth2TowerSumEt;
594 double dRLimit = 0.2;
595 for(
unsigned int mcEId = 0; mcEId < McElecs.size(); ++mcEId)
688 std::map<reco::GsfElectronRef, reco::GsfElectronRef> TagProbes;
689 for(std::vector<reco::GsfElectronRef>::const_iterator tagelec = tags.begin(); tagelec != tags.end(); ++tagelec)
692 std::pair<reco::GsfElectronRef, reco::GsfElectronRef> TagProbePair;
693 int nProbesPerTag = 0;
695 for(reco::GsfElectronCollection::const_iterator probeelec = probeCands->begin(); probeelec != probeCands->end(); ++probeelec)
698 double probeScEta = probe->superCluster()->eta();
699 if(probe->superCluster() != tag->superCluster() && fabs(probeScEta) < 2.5)
701 if(fabs(probeScEta) < 1.4442 || fabs(probeScEta) > 1.560)
706 TagProbePair = std::make_pair(tag, probe);
714 if(nProbesPerTag == 1) TagProbes.insert(TagProbePair);
724 const math::XYZPoint ZVertex(elec->TrackPositionAtVtx().X(), elec->TrackPositionAtVtx().Y(),elec->TrackPositionAtVtx().Z());
734 edm::LogDebug_(
"ersatzFabrikV1",
"", 569)<<
"elec = ("<< elec->p4().Px() <<
", "<< elec->p4().Py()<<
", "<< elec->p4().Pz() <<
", "<< elec->p4().E()<<
")";
736 edm::LogDebug_(
"ersatzFabrikV1",
"", 569)<<
"Z pt = "<< Zboson.Pt() <<
"Z boson mass = " << Zboson.M();
737 edm::LogDebug_(
"ersatzFabrikV1",
"", 570)<<
"Z boson in lab frame = ("<<Zboson.Px()<<
", "<<Zboson.Py()<<
", "
738 <<Zboson.Pz()<<
", "<<Zboson.E()<<
")";
740 edm::LogDebug_(
"ersatzFabrikV1",
"", 573)<<
"W boson in lab frame = ("<<RescZboson.Px()<<
", "<<RescZboson.Py()<<
", "
741 <<RescZboson.Pz()<<
", "<<RescZboson.E()<<
")";
742 ROOT::Math::Boost BoostToZRestFrame(Zboson.BoostToCM());
743 edm::LogDebug_(
"ersatzFabrikV1",
"", 576)<<
"Electron in lab frame = ("<< boost_ele.Px()<<
", "<< boost_ele.Py()<<
", "
744 << boost_ele.Pz()<<
", "<< boost_ele.E()<<
")";
745 edm::LogDebug_(
"ersatzFabrikV1",
"", 578)<<
"Ersatz Neutrino in lab frame = ("<< boost_nu.Px()<<
", "<< boost_nu.Py()<<
", "
746 << boost_nu.Pz()<<
", "<< boost_nu.E()<<
")";
747 boost_ele = BoostToZRestFrame(boost_ele);
748 boost_nu = BoostToZRestFrame(boost_nu);
749 edm::LogDebug_(
"ersatzFabrikV1",
"", 582)<<
"Electron in Z rest frame = ("<<boost_ele.Px()<<
", "<<boost_ele.Py()<<
", "
750 <<boost_ele.Pz()<<
", "<<boost_ele.E()<<
")";
751 edm::LogDebug_(
"ersatzFabrikV1",
"", 584)<<
"Ersatz Neutrino in Z rest frame = ("<<boost_nu.Px()<<
", "<<boost_nu.Py()<<
", "
752 <<boost_nu.Pz()<<
", "<<boost_nu.E()<<
")";
756 double E_W = RescZboson.E();
757 ROOT::Math::Boost BackToLab(RescZboson.Px()/E_W, RescZboson.Py()/E_W, RescZboson.Pz()/E_W);
759 boost_ele = BackToLab(boost_ele);
761 boost_nu = BackToLab(boost_nu);
763 edm::LogDebug_(
"ersatzFabrikV1",
"", 597)<<
"Electron back in lab frame = ("<<boost_ele.Px()<<
", "<<boost_ele.Py()<<
", "
764 <<boost_ele.Pz()<<
", "<<boost_ele.E()<<
")";
765 edm::LogDebug_(
"ersatzFabrikV1",
"", 599)<<
"Ersatz Neutrino back in lab frame = ("<<boost_nu.Px()<<
", "<<boost_nu.Py()<<
", "
766 <<boost_nu.Pz()<<
", "<<boost_nu.E()<<
")";
767 edm::LogDebug_(
"ersatzFabrikV1",
"", 601)<<
"boost_ele + boost_nu = ("<<sum.Px()<<
", "<<sum.Py()<<
", "
768 <<sum.Pz()<<
", "<<sum.E()<<
")";
770 nu.SetXYZT(nu.X(), nu.Y(), 0., nu.T());
771 ele.SetXYZT(ele.X(), ele.Y(), 0., ele.T());
772 boost_ele.SetXYZT(boost_ele.X(), boost_ele.Y(), 0., boost_ele.T());
773 metVec = met.
p4() + nu + ele - boost_ele;
880 boost_elec = tag->p4();
881 edm::LogDebug_(
"ersatzFabrikV1",
"", 858)<<
"boost_elec = ("<< boost_elec.Px() <<
", "<< boost_elec.Py()<<
", "<< boost_elec.Pz() <<
", "<< boost_elec.E()<<
")";
882 boost_nu = probe->p4();
883 edm::LogDebug_(
"ersatzFabrikV1",
"", 860)<<
"boost_nu = ("<< boost_nu.Px() <<
", "<< boost_nu.Py()<<
", "<< boost_nu.Pz() <<
", "<< boost_nu.E()<<
")";
885 edm::LogDebug_(
"ersatzFabrikV1",
"", 862)<<
"Zboson = ("<< Zboson.Px() <<
", "<< Zboson.Py()<<
", "<< Zboson.Pz() <<
", "<< Zboson.E()<<
")";
887 edm::LogDebug_(
"ersatzFabrikV1",
"", 864)<<
"RescZboson = ("<< RescZboson.Px() <<
", "<< RescZboson.Py()<<
", "<< RescZboson.Pz() <<
", "<< RescZboson.E()<<
")";
888 ROOT::Math::Boost BoostToZRestFrame(Zboson.BoostToCM());
889 elec = BoostToZRestFrame(boost_elec);
890 edm::LogDebug_(
"ersatzFabrikV1",
"", 867)<<
"boost_elec (in Z rest frame) = ("<< elec.Px() <<
", "<< elec.Py()<<
", "<< elec.Pz() <<
", "<< elec.E()<<
")";
891 nu = BoostToZRestFrame(boost_nu);
892 edm::LogDebug_(
"ersatzFabrikV1",
"", 869)<<
"boost_nu (in Z rest frame) = ("<< nu.Px() <<
", "<< nu.Py()<<
", "<< nu.Pz() <<
", "<< nu.E()<<
")";
894 edm::LogDebug_(
"ersatzFabrikV1",
"", 871)<<
"elec (in Z rest frame) = ("<< elec.Px() <<
", "<< elec.Py()<<
", "<< elec.Pz() <<
", "<< elec.E()<<
")";
896 edm::LogDebug_(
"ersatzFabrikV1",
"", 873)<<
"nu (in Z rest frame) = ("<< nu.Px() <<
", "<< nu.Py()<<
", "<< nu.Pz() <<
", "<< nu.E()<<
")";
897 ROOT::Math::Boost BoostBackToLab(RescZboson.Px()/RescZboson.E(), RescZboson.Py()/RescZboson.E(), RescZboson.Pz()/RescZboson.E());
899 elec = BoostBackToLab(elec);
900 edm::LogDebug_(
"ersatzFabrikV1",
"", 877)<<
"elec = ("<< elec.Px() <<
", "<< elec.Py()<<
", "<< elec.Pz() <<
", "<< elec.E()<<
")";
901 nu = BoostBackToLab(nu);
902 edm::LogDebug_(
"ersatzFabrikV1",
"", 879)<<
"nu = ("<< nu.Px() <<
", "<< nu.Py()<<
", "<< nu.Pz() <<
", "<< nu.E()<<
")";
920 elec.SetXYZT(elec.X(), elec.Y(), 0., elec.T());
921 nu.SetXYZT(nu.X(), nu.Y(), 0., nu.T());
922 boost_elec.SetXYZT(boost_elec.X(), boost_elec.Y(), 0., boost_elec.T());
923 metVec = met.
p4() + nu + elec - boost_elec;
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 &)
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
virtual const Candidate * daughter(size_type i) const =0
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
edm::InputTag TriggerEvent_
std::vector< reco::GsfElectronRef > uniqueElectronFinder(edm::Handle< reco::GsfElectronCollection > &pElectrons)
virtual const Candidate * mother(size_type i=0) const =0
return pointer to mother
double ErsatzV3CaloMt_[4]
double ErsatzV3_rescMesc_[4]
std::vector< TagProbePair > TagProbePairs
edm::ParameterSet hyb_fCorrPSet_
virtual const Point & vertex() const
vertex position
edm::InputTag TriggerResults_
#define DEFINE_FWK_MODULE(type)
edm::InputTag M5x5ScCollection_
virtual int status() const =0
status word
bool accept() const
Has at least one path accepted the event?
double ErsatzV4_rescMesc_[4]
edm::InputTag TriggerPath_
double probe_sc_nClus_[4]
math::XYZTLorentzVector DetectorVector(const reco::SuperClusterRef &sc)
reco::SuperCluster fEtaScCorr(const reco::SuperCluster &sc)
edm::InputTag GenMEtCollection_
double McProbe_rescEta_[4]
double McElecProbe_dEta_[4]
edm::InputTag MCTruthCollection_
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 deltaR(double eta1, double phi1, double eta2, double phi2)
double ErsatzV2CaloMEt_[4]
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
edm::InputTag CaloMEtCollection_
virtual size_type numberOfDaughters() const =0
number of daughters
edm::ParameterSet m5x5_fCorrPSet_
double ErsatzV2_rescMesc_[4]
double ErsatzV1PfMEtPhi_[4]
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)
double ErsatzV1CaloMEt_[4]
double energy() const
cluster energy
edm::InputTag HybridScCollection_
double McElec_rescEta_[4]
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
edm::InputTag PfMEtCollection_
math::XYZTLorentzVector PhysicsVectorRaw(const math::XYZPoint &vertex, const reco::SuperCluster &sc)
edm::ESHandle< CaloGeometry > geoHandle_
virtual int pdgId() const =0
PDG identifier.
double deltaPhi(double phi1, double phi2)
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
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)
virtual double pt() const
transverse momentum
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]
T const * product() const
edm::InputTag TcMEtCollection_
double ErsatzV4CaloMt_[4]
double ErsatzV1T1MEtPhi_[4]
double ErsatzV3CaloMEtPhi_[4]
std::vector< reco::PFMET > PFMETCollection
collection of PFMET objects
T * make() const
make new ROOT object
double ErsatzV1TcMEtPhi_[4]
reco::MET ersatzFabrik(const reco::GsfElectronRef &, const reco::SuperCluster &, const reco::MET &, const int)
double McElecProbe_dPhi_[4]
edm::InputTag ElectronCollection_
virtual void analyze(const edm::Event &, const edm::EventSetup &)
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]
double ErsatzV1CaloMt_[4]
virtual double phi() const
momentum azimuthal angle
virtual const LorentzVector & p4() const
four-momentum Lorentz vector
double ErsatzV1CaloMEtPhi_[4]
double ErsatzV2CaloMt_[4]
edm::ESHandle< CaloTopology > pTopology_
double McProbe_rescPhi_[4]
double ErsatzV1_rescMesc_[4]
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector