24 eleToken_ (consumes<
std::vector<
pat::
Electron> >(iConfig.getParameter<
edm::InputTag> (
"electronLabel"))),
25 muoToken_ (consumes<
std::vector<
pat::
Muon> >(iConfig.getParameter<
edm::InputTag> (
"muonLabel"))),
26 jetToken_ (consumes<
std::vector<
pat::
Jet> >(iConfig.getParameter<
edm::InputTag> (
"jetLabel"))),
27 metToken_ (consumes<
std::vector<
pat::
MET> >(iConfig.getParameter<
edm::InputTag> (
"metLabel"))),
29 caloIsoCut_ (iConfig.getParameter<double> (
"caloIsoCut") ),
30 mTop_ (iConfig.getParameter<double> (
"mTop") )
33 produces<std::vector<reco::CompositeCandidate> > ();
60 std::vector<pat::Muon>
const &
muons = *muonHandle;
64 std::vector<pat::Jet>
const &
jets = *jetHandle;
68 std::vector<pat::Electron>
const &
electrons = *electronHandle;
72 std::vector<pat::MET>
const &
mets = *metHandle;
96 double maxWLeptonPt = -1;
102 std::vector<pat::Muon>::const_iterator isolatedMuon = muons.end();
103 std::vector<pat::Muon>::const_iterator
muon = muons.end();
104 unsigned int nIsolatedMuons = 0;
105 std::vector<pat::Muon>::const_iterator muonIt = muons.begin(),
106 muonEnd = muons.end();
107 for (; muonIt != muonEnd; ++muonIt ) {
110 double pt = muonIt->pt();
111 if ( pt > maxWLeptonPt ) {
117 double caloIso = muonIt->caloIso();
120 isolatedMuon = muonIt;
127 std::vector<pat::Electron>::const_iterator isolatedElectron = electrons.end();
128 std::vector<pat::Electron>::const_iterator
electron = electrons.end();
129 unsigned int nIsolatedElectrons = 0;
130 std::vector<pat::Electron>::const_iterator electronIt = electrons.begin(),
131 electronEnd = electrons.end();
132 for (; electronIt != electronEnd; ++electronIt ) {
135 double pt = electronIt->pt();
136 if ( pt > maxWLeptonPt ) {
138 electron = electronIt;
142 double caloIso = electronIt->caloIso();
144 nIsolatedElectrons++;
145 isolatedElectron = electronIt;
156 if ( isolatedMuon != muonEnd ) { muon = isolatedMuon; isMuon =
true; }
157 else if ( isolatedElectron != electronEnd ) { electron = isolatedElectron; isMuon =
false; }
160 if ( muon != muonEnd && electron == electronEnd ) isMuon =
true;
161 else if ( muon == muonEnd && electron != electronEnd ) isMuon =
false;
162 else if ( muon != muonEnd && electron != electronEnd ) {
163 isMuon = muon->pt() > electron->pt();
170 int nIsolatedLeptons = nIsolatedMuons + nIsolatedElectrons;
171 if ( nIsolatedLeptons > 1 ) {
172 preselection =
false;
178 if ( muon == muonEnd && electron == electronEnd ) {
179 preselection =
false;
185 if ( jets.size() < 2 ||
187 preselection =
false;
225 if ( preselection ) {
227 if ( debug )
cout <<
"Preselection is satisfied" << endl;
229 if ( debug )
cout <<
"Jets.size() = " << jets.size() << endl;
238 if ( jets.size() >= 4 ) {
240 if ( debug )
cout <<
"Getting ttbar semileptonic solution" << endl;
248 if ( debug )
cout <<
"Got a nonzero size solution vector" << endl;
256 edm::LogWarning(
"DataNotFound") <<
"BoostedTopProducer: Cannot find TtSemiEvtSolution\n";
262 else if ( jets.size() == 2 || jets.size() == 3 ) {
270 if ( debug )
cout <<
"Adding muon as daughter" << endl;
273 if ( debug )
cout <<
"Adding electron as daughter" << endl;
276 if ( debug )
cout <<
"Adding neutrino as daughter" << endl;
278 addFourMomenta.
set( lepW );
283 zcalculator.
SetMET( neutrino );
287 zcalculator.
SetMuon( *electron );
288 double neutrinoPz = zcalculator.
Calculate(1);
291 neutrino.
setPz( neutrinoPz );
293 if ( debug )
cout <<
"Set neutrino pz to " << neutrinoPz << endl;
301 if ( debug )
cout <<
"Adding lepW as daughter" << endl;
308 TLorentzVector p4_W (lepW.
px(), lepW.
py(), lepW.
pz(), lepW.
energy() );
311 std::vector<pat::Jet>::const_iterator jetit = jets.begin(),
313 unsigned long ii = 1;
314 for ( ; jetit != jetend; ++jetit, ++
ii ) {
316 TLorentzVector p4_jet (jetit->px(), jetit->py(), jetit->pz(), jetit->energy() );
326 if ( debug )
cout <<
"Adding daughter " << s.str() << endl;
337 if ( debug )
cout <<
"Adding daughter " << s.str() << endl;
343 addFourMomenta.
set( lept );
344 addFourMomenta.
set( hadt );
348 if ( lepWHasJet && hadWHasJet ) {
349 if ( debug )
cout <<
"Adding daughters lept and hadt" << endl;
352 addFourMomenta.
set( ttbar );
362 std::vector<reco::CompositeCandidate> ttbarList;
364 if ( debug )
cout <<
"Writing out" << endl;
365 ttbarList.push_back( ttbar );
367 std::unique_ptr<std::vector<reco::CompositeCandidate> > pTtbar (
new std::vector<reco::CompositeCandidate>(ttbarList) );
376 TLorentzVector ptot = p1 +
p2;
377 Double_t theta1 = TMath::ACos( (p1.Vect().Dot(ptot.Vect()))/(p1.P()*ptot.P()) );
378 Double_t theta2 = TMath::ACos( (p2.Vect().Dot(ptot.Vect()))/(p2.P()*ptot.P()) );
381 double th1th2 = theta1 + theta2;
382 double psi = (p1.P()+p2.P())*
TMath::Abs(TMath::Sin(th1th2))/(2.* mass );
384 psi = (p1.P()+p2.P())*( 1. +
TMath::Abs(TMath::Cos(th1th2)))/(2.* mass );
Analysis-level MET class.
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool isMuon(const Candidate &part)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetTokenT< std::vector< pat::Electron > > eleToken_
edm::EDGetTokenT< std::vector< pat::Muon > > muoToken_
double px() const final
x coordinate of momentum vector
edm::EDGetTokenT< TtSemiLeptonicEvent > solToken_
void produce(edm::Event &, const edm::EventSetup &) override
Class derived from the TtEvent for the semileptonic decay channel.
std::map< std::string, int, std::less< std::string > > psi
edm::EDGetTokenT< std::vector< pat::Jet > > jetToken_
void SetMET(const pat::MET &MET)
Set MET.
edm::EDGetTokenT< std::vector< pat::MET > > metToken_
#define DEFINE_FWK_MODULE(type)
double pz() const final
z coordinate of momentum vector
void SetMuon(const pat::Particle &lepton)
Set Muon.
double energy() const final
energy
BoostedTopProducer(const edm::ParameterSet &)
void addDaughter(const Candidate &, const std::string &s="")
add a clone of the passed candidate as daughter
const reco::CompositeCandidate & eventHypo(const HypoClassKey &key, const unsigned &cmb=0) const
double Calculate(int type=0)
member functions
double py() const final
y coordinate of momentum vector
double Psi(const TLorentzVector &p1, const TLorentzVector &p2, double mass)
~BoostedTopProducer() override
void set(reco::Candidate &c) const
set up a candidate
size_type numberOfDaughters() const override
number of daughters
void setPz(double pz) final