float ReconstructionMCMatching::DrB2(Interpretation& i){
    float dr=999;
    if(b2.Pt()>0.01 && i.B2().Pt()>0.01){
	dr=b2.DeltaR(i.B2());
    }
    return dr;
}
bool ReconstructionMCMatching::MatchH(Interpretation& i){
  if(setupMC<2){
    cerr << "need to setup mc matching (incl Higgs) first!" << endl;
    return false;
  }
  bool matchH=b1.E()>1.&&b2.E()>1.&&i.B1().E()>1.&&i.B2().E()>1.
    && ( (b1.DeltaR(i.B1())<maxdr && b2.DeltaR(i.B2())<maxdr) || (b1.DeltaR(i.B2())<maxdr && b2.DeltaR(i.B1())<maxdr) );
  return matchH;
}
int ReconstructionMCMatching::MatchNH(Interpretation& i){
  if(setupMC<2){
    cerr << "need to setup mc matching (incl Higgs) first!" << endl;
    return false;
  }
  int nQ=0;
  if(b1.E()>1.&&b2.E()>1.&&i.B1().E()>1.&&i.B2().E()>1.){
    if(b1.DeltaR(i.B1())<maxdr || b2.DeltaR(i.B1())<maxdr) nQ++;
    if(b1.DeltaR(i.B2())<maxdr || b2.DeltaR(i.B2())<maxdr) nQ++;
  }
  return nQ;
}
float ReconstructionQuality::TTHBB_ME(Interpretation& i){
  if(i.HasTag("TTHBB_ME")) return i.GetTag("TTHBB_ME");
  float tag=me.GetTTHBBMEsq(i.TopHad(),i.TopLep(),i.B1(),i.B2());
  i.SetTag("TTHBB_ME",tag);
  return tag;
}