192 std::unique_ptr< std::vector<pat::Particle> > pPartonsHadP(
new std::vector<pat::Particle> );
193 std::unique_ptr< std::vector<pat::Particle> > pPartonsHadQ(
new std::vector<pat::Particle> );
194 std::unique_ptr< std::vector<pat::Particle> > pPartonsHadB(
new std::vector<pat::Particle> );
195 std::unique_ptr< std::vector<pat::Particle> > pPartonsLepB(
new std::vector<pat::Particle> );
196 std::unique_ptr< std::vector<pat::Particle> > pLeptons (
new std::vector<pat::Particle> );
197 std::unique_ptr< std::vector<pat::Particle> > pNeutrinos (
new std::vector<pat::Particle> );
199 std::unique_ptr< std::vector<std::vector<int> > > pCombi (
new std::vector<std::vector<int> > );
200 std::unique_ptr< std::vector<double> > pChi2 (
new std::vector<double> );
201 std::unique_ptr< std::vector<double> > pProb (
new std::vector<double> );
202 std::unique_ptr< std::vector<double> > pMT (
new std::vector<double> );
203 std::unique_ptr< std::vector<double> > pSigMT (
new std::vector<double> );
204 std::unique_ptr< std::vector<int> > pStatus(
new std::vector<int> );
205 std::unique_ptr< int > pJetsConsidered(
new int );
227 bool foundLepton =
false;
230 if( !dynamic_cast<const reco::Muon*>(&((*leps)[0])) )
232 for(
unsigned iLep=0; iLep<(*leps).size() && !foundLepton; ++iLep) {
241 unsigned int nJetsFound = 0;
242 for(
unsigned iJet=0; iJet<(*jets).size() && (
int)nJetsFound!=
maxNJets_; ++iJet) {
243 double jet_eta = (*jets)[iJet].eta();
244 if ( (*jets)[iJet].isCaloJet() ) {
245 jet_eta = ((
reco::CaloJet*) ((*jets)[iJet]).originalObject())->detectorP4().eta();
252 *pJetsConsidered = nJetsFound;
258 if( !foundLepton || mets->empty() || nJetsFound<
nPartons ) {
267 std::vector<int> invalidCombi;
269 invalidCombi.push_back( -1 );
270 pCombi->push_back( invalidCombi );
272 pChi2->push_back( -1. );
274 pProb->push_back( -1. );
276 pMT->push_back( -1. );
277 pSigMT->push_back( -1. );
279 pStatus->push_back( -1 );
293 evt.
put(
std::move(pJetsConsidered),
"NumberOfConsideredJets");
297 std::list<FitResult> FitResultList;
310 size_t nHitFitJet = 0 ;
313 std::vector<hitfit::Fit_Result> hitFitResult;
334 for (
size_t fit = 0 ;
fit != nHitFit ; ++
fit) {
346 std::vector<int> hitCombi(4);
347 for (
size_t jet = 0 ;
jet != nHitFitJet ; ++
jet) {
381 if ( hitFitResult[
fit].chisq() > 0
392 result.Chi2 = hitFitResult[
fit].chisq();
393 result.Prob =
exp(-1.0*(hitFitResult[
fit].chisq())/2.0);
394 result.MT = hitFitResult[
fit].mt();
395 result.SigMT= hitFitResult[
fit].sigmt();
414 result.JetCombi = hitCombi;
416 FitResultList.push_back(result);
422 FitResultList.sort();
429 if( ((
unsigned)FitResultList.size())<1 ) {
437 std::vector<int> invalidCombi;
439 invalidCombi.push_back( -1 );
440 pCombi->push_back( invalidCombi );
442 pChi2->push_back( -1. );
444 pProb->push_back( -1. );
446 pMT->push_back( -1. );
447 pSigMT->push_back( -1. );
449 pStatus->push_back( -1 );
452 unsigned int iComb = 0;
453 for(
typename std::list<FitResult>::const_iterator result = FitResultList.begin(); result != FitResultList.end(); ++
result) {
457 pPartonsHadP->push_back( result->HadP );
458 pPartonsHadQ->push_back( result->HadQ );
459 pPartonsHadB->push_back( result->HadB );
460 pPartonsLepB->push_back( result->LepB );
462 pLeptons->push_back( result->LepL );
464 pNeutrinos->push_back( result->LepN );
466 pCombi->push_back( result->JetCombi );
468 pChi2->push_back( result->Chi2 );
470 pProb->push_back( result->Prob );
472 pMT->push_back( result->MT );
473 pSigMT->push_back( result->SigMT );
475 pStatus->push_back( result->Status );
490 evt.
put(
std::move(pJetsConsidered),
"NumberOfConsideredJets");
int maxNComb_
maximal number of combinations to be written to the event
double maxEtaEle_
maximum eta value for electrons, needed to limited range in which resolutions are provided ...
std::vector< Lepjets_Event > GetUnfittedEvent()
Return the unfitted events for all permutations.
double maxBTagValueNonBJet_
max value of bTag for a non-b-jet
static const unsigned int nPartons
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Jets made from CaloTowers.
std::vector< Fit_Result >::size_type FitAllPermutation()
Fit all permutations of the internal event. Returns the number of permutations.
Represent a lepton in an instance of Lepjets_Event class. This class hold the following information: ...
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetTokenT< std::vector< pat::MET > > metsToken_
void SetMet(const AMet &met, bool useObjRes=false)
Set the missing transverse energy of the internal event.
Lepjets_Event_Jet & jet(std::vector< Lepjets_Event_Jet >::size_type i)
Return a reference to jet at index position i.
double maxEtaJet_
maximum eta value for jets, needed to limited range in which resolutions are provided ...
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
int & type()
Return a reference to the type code.
std::vector< Fit_Result > GetFitAllPermutation()
Return the results of fitting all permutations of the internal event.
bool useBTag_
switch to tell whether to use b-tagging or not
Represent a simple event consisting of lepton(s) and jet(s). An instance of this class holds a list o...
Abs< T >::type abs(const T &t)
A class to represent a jet in an instance of Lepjets_Event class. The class is derived from the Lepje...
int maxNJets_
maximal number of jets (-1 possible to indicate 'all')
edm::EDGetTokenT< std::vector< pat::Jet > > jetsToken_
Fourvec & met()
Return a reference to the missing transverse energy.
Lepjets_Event_Lep & lep(std::vector< Lepjets_Event_Lep >::size_type i)
Return a reference to lepton at index position i.
edm::EDGetTokenT< LeptonCollection > lepsToken_
XYZPointD XYZPoint
point in space with cartesian internal representation
Analysis-level particle class.
Fourvec & p()
Return a reference to the four-momentum.
double maxEtaMu_
maximum eta value for muons, needed to limited range in which resolutions are provided ...
double minBTagValueBJet_
min value of bTag for a b-jet
void AddLepton(const AElectron &electron, bool useObjRes=false)
Add one electron into the internal event.
void clear()
Clear the internal event, fit results, and jets.
std::string bTagAlgo_
input tag for b-tagging algorithm
void AddJet(const AJet &jet, bool useObjRes=false)
Add one jet into the internal event. This function will do nothing if the internal event has already ...