7 genEventInfoProductTag_(iConfig.getParameter<
edm::InputTag>(
"genEventInfoProductTag")),
8 genParticlesTag_(iConfig.getParameter<
edm::InputTag>(
"genParticlesTag"))
42 bool hasTop(
false), hasTopbar(
false);
43 for(
size_t i = 0;
i < genParticles->size(); ++
i) {
45 if(p.
pdgId() == 6) hasTop=
true;
46 if(p.
pdgId() == -6) hasTopbar=
true;
49 if(hasTop && hasTopbar){
51 for(
size_t i = 0;
i < genParticles->size(); ++
i) {
53 if ( (p.
pdgId() == 11 ||
56 if ( (p.
pdgId() == -11 ||
58 p.
pdgId() == -15) && p.
status() == 3) { _leptonBar = &
p ; }
60 if (_lepton && _leptonBar)
break;
63 if (_lepton && _leptonBar) {
68 double deltaPhi = fabs(TVector2::Phi_mpi_pi(lepton.phi() - leptonBar.phi())) ;
71 double asym = ( deltaPhi > CLHEP::halfpi ) ? 0.5 : -0.5 ;
76 double llpairPt = llpair.pt() ;
79 double llpairM = llpair.M() ;
96 nEvt = dqm.
book1dHisto(
"nEvt",
"n analyzed Events", 1, 0., 1.,
"bin",
"Number of Events");
97 _h_asym = dqm.
book1dHisto(
"TTbar_asym",
"Asymmetr", 2, -1., 1.,
"Asymmetry",
"Number of Events");
98 _h_deltaPhi = dqm.
book1dHisto(
"TTbar_deltaPhi",
"#Delta#phi(ll)", 320, 0, 3.2,
"#Delta#phi_{ll} (rad)",
"Number of Events");
99 _h_llpairPt = dqm.
book1dHisto(
"TTbar_llpairPt",
"Lepton pair transverse momentum", 1000, 0, 1000,
"p_{T}^{ll} (GeV)",
"Number of Events");
100 _h_llpairM = dqm.
book1dHisto(
"TTbar_llpairM",
"Lepton pair invariant mass", 1000, 0, 1000,
"M_{ll} (GeV)",
"Number of Events");
int pdgId() const final
PDG identifier.
edm::EDGetTokenT< reco::GenParticleCollection > genParticlesTagToken_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::InputTag genEventInfoProductTag_
MonitorElement * book1dHisto(std::string name, std::string title, int n, double xmin, double xmax, std::string xaxis, std::string yaxis)
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
void setCurrentFolder(std::string const &fullpath)
TTbarSpinCorrHepMCAnalyzer(const edm::ParameterSet &)
edm::InputTag genParticlesTag_
const LorentzVector & p4() const final
four-momentum Lorentz vector
void analyze(const edm::Event &, const edm::EventSetup &) override
MonitorElement * _h_deltaPhi
void bookHistograms(DQMStore::IBooker &i, edm::Run const &, edm::EventSetup const &) override
int status() const final
status word
edm::EDGetTokenT< GenEventInfoProduct > genEventInfoProductTagToken_
~TTbarSpinCorrHepMCAnalyzer() override
MonitorElement * _h_llpairM
MonitorElement * _h_llpairPt