15 embeddedGsfElectronCore_(
false),
16 embeddedGsfTrack_(
false),
17 embeddedSuperCluster_(
false),
18 embeddedPflowSuperCluster_(
false),
19 embeddedTrack_(
false),
20 embeddedSeedCluster_(
false),
21 embeddedRecHits_(
false),
22 embeddedPFCandidate_(
false),
24 ecalRegressionEnergy_(0.0),
25 ecalTrackRegressionEnergy_(0.0),
26 ecalRegressionError_(0.0),
27 ecalTrackRegressionError_(0.0),
30 ecalRegressionScale_(-99999.),
31 ecalRegressionSmear_(-99999.),
32 ecalTrackRegressionScale_(-99999.),
33 ecalTrackRegressionSmear_(-99999.),
34 packedPFCandidates_(),
35 associatedPackedFCandidateIndices_() {
36 initImpactParameters();
42 embeddedGsfElectronCore_(
false),
43 embeddedGsfTrack_(
false),
44 embeddedSuperCluster_(
false),
45 embeddedPflowSuperCluster_(
false),
46 embeddedTrack_(
false),
47 embeddedSeedCluster_(
false),
48 embeddedRecHits_(
false),
49 embeddedPFCandidate_(
false),
50 ecalDrivenMomentum_(anElectron.
p4()) {
51 initImpactParameters();
57 embeddedGsfElectronCore_(
false),
58 embeddedGsfTrack_(
false),
59 embeddedSuperCluster_(
false),
60 embeddedPflowSuperCluster_(
false),
61 embeddedTrack_(
false),
62 embeddedSeedCluster_(
false),
63 embeddedRecHits_(
false),
64 embeddedPFCandidate_(
false),
65 ecalDrivenMomentum_(anElectronRef->
p4()) {
66 initImpactParameters();
72 embeddedGsfElectronCore_(
false),
73 embeddedGsfTrack_(
false),
74 embeddedSuperCluster_(
false),
75 embeddedPflowSuperCluster_(
false),
76 embeddedTrack_(
false),
77 embeddedSeedCluster_(
false),
78 embeddedRecHits_(
false),
79 embeddedPFCandidate_(
false),
80 ecalDrivenMomentum_(anElectronRef->
p4()) {
81 initImpactParameters();
92 out <<
"\tpat::Electron: ";
93 out << std::setiosflags(std::ios::right);
95 out << std::setprecision(3);
96 out <<
" E/pT/eta/phi " << obj.
energy() <<
"/" << obj.
pt() <<
"/" << obj.
eta() <<
"/" << obj.
phi();
109 if (embeddedGsfTrack_) {
118 if (embeddedGsfElectronCore_) {
127 if (embeddedSuperCluster_) {
128 if (embeddedSeedCluster_ || !basicClusters_.empty() || !preshowerClusters_.empty()) {
129 if (!superClusterRelinked_.isSet()) {
130 std::unique_ptr<std::vector<reco::SuperCluster> >
sc(
new std::vector<reco::SuperCluster>(superCluster_));
131 if (embeddedSeedCluster_ && !(*sc)[0].
seed().isAvailable()) {
132 (*sc)[0].setSeed(
seed());
134 if (!basicClusters_.empty() && !(*sc)[0].clusters().isAvailable()) {
136 for (
unsigned int iclus = 0; iclus < basicClusters_.size(); ++iclus) {
139 (*sc)[0].setClusters(clusters);
141 if (!preshowerClusters_.empty() && !(*sc)[0].preshowerClusters().isAvailable()) {
143 for (
unsigned int iclus = 0; iclus < preshowerClusters_.size(); ++iclus) {
146 (*sc)[0].setPreshowerClusters(clusters);
148 superClusterRelinked_.set(
std::move(sc));
163 if (embeddedPflowSuperCluster_) {
172 if (embeddedSeedCluster_) {
181 if (embeddedTrack_) {
193 gsfElectronCore_.clear();
196 embeddedGsfElectronCore_ =
true;
205 embeddedGsfTrack_ =
true;
211 superCluster_.clear();
214 embeddedSuperCluster_ =
true;
220 pflowSuperCluster_.clear();
223 embeddedPflowSuperCluster_ =
true;
229 seedCluster_.clear();
232 embeddedSeedCluster_ =
true;
238 basicClusters_.clear();
242 for (; itscl != itsclE; ++itscl) {
243 basicClusters_.push_back(**itscl);
250 preshowerClusters_.clear();
254 for (; itscl != itsclE; ++itscl) {
255 preshowerClusters_.push_back(**itscl);
262 pflowBasicClusters_.clear();
266 for (; itscl != itsclE; ++itscl) {
267 pflowBasicClusters_.push_back(**itscl);
274 pflowPreshowerClusters_.clear();
278 for (; itscl != itsclE; ++itscl) {
279 pflowPreshowerClusters_.push_back(**itscl);
289 embeddedTrack_ =
true;
295 if (rechits !=
nullptr) {
297 embeddedRecHits_ =
true;
316 for (std::vector<IdPair>::const_iterator it = electronIDs_.begin(), ed = electronIDs_.end(); it != ed; ++it) {
317 if (it->first == name)
321 ex <<
"pat::Electron: the ID " << name <<
" can't be found in this pat::Electron.\n";
322 ex <<
"The available IDs are: ";
323 for (std::vector<IdPair>::const_iterator it = electronIDs_.begin(), ed = electronIDs_.end(); it != ed; ++it) {
324 ex <<
"'" << it->first <<
"' ";
332 for (std::vector<IdPair>::const_iterator it = electronIDs_.begin(), ed = electronIDs_.end(); it != ed; ++it) {
333 if (it->first == name)
341 if (embeddedPFCandidate_) {
344 return pfCandidateRef_;
351 if (pfCandidateRef_.isAvailable() && pfCandidateRef_.isNonnull()) {
353 embeddedPFCandidate_ =
true;
360 if (pfCandidateRef_.isNonnull()) {
367 if (i >= associatedPackedFCandidateIndices_.size()) {
387 if (cachedIP_ & (1 <<
int(type_))) {
406 if (cachedIP_ & (1 <<
int(type_))) {
417 cachedIP_ |= (1 <<
int(type));
422 sigmaIetaIphi_ = sigmaIetaIphi;
428 for (uint16_t
idx : associatedPackedFCandidateIndices_) {
void setMvaVariables(double sigmaIetaIphi, double ip3d)
set missing mva input variables
edm::Ref< GsfTrackCollection > GsfTrackRef
persistent reference to a GsfTrack
GsfTrackRef gsfTrack() const override
reference to a GsfTrack
void embedRecHits(const EcalRecHitCollection *rechits)
method to store the RecHits internally - can be called from the PATElectronProducer ...
bool isElectronIDAvailable(const std::string &name) const
Returns true if a specific ID is available in this pat::Electron.
edm::Ref< GsfElectronCoreCollection > GsfElectronCoreRef
virtual TrackRef closestCtfTrackRef() const
double eta() const final
momentum pseudorapidity
Ptr< typename C::value_type > refToPtr(Ref< C, typename C::value_type, refhelper::FindUsingAdvance< C, typename C::value_type > > const &ref)
virtual SuperClusterRef parentSuperCluster() const
double dB() const
the version without arguments returns PD2D, but with an absolute value (for backwards compatibility) ...
reco::CandidatePtr pfCandidate_
ret
prodAgent to be discontinued
void push_back(Ptr< T > const &iPtr)
void embedSuperCluster()
method to store the electron's SuperCluster internally
void embedGsfElectronCore()
method to store the electron's core internally
double pt() const final
transverse momentum
edm::Ptr< CaloCluster > CaloClusterPtr
reco::CandidatePtr sourceCandidatePtr(size_type i) const override
get the source candidate pointer with index i
edm::Ref< SuperClusterCollection > SuperClusterRef
reference to an object in a collection of SuperCluster objects
reco::TrackRef track() const override
returns nothing. Use either gsfTrack or closestCtfTrack
void embedPflowSuperCluster()
method to store the electron's PflowSuperCluster internally
void setDB(double dB, double edB, IPTYPE type)
Set impact parameter of a certain type and its uncertainty.
void embedSeedCluster()
method to store the electron's seedcluster internally
std::ostream & operator<<(std::ostream &, BeamSpot beam)
reco::PFCandidateRef pfCandidateRef() const
reference to the source PFCandidates; null if this has been built from a standard electron ...
~Electron() override
destructor
double edB() const
the version without arguments returns PD2D, but with an absolute value (for backwards compatibility) ...
float electronID(const std::string &name) const
Returns a specific electron ID associated to the pat::Electron given its name.
double energy() const final
energy
math::XYZTLorentzVector LorentzVector
void embedPflowBasicClusters()
method to store the electron's pflow basic clusters
edm::Ref< PFCandidateCollection > PFCandidateRef
persistent reference to a PFCandidate
void embedBasicClusters()
method to store the electron's basic clusters
void embedGsfTrack()
method to store the electron's GsfTrack internally
edm::Ptr< Candidate > CandidatePtr
persistent reference to an object in a collection of Candidate objects
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Analysis-level electron class.
reco::TrackRef closestCtfTrackRef() const override
override the reco::GsfElectron::closestCtfTrackRef method, to access the internal storage of the trac...
virtual GsfElectronCoreRef core() const
void embedPreshowerClusters()
method to store the electron's preshower clusters
reco::GsfElectronCoreRef core() const override
override the virtual reco::GsfElectron::core method, so that the embedded core can be used by GsfElec...
SuperClusterRef superCluster() const override
reference to a SuperCluster
reco::CaloClusterPtr seed() const
direct access to the seed cluster
reco::GsfTrackRef gsfTrack() const override
override the reco::GsfElectron::gsfTrack method, to access the internal storage of the supercluster ...
void initImpactParameters()
init impact parameter defaults (for use in a constructor)
void embedPflowPreshowerClusters()
method to store the electron's pflow preshower clusters
Electron()
default constructor
void embedTrack()
method to store the electron's Track internally
double phi() const final
momentum azimuthal angle
edm::RefVector< pat::PackedCandidateCollection > associatedPackedPFCandidates() const
References to PFCandidates linked to this object (e.g. for isolation vetos or masking before jet recl...
reco::SuperClusterRef superCluster() const override
override the reco::GsfElectron::superCluster method, to access the internal storage of the superclust...
reco::SuperClusterRef parentSuperCluster() const override
override the reco::GsfElectron::pflowSuperCluster method, to access the internal storage of the pflow...
void embedPFCandidate()
embed the PFCandidate pointed to by pfCandidateRef_