192 std::auto_ptr< std::vector<pat::Particle> > pPartonsHadP(
new std::vector<pat::Particle> );
193 std::auto_ptr< std::vector<pat::Particle> > pPartonsHadQ(
new std::vector<pat::Particle> );
194 std::auto_ptr< std::vector<pat::Particle> > pPartonsHadB(
new std::vector<pat::Particle> );
195 std::auto_ptr< std::vector<pat::Particle> > pPartonsLepB(
new std::vector<pat::Particle> );
196 std::auto_ptr< std::vector<pat::Particle> > pLeptons (
new std::vector<pat::Particle> );
197 std::auto_ptr< std::vector<pat::Particle> > pNeutrinos (
new std::vector<pat::Particle> );
199 std::auto_ptr< std::vector<std::vector<int> > > pCombi (
new std::vector<std::vector<int> > );
200 std::auto_ptr< std::vector<double> > pChi2 (
new std::vector<double> );
201 std::auto_ptr< std::vector<double> > pProb (
new std::vector<double> );
202 std::auto_ptr< std::vector<double> > pMT (
new std::vector<double> );
203 std::auto_ptr< std::vector<double> > pSigMT (
new std::vector<double> );
204 std::auto_ptr< std::vector<int> > pStatus(
new std::vector<int> );
205 std::auto_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 );
282 evt.
put(pPartonsHadP,
"PartonsHadP");
283 evt.
put(pPartonsHadQ,
"PartonsHadQ");
284 evt.
put(pPartonsHadB,
"PartonsHadB");
285 evt.
put(pPartonsLepB,
"PartonsLepB");
286 evt.
put(pLeptons ,
"Leptons" );
287 evt.
put(pNeutrinos ,
"Neutrinos" );
288 evt.
put(pChi2 ,
"Chi2" );
289 evt.
put(pProb ,
"Prob" );
290 evt.
put(pMT ,
"MT" );
291 evt.
put(pSigMT ,
"SigMT" );
292 evt.
put(pStatus ,
"Status" );
293 evt.
put(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 );
479 evt.
put(pPartonsHadP,
"PartonsHadP");
480 evt.
put(pPartonsHadQ,
"PartonsHadQ");
481 evt.
put(pPartonsHadB,
"PartonsHadB");
482 evt.
put(pPartonsLepB,
"PartonsLepB");
483 evt.
put(pLeptons ,
"Leptons" );
484 evt.
put(pNeutrinos ,
"Neutrinos" );
485 evt.
put(pChi2 ,
"Chi2" );
486 evt.
put(pProb ,
"Prob" );
487 evt.
put(pMT ,
"MT" );
488 evt.
put(pSigMT ,
"SigMT" );
489 evt.
put(pStatus ,
"Status" );
490 evt.
put(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
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: ...
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.
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
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...
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')
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
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.
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 ...