|
|
Go to the documentation of this file.
4 #ifndef DataFormats_PatCandidates_PATObject_h
5 #define DataFormats_PatCandidates_PATObject_h
44 template <
class ObjectType>
88 const size_t idx = 0)
const;
90 const size_t idx = 0)
const {
95 const size_t idx = 0)
const {
118 const size_t idx = 0)
const;
121 const size_t idx = 0)
const {
128 const bool algoCondAccepted =
true)
const;
131 const bool algoCondAccepted =
true)
const {
136 const unsigned algoCondAccepted)
const {
141 const unsigned algoCondAccepted)
const {
148 const bool algoCondAccepted =
true,
149 const size_t idx = 0)
const;
152 const bool algoCondAccepted =
true,
153 const size_t idx = 0)
const {
158 const unsigned algoCondAccepted,
159 const size_t idx = 0)
const {
164 const unsigned algoCondAccepted,
165 const size_t idx = 0)
const {
176 const size_t idx = 0)
const;
187 const bool pathLastFilterAccepted =
false,
188 const bool pathL3FilterAccepted =
true)
const;
191 const bool pathLastFilterAccepted =
false,
192 const bool pathL3FilterAccepted =
true)
const {
197 const unsigned pathLastFilterAccepted,
198 const unsigned pathL3FilterAccepted = 1)
const {
203 const unsigned pathLastFilterAccepted,
204 const unsigned pathL3FilterAccepted = 1)
const {
206 std::string(namePath),
bool(pathLastFilterAccepted),
bool(pathL3FilterAccepted));
214 const bool pathLastFilterAccepted =
false,
215 const bool pathL3FilterAccepted =
true,
216 const size_t idx = 0)
const;
219 const bool pathLastFilterAccepted =
false,
220 const bool pathL3FilterAccepted =
true,
221 const size_t idx = 0)
const {
226 const unsigned pathLastFilterAccepted,
227 const unsigned pathL3FilterAccepted = 1,
228 const size_t idx = 0)
const {
233 const unsigned pathLastFilterAccepted,
234 const unsigned pathL3FilterAccepted = 1,
235 const size_t idx = 0)
const {
237 std::string(namePath),
bool(pathLastFilterAccepted),
bool(pathL3FilterAccepted),
idx);
249 it->unpackPathNames(
names);
255 std::vector<std::pair<std::string, pat::LookupTableRecord> >
efficiencies()
const;
323 template <
typename T>
326 return (
data !=
nullptr ?
data->template get<T>() :
nullptr);
342 return (
data !=
nullptr ?
data->bareData() :
nullptr);
349 template <
typename T>
351 std::unique_ptr<pat::UserData> made(pat::UserData::make<T>(
data, transientOnly));
358 std::unique_ptr<pat::UserData>
cloned(
data->clone());
505 template <
class ObjectType>
508 template <
class ObjectType>
511 template <
class ObjectType>
520 template <
class ObjectType>
523 template <
class ObjectType>
525 if (refToOrig_.isNull()) {
529 }
else if (!refToOrig_.isAvailable()) {
531 <<
"The original collection from which this PAT object was made is not present any more in the event, hence "
532 "you cannot access the originating object anymore.";
534 return refToOrig_.get();
538 template <
class ObjectType>
543 template <
class ObjectType>
545 if (
idx >= triggerObjectMatches().
size())
551 template <
class ObjectType>
555 for (
size_t i = 0;
i < triggerObjectMatches().size(); ++
i) {
556 if (triggerObjectMatch(
i) != 0 && triggerObjectMatch(
i)->hasTriggerObjectType(triggerObjectType))
557 matches.push_back(*(triggerObjectMatch(
i)));
562 template <
class ObjectType>
565 std::vector<size_t> refs;
566 for (
size_t i = 0;
i < triggerObjectMatches().size(); ++
i) {
567 if (triggerObjectMatch(
i) !=
nullptr && triggerObjectMatch(
i)->hasTriggerObjectType(triggerObjectType))
570 if (
idx >= refs.size())
573 return ref.
isNonnull() ? ref.get() :
nullptr;
576 template <
class ObjectType>
580 for (
size_t i = 0;
i < triggerObjectMatches().size(); ++
i) {
581 if (triggerObjectMatch(
i) != 0 && triggerObjectMatch(
i)->hasCollection(coll))
582 matches.push_back(*(triggerObjectMatch(
i)));
587 template <
class ObjectType>
589 const size_t idx)
const {
590 std::vector<size_t> refs;
591 for (
size_t i = 0;
i < triggerObjectMatches().size(); ++
i) {
592 if (triggerObjectMatch(
i) != 0 && triggerObjectMatch(
i)->hasCollection(coll)) {
596 if (
idx >= refs.size())
599 return ref.
isNonnull() ? ref.get() :
nullptr;
602 template <
class ObjectType>
606 for (
size_t i = 0;
i < triggerObjectMatches().size(); ++
i) {
607 if (triggerObjectMatch(
i) != 0 && triggerObjectMatch(
i)->hasConditionName(nameCondition))
608 matches.push_back(*(triggerObjectMatch(
i)));
613 template <
class ObjectType>
615 const size_t idx)
const {
616 std::vector<size_t> refs;
617 for (
size_t i = 0;
i < triggerObjectMatches().size(); ++
i) {
618 if (triggerObjectMatch(
i) != 0 && triggerObjectMatch(
i)->hasConditionName(nameCondition))
621 if (
idx >= refs.size())
624 return ref.
isNonnull() ? ref.get() :
nullptr;
627 template <
class ObjectType>
629 const std::string &nameAlgorithm,
const bool algoCondAccepted)
const {
631 for (
size_t i = 0;
i < triggerObjectMatches().size(); ++
i) {
632 if (triggerObjectMatch(
i) != 0 && triggerObjectMatch(
i)->hasAlgorithmName(nameAlgorithm, algoCondAccepted))
633 matches.push_back(*(triggerObjectMatch(
i)));
638 template <
class ObjectType>
640 const bool algoCondAccepted,
641 const size_t idx)
const {
642 std::vector<size_t> refs;
643 for (
size_t i = 0;
i < triggerObjectMatches().size(); ++
i) {
644 if (triggerObjectMatch(
i) != 0 && triggerObjectMatch(
i)->hasAlgorithmName(nameAlgorithm, algoCondAccepted))
647 if (
idx >= refs.size())
650 return ref.
isNonnull() ? ref.get() :
nullptr;
653 template <
class ObjectType>
657 for (
size_t i = 0;
i < triggerObjectMatches().size(); ++
i) {
658 if (triggerObjectMatch(
i) != 0 && triggerObjectMatch(
i)->hasFilterLabel(labelFilter))
659 matches.push_back(*(triggerObjectMatch(
i)));
664 template <
class ObjectType>
666 const size_t idx)
const {
667 std::vector<size_t> refs;
668 for (
size_t i = 0;
i < triggerObjectMatches().size(); ++
i) {
669 if (triggerObjectMatch(
i) != 0 && triggerObjectMatch(
i)->hasFilterLabel(labelFilter))
672 if (
idx >= refs.size())
675 return ref.
isNonnull() ? ref.get() :
nullptr;
678 template <
class ObjectType>
680 const std::string &namePath,
const bool pathLastFilterAccepted,
const bool pathL3FilterAccepted)
const {
682 for (
size_t i = 0;
i < triggerObjectMatches().size(); ++
i) {
683 if (triggerObjectMatch(
i) !=
nullptr &&
684 triggerObjectMatch(
i)->hasPathName(namePath, pathLastFilterAccepted, pathL3FilterAccepted))
685 matches.push_back(*(triggerObjectMatch(
i)));
690 template <
class ObjectType>
692 const bool pathLastFilterAccepted,
693 const bool pathL3FilterAccepted,
694 const size_t idx)
const {
695 std::vector<size_t> refs;
696 for (
size_t i = 0;
i < triggerObjectMatches().size(); ++
i) {
697 if (triggerObjectMatch(
i) !=
nullptr &&
698 triggerObjectMatch(
i)->hasPathName(namePath, pathLastFilterAccepted, pathL3FilterAccepted))
701 if (
idx >= refs.size())
704 return ref.
isNonnull() ? ref.get() :
nullptr;
707 template <
class ObjectType>
711 if ((it == efficiencyNames_.end()) || (*it !=
name)) {
712 throw cms::Exception(
"Invalid Label") <<
"There is no efficiency with name '" <<
name <<
"' in this PAT Object\n";
714 return efficiencyValues_[
std::distance(efficiencyNames_.cbegin(), it)];
717 template <
class ObjectType>
719 std::vector<std::pair<std::string, pat::LookupTableRecord> >
ret;
720 std::vector<std::string>::const_iterator itn = efficiencyNames_.begin(), edn = efficiencyNames_.end();
721 std::vector<pat::LookupTableRecord>::const_iterator itv = efficiencyValues_.begin();
722 for (; itn != edn; ++itn, ++itv) {
723 ret.emplace_back(*itn, *itv);
728 template <
class ObjectType>
732 const auto dist =
std::distance(efficiencyNames_.begin(), it);
733 if (it == efficiencyNames_.end()) {
734 efficiencyNames_.push_back(
name);
735 efficiencyValues_.push_back(
value);
736 }
else if (*it ==
name) {
737 efficiencyValues_[dist] =
value;
739 efficiencyNames_.insert(it,
name);
740 efficiencyValues_.insert(efficiencyValues_.begin() + dist,
value);
744 template <
class ObjectType>
746 genParticleRef_ = std::vector<reco::GenParticleRef>(1, ref);
747 genParticleEmbedded_.clear();
752 template <
class ObjectType>
754 if (!genParticleEmbedded_.empty()) {
756 genParticleEmbedded_.push_back(*ref);
758 genParticleRef_.push_back(ref);
762 template <
class ObjectType>
764 genParticleEmbedded_.clear();
765 genParticleEmbedded_.push_back(particle);
766 genParticleRef_.clear();
769 template <
class ObjectType>
771 genParticleEmbedded_.clear();
772 for (std::vector<reco::GenParticleRef>::const_iterator it = genParticleRef_.begin(); it != genParticleRef_.end();
775 genParticleEmbedded_.push_back(**it);
777 genParticleRef_.clear();
780 template <
class ObjectType>
782 if (genParticleEmbedded_.empty())
783 return genParticleRef_;
784 std::vector<reco::GenParticleRef>
ret(genParticleEmbedded_.size());
785 for (
size_t i = 0,
n =
ret.size();
i <
n; ++
i) {
791 template <
class ObjectType>
794 const std::vector<reco::GenParticleRef> &vec = (genParticleEmbedded_.empty() ? genParticleRef_ : genParticleRefs());
795 for (std::vector<reco::GenParticleRef>::const_iterator ref = vec.begin(),
end = vec.end(); ref !=
end; ++ref) {
796 if (ref->isNonnull()) {
802 }
else if (!autoCharge) {
809 else if ((this->
charge() == 0) && (pdgId ==
g.pdgId()))
811 else if (
g.charge() * this->
charge() * pdgId > 0)
819 template <
class ObjectType>
825 template <
class ObjectType>
833 template <
class ObjectType>
839 overlapItems_.insert(overlapItems_.begin() + dist,
overlaps);
845 template <
class ObjectType>
848 if (it != userDataLabels_.cend() && *it ==
key) {
849 return &userDataObjects_[
std::distance(userDataLabels_.cbegin(), it)];
854 template <
class ObjectType>
856 std::unique_ptr<pat::UserData>
data,
859 const auto dist =
std::distance(userDataLabels_.begin(), it);
860 if (it == userDataLabels_.end() || *it !=
label) {
861 userDataLabels_.insert(it,
label);
862 userDataObjects_.insert(userDataObjects_.begin() + dist,
std::move(
data));
863 }
else if (overwrite) {
867 userDataLabels_.insert(it + 1,
label);
868 userDataObjects_.insert(userDataObjects_.begin() + dist + 1,
std::move(
data));
872 template <
class ObjectType>
875 if (it != userFloatLabels_.cend() && *it ==
key) {
876 return userFloats_[
std::distance(userFloatLabels_.cbegin(), it)];
879 return std::numeric_limits<float>::quiet_NaN();
882 template <
class ObjectType>
884 auto range = std::equal_range(userFloatLabels_.cbegin(), userFloatLabels_.cend(),
key);
885 std::vector<float>
result;
887 for (
auto it =
range.first; it !=
range.second; ++it) {
893 template <
class ObjectType>
896 const auto dist =
std::distance(userFloatLabels_.begin(), it);
897 if (it == userFloatLabels_.end() || *it !=
label) {
898 userFloatLabels_.insert(it,
label);
899 userFloats_.insert(userFloats_.begin() + dist,
data);
900 }
else if (overwrite) {
901 userFloats_[dist] =
data;
904 userFloatLabels_.insert(it + 1,
label);
905 userFloats_.insert(userFloats_.begin() + dist + 1,
data);
909 template <
class ObjectType>
912 if (it != userIntLabels_.cend() && *it ==
key) {
913 return userInts_[
std::distance(userIntLabels_.cbegin(), it)];
919 template <
class ObjectType>
921 auto range = std::equal_range(userIntLabels_.cbegin(), userIntLabels_.cend(),
key);
924 for (
auto it =
range.first; it !=
range.second; ++it) {
930 template <
class ObjectType>
934 if (it == userIntLabels_.end() || *it !=
label) {
935 userIntLabels_.insert(it,
label);
936 userInts_.insert(userInts_.begin() + dist,
data);
937 }
else if (overwrite) {
938 userInts_[dist] =
data;
941 userIntLabels_.insert(it + 1,
label);
942 userInts_.insert(userInts_.begin() + dist + 1,
data);
946 template <
class ObjectType>
949 if (it != userCandLabels_.cend()) {
950 return userCands_[
std::distance(userCandLabels_.begin(), it)];
955 template <
class ObjectType>
958 const bool overwrite) {
960 const auto dist =
std::distance(userCandLabels_.begin(), it);
961 if (it == userCandLabels_.end() || *it !=
label) {
962 userCandLabels_.insert(it,
label);
963 userCands_.insert(userCands_.begin() + dist,
data);
964 }
else if (overwrite) {
965 userCands_[dist] =
data;
967 userCandLabels_.insert(it + 1,
label);
968 userCands_.insert(userCands_.begin() + dist + 1,
data);
972 template <
class ObjectType>
974 const bool has_unlabelled = (kinResolutionLabels_.size() + 1 == kinResolutions_.size());
976 if (has_unlabelled) {
977 return kinResolutions_[0];
979 throw cms::Exception(
"Missing Data",
"This object does not contain an un-labelled kinematic resolution");
984 const size_t increment = (has_unlabelled ? 1 : 0);
987 ex <<
"This object does not contain a kinematic resolution with name '" <<
label <<
"'.\n";
988 ex <<
"The known labels are: ";
989 for (std::vector<std::string>::const_iterator it = kinResolutionLabels_.cbegin();
990 it != kinResolutionLabels_.cend();
992 ex <<
"'" << *it <<
"' ";
997 return kinResolutions_[dist + increment];
1002 template <
class ObjectType>
1004 if (
label.empty()) {
1005 return (kinResolutionLabels_.size() + 1 == kinResolutions_.size());
1012 template <
class ObjectType>
1014 const bool has_unlabelled = (kinResolutionLabels_.size() + 1 == kinResolutions_.size());
1015 if (
label.empty()) {
1016 if (has_unlabelled) {
1018 kinResolutions_[0] =
resol;
1022 kinResolutions_.insert(kinResolutions_.begin(),
resol);
1027 const size_t increment = (has_unlabelled ? 1 : 0);
1030 kinResolutions_[dist + increment] =
resol;
1033 kinResolutions_.insert(kinResolutions_.begin() + dist + increment,
resol);
ret
prodAgent to be discontinued
const std::vector< pat::LookupTableRecord > & efficiencyValues() const
Returns the list of the values of the stored efficiencies (the ordering is the same as in efficiencyN...
void setOverlaps(const std::string &label, const reco::CandidatePtrVector &overlaps)
Base class for data that users can add to pat objects.
double resolP(const LorentzVector &p4) const
Resolution on p, given the 4-momentum of the associated Candidate.
edm::Ref< GenParticleCollection > GenParticleRef
persistent reference to a GenParticle
const std::vector< std::string > & overlapLabels() const
Returns the labels of the overlap tests that found at least one overlap.
def addGenParticleRef(patMuonProducer, label='classByHitsGlbOrTrk')
void throwMissingLabel(const std::string &what, const std::string &bad_label, const std::vector< std::string > &available)
std::vector< pat::LookupTableRecord > efficiencyValues_
vector of the efficiencies (values)
const void * userDataBare(const std::string &key) const
const TriggerObjectStandAlone * triggerObjectMatchByPath(const std::string &namePath, const bool pathLastFilterAccepted=false, const bool pathL3FilterAccepted=true, const size_t idx=0) const
const TriggerObjectStandAloneCollection & triggerObjectMatches() const
get all matched trigger objects
const TriggerObjectStandAloneCollection triggerObjectMatchesByFilterID(const unsigned triggerObjectType) const
bool hasUserData(const std::string &key) const
Check if user data with a specific type is present.
const T * userData(const std::string &key) const
Returns user-defined data. Returns NULL if the data is not present, or not of type T.
void addTriggerObjectMatch(const TriggerObjectStandAlone &trigObj)
add a trigger match
const TriggerObjectStandAlone * triggerObjectMatchByAlgorithm(const char *nameAlgorithm, const bool algoCondAccepted=true, const size_t idx=0) const
const TriggerObjectStandAloneCollection triggerObjectMatchesByType(const trigger::TriggerObjectType triggerObjectType) const
const TriggerObjectStandAlone * triggerObjectMatchByFilter(const char *labelFilter, const size_t idx=0) const
std::vector< std::string > kinResolutionLabels_
double resolPInv(const std::string &label="") const
Resolution on 1/p, possibly with a label to specify which resolution to use.
reco::GenParticleRef genParticleById(int pdgId, int status, uint8_t autoCharge=0) const
Analysis-level trigger object class (stand-alone)
double resolPx(const LorentzVector &p4) const
Resolution on px, given the 4-momentum of the associated Candidate.
const TriggerObjectStandAlone * triggerObjectMatchByFilter(const std::string &labelFilter, const size_t idx=0) const
get one matched HLT object used in a certain HLT filter by index
double resolPhi(const LorentzVector &p4) const
Resolution on phi, given the 4-momentum of the associated Candidate.
const TriggerObjectStandAloneCollection triggerObjectMatchesByAlgorithm(const std::string &nameAlgorithm, const bool algoCondAccepted=true) const
T const * get() const
Returns C++ pointer to the item.
double resolPInv(const LorentzVector &p4) const
Resolution on 1/p, given the 4-momentum of the associated Candidate.
size_t genParticlesSize() const
Number of generator level particles stored as ref or embedded.
void addGenParticleRef(const reco::GenParticleRef &ref)
void addUserInt(const std::string &label, int32_t data, const bool overwrite=false)
Set user-defined int.
const TriggerObjectStandAlone * triggerObjectMatchByAlgorithm(const std::string &nameAlgorithm, const bool algoCondAccepted=true, const size_t idx=0) const
bool hasOverlaps(const std::string &label) const
Returns true if there was at least one overlap for this test label.
double resolPhi(const std::string &label="") const
Resolution on phi, possibly with a label to specify which resolution to use.
std::vector< std::pair< std::string, pat::LookupTableRecord > > efficiencies() const
Returns the efficiencies as <name,value> pairs (by value)
float userFloat(const std::string &key) const
std::vector< int > userIntRange(const std::string &key) const
returns a range of values corresponding to key
const TriggerObjectStandAlone * triggerObjectMatchByCondition(const std::string &nameCondition, const size_t idx=0) const
get one matched L1 object used in a succeeding object combination of a certain L1 condition by index
bool hasUserCand(const std::string &key) const
Return true if there is a user-defined int with a given name.
const TriggerObjectStandAloneCollection triggerObjectMatchesByCondition(const std::string &nameCondition) const
get all matched L1 objects used in a succeeding object combination of a certain L1 condition
pat::UserDataCollection userDataObjects_
void addUserDataFromPtr(const std::string &label, const edm::Ptr< pat::UserData > &data, bool overwrite=false)
const TriggerObjectStandAloneCollection triggerObjectMatchesByFilter(const char *labelFilter) const
std::vector< std::string > overlapLabels_
Overlapping test labels (only if there are any overlaps)
std::vector< int32_t > userInts_
const TriggerObjectStandAlone * triggerObjectMatchByCollection(const std::string &coll, const size_t idx=0) const
get one matched trigger object from a certain collection by index
double resolTheta(const std::string &label="") const
Resolution on theta, possibly with a label to specify which resolution to use.
double resolP(const std::string &label="") const
Resolution on p, possibly with a label to specify which resolution to use.
edm::Ptr< reco::Candidate > refToOrig_
const std::string names[nVars_]
double resolPy(const LorentzVector &p4) const
Resolution on py, given the 4-momentum of the associated Candidate.
const TriggerObjectStandAloneCollection triggerObjectMatchesByFilter(const std::string &labelFilter) const
get all matched HLT objects used in a certain HLT filter
std::vector< reco::GenParticleRef > genParticleRefs() const
const reco::CandidatePtrVector & overlaps(const std::string &label) const
void addUserData(const std::string &label, const T &data, bool transientOnly=false, bool overwrite=false)
const TriggerObjectStandAlone * triggerObjectMatchByFilterID(const unsigned triggerObjectType, const size_t idx=0) const
bool hasUserFloat(const std::string &key) const
Return true if there is a user-defined float with a given name.
Templated PAT object container.
double resolPy(const std::string &label="") const
Resolution on py, possibly with a label to specify which resolution to use.
const reco::CandidatePtrVector & get_empty_cpv()
const TriggerObjectStandAlone * triggerObjectMatchByCondition(const char *nameCondition, const size_t idx=0) const
reco::CandidatePtr userCand(const std::string &key) const
~PATObject() override
destructor
std::vector< float > userFloatRange(const std::string &key) const
return a range of values corresponding to key
const TriggerObjectStandAlone * triggerObjectMatchByAlgorithm(const std::string &nameAlgorithm, const unsigned algoCondAccepted, const size_t idx=0) const
double resolM(const LorentzVector &p4) const
bool hasUserFloat(const char *key) const
a CINT-friendly interface
void addUserDataObject_(const std::string &label, std::unique_ptr< pat::UserData > value, bool overwrite=false)
void addUserCand(const std::string &label, const reco::CandidatePtr &data, const bool overwrite=false)
Set user-defined int.
const std::string & get_empty_str()
const TriggerObjectStandAlone * triggerObjectMatchByAlgorithm(const char *nameAlgorithm, const unsigned algoCondAccepted, const size_t idx=0) const
const pat::LookupTableRecord & efficiency(const std::string &name) const
Returns an efficiency given its name.
const edm::Ptr< reco::Candidate > & originalObjectRef() const
reference to original object. Returns a null reference if not available
bool hasUserInt(const std::string &key) const
Return true if there is a user-defined int with a given name.
std::vector< reco::CandidatePtr > userCands_
const TriggerObjectStandAlone * triggerObjectMatchByPath(const std::string &namePath, const unsigned pathLastFilterAccepted, const unsigned pathL3FilterAccepted=1, const size_t idx=0) const
std::vector< std::string > userIntLabels_
const TriggerObjectStandAloneCollection triggerObjectMatchesByAlgorithm(const std::string &nameAlgorithm, const unsigned algoCondAccepted) const
float userFloat(const char *key) const
a CINT-friendly interface
const std::string & userDataObjectType(const std::string &key) const
Get human-readable type of user data object, for debugging.
const TriggerObjectStandAlone * triggerObjectMatch(const size_t idx=0) const
get one matched trigger object by index
std::vector< reco::GenParticleRef > genParticleRef_
Reference to a generator level particle.
double resolPt(const LorentzVector &p4) const
Resolution on pt, given the 4-momentum of the associated Candidate.
const TriggerObjectStandAloneCollection triggerObjectMatchesByCollection(const std::string &coll) const
get all matched trigger objects from a certain collection
bool isNonnull() const
Checks for non-null.
const pat::UserData * userDataObject_(const std::string &key) const
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
void setGenParticle(const reco::GenParticle &particle)
Set the generator level particle from a particle not in the Event (embedding it, of course)
void addUserFloat(const std::string &label, float data, const bool overwrite=false)
Set user-defined float.
double resolPt(const std::string &label="") const
Resolution on pt, possibly with a label to specify which resolution to use.
std::vector< TriggerObjectStandAlone > TriggerObjectStandAloneCollection
Collection of TriggerObjectStandAlone.
double resolPx(const std::string &label="") const
Resolution on px, possibly with a label to specify which resolution to use.
const std::vector< std::string > & userFloatNames() const
Get list of user-defined float names.
std::vector< std::string > efficiencyNames_
vector of the efficiencies (names)
const TriggerObjectStandAloneCollection triggerObjectMatchesByPath(const std::string &namePath, const bool pathLastFilterAccepted=false, const bool pathL3FilterAccepted=true) const
double resolE(const LorentzVector &p4) const
Resolution on energy, given the 4-momentum of the associated Candidate.
std::vector< reco::GenParticle > genParticleEmbedded_
vector to hold an embedded generator level particle
const TriggerObjectStandAlone * triggerObjectMatchByPath(const char *namePath, const unsigned pathLastFilterAccepted, const unsigned pathL3FilterAccepted=1, const size_t idx=0) const
const TriggerObjectStandAloneCollection triggerObjectMatchesByAlgorithm(const char *nameAlgorithm, const bool algoCondAccepted=true) const
const TriggerObjectStandAlone * triggerObjectMatchByType(const trigger::TriggerObjectType triggerObjectType, const size_t idx=0) const
get one matched trigger object of a certain type by index
void setGenParticleRef(const reco::GenParticleRef &ref, bool embed=false)
Set the generator level particle reference.
double resolEta(const std::string &label="") const
Resolution on eta, possibly with a label to specify which resolution to use.
const std::vector< std::string > & efficiencyNames() const
Returns the list of the names of the stored efficiencies.
PATObject()
default constructor
std::vector< pat::CandKinResolution > kinResolutions_
Kinematic resolutions.
const reco::Candidate * originalObject() const
access to the original object; returns zero for null Ref and throws for unavailable collection
const TriggerObjectStandAloneCollection triggerObjectMatchesByPath(const char *namePath, const bool pathLastFilterAccepted=false, const bool pathL3FilterAccepted=true) const
const TriggerObjectStandAloneCollection triggerObjectMatchesByCollection(const char *coll) const
std::vector< std::string > userCandLabels_
const TriggerObjectStandAloneCollection triggerObjectMatchesByType(const unsigned triggerObjectType) const
void setEfficiency(const std::string &name, const pat::LookupTableRecord &value)
double resolM(const std::string &label="") const
double resolTheta(const LorentzVector &p4) const
Resolution on theta, given the 4-momentum of the associated Candidate.
double resolPz(const LorentzVector &p4) const
Resolution on pz, given the 4-momentum of the associated Candidate.
const TriggerObjectStandAloneCollection triggerObjectMatchesByPath(const char *namePath, const unsigned pathLastFilterAccepted, const unsigned pathL3FilterAccepted=1) const
double resolPz(const std::string &label="") const
Resolution on pz, possibly with a label to specify which resolution to use.
const TriggerObjectStandAlone * triggerObjectMatchByPath(const char *namePath, const bool pathLastFilterAccepted=false, const bool pathL3FilterAccepted=true, const size_t idx=0) const
const reco::GenParticle * genParticle(size_t idx=0) const
bool hasKinResolution(const std::string &label="") const
Check if the kinematic resolutions are stored into this object (possibly specifying a label for them)
const std::vector< std::string > & userIntNames() const
Get list of user-defined int names.
double resolEt(const std::string &label="") const
Resolution on et, possibly with a label to specify which resolution to use.
const TriggerObjectStandAloneCollection triggerObjectMatchesByPath(const std::string &namePath, const unsigned pathLastFilterAccepted, const unsigned pathL3FilterAccepted=1) const
char data[epos_bytes_allocation]
TriggerObjectStandAloneCollection triggerObjectMatchesEmbedded_
vector of trigger matches
std::vector< std::string > userDataLabels_
User data object.
edm::Ptr< Candidate > CandidatePtr
persistent reference to an object in a collection of Candidate objects
Abs< T >::type abs(const T &t)
const TriggerObjectStandAlone * triggerObjectMatchByType(const unsigned triggerObjectType, const size_t idx=0) const
const TriggerObjectStandAloneCollection triggerObjectMatchesByCondition(const char *nameCondition) const
int32_t userInt(const std::string &key) const
void unpackTriggerObjectPathNames(const edm::TriggerNames &names)
unpack path names of matched trigger objects (if they were packed before embedding,...
double resolEta(const LorentzVector &p4) const
Resolution on eta, given the 4-momentum of the associated Candidate.
Class to store the result of a lookup table fetch, e.g. for efficiencies.
const TriggerObjectStandAlone * triggerObjectMatchByCollection(const char *coll, const size_t idx=0) const
const TriggerObjectStandAloneCollection triggerObjectMatchesByAlgorithm(const char *nameAlgorithm, const unsigned algoCondAccepted) const
reco::GenParticleRef genParticleRef(size_t idx=0) const
const std::vector< std::string > & userDataNames() const
Get list of user data object names.
double resolEt(const LorentzVector &p4) const
Resolution on et, given the 4-momentum of the associated Candidate.
std::vector< std::string > userFloatLabels_
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
double resolE(const std::string &label="") const
Resolution on energy, possibly with a label to specify which resolution to use.
std::vector< float > userFloats_
const pat::CandKinResolution & getKinResolution(const std::string &label="") const
const std::vector< std::string > & userCandNames() const
Get list of user-defined cand names.
std::vector< reco::CandidatePtrVector > overlapItems_
Overlapping items (sorted by distance)
void setKinResolution(const pat::CandKinResolution &resol, const std::string &label="")
Add a kinematic resolution to this object (possibly with a label)