forked from cms-sw/cmssw
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request cms-sw#8536 from cbernet/heppy_7_4_0_pre9
New version of heppy
- Loading branch information
Showing
56 changed files
with
1,772 additions
and
546 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#ifndef PhysicsTools_Heppy_Apc_h | ||
#define PhysicsTools_Heppy_Apc_h | ||
|
||
#include <cmath> | ||
#include <numeric> | ||
#include <vector> | ||
|
||
|
||
/* Apc | ||
* | ||
* Calculates the Apc event variable for a given input jet collection | ||
* | ||
*/ | ||
|
||
namespace heppy { | ||
|
||
struct Apc { | ||
|
||
static double getApcJetMetMin( const std::vector<double>& et, | ||
const std::vector<double>& px, | ||
const std::vector<double>& py, | ||
const double metx, const double mety); | ||
|
||
}; | ||
|
||
}; | ||
|
||
#endif // Apc_h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
#ifndef PhysicsTools_Heppy_IsolationComputer_h | ||
#define PhysicsTools_Heppy_IsolationComputer_h | ||
|
||
#include <vector> | ||
#include "DataFormats/PatCandidates/interface/PackedCandidate.h" | ||
|
||
namespace heppy { | ||
class IsolationComputer { | ||
public: | ||
/// Create the calculator; optionally specify a cone for computing deltaBeta weights | ||
IsolationComputer(float weightCone=-1) : weightCone_(weightCone) {} | ||
|
||
/// Self-veto policy | ||
enum SelfVetoPolicy { | ||
selfVetoNone=0, selfVetoAll=1, selfVetoFirst=2 | ||
}; | ||
/// Initialize with the list of packed candidates (note: clears also all vetos) | ||
void setPackedCandidates(const std::vector<pat::PackedCandidate> & all, int fromPV_thresh=1, float dz_thresh=9999., bool also_leptons=false) ; | ||
|
||
|
||
/// veto footprint from this candidate, for the isolation of all candidates and also for calculation of neutral weights (if used) | ||
void addVetos(const reco::Candidate &cand) ; | ||
|
||
/// clear all vetos | ||
void clearVetos() ; | ||
|
||
/// Isolation from charged from the PV | ||
float chargedAbsIso(const reco::Candidate &cand, float dR, float innerR=0, float threshold=0, SelfVetoPolicy selfVeto=selfVetoAll) const ; | ||
|
||
/// Isolation from charged from PU | ||
float puAbsIso(const reco::Candidate &cand, float dR, float innerR=0, float threshold=0, SelfVetoPolicy selfVeto=selfVetoAll) const ; | ||
|
||
/// Isolation from all neutrals (uncorrected) | ||
float neutralAbsIsoRaw(const reco::Candidate &cand, float dR, float innerR=0, float threshold=0, SelfVetoPolicy selfVeto=selfVetoAll) const ; | ||
|
||
/// Isolation from neutral hadrons (uncorrected) | ||
float neutralHadAbsIsoRaw(const reco::Candidate &cand, float dR, float innerR=0, float threshold=0, SelfVetoPolicy selfVeto=selfVetoAll) const ; | ||
|
||
/// Isolation from photons (uncorrected) | ||
float photonAbsIsoRaw(const reco::Candidate &cand, float dR, float innerR=0, float threshold=0, SelfVetoPolicy selfVeto=selfVetoAll) const ; | ||
|
||
/// Isolation from all neutrals (with weights) | ||
float neutralAbsIsoWeighted(const reco::Candidate &cand, float dR, float innerR=0, float threshold=0, SelfVetoPolicy selfVeto=selfVetoAll) const ; | ||
|
||
/// Isolation from neutral hadrons (with weights) | ||
float neutralHadAbsIsoWeighted(const reco::Candidate &cand, float dR, float innerR=0, float threshold=0, SelfVetoPolicy selfVeto=selfVetoAll) const ; | ||
|
||
/// Isolation from photons (with weights) | ||
float photonAbsIsoWeighted(const reco::Candidate &cand, float dR, float innerR=0, float threshold=0, SelfVetoPolicy selfVeto=selfVetoAll) const ; | ||
protected: | ||
const std::vector<pat::PackedCandidate> * allcands_; | ||
float weightCone_; | ||
// collections of objects, sorted in eta | ||
std::vector<const pat::PackedCandidate *> charged_, neutral_, pileup_; | ||
mutable std::vector<float> weights_; | ||
std::vector<const reco::Candidate *> vetos_; | ||
|
||
float isoSumRaw(const std::vector<const pat::PackedCandidate *> & cands, const reco::Candidate &cand, float dR, float innerR, float threshold, SelfVetoPolicy selfVeto, int pdgId=-1) const ; | ||
float isoSumNeutralsWeighted(const reco::Candidate &cand, float dR, float innerR, float threshold, SelfVetoPolicy selfVeto, int pdgId=-1) const ; | ||
}; | ||
|
||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.