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"))),
28 solToken_ (mayConsume<
TtSemiLeptonicEvent>(iConfig.getParameter<edm::InputTag> (
"solLabel"))),
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 bool 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();
129 bool nIsolatedElectrons = 0;
130 std::vector<pat::Electron>::const_iterator electronIt =
electrons.begin(),
132 for (; electronIt != electronEnd; ++electronIt ) {
135 double pt = electronIt->pt();
136 if ( pt > maxWLeptonPt ) {
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; }
162 else if (
muon != muonEnd &&
electron != electronEnd ) {
170 int nIsolatedLeptons = nIsolatedMuons + nIsolatedElectrons;
171 if ( nIsolatedLeptons > 1 ) {
185 if (
jets.size() < 2 ||
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 );
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::auto_ptr<std::vector<reco::CompositeCandidate> > pTtbar (
new std::vector<reco::CompositeCandidate>(ttbarList) );
368 iEvent.
put( pTtbar );
387 TLorentzVector ptot = p1 +
p2;
388 Double_t theta1 = TMath::ACos( (p1.Vect().Dot(ptot.Vect()))/(p1.P()*ptot.P()) );
389 Double_t theta2 = TMath::ACos( (p2.Vect().Dot(ptot.Vect()))/(p2.P()*ptot.P()) );
392 double th1th2 = theta1 + theta2;
393 double psi = (p1.P()+p2.P())*
TMath::Abs(TMath::Sin(th1th2))/(2.* mass );
395 psi = (p1.P()+p2.P())*( 1. +
TMath::Abs(TMath::Cos(th1th2)))/(2.* mass );
Analysis-level MET class.
bool isMuon(const Candidate &part)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
edm::EDGetTokenT< std::vector< pat::Electron > > eleToken_
edm::EDGetTokenT< std::vector< pat::Muon > > muoToken_
edm::EDGetTokenT< TtSemiLeptonicEvent > solToken_
Class derived from the TtEvent for the semileptonic decay channel.
virtual void produce(edm::Event &, const edm::EventSetup &)
virtual size_type numberOfDaughters() const
number of daughters
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_
virtual double energy() const
energy
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
void SetMuon(const pat::Particle &lepton)
Set Muon.
tuple preselection
PRESELECTION
BoostedTopProducer(const edm::ParameterSet &)
void addDaughter(const Candidate &, const std::string &s="")
add a clone of the passed candidate as daughter
virtual void setPz(double pz)
virtual double px() const
x coordinate of momentum vector
double Calculate(int type=0)
member functions
virtual double pz() const
z coordinate of momentum vector
double Psi(const TLorentzVector &p1, const TLorentzVector &p2, double mass)
virtual double py() const
y coordinate of momentum vector