CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_7_hltpatch1/src/AnalysisDataFormats/TopObjects/src/StEvtSolution.cc

Go to the documentation of this file.
00001 //
00002 // $Id: StEvtSolution.cc,v 1.11 2008/11/14 19:20:51 rwolf Exp $
00003 //
00004 
00005 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00006 #include "AnalysisDataFormats/TopObjects/interface/StEvtSolution.h"
00007 
00008 StEvtSolution::StEvtSolution()
00009 {
00010   jetCorrScheme_  = 0;
00011   chi2Prob_       = -999.;
00012   pTrueCombExist_ = -999.;
00013   pTrueBJetSel_   = -999.;
00014   pTrueBhadrSel_  = -999.;
00015   pTrueJetComb_   = -999.;
00016   signalPur_      = -999.;
00017   signalLRTot_    = -999.;
00018   sumDeltaRjp_    = -999.;
00019   deltaRB_        = -999.;
00020   deltaRL_        = -999.;
00021   changeBL_       = -999 ;
00022   bestSol_        = false;
00023 }
00024 
00025 StEvtSolution::~StEvtSolution()
00026 {
00027 }
00028 
00029 //-------------------------------------------
00030 // get calibrated base objects 
00031 //-------------------------------------------
00032 pat::Jet StEvtSolution::getBottom() const 
00033 {
00034   // WARNING this is obsolete and only 
00035   // kept for backwards compatibility
00036   if(jetCorrScheme_==1){
00037     //jet calibrated according to MC truth
00038     return bottom_->correctedJet("HAD", "B");
00039   } 
00040   else if(jetCorrScheme_==2){
00041     return bottom_->correctedJet("HAD", "B");
00042   }
00043   else{
00044     return *bottom_;
00045   }
00046 }
00047 
00048 pat::Jet StEvtSolution::getLight() const 
00049 {
00050   // WARNING this is obsolete and only 
00051   // kept for backwards compatibility
00052   if(jetCorrScheme_==1){
00053     //jet calibrated according to MC truth
00054     return light_->correctedJet("HAD", "UDS");
00055   }
00056   else if(jetCorrScheme_==2){
00057     return light_->correctedJet("HAD", "UDS");
00058   }
00059   else{
00060     return *light_;
00061   }
00062 }
00063 
00064 reco::Particle StEvtSolution::getLepW() const 
00065 {
00066   // FIXME: the charge from the genevent
00067   reco::Particle p;
00068   if(this->getDecay() == "muon") p=reco::Particle(0, this->getMuon().p4()+this->getNeutrino().p4(), math::XYZPoint());
00069   if(this->getDecay() == "electron") p=reco::Particle(0, this->getElectron().p4()+this->getNeutrino().p4(), math::XYZPoint());
00070   return p;
00071 }
00072 
00073 reco::Particle StEvtSolution::getLept() const 
00074 {
00075   // FIXME: the charge from the genevent
00076   reco::Particle p;
00077   if(this->getDecay() == "muon") p=reco::Particle(0, this->getMuon().p4()+this->getNeutrino().p4()+this->getBottom().p4(), math::XYZPoint());
00078   if(this->getDecay() == "electron") p=reco::Particle(0, this->getElectron().p4()+this->getNeutrino().p4()+this->getBottom().p4(), math::XYZPoint());
00079   return p;
00080 }
00081 
00082 //-------------------------------------------
00083 // get the matched gen particles
00084 //-------------------------------------------
00085 // FIXME: provide defaults if the genevent is invalid
00086 const reco::GenParticle * StEvtSolution::getGenBottom() const 
00087 { 
00088   if(!theGenEvt_) return 0; 
00089   else return theGenEvt_->decayB();
00090 }
00091 
00092 // FIXME: not implemented yet
00093 // const reco::GenParticle * StEvtSolution::getGenLight() const 
00094 // { 
00095 //   if(!theGenEvt_) return 0; 
00096 //   else return theGenEvt_->recoilQuark(); 
00097 // }
00098 
00099 const reco::GenParticle * StEvtSolution::getGenLepton() const 
00100 { 
00101   if(!theGenEvt_) return 0; 
00102   else return theGenEvt_->singleLepton(); 
00103 }
00104 
00105 const reco::GenParticle * StEvtSolution::getGenNeutrino() const 
00106 { 
00107   if(!theGenEvt_) return 0; 
00108   else return theGenEvt_->singleNeutrino(); 
00109 }
00110 
00111 const reco::GenParticle * StEvtSolution::getGenLepW() const 
00112 { 
00113   if (!theGenEvt_) return 0; 
00114   else return theGenEvt_->singleW(); 
00115 }
00116 
00117 const reco::GenParticle * StEvtSolution::getGenLept() const 
00118 { 
00119   if (!theGenEvt_) return 0; 
00120   else return theGenEvt_->singleTop(); 
00121 }
00122 
00123 //-------------------------------------------
00124 // get uncalibrated reco objects
00125 //-------------------------------------------
00126 reco::Particle StEvtSolution::getRecLept() const 
00127 {
00128   // FIXME: the charge from the genevent
00129   reco::Particle p;
00130   if(this->getDecay() == "muon") p=reco::Particle(0, this->getMuon().p4()+this->getNeutrino().p4()+this->getRecBottom().p4(), math::XYZPoint());
00131   if(this->getDecay() == "electron") p=reco::Particle(0, this->getElectron().p4()+this->getNeutrino().p4()+this->getRecBottom().p4(), math::XYZPoint());
00132   return p;
00133 }
00134 
00135 //-------------------------------------------
00136 // get objects from kinematic fit
00137 //-------------------------------------------
00138 reco::Particle StEvtSolution::getFitLepW() const 
00139 {
00140   // FIXME: provide the correct charge from generated event
00141   return reco::Particle(0, this->getFitLepton().p4()+this->getFitNeutrino().p4());
00142 }
00143 
00144 reco::Particle StEvtSolution::getFitLept() const 
00145 { 
00146   // FIXME: provide the correct charge from generated event
00147   return reco::Particle(0, this->getFitLepton().p4()+this->getFitNeutrino().p4()+this->getFitBottom().p4());
00148 }
00149 
00150 //-------------------------------------------  
00151 // set the generated event
00152 //-------------------------------------------
00153 void StEvtSolution::setGenEvt(const edm::Handle<StGenEvent> & aGenEvt){
00154   theGenEvt_ = edm::RefProd<StGenEvent>(aGenEvt);
00155 }
00156 
00157 //-------------------------------------------
00158 // set other info on the event
00159 //-------------------------------------------
00160 void StEvtSolution::setScanValues(const std::vector<double> & val) {
00161   for(unsigned int i=0; i<val.size(); i++) scanValues_.push_back(val[i]);
00162 }