188 std::unique_ptr<std::vector<pat::Particle> > pPartonsHadP(
new std::vector<pat::Particle>);
189 std::unique_ptr<std::vector<pat::Particle> > pPartonsHadQ(
new std::vector<pat::Particle>);
190 std::unique_ptr<std::vector<pat::Particle> > pPartonsHadB(
new std::vector<pat::Particle>);
191 std::unique_ptr<std::vector<pat::Particle> > pPartonsLepB(
new std::vector<pat::Particle>);
192 std::unique_ptr<std::vector<pat::Particle> > pLeptons(
new std::vector<pat::Particle>);
193 std::unique_ptr<std::vector<pat::Particle> > pNeutrinos(
new std::vector<pat::Particle>);
195 std::unique_ptr<std::vector<std::vector<int> > > pCombi(
new std::vector<std::vector<int> >);
196 std::unique_ptr<std::vector<double> > pChi2(
new std::vector<double>);
197 std::unique_ptr<std::vector<double> > pProb(
new std::vector<double>);
198 std::unique_ptr<std::vector<double> > pMT(
new std::vector<double>);
199 std::unique_ptr<std::vector<double> > pSigMT(
new std::vector<double>);
200 std::unique_ptr<std::vector<int> > pStatus(
new std::vector<int>);
201 std::unique_ptr<int> pJetsConsidered(
new int);
223 bool foundLepton =
false;
224 if (!leps->empty()) {
226 if (!dynamic_cast<const reco::Muon*>(&((*leps)[0])))
228 for (
unsigned iLep = 0; iLep < (*leps).size() && !foundLepton; ++iLep) {
237 unsigned int nJetsFound = 0;
238 for (
unsigned iJet = 0; iJet < (*jets).size() && (
int)nJetsFound !=
maxNJets_; ++iJet) {
239 double jet_eta = (*jets)[iJet].eta();
240 if ((*jets)[iJet].isCaloJet()) {
241 jet_eta = ((
reco::CaloJet*)((*jets)[iJet]).originalObject())->detectorP4().eta();
248 *pJetsConsidered = nJetsFound;
254 if (!foundLepton || mets->empty() || nJetsFound <
nPartons) {
263 std::vector<int> invalidCombi;
265 invalidCombi.push_back(-1);
266 pCombi->push_back(invalidCombi);
268 pChi2->push_back(-1.);
270 pProb->push_back(-1.);
273 pSigMT->push_back(-1.);
275 pStatus->push_back(-1);
289 evt.
put(
std::move(pJetsConsidered),
"NumberOfConsideredJets");
293 std::list<FitResult> FitResultList;
306 size_t nHitFitJet = 0;
309 std::vector<hitfit::Fit_Result> hitFitResult;
330 for (
size_t fit = 0;
fit != nHitFit; ++
fit) {
341 std::vector<int> hitCombi(4);
342 for (
size_t jet = 0;
jet != nHitFitJet; ++
jet) {
380 if (hitFitResult[
fit].chisq() > 0
389 result.Chi2 = hitFitResult[
fit].chisq();
390 result.Prob =
exp(-1.0 * (hitFitResult[
fit].chisq()) / 2.0);
391 result.MT = hitFitResult[
fit].mt();
392 result.SigMT = hitFitResult[
fit].sigmt();
406 fittedEvent.
met().x(), fittedEvent.
met().y(), fittedEvent.
met().z(), fittedEvent.
met().t()),
408 result.JetCombi = hitCombi;
410 FitResultList.push_back(result);
415 FitResultList.sort();
422 if (((
unsigned)FitResultList.size()) < 1) {
430 std::vector<int> invalidCombi;
432 invalidCombi.push_back(-1);
433 pCombi->push_back(invalidCombi);
435 pChi2->push_back(-1.);
437 pProb->push_back(-1.);
440 pSigMT->push_back(-1.);
442 pStatus->push_back(-1);
444 unsigned int iComb = 0;
445 for (
typename std::list<FitResult>::const_iterator result = FitResultList.begin(); result != FitResultList.end();
451 pPartonsHadP->push_back(result->HadP);
452 pPartonsHadQ->push_back(result->HadQ);
453 pPartonsHadB->push_back(result->HadB);
454 pPartonsLepB->push_back(result->LepB);
456 pLeptons->push_back(result->LepL);
458 pNeutrinos->push_back(result->LepN);
460 pCombi->push_back(result->JetCombi);
462 pChi2->push_back(result->Chi2);
464 pProb->push_back(result->Prob);
466 pMT->push_back(result->MT);
467 pSigMT->push_back(result->SigMT);
469 pStatus->push_back(result->Status);
484 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 ...