Template class to fill the TtEvent structure. More...
#include <TopQuarkAnalysis/TopEventProducers/interface/TtEvtBuilder.h>
Template class to fill the TtEvent structure.
Template class to fill the TtEvent structure for:
TtSemiLeptonicEvent TtFullLeptonicEvent TtFullHadronicEvent
event hypothesis, genEvent and extra information (if available) are read from the event and contracted into the TtEvent
Definition at line 29 of file TtEvtBuilder.h.
TtEvtBuilder< C >::TtEvtBuilder | ( | const edm::ParameterSet & | cfg | ) | [explicit] |
default constructor
Definition at line 82 of file TtEvtBuilder.h.
References TtEvtBuilder< C >::disc_, edm::ParameterSet::exists(), TtEvtBuilder< C >::fitChi2_, TtEvtBuilder< C >::fitProb_, TtEvtBuilder< C >::genMatch_, edm::ParameterSet::getParameter(), TtEvtBuilder< C >::kinFit_, TtEvtBuilder< C >::kinSolution_, TtEvtBuilder< C >::meth_, TtEvtBuilder< C >::mvaDisc_, TtEvtBuilder< C >::solWeight_, TtEvtBuilder< C >::sumDR_, TtEvtBuilder< C >::sumPt_, and TtEvtBuilder< C >::wrongCharge_.
: verbosity_ (cfg.getParameter<int> ("verbosity" )), hyps_ (cfg.getParameter<std::vector<std::string> >("hypotheses" )), genEvt_ (cfg.getParameter<edm::InputTag> ("genEvent" )), decayChnTop1_(cfg.getParameter<int> ("decayChannel1")), decayChnTop2_(cfg.getParameter<int> ("decayChannel2")) { // parameter subsets for kKinFit if( cfg.exists("kinFit") ) { kinFit_ = cfg.getParameter<edm::ParameterSet>("kinFit"); fitChi2_ = kinFit_.getParameter<edm::InputTag>("chi2"); fitProb_ = kinFit_.getParameter<edm::InputTag>("prob"); } // parameter subsets for kKinSolution if( cfg.exists("kinSolution") ) { kinSolution_ = cfg.getParameter<edm::ParameterSet>("kinSolution"); solWeight_ = kinSolution_.getParameter<edm::InputTag>("solWeight"); wrongCharge_ = kinSolution_.getParameter<edm::InputTag>("wrongCharge"); } // parameter subsets for kGenMatch if( cfg.exists("genMatch") ) { genMatch_ = cfg.getParameter<edm::ParameterSet>("genMatch"); sumPt_ = genMatch_.getParameter<edm::InputTag>("sumPt"); sumDR_ = genMatch_.getParameter<edm::InputTag>("sumDR"); } // parameter subsets for kMvaDisc if( cfg.exists("mvaDisc") ) { mvaDisc_ = cfg.getParameter<edm::ParameterSet>("mvaDisc"); meth_ = mvaDisc_.getParameter<edm::InputTag>("meth"); disc_ = mvaDisc_.getParameter<edm::InputTag>("disc"); } // produces a TtEventEvent for: // * TtSemiLeptonicEvent // * TtFullLeptonicEvent // * TtFullHadronicEvent // from hypotheses and associated extra information produces<C>(); }
TtEvtBuilder< C >::~TtEvtBuilder | ( | ) | [inline] |
virtual void TtEvtBuilder< C >::fillSpecific | ( | C & | , |
const edm::Event & | |||
) | [private, virtual] |
fill data members that are decay-channel specific
void TtEvtBuilder< TtSemiLeptonicEvent >::fillSpecific | ( | TtSemiLeptonicEvent & | ttEvent, |
const edm::Event & | evt | ||
) | [private] |
Definition at line 219 of file TtEvtBuilder.h.
References edm::Event::getByLabel(), h, combine::key, and TtSemiLeptonicEvent::setNumberOfRealNeutrinoSolutions().
{ // set number of real neutrino solutions for all hypotheses typedef std::vector<std::string>::const_iterator EventHypo; for(EventHypo h=hyps_.begin(); h!=hyps_.end(); ++h){ edm::Handle<int> key; evt.getByLabel(*h, "Key", key); edm::Handle<int> numberOfRealNeutrinoSolutions; evt.getByLabel(*h, "NumberOfRealNeutrinoSolutions", numberOfRealNeutrinoSolutions); ttEvent.setNumberOfRealNeutrinoSolutions((TtEvent::HypoClassKey&)*key, *numberOfRealNeutrinoSolutions); } }
void TtEvtBuilder< TtFullLeptonicEvent >::fillSpecific | ( | TtFullLeptonicEvent & | ttEvent, |
const edm::Event & | evt | ||
) | [private] |
Definition at line 202 of file TtEvtBuilder.h.
References edm::Event::getByLabel(), TtEvent::isHypoAvailable(), TtEvent::kKinSolution, TtFullLeptonicEvent::setSolWeight(), and TtFullLeptonicEvent::setWrongCharge().
{ // set kKinSolution extras if( ttEvent.isHypoAvailable(TtEvent::kKinSolution) ) { edm::Handle<std::vector<double> > solWeight; evt.getByLabel(solWeight_, solWeight); ttEvent.setSolWeight( *solWeight ); edm::Handle<bool> wrongCharge; evt.getByLabel(wrongCharge_, wrongCharge); ttEvent.setWrongCharge( *wrongCharge ); } }
void TtEvtBuilder< TtFullHadronicEvent >::fillSpecific | ( | TtFullHadronicEvent & | ttEvent, |
const edm::Event & | evt | ||
) | [private] |
Definition at line 197 of file TtEvtBuilder.h.
{ }
void TtEvtBuilder< C >::produce | ( | edm::Event & | evt, |
const edm::EventSetup & | setup | ||
) | [private, virtual] |
produce function (this one is not even accessible for derived classes)
Implements edm::EDProducer.
Definition at line 123 of file TtEvtBuilder.h.
References funct::C, fitChi2(), TtGenEvtProducer_cfi::genEvt, edm::Event::getByLabel(), h, combine::key, TtEvent::kGenMatch, TtEvent::kKinFit, TtEvent::kMVADisc, and edm::Event::put().
{ C ttEvent; // set leptonic decay channels ttEvent.setLepDecays( WDecay::LeptonType(decayChnTop1_), WDecay::LeptonType(decayChnTop2_) ); // set genEvent (if available) edm::Handle<TtGenEvent> genEvt; if( evt.getByLabel(genEvt_, genEvt) ) ttEvent.setGenEvent(genEvt); // add event hypotheses for all given // hypothesis classes to the TtEvent typedef std::vector<std::string>::const_iterator EventHypo; for(EventHypo h=hyps_.begin(); h!=hyps_.end(); ++h){ edm::Handle<int> key; evt.getByLabel(*h, "Key", key); edm::Handle<std::vector<TtEvent::HypoCombPair> > hypMatchVec; evt.getByLabel(*h, hypMatchVec); typedef std::vector<TtEvent::HypoCombPair>::const_iterator HypMatch; for(HypMatch hm=hypMatchVec->begin(); hm != hypMatchVec->end(); ++hm){ ttEvent.addEventHypo((TtEvent::HypoClassKey&)*key, *hm); } } // set kKinFit extras if( ttEvent.isHypoAvailable(TtEvent::kKinFit) ) { edm::Handle<std::vector<double> > fitChi2; evt.getByLabel(fitChi2_, fitChi2); ttEvent.setFitChi2( *fitChi2 ); edm::Handle<std::vector<double> > fitProb; evt.getByLabel(fitProb_, fitProb); ttEvent.setFitProb( *fitProb ); } // set kGenMatch extras if( ttEvent.isHypoAvailable(TtEvent::kGenMatch) ) { edm::Handle<std::vector<double> > sumPt; evt.getByLabel(sumPt_, sumPt); ttEvent.setGenMatchSumPt( *sumPt ); edm::Handle<std::vector<double> > sumDR; evt.getByLabel(sumDR_, sumDR); ttEvent.setGenMatchSumDR( *sumDR ); } // set kMvaDisc extras if( ttEvent.isHypoAvailable(TtEvent::kMVADisc) ) { edm::Handle<std::string> meth; evt.getByLabel(meth_, meth); ttEvent.setMvaMethod( *meth ); edm::Handle<std::vector<double> > disc; evt.getByLabel(disc_, disc); ttEvent.setMvaDiscriminators( *disc ); } // fill data members that are decay-channel specific fillSpecific(ttEvent, evt); // print summary via MessageLogger if verbosity_>0 ttEvent.print(verbosity_); // write object into the edm::Event std::auto_ptr<C> pOut(new C); *pOut=ttEvent; evt.put(pOut); }
int TtEvtBuilder< C >::decayChnTop1_ [private] |
decay channels of the two top decay branches; to be filled according to WDecay::LeptonTypes in TtGenEvent
Definition at line 56 of file TtEvtBuilder.h.
int TtEvtBuilder< C >::decayChnTop2_ [private] |
Definition at line 57 of file TtEvtBuilder.h.
edm::InputTag TtEvtBuilder< C >::disc_ [private] |
Definition at line 78 of file TtEvtBuilder.h.
Referenced by TtEvtBuilder< C >::TtEvtBuilder().
edm::InputTag TtEvtBuilder< C >::fitChi2_ [private] |
Definition at line 62 of file TtEvtBuilder.h.
Referenced by TtEvtBuilder< C >::TtEvtBuilder().
edm::InputTag TtEvtBuilder< C >::fitProb_ [private] |
Definition at line 63 of file TtEvtBuilder.h.
Referenced by TtEvtBuilder< C >::TtEvtBuilder().
edm::InputTag TtEvtBuilder< C >::genEvt_ [private] |
Definition at line 53 of file TtEvtBuilder.h.
edm::ParameterSet TtEvtBuilder< C >::genMatch_ [private] |
input parameters for the kGenMatch hypothesis class extras
Definition at line 71 of file TtEvtBuilder.h.
Referenced by TtEvtBuilder< C >::TtEvtBuilder().
std::vector<std::string> TtEvtBuilder< C >::hyps_ [private] |
vector of hypothesis class names
Definition at line 51 of file TtEvtBuilder.h.
edm::ParameterSet TtEvtBuilder< C >::kinFit_ [private] |
input parameters for the kKinFit hypothesis class extras
Definition at line 61 of file TtEvtBuilder.h.
Referenced by TtEvtBuilder< C >::TtEvtBuilder().
edm::ParameterSet TtEvtBuilder< C >::kinSolution_ [private] |
input parameters for the kKinSolution hypothesis class extras
Definition at line 66 of file TtEvtBuilder.h.
Referenced by TtEvtBuilder< C >::TtEvtBuilder().
edm::InputTag TtEvtBuilder< C >::meth_ [private] |
Definition at line 77 of file TtEvtBuilder.h.
Referenced by TtEvtBuilder< C >::TtEvtBuilder().
edm::ParameterSet TtEvtBuilder< C >::mvaDisc_ [private] |
input parameters for the kMVADisc hypothesis class extras
Definition at line 76 of file TtEvtBuilder.h.
Referenced by TtEvtBuilder< C >::TtEvtBuilder().
edm::InputTag TtEvtBuilder< C >::solWeight_ [private] |
Definition at line 67 of file TtEvtBuilder.h.
Referenced by TtEvtBuilder< C >::TtEvtBuilder().
edm::InputTag TtEvtBuilder< C >::sumDR_ [private] |
Definition at line 73 of file TtEvtBuilder.h.
Referenced by TtEvtBuilder< C >::TtEvtBuilder().
edm::InputTag TtEvtBuilder< C >::sumPt_ [private] |
Definition at line 72 of file TtEvtBuilder.h.
Referenced by TtEvtBuilder< C >::TtEvtBuilder().
int TtEvtBuilder< C >::verbosity_ [private] |
vebosity level
Definition at line 49 of file TtEvtBuilder.h.
edm::InputTag TtEvtBuilder< C >::wrongCharge_ [private] |
Definition at line 68 of file TtEvtBuilder.h.
Referenced by TtEvtBuilder< C >::TtEvtBuilder().