CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
TTbar_P4Violation Class Reference

#include <TTbar_P4Violation.h>

Inheritance diagram for TTbar_P4Violation:
edm::EDFilter edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 TTbar_P4Violation (const edm::ParameterSet &)
 
 ~TTbar_P4Violation ()
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDFilter ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::EDFilter
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

Private Member Functions

virtual void beginJob ()
 
virtual void endJob ()
 
virtual bool filter (edm::Event &, const edm::EventSetup &)
 

Private Attributes

edm::InputTag genEvt_
 
edm::EDGetTokenT< TtGenEventgenEvtToken_
 

Additional Inherited Members

- Public Types inherited from edm::EDFilter
typedef EDFilter ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 42 of file TTbar_P4Violation.h.

Constructor & Destructor Documentation

TTbar_P4Violation::TTbar_P4Violation ( const edm::ParameterSet iConfig)
explicit

Definition at line 14 of file TTbar_P4Violation.cc.

References genEvt_, and genEvtToken_.

14  :
15  genEvt_(iConfig.getParameter<edm::InputTag>("genEvt"))
16 {
17  genEvtToken_=consumes<TtGenEvent>(genEvt_);
18 
19 }
T getParameter(std::string const &) const
edm::InputTag genEvt_
edm::EDGetTokenT< TtGenEvent > genEvtToken_
TTbar_P4Violation::~TTbar_P4Violation ( )

Definition at line 22 of file TTbar_P4Violation.cc.

23 {
24 
25  // do anything here that needs to be done at desctruction time
26  // (e.g. close files, deallocate resources etc.)
27 
28 }

Member Function Documentation

void TTbar_P4Violation::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDFilter.

Definition at line 110 of file TTbar_P4Violation.cc.

111 {
112 }
void TTbar_P4Violation::endJob ( void  )
privatevirtual

Reimplemented from edm::EDFilter.

Definition at line 116 of file TTbar_P4Violation.cc.

116  {
117 }
void TTbar_P4Violation::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 121 of file TTbar_P4Violation.cc.

References edm::ConfigurationDescriptions::addDefault(), and edm::ParameterSetDescription::setUnknown().

121  {
122  //The following says we do not know what parameters are allowed so do no validation
123  // Please change this to state exactly what you do use, even if it is no parameters
125  desc.setUnknown();
126  descriptions.addDefault(desc);
127 }
void addDefault(ParameterSetDescription const &psetDescription)
bool TTbar_P4Violation::filter ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDFilter.

Definition at line 37 of file TTbar_P4Violation.cc.

References edm::false, TtGenEvtProducer_cfi::genEvt, genEvtToken_, edm::Event::getByToken(), and funct::true.

38 {
39  using namespace edm;
40 
41  // --- get TopQuarkAnalysis TtGenEvent
44 
45  if(!genEvt.isValid()) return false;
46 
47  const reco::GenParticle* top = 0;
48  const reco::GenParticle* antitop = 0;
49  const reco::GenParticle* bottom = 0;
50  const reco::GenParticle* antibottom = 0;
51  const reco::GenParticle* Wplus = 0;
52  const reco::GenParticle* Wmin = 0;
53 
54  top = genEvt->top();
55  antitop = genEvt->topBar();
56  bottom = genEvt->b();
57  antibottom = genEvt->bBar();
58  Wplus = genEvt->wPlus();
59  Wmin = genEvt->wMinus();
60 
61 
62  if(top && antitop && bottom && antibottom && Wplus && Wmin){
63  const reco::Particle::LorentzVector topP4 = bottom->p4() + Wplus->p4() ;
64  const reco::Particle::LorentzVector antitopP4 = antibottom->p4() + Wmin ->p4() ;
65 
66  double tolerance = 0.1 ;
67 
68  bool topViolated = false ;
69  bool antitopViolated = false ;
70 
71  if ( (top->p4().px() - topP4.px() > tolerance) ||
72  (top->p4().py() - topP4.py() > tolerance) ||
73  (top->p4().pz() - topP4.pz() > tolerance) ||
74  (top->p4().e () - topP4.e () > tolerance) ) {
75 
76  topViolated = true ;
77 
78  //printf( "momentum not conserved for top:\n" ) ;
79  //printf( " %5.5f\t %5.5f \t %5.5f \t %5.5f \n", top->p4().px(), top->p4().py(), top->p4().pz(), top->p4().e() ) ;
80  //printf( " %5.5f\t %5.5f \t %5.5f \t %5.5f \n", topP4.px(), topP4.py(), topP4.pz(), topP4.e() ) ;
81  }
82 
83  if ( (antitop->p4().px() - antitopP4.px() > tolerance) ||
84  (antitop->p4().py() - antitopP4.py() > tolerance) ||
85  (antitop->p4().pz() - antitopP4.pz() > tolerance) ||
86  (antitop->p4().e () - antitopP4.e () > tolerance) ) {
87 
88  antitopViolated = true ;
89 
90  //printf( "momentum not conserved for anti-top:\n" ) ;
91  //printf( " %5.5f\t %5.5f \t %5.5f \t %5.5f \n ", antitop->p4().px(), antitop->p4().py(), antitop->p4().pz(), antitop->p4().e() ) ;
92  //printf( " %5.5f\t %5.5f \t %5.5f \t %5.5f \n ", antitopP4.px(), antitopP4.py(), antitopP4.pz(), antitopP4.e() ) ;
93  }
94 
95  return (topViolated || antitopViolated);
96 
97 
98  // GOSSIE temp
99  bool bottomOK = true ;
100  bool antibottomOK = true ;
101  if ( fabs( bottom->p4().pz()) < 1. ) bottomOK = false ;
102  if ( fabs(antibottom->p4().pz()) < 1. ) antibottomOK = false ;
103  return (bottomOK && antibottomOK);
104  }
105  return false;
106 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
edm::EDGetTokenT< TtGenEvent > genEvtToken_
volatile std::atomic< bool > shutdown_flag false
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Particle.h:27

Member Data Documentation

edm::InputTag TTbar_P4Violation::genEvt_
private

Definition at line 55 of file TTbar_P4Violation.h.

Referenced by TTbar_P4Violation().

edm::EDGetTokenT<TtGenEvent> TTbar_P4Violation::genEvtToken_
private

Definition at line 56 of file TTbar_P4Violation.h.

Referenced by filter(), and TTbar_P4Violation().