24 eleLabel_ (iConfig.getParameter<edm::InputTag> (
"electronLabel")),
25 muoLabel_ (iConfig.getParameter<edm::InputTag> (
"muonLabel")),
26 jetLabel_ (iConfig.getParameter<edm::InputTag> (
"jetLabel")),
27 metLabel_ (iConfig.getParameter<edm::InputTag> (
"metLabel")),
28 solLabel_ (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;
92 bool preselection =
true;
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 ) {
172 preselection =
false;
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 );
280 bool nuzHasComplex =
false;
283 zcalculator.
SetMET( neutrino );
288 double neutrinoPz = zcalculator.
Calculate(1);
289 if (zcalculator.
IsComplex()) nuzHasComplex =
true;
291 neutrino.
setPz( neutrinoPz );
293 if (
debug )
cout <<
"Set neutrino pz to " << neutrinoPz << endl;
301 if (
debug )
cout <<
"Adding lepW as daughter" << endl;
304 std::string hadName(
"hadJet");
305 std::string lepName(
"lepJet");
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.
double Psi(TLorentzVector p1, TLorentzVector p2, double mass)
bool isMuon(const Candidate &part)
#define DEFINE_FWK_MODULE(type)
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
void SetMET(const pat::MET &MET)
Set MET.
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.
BoostedTopProducer(const edm::ParameterSet &)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
void addDaughter(const Candidate &, const std::string &s="")
add a clone of the passed candidate as daughter
virtual void setPz(double pz)
bool IsComplex() const
check for complex root
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
virtual double py() const
y coordinate of momentum vector