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_()
37 initImpactParameters();
43 embeddedGsfElectronCore_(
false),
44 embeddedGsfTrack_(
false),
45 embeddedSuperCluster_(
false),
46 embeddedPflowSuperCluster_(
false),
47 embeddedTrack_(
false),
48 embeddedSeedCluster_(
false),
49 embeddedRecHits_(
false),
50 embeddedPFCandidate_(
false),
51 ecalDrivenMomentum_(anElectron.
p4())
53 initImpactParameters();
59 embeddedGsfElectronCore_(
false),
60 embeddedGsfTrack_(
false),
61 embeddedSuperCluster_(
false),
62 embeddedPflowSuperCluster_(
false),
63 embeddedTrack_(
false),
64 embeddedSeedCluster_(
false),
65 embeddedRecHits_(
false),
66 embeddedPFCandidate_(
false),
67 ecalDrivenMomentum_(anElectronRef->
p4())
69 initImpactParameters();
75 embeddedGsfElectronCore_(
false),
76 embeddedGsfTrack_(
false),
77 embeddedSuperCluster_(
false),
78 embeddedPflowSuperCluster_(
false),
79 embeddedTrack_(
false),
80 embeddedSeedCluster_(
false),
81 embeddedRecHits_(
false),
82 embeddedPFCandidate_(
false),
83 ecalDrivenMomentum_(anElectronRef->
p4())
85 initImpactParameters();
98 out <<
"\tpat::Electron: ";
99 out << std::setiosflags(std::ios::right);
101 out << std::setprecision(3);
102 out <<
" E/pT/eta/phi " 120 if (embeddedGsfTrack_) {
129 if (embeddedGsfElectronCore_) {
139 if (embeddedSuperCluster_) {
140 if (embeddedSeedCluster_ || !basicClusters_.empty() || !preshowerClusters_.empty()) {
141 if (!superClusterRelinked_.isSet()) {
142 std::unique_ptr<std::vector<reco::SuperCluster> >
sc(
new std::vector<reco::SuperCluster>(superCluster_));
143 if (embeddedSeedCluster_ && !(*sc)[0].
seed().isAvailable()) {
144 (*sc)[0].setSeed(
seed());
146 if (basicClusters_.size() && !(*sc)[0].clusters().isAvailable()) {
148 for (
unsigned int iclus=0; iclus<basicClusters_.size(); ++iclus) {
151 (*sc)[0].setClusters(clusters);
153 if (preshowerClusters_.size() && !(*sc)[0].preshowerClusters().isAvailable()) {
155 for (
unsigned int iclus=0; iclus<preshowerClusters_.size(); ++iclus) {
158 (*sc)[0].setPreshowerClusters(clusters);
160 superClusterRelinked_.set(
std::move(sc));
175 if (embeddedPflowSuperCluster_) {
184 if(embeddedSeedCluster_){
193 if (embeddedTrack_) {
207 gsfElectronCore_.clear();
210 embeddedGsfElectronCore_ =
true;
219 embeddedGsfTrack_ =
true;
226 superCluster_.clear();
229 embeddedSuperCluster_ =
true;
235 pflowSuperCluster_.clear();
238 embeddedPflowSuperCluster_ =
true;
244 seedCluster_.clear();
247 embeddedSeedCluster_ =
true;
253 basicClusters_.clear();
257 for(;itscl!=itsclE;++itscl){
258 basicClusters_.push_back( **itscl ) ;
265 preshowerClusters_.clear();
269 for(;itscl!=itsclE;++itscl){
270 preshowerClusters_.push_back( **itscl ) ;
277 pflowBasicClusters_.clear();
281 for(;itscl!=itsclE;++itscl){
282 pflowBasicClusters_.push_back( **itscl ) ;
289 pflowPreshowerClusters_.clear();
293 for(;itscl!=itsclE;++itscl){
294 pflowPreshowerClusters_.push_back( **itscl ) ;
304 embeddedTrack_ =
true;
312 embeddedRecHits_ =
true;
331 for (std::vector<IdPair>::const_iterator it = electronIDs_.begin(), ed = electronIDs_.end(); it != ed; ++it) {
332 if (it->first == name)
return it->second;
335 ex <<
"pat::Electron: the ID " << name <<
" can't be found in this pat::Electron.\n";
336 ex <<
"The available IDs are: ";
337 for (std::vector<IdPair>::const_iterator it = electronIDs_.begin(), ed = electronIDs_.end(); it != ed; ++it) {
338 ex <<
"'" << it->first <<
"' ";
346 for (std::vector<IdPair>::const_iterator it = electronIDs_.begin(), ed = electronIDs_.end(); it != ed; ++it) {
347 if (it->first == name)
return true;
355 if (embeddedPFCandidate_) {
358 return pfCandidateRef_;
365 if ( pfCandidateRef_.isAvailable() && pfCandidateRef_.isNonnull()) {
367 embeddedPFCandidate_ =
true;
374 if (pfCandidateRef_.isNonnull()) {
381 if (i >= associatedPackedFCandidateIndices_.size()) {
402 if ( cachedIP_ & (1 <<
int(type_))) {
421 if ( cachedIP_ & (1 <<
int(type_))) {
430 ip_[
type] = dB; eip_[
type] = edB; cachedIP_ |= (1 <<
int(type));
435 sigmaIetaIphi_ = sigmaIetaIphi;
441 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
virtual double pt() const final
transverse momentum
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
SuperClusterRef parentSuperCluster() const
Ptr< typename C::value_type > refToPtr(Ref< C, typename C::value_type, refhelper::FindUsingAdvance< C, typename C::value_type > > const &ref)
double dB() const
the version without arguments returns PD2D, but with an absolute value (for backwards compatibility) ...
virtual double eta() const final
momentum pseudorapidity
void push_back(Ptr< T > const &iPtr)
void embedSuperCluster()
method to store the electron's SuperCluster internally
reco::PFCandidatePtr pfCandidate_
math::XYZTLorentzVector LorentzVector
void embedGsfElectronCore()
method to store the electron's core internally
edm::Ptr< CaloCluster > CaloClusterPtr
edm::Ref< SuperClusterCollection > SuperClusterRef
reference to an object in a collection of SuperCluster objects
TrackRef closestCtfTrackRef() const
void embedPflowSuperCluster()
method to store the electron's PflowSuperCluster internally
virtual double phi() const final
momentum azimuthal angle
reco::SuperClusterRef superCluster() const
override the reco::GsfElectron::superCluster method, to access the internal storage of the superclust...
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::GsfTrackRef gsfTrack() const
override the reco::GsfElectron::gsfTrack method, to access the internal storage of the supercluster ...
reco::PFCandidateRef pfCandidateRef() const
reference to the source PFCandidates; null if this has been built from a standard electron ...
reco::TrackRef closestCtfTrackRef() const
override the reco::GsfElectron::closestCtfTrackRef method, to access the internal storage of the trac...
double edB() const
the version without arguments returns PD2D, but with an absolute value (for backwards compatibility) ...
virtual SuperClusterRef superCluster() const
reference to a SuperCluster
virtual double energy() const final
energy
float electronID(const std::string &name) const
Returns a specific electron ID associated to the pat::Electron given its name.
reco::SuperClusterRef parentSuperCluster() const
override the reco::GsfElectron::pflowSuperCluster method, to access the internal storage of the pflow...
virtual reco::GsfElectronCoreRef core() const
override the virtual reco::GsfElectron::core method, so that the embedded core can be used by GsfElec...
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
reco::TrackRef track() const
returns nothing. Use either gsfTrack or closestCtfTrack
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Analysis-level electron class.
virtual GsfElectronCoreRef core() const
void embedPreshowerClusters()
method to store the electron's preshower clusters
reco::CandidatePtr sourceCandidatePtr(size_type i) const
get the source candidate pointer with index i
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
reco::CaloClusterPtr seed() const
direct access to the seed cluster
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
virtual ~Electron()
destructor
void embedTrack()
method to store the electron's Track internally
edm::RefVector< pat::PackedCandidateCollection > associatedPackedPFCandidates() const
References to PFCandidates linked to this object (e.g. for isolation vetos or masking before jet recl...
void embedPFCandidate()
embed the PFCandidate pointed to by pfCandidateRef_
virtual GsfTrackRef gsfTrack() const
reference to a GsfTrack