4 #ifndef DataFormats_PatCandidates_PATObject_h 5 #define DataFormats_PatCandidates_PATObject_h 42 template <
class ObjectType>
86 const size_t idx = 0)
const;
88 const size_t idx = 0)
const {
93 const size_t idx = 0)
const {
116 const size_t idx = 0)
const;
119 const size_t idx = 0)
const {
126 const bool algoCondAccepted =
true)
const;
129 const bool algoCondAccepted =
true)
const {
134 const unsigned algoCondAccepted)
const {
139 const unsigned algoCondAccepted)
const {
146 const bool algoCondAccepted =
true,
147 const size_t idx = 0)
const;
150 const bool algoCondAccepted =
true,
151 const size_t idx = 0)
const {
156 const unsigned algoCondAccepted,
157 const size_t idx = 0)
const {
162 const unsigned algoCondAccepted,
163 const size_t idx = 0)
const {
174 const size_t idx = 0)
const;
185 const bool pathLastFilterAccepted =
false,
186 const bool pathL3FilterAccepted =
true)
const;
189 const bool pathLastFilterAccepted =
false,
190 const bool pathL3FilterAccepted =
true)
const {
195 const unsigned pathLastFilterAccepted,
196 const unsigned pathL3FilterAccepted = 1)
const {
201 const unsigned pathLastFilterAccepted,
202 const unsigned pathL3FilterAccepted = 1)
const {
204 std::string(namePath),
bool(pathLastFilterAccepted),
bool(pathL3FilterAccepted));
212 const bool pathLastFilterAccepted =
false,
213 const bool pathL3FilterAccepted =
true,
214 const size_t idx = 0)
const;
217 const bool pathLastFilterAccepted =
false,
218 const bool pathL3FilterAccepted =
true,
219 const size_t idx = 0)
const {
224 const unsigned pathLastFilterAccepted,
225 const unsigned pathL3FilterAccepted = 1,
226 const size_t idx = 0)
const {
231 const unsigned pathLastFilterAccepted,
232 const unsigned pathL3FilterAccepted = 1,
233 const size_t idx = 0)
const {
235 std::string(namePath),
bool(pathLastFilterAccepted),
bool(pathL3FilterAccepted),
idx);
253 std::vector<std::pair<std::string, pat::LookupTableRecord> >
efficiencies()
const;
321 template <
typename T>
324 return (
data !=
nullptr ?
data->template get<T>() :
nullptr);
340 return (
data !=
nullptr ?
data->bareData() :
nullptr);
347 template <
typename T>
349 std::unique_ptr<pat::UserData> made(pat::UserData::make<T>(
data, transientOnly));
356 std::unique_ptr<pat::UserData>
cloned(
data->clone());
503 template <
class ObjectType>
506 template <
class ObjectType>
509 template <
class ObjectType>
518 template <
class ObjectType>
521 template <
class ObjectType>
523 if (refToOrig_.isNull()) {
527 }
else if (!refToOrig_.isAvailable()) {
529 <<
"The original collection from which this PAT object was made is not present any more in the event, hence " 530 "you cannot access the originating object anymore.";
532 return refToOrig_.get();
536 template <
class ObjectType>
541 template <
class ObjectType>
543 if (
idx >= triggerObjectMatches().
size())
549 template <
class ObjectType>
553 for (
size_t i = 0;
i < triggerObjectMatches().size(); ++
i) {
554 if (triggerObjectMatch(
i) != 0 && triggerObjectMatch(
i)->hasTriggerObjectType(triggerObjectType))
555 matches.push_back(*(triggerObjectMatch(
i)));
560 template <
class ObjectType>
563 std::vector<size_t> refs;
564 for (
size_t i = 0;
i < triggerObjectMatches().size(); ++
i) {
565 if (triggerObjectMatch(
i) !=
nullptr && triggerObjectMatch(
i)->hasTriggerObjectType(triggerObjectType))
568 if (
idx >= refs.size())
571 return ref.
isNonnull() ? ref.get() :
nullptr;
574 template <
class ObjectType>
578 for (
size_t i = 0;
i < triggerObjectMatches().size(); ++
i) {
579 if (triggerObjectMatch(
i) != 0 && triggerObjectMatch(
i)->hasCollection(coll))
580 matches.push_back(*(triggerObjectMatch(
i)));
585 template <
class ObjectType>
587 const size_t idx)
const {
588 std::vector<size_t> refs;
589 for (
size_t i = 0;
i < triggerObjectMatches().size(); ++
i) {
590 if (triggerObjectMatch(
i) != 0 && triggerObjectMatch(
i)->hasCollection(coll)) {
594 if (
idx >= refs.size())
597 return ref.
isNonnull() ? ref.get() :
nullptr;
600 template <
class ObjectType>
604 for (
size_t i = 0;
i < triggerObjectMatches().size(); ++
i) {
605 if (triggerObjectMatch(
i) != 0 && triggerObjectMatch(
i)->hasConditionName(nameCondition))
606 matches.push_back(*(triggerObjectMatch(
i)));
611 template <
class ObjectType>
613 const size_t idx)
const {
614 std::vector<size_t> refs;
615 for (
size_t i = 0;
i < triggerObjectMatches().size(); ++
i) {
616 if (triggerObjectMatch(
i) != 0 && triggerObjectMatch(
i)->hasConditionName(nameCondition))
619 if (
idx >= refs.size())
622 return ref.
isNonnull() ? ref.get() :
nullptr;
625 template <
class ObjectType>
627 const std::string &nameAlgorithm,
const bool algoCondAccepted)
const {
629 for (
size_t i = 0;
i < triggerObjectMatches().size(); ++
i) {
630 if (triggerObjectMatch(
i) != 0 && triggerObjectMatch(
i)->hasAlgorithmName(nameAlgorithm, algoCondAccepted))
631 matches.push_back(*(triggerObjectMatch(
i)));
636 template <
class ObjectType>
638 const bool algoCondAccepted,
639 const size_t idx)
const {
640 std::vector<size_t> refs;
641 for (
size_t i = 0;
i < triggerObjectMatches().size(); ++
i) {
642 if (triggerObjectMatch(
i) != 0 && triggerObjectMatch(
i)->hasAlgorithmName(nameAlgorithm, algoCondAccepted))
645 if (
idx >= refs.size())
648 return ref.
isNonnull() ? ref.get() :
nullptr;
651 template <
class ObjectType>
655 for (
size_t i = 0;
i < triggerObjectMatches().size(); ++
i) {
656 if (triggerObjectMatch(
i) != 0 && triggerObjectMatch(
i)->hasFilterLabel(labelFilter))
657 matches.push_back(*(triggerObjectMatch(
i)));
662 template <
class ObjectType>
664 const size_t idx)
const {
665 std::vector<size_t> refs;
666 for (
size_t i = 0;
i < triggerObjectMatches().size(); ++
i) {
667 if (triggerObjectMatch(
i) != 0 && triggerObjectMatch(
i)->hasFilterLabel(labelFilter))
670 if (
idx >= refs.size())
673 return ref.
isNonnull() ? ref.get() :
nullptr;
676 template <
class ObjectType>
678 const std::string &namePath,
const bool pathLastFilterAccepted,
const bool pathL3FilterAccepted)
const {
680 for (
size_t i = 0;
i < triggerObjectMatches().size(); ++
i) {
681 if (triggerObjectMatch(
i) !=
nullptr &&
682 triggerObjectMatch(
i)->hasPathName(namePath, pathLastFilterAccepted, pathL3FilterAccepted))
683 matches.push_back(*(triggerObjectMatch(
i)));
688 template <
class ObjectType>
690 const bool pathLastFilterAccepted,
691 const bool pathL3FilterAccepted,
692 const size_t idx)
const {
693 std::vector<size_t> refs;
694 for (
size_t i = 0;
i < triggerObjectMatches().size(); ++
i) {
695 if (triggerObjectMatch(
i) !=
nullptr &&
696 triggerObjectMatch(
i)->hasPathName(namePath, pathLastFilterAccepted, pathL3FilterAccepted))
699 if (
idx >= refs.size())
702 return ref.
isNonnull() ? ref.get() :
nullptr;
705 template <
class ObjectType>
709 if ((
it == efficiencyNames_.end()) || (*
it !=
name)) {
710 throw cms::Exception(
"Invalid Label") <<
"There is no efficiency with name '" <<
name <<
"' in this PAT Object\n";
712 return efficiencyValues_[
std::distance(efficiencyNames_.cbegin(),
it)];
715 template <
class ObjectType>
717 std::vector<std::pair<std::string, pat::LookupTableRecord> >
ret;
718 std::vector<std::string>::const_iterator itn = efficiencyNames_.begin(), edn = efficiencyNames_.end();
719 std::vector<pat::LookupTableRecord>::const_iterator itv = efficiencyValues_.begin();
720 for (; itn != edn; ++itn, ++itv) {
721 ret.emplace_back(*itn, *itv);
726 template <
class ObjectType>
731 if (
it == efficiencyNames_.end()) {
732 efficiencyNames_.push_back(
name);
733 efficiencyValues_.push_back(
value);
735 efficiencyValues_[dist] =
value;
737 efficiencyNames_.insert(
it,
name);
738 efficiencyValues_.insert(efficiencyValues_.begin() + dist,
value);
742 template <
class ObjectType>
744 genParticleRef_ = std::vector<reco::GenParticleRef>(1, ref);
745 genParticleEmbedded_.clear();
750 template <
class ObjectType>
752 if (!genParticleEmbedded_.empty()) {
754 genParticleEmbedded_.push_back(*ref);
756 genParticleRef_.push_back(ref);
760 template <
class ObjectType>
762 genParticleEmbedded_.clear();
763 genParticleEmbedded_.push_back(particle);
764 genParticleRef_.clear();
767 template <
class ObjectType>
769 genParticleEmbedded_.clear();
770 for (std::vector<reco::GenParticleRef>::const_iterator
it = genParticleRef_.begin();
it != genParticleRef_.end();
773 genParticleEmbedded_.push_back(**
it);
775 genParticleRef_.clear();
778 template <
class ObjectType>
780 if (genParticleEmbedded_.empty())
781 return genParticleRef_;
782 std::vector<reco::GenParticleRef>
ret(genParticleEmbedded_.size());
783 for (
size_t i = 0,
n =
ret.size();
i <
n; ++
i) {
789 template <
class ObjectType>
792 const std::vector<reco::GenParticleRef> &vec = (genParticleEmbedded_.empty() ? genParticleRef_ : genParticleRefs());
793 for (std::vector<reco::GenParticleRef>::const_iterator ref = vec.begin(),
end = vec.end(); ref !=
end; ++ref) {
794 if (ref->isNonnull()) {
800 }
else if (!autoCharge) {
807 else if ((this->
charge() == 0) && (pdgId ==
g.pdgId()))
809 else if (
g.charge() * this->
charge() * pdgId > 0)
817 template <
class ObjectType>
823 template <
class ObjectType>
831 template <
class ObjectType>
837 overlapItems_.insert(overlapItems_.begin() + dist,
overlaps);
843 template <
class ObjectType>
846 if (
it != userDataLabels_.cend() && *
it ==
key) {
852 template <
class ObjectType>
854 std::unique_ptr<pat::UserData>
data,
858 if (
it == userDataLabels_.end() || *
it !=
label) {
859 userDataLabels_.insert(
it,
label);
860 userDataObjects_.insert(userDataObjects_.begin() + dist,
std::move(
data));
861 }
else if (overwrite) {
865 userDataLabels_.insert(
it + 1,
label);
866 userDataObjects_.insert(userDataObjects_.begin() + dist + 1,
std::move(
data));
870 template <
class ObjectType>
873 if (
it != userFloatLabels_.cend() && *
it ==
key) {
877 return std::numeric_limits<float>::quiet_NaN();
880 template <
class ObjectType>
882 auto range = std::equal_range(userFloatLabels_.cbegin(), userFloatLabels_.cend(),
key);
883 std::vector<float>
result;
891 template <
class ObjectType>
895 if (
it == userFloatLabels_.end() || *
it !=
label) {
896 userFloatLabels_.insert(
it,
label);
897 userFloats_.insert(userFloats_.begin() + dist,
data);
898 }
else if (overwrite) {
899 userFloats_[dist] =
data;
902 userFloatLabels_.insert(
it + 1,
label);
903 userFloats_.insert(userFloats_.begin() + dist + 1,
data);
907 template <
class ObjectType>
910 if (
it != userIntLabels_.cend() && *
it ==
key) {
917 template <
class ObjectType>
919 auto range = std::equal_range(userIntLabels_.cbegin(), userIntLabels_.cend(),
key);
928 template <
class ObjectType>
932 if (
it == userIntLabels_.end() || *
it !=
label) {
933 userIntLabels_.insert(
it,
label);
934 userInts_.insert(userInts_.begin() + dist,
data);
935 }
else if (overwrite) {
936 userInts_[dist] =
data;
939 userIntLabels_.insert(
it + 1,
label);
940 userInts_.insert(userInts_.begin() + dist + 1,
data);
944 template <
class ObjectType>
947 if (
it != userCandLabels_.cend()) {
953 template <
class ObjectType>
956 const bool overwrite) {
959 if (
it == userCandLabels_.end() || *
it !=
label) {
960 userCandLabels_.insert(
it,
label);
961 userCands_.insert(userCands_.begin() + dist,
data);
962 }
else if (overwrite) {
963 userCands_[dist] =
data;
965 userCandLabels_.insert(
it + 1,
label);
966 userCands_.insert(userCands_.begin() + dist + 1,
data);
970 template <
class ObjectType>
972 const bool has_unlabelled = (kinResolutionLabels_.size() + 1 == kinResolutions_.size());
974 if (has_unlabelled) {
975 return kinResolutions_[0];
977 throw cms::Exception(
"Missing Data",
"This object does not contain an un-labelled kinematic resolution");
982 const size_t increment = (has_unlabelled ? 1 : 0);
985 ex <<
"This object does not contain a kinematic resolution with name '" <<
label <<
"'.\n";
986 ex <<
"The known labels are: ";
987 for (std::vector<std::string>::const_iterator
it = kinResolutionLabels_.cbegin();
988 it != kinResolutionLabels_.cend();
990 ex <<
"'" << *
it <<
"' ";
995 return kinResolutions_[dist + increment];
1000 template <
class ObjectType>
1002 if (
label.empty()) {
1003 return (kinResolutionLabels_.size() + 1 == kinResolutions_.size());
1010 template <
class ObjectType>
1012 const bool has_unlabelled = (kinResolutionLabels_.size() + 1 == kinResolutions_.size());
1013 if (
label.empty()) {
1014 if (has_unlabelled) {
1016 kinResolutions_[0] =
resol;
1020 kinResolutions_.insert(kinResolutions_.begin(),
resol);
1025 const size_t increment = (has_unlabelled ? 1 : 0);
1028 kinResolutions_[dist + increment] =
resol;
1031 kinResolutions_.insert(kinResolutions_.begin() + dist + increment,
resol);
std::vector< std::string > efficiencyNames_
vector of the efficiencies (names)
~PATObject() override
destructor
double resolTheta(const std::string &label="") const
Resolution on theta, possibly with a label to specify which resolution to use.
void addUserCand(const std::string &label, const reco::CandidatePtr &data, const bool overwrite=false)
Set user-defined int.
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 addUserDataObject_(const std::string &label, std::unique_ptr< pat::UserData > value, bool overwrite=false)
const TriggerObjectStandAloneCollection triggerObjectMatchesByFilter(const std::string &labelFilter) const
get all matched HLT objects used in a certain HLT filter
def addGenParticleRef(patMuonProducer, label='classByHitsGlbOrTrk')
const pat::LookupTableRecord & efficiency(const std::string &name) const
Returns an efficiency given its name.
const TriggerObjectStandAlone * triggerObjectMatchByFilterID(const unsigned triggerObjectType, const size_t idx=0) const
const std::vector< std::string > & efficiencyNames() const
Returns the list of the names of the stored efficiencies.
bool hasUserInt(const std::string &key) const
Return true if there is a user-defined int with a given name.
double resolPx(const LorentzVector &p4) const
Resolution on px, given the 4-momentum of the associated Candidate.
const TriggerObjectStandAloneCollection triggerObjectMatchesByAlgorithm(const std::string &nameAlgorithm, const unsigned algoCondAccepted) const
float userFloat(const char *key) const
a CINT-friendly interface
reco::CandidatePtr userCand(const std::string &key) const
std::vector< reco::GenParticleRef > genParticleRef_
Reference to a generator level particle.
bool hasUserFloat(const char *key) const
a CINT-friendly interface
const reco::CandidatePtrVector & get_empty_cpv()
std::vector< TriggerObjectStandAlone > TriggerObjectStandAloneCollection
Collection of TriggerObjectStandAlone.
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
const pat::UserData * userDataObject_(const std::string &key) const
double resolEta(const std::string &label="") const
Resolution on eta, possibly with a label to specify which resolution to use.
const reco::GenParticle * genParticle(size_t idx=0) const
PATObject()
default constructor
const TriggerObjectStandAloneCollection triggerObjectMatchesByCollection(const char *coll) const
ret
prodAgent to be discontinued
double resolE(const LorentzVector &p4) const
Resolution on energy, given the 4-momentum of the associated Candidate.
double resolPt(const std::string &label="") const
Resolution on pt, possibly with a label to specify which resolution to use.
std::vector< reco::CandidatePtr > userCands_
edm::Ref< GenParticleCollection > GenParticleRef
persistent reference to a GenParticle
Class to store the result of a lookup table fetch, e.g. for efficiencies.
const TriggerObjectStandAloneCollection triggerObjectMatchesByAlgorithm(const char *nameAlgorithm, const bool algoCondAccepted=true) const
const TriggerObjectStandAlone * triggerObjectMatchByPath(const char *namePath, const unsigned pathLastFilterAccepted, const unsigned pathL3FilterAccepted=1, const size_t idx=0) const
const TriggerObjectStandAlone * triggerObjectMatchByPath(const char *namePath, const bool pathLastFilterAccepted=false, const bool pathL3FilterAccepted=true, const size_t idx=0) const
bool isNonnull() const
Checks for non-null.
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 ...
double resolEta(const LorentzVector &p4) const
Resolution on eta, given the 4-momentum of the associated Candidate.
const TriggerObjectStandAloneCollection triggerObjectMatchesByCondition(const char *nameCondition) const
const std::vector< std::string > & userFloatNames() const
Get list of user-defined float names.
void addUserFloat(const std::string &label, float data, const bool overwrite=false)
Set user-defined float.
const std::vector< std::string > & userIntNames() const
Get list of user-defined int names.
std::vector< std::string > userCandLabels_
const TriggerObjectStandAloneCollection triggerObjectMatchesByType(const unsigned triggerObjectType) const
void setGenParticle(const reco::GenParticle &particle)
Set the generator level particle from a particle not in the Event (embedding it, of course) ...
double resolM(const std::string &label="") const
const TriggerObjectStandAloneCollection triggerObjectMatchesByPath(const std::string &namePath, const bool pathLastFilterAccepted=false, const bool pathL3FilterAccepted=true) const
void setEfficiency(const std::string &name, const pat::LookupTableRecord &value)
TriggerObjectStandAloneCollection triggerObjectMatchesEmbedded_
vector of trigger matches
const TriggerObjectStandAloneCollection triggerObjectMatchesByAlgorithm(const char *nameAlgorithm, const unsigned algoCondAccepted) const
double resolPInv(const LorentzVector &p4) const
Resolution on 1/p, given the 4-momentum of the associated Candidate.
const TriggerObjectStandAloneCollection triggerObjectMatchesByPath(const std::string &namePath, const unsigned pathLastFilterAccepted, const unsigned pathL3FilterAccepted=1) const
double resolTheta(const LorentzVector &p4) const
Resolution on theta, given the 4-momentum of the associated Candidate.
void setGenParticleRef(const reco::GenParticleRef &ref, bool embed=false)
Set the generator level particle reference.
std::vector< std::string > userDataLabels_
User data object.
const std::string names[nVars_]
std::vector< reco::GenParticle > genParticleEmbedded_
vector to hold an embedded generator level particle
reco::GenParticleRef genParticleRef(size_t idx=0) const
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
const std::vector< std::string > & userDataNames() const
Get list of user data object names.
std::vector< float > userFloats_
double resolPz(const std::string &label="") const
Resolution on pz, possibly with a label to specify which resolution to use.
double resolPz(const LorentzVector &p4) const
Resolution on pz, given the 4-momentum of the associated Candidate.
const TriggerObjectStandAlone * triggerObjectMatchByType(const unsigned triggerObjectType, const size_t idx=0) const
double resolPhi(const LorentzVector &p4) const
Resolution on phi, given the 4-momentum of the associated Candidate.
double resolP(const LorentzVector &p4) const
Resolution on p, given the 4-momentum of the associated Candidate.
void setKinResolution(const pat::CandKinResolution &resol, const std::string &label="")
Add a kinematic resolution to this object (possibly with a label)
const TriggerObjectStandAloneCollection triggerObjectMatchesByPath(const char *namePath, const bool pathLastFilterAccepted=false, const bool pathL3FilterAccepted=true) const
void unpackTriggerObjectPathNames(const edm::TriggerNames &names)
unpack path names of matched trigger objects (if they were packed before embedding, which is not normally the case)
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...
std::vector< pat::LookupTableRecord > efficiencyValues_
vector of the efficiencies (values)
const TriggerObjectStandAloneCollection triggerObjectMatchesByPath(const char *namePath, const unsigned pathLastFilterAccepted, const unsigned pathL3FilterAccepted=1) const
const TriggerObjectStandAloneCollection triggerObjectMatchesByFilterID(const unsigned triggerObjectType) const
const pat::CandKinResolution & getKinResolution(const std::string &label="") const
bool hasKinResolution(const std::string &label="") const
Check if the kinematic resolutions are stored into this object (possibly specifying a label for them)...
double resolM(const LorentzVector &p4) const
double resolEt(const std::string &label="") const
Resolution on et, possibly with a label to specify which resolution to use.
const TriggerObjectStandAlone * triggerObjectMatchByPath(const std::string &namePath, const bool pathLastFilterAccepted=false, const bool pathL3FilterAccepted=true, const size_t idx=0) const
const TriggerObjectStandAlone * triggerObjectMatchByCollection(const char *coll, const size_t idx=0) const
Abs< T >::type abs(const T &t)
double resolPt(const LorentzVector &p4) const
Resolution on pt, given the 4-momentum of the associated Candidate.
std::vector< std::string > userFloatLabels_
void throwMissingLabel(const std::string &what, const std::string &bad_label, const std::vector< std::string > &available)
double resolE(const std::string &label="") const
Resolution on energy, possibly with a label to specify which resolution to use.
key
prepare the HTCondor submission files and eventually submit them
const TriggerObjectStandAloneCollection triggerObjectMatchesByType(const trigger::TriggerObjectType triggerObjectType) const
int32_t userInt(const std::string &key) const
const TriggerObjectStandAlone * triggerObjectMatchByAlgorithm(const char *nameAlgorithm, const bool algoCondAccepted=true, const size_t idx=0) const
const TriggerObjectStandAlone * triggerObjectMatchByFilter(const char *labelFilter, const size_t idx=0) const
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
bool hasOverlaps(const std::string &label) const
Returns true if there was at least one overlap for this test label.
void addUserInt(const std::string &label, int32_t data, const bool overwrite=false)
Set user-defined int.
const TriggerObjectStandAloneCollection & triggerObjectMatches() const
get all matched trigger objects
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...
const std::vector< std::string > & userCandNames() const
Get list of user-defined cand names.
std::vector< reco::CandidatePtrVector > overlapItems_
Overlapping items (sorted by distance)
std::vector< std::string > kinResolutionLabels_
void setOverlaps(const std::string &label, const reco::CandidatePtrVector &overlaps)
void addGenParticleRef(const reco::GenParticleRef &ref)
edm::Ptr< Candidate > CandidatePtr
persistent reference to an object in a collection of Candidate objects
pat::UserDataCollection userDataObjects_
const std::vector< std::string > & overlapLabels() const
Returns the labels of the overlap tests that found at least one overlap.
const TriggerObjectStandAlone * triggerObjectMatchByAlgorithm(const std::string &nameAlgorithm, const bool algoCondAccepted=true, const size_t idx=0) const
const void * userDataBare(const std::string &key) const
double resolPhi(const std::string &label="") const
Resolution on phi, possibly with a label to specify which resolution to use.
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 ...
std::vector< int > userIntRange(const std::string &key) const
returns a range of values corresponding to key
void addTriggerObjectMatch(const TriggerObjectStandAlone &trigObj)
add a trigger match
bool hasUserData(const std::string &key) const
Check if user data with a specific type is present.
const TriggerObjectStandAloneCollection triggerObjectMatchesByAlgorithm(const std::string &nameAlgorithm, const bool algoCondAccepted=true) const
const reco::CandidatePtrVector & overlaps(const std::string &label) const
double resolPy(const LorentzVector &p4) const
Resolution on py, given the 4-momentum of the associated Candidate.
double resolEt(const LorentzVector &p4) const
Resolution on et, given the 4-momentum of the associated Candidate.
const TriggerObjectStandAloneCollection triggerObjectMatchesByFilter(const char *labelFilter) const
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
char data[epos_bytes_allocation]
std::vector< std::pair< std::string, pat::LookupTableRecord > > efficiencies() const
Returns the efficiencies as <name,value> pairs (by value)
double resolP(const std::string &label="") const
Resolution on p, possibly with a label to specify which resolution to use.
const TriggerObjectStandAlone * triggerObjectMatchByCollection(const std::string &coll, const size_t idx=0) const
get one matched trigger object from a certain collection by index
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
T const * get() const
Returns C++ pointer to the item.
Templated PAT object container.
size_t genParticlesSize() const
Number of generator level particles stored as ref or embedded.
bool hasUserFloat(const std::string &key) const
Return true if there is a user-defined float with a given name.
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Base class for data that users can add to pat objects.
double resolPy(const std::string &label="") const
Resolution on py, possibly with a label to specify which resolution to use.
std::vector< std::string > overlapLabels_
Overlapping test labels (only if there are any overlaps)
const edm::Ptr< reco::Candidate > & originalObjectRef() const
reference to original object. Returns a null reference if not available
const TriggerObjectStandAlone * triggerObjectMatchByPath(const std::string &namePath, const unsigned pathLastFilterAccepted, const unsigned pathL3FilterAccepted=1, const size_t idx=0) const
float userFloat(const std::string &key) const
std::vector< int32_t > userInts_
const TriggerObjectStandAloneCollection triggerObjectMatchesByCollection(const std::string &coll) const
get all matched trigger objects from a certain collection
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 ...
std::vector< reco::GenParticleRef > genParticleRefs() const
edm::Ptr< reco::Candidate > refToOrig_
const TriggerObjectStandAlone * triggerObjectMatchByAlgorithm(const char *nameAlgorithm, const unsigned algoCondAccepted, const size_t idx=0) const
void addUserData(const std::string &label, const T &data, bool transientOnly=false, bool overwrite=false)
void addUserDataFromPtr(const std::string &label, const edm::Ptr< pat::UserData > &data, bool overwrite=false)
Analysis-level trigger object class (stand-alone)
double resolPx(const std::string &label="") const
Resolution on px, possibly with a label to specify which resolution to use.
const std::string & get_empty_str()
const TriggerObjectStandAlone * triggerObjectMatchByCondition(const char *nameCondition, const size_t idx=0) const
std::vector< std::string > userIntLabels_