4 #ifndef DataFormats_PatCandidates_PATObject_h
5 #define DataFormats_PatCandidates_PATObject_h
43 namespace pat_statics {
48 template <
class ObjectType>
213 std::vector<std::pair<std::string,pat::LookupTableRecord> >
efficiencies()
const ;
282 return (data !=
nullptr ? data->template get<T>() :
nullptr);
301 return (data !=
nullptr ? data->
bareData() :
nullptr);
310 std::auto_ptr<pat::UserData> made(pat::UserData::make<T>(data, transientOnly));
317 std::auto_ptr<pat::UserData>
cloned(data->clone());
477 refToOrig_(ref.id(), ref.
get(), ref.
key())
488 if (refToOrig_.isNull()) {
492 }
else if (!refToOrig_.isAvailable()) {
493 throw edm::Exception(
edm::errors::ProductNotFound) <<
"The original collection from which this PAT object was made is not present any more in the event, hence you cannot access the originating object anymore.";
495 return refToOrig_.get();
499 template <
class ObjectType>
502 template <
class ObjectType>
504 if ( idx >= triggerObjectMatches().
size() )
return 0;
509 template <
class ObjectType>
512 for (
size_t i = 0;
i < triggerObjectMatches().size(); ++
i ) {
513 if ( triggerObjectMatch(
i ) != 0 && triggerObjectMatch(
i )->hasTriggerObjectType( triggerObjectType ) ) matches.push_back( *( triggerObjectMatch(
i ) ) );
518 template <
class ObjectType>
520 std::vector< size_t > refs;
521 for (
size_t i = 0;
i < triggerObjectMatches().size(); ++
i ) {
522 if ( triggerObjectMatch(
i ) != 0 && triggerObjectMatch(
i )->hasTriggerObjectType( triggerObjectType ) ) refs.push_back(
i );
524 if ( idx >= refs.size() )
return 0;
529 template <
class ObjectType>
532 for (
size_t i = 0;
i < triggerObjectMatches().size(); ++
i ) {
533 if ( triggerObjectMatch(
i ) != 0 && triggerObjectMatch(
i )->hasCollection( coll ) ) matches.push_back( *( triggerObjectMatch(
i ) ) );
538 template <
class ObjectType>
540 std::vector< size_t > refs;
541 for (
size_t i = 0;
i < triggerObjectMatches().size(); ++
i ) {
542 if ( triggerObjectMatch(
i ) != 0 && triggerObjectMatch(
i )->hasCollection( coll ) ) {
546 if ( idx >= refs.size() )
return 0;
551 template <
class ObjectType>
554 for (
size_t i = 0;
i < triggerObjectMatches().size(); ++
i ) {
555 if ( triggerObjectMatch(
i ) != 0 && triggerObjectMatch(
i )->hasConditionName( nameCondition ) ) matches.push_back( *( triggerObjectMatch(
i ) ) );
560 template <
class ObjectType>
562 std::vector< size_t > refs;
563 for (
size_t i = 0;
i < triggerObjectMatches().size(); ++
i ) {
564 if ( triggerObjectMatch(
i ) != 0 && triggerObjectMatch(
i )->hasConditionName( nameCondition ) ) refs.push_back(
i );
566 if ( idx >= refs.size() )
return 0;
571 template <
class ObjectType>
574 for (
size_t i = 0;
i < triggerObjectMatches().size(); ++
i ) {
575 if ( triggerObjectMatch(
i ) != 0 && triggerObjectMatch(
i )->hasAlgorithmName( nameAlgorithm, algoCondAccepted ) ) matches.push_back( *( triggerObjectMatch(
i ) ) );
580 template <
class ObjectType>
582 std::vector< size_t > refs;
583 for (
size_t i = 0;
i < triggerObjectMatches().size(); ++
i ) {
584 if ( triggerObjectMatch(
i ) != 0 && triggerObjectMatch(
i )->hasAlgorithmName( nameAlgorithm, algoCondAccepted ) ) refs.push_back(
i );
586 if ( idx >= refs.size() )
return 0;
591 template <
class ObjectType>
594 for (
size_t i = 0;
i < triggerObjectMatches().size(); ++
i ) {
595 if ( triggerObjectMatch(
i ) != 0 && triggerObjectMatch(
i )->hasFilterLabel( labelFilter ) ) matches.push_back( *( triggerObjectMatch(
i ) ) );
600 template <
class ObjectType>
602 std::vector< size_t > refs;
603 for (
size_t i = 0;
i < triggerObjectMatches().size(); ++
i ) {
604 if ( triggerObjectMatch(
i ) != 0 && triggerObjectMatch(
i )->hasFilterLabel( labelFilter ) ) refs.push_back(
i );
606 if ( idx >= refs.size() )
return 0;
611 template <
class ObjectType>
614 for (
size_t i = 0;
i < triggerObjectMatches().size(); ++
i ) {
615 if ( triggerObjectMatch(
i ) != 0 && triggerObjectMatch(
i )->hasPathName( namePath, pathLastFilterAccepted, pathL3FilterAccepted ) ) matches.push_back( *( triggerObjectMatch(
i ) ) );
620 template <
class ObjectType>
622 std::vector< size_t > refs;
623 for (
size_t i = 0;
i < triggerObjectMatches().size(); ++
i ) {
624 if ( triggerObjectMatch(
i ) != 0 && triggerObjectMatch(
i )->hasPathName( namePath, pathLastFilterAccepted, pathL3FilterAccepted ) ) refs.push_back(
i );
626 if ( idx >= refs.size() )
return 0;
631 template <
class ObjectType>
635 auto it = std::lower_bound(efficiencyNames_.cbegin(), efficiencyNames_.cend(),
name);
636 if ((it == efficiencyNames_.end()) || (*it != name)) {
637 throw cms::Exception(
"Invalid Label") <<
"There is no efficiency with name '" << name <<
"' in this PAT Object\n";
639 return efficiencyValues_[
std::distance(efficiencyNames_.cbegin(),it)];
642 template <
class ObjectType>
643 std::vector<std::pair<std::string,pat::LookupTableRecord> >
645 std::vector<std::pair<std::string,pat::LookupTableRecord> >
ret;
646 std::vector<std::string>::const_iterator itn = efficiencyNames_.begin(), edn = efficiencyNames_.end();
647 std::vector<pat::LookupTableRecord>::const_iterator itv = efficiencyValues_.begin();
648 for ( ; itn != edn; ++itn, ++itv) {
649 ret.emplace_back( *itn, *itv);
654 template <
class ObjectType>
657 auto it = std::lower_bound(efficiencyNames_.begin(), efficiencyNames_.end(),
name);
658 const auto dist =
std::distance(efficiencyNames_.begin(),it);
659 if (it == efficiencyNames_.end()) {
660 efficiencyNames_.push_back(name);
661 efficiencyValues_.push_back(value);
662 }
else if (*it == name) {
663 efficiencyValues_[dist] =
value;
665 efficiencyNames_.
insert(it, name);
666 efficiencyValues_.insert( efficiencyValues_.begin() + dist,
value );
670 template <
class ObjectType>
672 genParticleRef_ = std::vector<reco::GenParticleRef>(1,ref);
673 genParticleEmbedded_.clear();
674 if (embed) embedGenParticle();
677 template <
class ObjectType>
679 if (!genParticleEmbedded_.empty()) {
680 if (ref.
isNonnull()) genParticleEmbedded_.push_back(*ref);
682 genParticleRef_.push_back(ref);
686 template <
class ObjectType>
688 genParticleEmbedded_.clear();
689 genParticleEmbedded_.push_back(particle);
690 genParticleRef_.clear();
693 template <
class ObjectType>
695 genParticleEmbedded_.clear();
696 for (std::vector<reco::GenParticleRef>::const_iterator it = genParticleRef_.begin(); it != genParticleRef_.end(); ++it) {
697 if (it->isNonnull()) genParticleEmbedded_.push_back(**it);
699 genParticleRef_.clear();
702 template <
class ObjectType>
704 if (genParticleEmbedded_.empty())
return genParticleRef_;
705 std::vector<reco::GenParticleRef>
ret(genParticleEmbedded_.size());
706 for (
size_t i = 0,
n =
ret.size();
i <
n; ++
i) {
712 template <
class ObjectType>
715 const std::vector<reco::GenParticleRef> & vec = (genParticleEmbedded_.empty() ? genParticleRef_ : genParticleRefs());
716 for (std::vector<reco::GenParticleRef>::const_iterator ref = vec.begin(),
end = vec.end(); ref !=
end; ++ref) {
717 if (ref->isNonnull()) {
722 }
else if (!autoCharge) {
723 if (pdgId == g.
pdgId())
return *ref;
726 if (g.
charge() == 0)
return *ref;
727 else if ((this->
charge() == 0) && (pdgId == g.
pdgId()))
return *ref;
728 else if (g.
charge()*this->
charge()*pdgId > 0)
return *ref;
735 template <
class ObjectType>
737 auto match = std::lower_bound(overlapLabels_.cbegin(), overlapLabels_.cend(),
label);
741 template <
class ObjectType>
744 auto match = std::lower_bound(overlapLabels_.cbegin(), overlapLabels_.cend(),
label);
749 template <
class ObjectType>
752 auto match = std::lower_bound(overlapLabels_.begin(), overlapLabels_.end(),
label);
755 overlapLabels_.insert(
match,label);
756 overlapItems_.insert(overlapItems_.begin()+dist,
overlaps);
762 template <
class ObjectType>
765 auto it = std::lower_bound(userDataLabels_.cbegin(),userDataLabels_.cend(),
key);
766 if ( it != userDataLabels_.cend() && *it ==
key) {
767 return &userDataObjects_[
std::distance(userDataLabels_.cbegin(),it)];
772 template <
class ObjectType>
775 auto it = std::lower_bound(userDataLabels_.begin(), userDataLabels_.end(),
label);
776 const auto dist =
std::distance(userDataLabels_.begin(), it);
777 if( it == userDataLabels_.end() || *it !=
label ) {
778 userDataLabels_.insert(it,label);
779 userDataObjects_.insert(userDataObjects_.begin()+dist,
data);
780 }
else if( overwrite ) {
781 userDataObjects_.set(dist, data);
784 userDataLabels_.insert(it+1,label);
785 userDataObjects_.insert(userDataObjects_.begin()+dist+1,
data);
790 template <
class ObjectType>
793 auto it = std::lower_bound(userFloatLabels_.cbegin(),userFloatLabels_.cend(),
key);
794 if( it != userFloatLabels_.cend() && *it ==
key ) {
795 return userFloats_[
std::distance(userFloatLabels_.cbegin(),it)];
798 return std::numeric_limits<float>::quiet_NaN();
801 template<
class ObjectType>
803 auto range = std::equal_range(userFloatLabels_.cbegin(),userFloatLabels_.cend(),
key);
804 std::vector<float>
result;
806 for(
auto it = range.first; it != range.second; ++it ) {
807 result.push_back(userFloats_[
std::distance(userFloatLabels_.cbegin(),it)]);
812 template <
class ObjectType>
815 const bool overwrite )
817 auto it = std::lower_bound(userFloatLabels_.begin(),userFloatLabels_.end(),
label);
818 const auto dist =
std::distance(userFloatLabels_.begin(),it);
819 if( it == userFloatLabels_.end() || *it !=
label ) {
820 userFloatLabels_.insert(it,label);
821 userFloats_.insert(userFloats_.begin()+dist,
data);
822 }
else if( overwrite ) {
823 userFloats_[ dist ] =
data;
826 userFloatLabels_.insert(it+1,label);
827 userFloats_.insert(userFloats_.begin()+dist+1,
data);
832 template <
class ObjectType>
835 auto it = std::lower_bound(userIntLabels_.cbegin(), userIntLabels_.cend(),
key);
836 if ( it != userIntLabels_.cend() && *it ==
key ) {
843 template<
class ObjectType>
845 auto range = std::equal_range(userIntLabels_.cbegin(),userIntLabels_.cend(),
key);
848 for(
auto it = range.first; it != range.second; ++it ) {
849 result.push_back(userInts_[
std::distance(userIntLabels_.cbegin(),it)]);
854 template <
class ObjectType>
859 auto it = std::lower_bound(userIntLabels_.begin(),userIntLabels_.end(),
label);
861 if( it == userIntLabels_.end() || *it !=
label ) {
862 userIntLabels_.insert(it,label);
863 userInts_.insert(userInts_.begin()+dist,
data);
864 }
else if( overwrite ) {
865 userInts_[dist] =
data;
868 userIntLabels_.insert(it+1, label);
869 userInts_.insert(userInts_.begin()+dist+1,
data);
873 template <
class ObjectType>
876 auto it = std::lower_bound(userCandLabels_.cbegin(), userCandLabels_.cend(),
key);
877 if (it != userCandLabels_.cend()) {
878 return userCands_[
std::distance(userCandLabels_.begin(),it)];
883 template <
class ObjectType>
886 const bool overwrite )
888 auto it = std::lower_bound(userCandLabels_.begin(),userCandLabels_.end(),
label);
890 if( it == userCandLabels_.end() || *it !=
label ) {
891 userCandLabels_.insert(it,label);
892 userCands_.insert(userCands_.begin()+dist,
data);
893 }
else if( overwrite ) {
894 userCands_[dist] =
data;
896 userCandLabels_.insert(it+1,label);
897 userCands_.insert(userCands_.begin()+dist+1,
data);
902 template <
class ObjectType>
904 const bool has_unlabelled = (kinResolutionLabels_.size()+1 == kinResolutions_.size());
906 if ( has_unlabelled ) {
907 return kinResolutions_[0];
909 throw cms::Exception(
"Missing Data",
"This object does not contain an un-labelled kinematic resolution");
912 auto match = std::lower_bound(kinResolutionLabels_.cbegin(), kinResolutionLabels_.cend(),
label);
914 const size_t increment = ( has_unlabelled ? 1 : 0 );
917 ex <<
"This object does not contain a kinematic resolution with name '" << label <<
"'.\n";
918 ex <<
"The known labels are: " ;
919 for (std::vector<std::string>::const_iterator it = kinResolutionLabels_.cbegin(); it != kinResolutionLabels_.cend(); ++it) {
920 ex <<
"'" << *it <<
"' ";
925 return kinResolutions_[dist+increment];
930 template <
class ObjectType>
933 return (kinResolutionLabels_.size()+1 == kinResolutions_.size());
935 auto match = std::lower_bound(kinResolutionLabels_.cbegin(), kinResolutionLabels_.cend(),
label);
940 template <
class ObjectType>
942 const bool has_unlabelled = (kinResolutionLabels_.size()+1 == kinResolutions_.size());
944 if (has_unlabelled) {
946 kinResolutions_[0] = resol;
950 kinResolutions_.insert(kinResolutions_.begin(), resol);
953 auto match = std::lower_bound(kinResolutionLabels_.begin(), kinResolutionLabels_.end(),
label);
955 const size_t increment = ( has_unlabelled ? 1 : 0 );
958 kinResolutions_[dist+increment] = resol;
960 kinResolutionLabels_.insert(
match,label);
961 kinResolutions_.insert(kinResolutions_.begin()+dist+increment,resol);
std::vector< std::string > efficiencyNames_
vector of the efficiencies (names)
const TriggerObjectStandAlone * triggerObjectMatchByCollection(const std::string &coll, const size_t idx=0) const
get one matched trigger object from a certain collection by index
void addUserDataObject_(const std::string &label, std::auto_ptr< pat::UserData > &value, bool overwrite=false)
bool hasUserFloat(const char *key) const
a CINT-friendly interface
void addUserCand(const std::string &label, const reco::CandidatePtr &data, const bool overwrite=false)
Set user-defined int.
bool hasOverlaps(const std::string &label) const
Returns true if there was at least one overlap for this test label.
const TriggerObjectStandAlone * triggerObjectMatchByPath(const std::string &namePath, const unsigned pathLastFilterAccepted, const unsigned pathL3FilterAccepted=1, const size_t idx=0) const
tuple ret
prodAgent to be discontinued
const TriggerObjectStandAlone * triggerObjectMatchByAlgorithm(const char *nameAlgorithm, const bool algoCondAccepted=true, const size_t idx=0) const
bool isNonnull() const
Checks for non-null.
std::vector< std::pair< std::string, pat::LookupTableRecord > > efficiencies() const
Returns the efficiencies as <name,value> pairs (by value)
const TriggerObjectStandAlone * triggerObjectMatchByPath(const char *namePath, const unsigned pathLastFilterAccepted, const unsigned pathL3FilterAccepted=1, const size_t idx=0) const
const TriggerObjectStandAlone * triggerObjectMatchByAlgorithm(const char *nameAlgorithm, const unsigned algoCondAccepted, const size_t idx=0) const
double resolPhi(const LorentzVector &p4) const
Resolution on phi, given the 4-momentum of the associated Candidate.
static const HistoName names[]
std::vector< reco::GenParticleRef > genParticleRef_
Reference to a generator level particle.
bool hasKinResolution(const std::string &label="") const
Check if the kinematic resolutions are stored into this object (possibly specifying a label for them)...
reco::GenParticleRef genParticleRef(size_t idx=0) const
const reco::GenParticle * genParticle(size_t idx=0) const
PATObject()
default constructor
double resolP(const std::string &label="") const
Resolution on p, possibly with a label to specify which resolution to use.
const TriggerObjectStandAlone * triggerObjectMatchByFilterID(const unsigned triggerObjectType, const size_t idx=0) const
size_t genParticlesSize() const
Number of generator level particles stored as ref or embedded.
std::vector< reco::CandidatePtr > userCands_
const TriggerObjectStandAloneCollection triggerObjectMatchesByPath(const char *namePath, const unsigned pathLastFilterAccepted, const unsigned pathL3FilterAccepted=1) const
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 triggerObjectMatchesByFilter(const std::string &labelFilter) const
get all matched HLT objects used in a certain HLT filter
double resolPInv(const std::string &label="") const
Resolution on 1/p, possibly with a label to specify which resolution to use.
bool hasUserFloat(const std::string &key) const
Return true if there is a user-defined float with a given name.
std::vector< pat::CandKinResolution > kinResolutions_
Kinematic resolutions.
double resolPz(const std::string &label="") const
Resolution on pz, possibly with a label to specify which resolution to use.
const TriggerObjectStandAlone * triggerObjectMatchByCondition(const char *nameCondition, const size_t idx=0) const
bool hasUserCand(const std::string &key) const
Return true if there is a user-defined int with a given name.
void addUserFloat(const std::string &label, float data, const bool overwrite=false)
Set user-defined float.
std::vector< std::string > userCandLabels_
std::vector< TriggerObjectStandAlone > TriggerObjectStandAloneCollection
Collection of TriggerObjectStandAlone.
void setGenParticle(const reco::GenParticle &particle)
Set the generator level particle from a particle not in the Event (embedding it, of course) ...
std::vector< reco::GenParticleRef > genParticleRefs() const
std::vector< float > userFloatRange(const std::string &key) const
return a range of values corresponding to key
void setEfficiency(const std::string &name, const pat::LookupTableRecord &value)
TriggerObjectStandAloneCollection triggerObjectMatchesEmbedded_
vector of trigger matches
void setGenParticleRef(const reco::GenParticleRef &ref, bool embed=false)
Set the generator level particle reference.
std::vector< std::string > userDataLabels_
User data object.
std::vector< reco::GenParticle > genParticleEmbedded_
vector to hold an embedded generator level particle
const std::vector< std::string > & userCandNames() const
Get list of user-defined cand names.
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< pat::LookupTableRecord > & efficiencyValues() const
Returns the list of the values of the stored efficiencies (the ordering is the same as in efficiencyN...
std::vector< float > userFloats_
float userFloat(const std::string &key) const
virtual ~PATObject()
destructor
void setKinResolution(const pat::CandKinResolution &resol, const std::string &label="")
Add a kinematic resolution to this object (possibly with a label)
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)
bool hasUserInt(const std::string &key) const
Return true if there is a user-defined int with a given name.
double resolPt(const std::string &label="") const
Resolution on pt, possibly with a label to specify which resolution to use.
const reco::CandidatePtrVector & overlaps(const std::string &label) const
virtual int status() const final
status word
const TriggerObjectStandAlone * triggerObjectMatchByAlgorithm(const std::string &nameAlgorithm, const bool algoCondAccepted=true, const size_t idx=0) const
double resolPz(const LorentzVector &p4) const
Resolution on pz, 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
std::vector< pat::LookupTableRecord > efficiencyValues_
vector of the efficiencies (values)
double resolPy(const std::string &label="") const
Resolution on py, possibly with a label to specify which resolution to use.
double resolEt(const std::string &label="") const
Resolution on et, possibly with a label to specify which resolution to use.
double resolPx(const std::string &label="") const
Resolution on px, possibly with a label to specify which resolution to use.
double resolP(const LorentzVector &p4) const
Resolution on p, given the 4-momentum of the associated Candidate.
double resolPy(const LorentzVector &p4) const
Resolution on py, given the 4-momentum of the associated Candidate.
const TriggerObjectStandAlone * triggerObjectMatchByPath(const char *namePath, const bool pathLastFilterAccepted=false, const bool pathL3FilterAccepted=true, const size_t idx=0) const
static const std::string EMPTY_STR("")
virtual int charge() const final
electric charge
Abs< T >::type abs(const T &t)
double resolEta(const LorentzVector &p4) const
Resolution on eta, 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)
const TriggerObjectStandAlone * triggerObjectMatch(const size_t idx=0) const
get one matched trigger object by index
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 TriggerObjectStandAlone * triggerObjectMatchByFilter(const char *labelFilter, const size_t idx=0) const
T const * get() const
Returns C++ pointer to the item.
const TriggerObjectStandAloneCollection triggerObjectMatchesByPath(const std::string &namePath, const bool pathLastFilterAccepted=false, const bool pathL3FilterAccepted=true) const
bool insert(Storage &iStorage, ItemType *iItem, const IdTag &iIdTag)
double resolPhi(const std::string &label="") const
Resolution on phi, possibly with a label to specify which resolution to use.
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 bool pathLastFilterAccepted=false, const bool pathL3FilterAccepted=true, const size_t idx=0) const
const TriggerObjectStandAloneCollection triggerObjectMatchesByCondition(const char *nameCondition) const
bool hasUserData(const std::string &key) const
Check if user data with a specific type is present.
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
void addUserInt(const std::string &label, int32_t data, const bool overwrite=false)
Set user-defined int.
double resolE(const std::string &label="") const
Resolution on energy, possibly with a label to specify which resolution to use.
const TriggerObjectStandAloneCollection triggerObjectMatchesByPath(const char *namePath, const bool pathLastFilterAccepted=false, const bool pathL3FilterAccepted=true) const
const TriggerObjectStandAloneCollection triggerObjectMatchesByAlgorithm(const std::string &nameAlgorithm, const bool algoCondAccepted=true) const
const TriggerObjectStandAloneCollection triggerObjectMatchesByAlgorithm(const char *nameAlgorithm, const bool algoCondAccepted=true) const
double resolM(const LorentzVector &p4) const
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)
const TriggerObjectStandAloneCollection triggerObjectMatchesByFilterID(const unsigned triggerObjectType) const
void addGenParticleRef(const reco::GenParticleRef &ref)
edm::Ptr< Candidate > CandidatePtr
persistent reference to an object in a collection of Candidate objects
double resolPInv(const LorentzVector &p4) const
Resolution on 1/p, given the 4-momentum of the associated Candidate.
pat::UserDataCollection userDataObjects_
const TriggerObjectStandAloneCollection triggerObjectMatchesByCollection(const std::string &coll) const
get all matched trigger objects from a certain collection
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
const pat::UserData * userDataObject_(const std::string &key) const
int32_t userInt(const std::string &key) const
tuple idx
DEBUGGING if hasattr(process,"trackMonIterativeTracking2012"): print "trackMonIterativeTracking2012 D...
const TriggerObjectStandAlone * triggerObjectMatchByType(const unsigned triggerObjectType, const size_t idx=0) const
void addTriggerObjectMatch(const TriggerObjectStandAlone &trigObj)
add a trigger match
const std::vector< std::string > & userDataNames() const
Get list of user data object names.
const TriggerObjectStandAlone * triggerObjectMatchByAlgorithm(const std::string &nameAlgorithm, const unsigned algoCondAccepted, const size_t idx=0) const
const TriggerObjectStandAloneCollection & triggerObjectMatches() const
get all matched trigger objects
virtual int pdgId() const final
PDG identifier.
const void * userDataBare(const std::string &key) const
reco::CandidatePtr userCand(const std::string &key) const
const TriggerObjectStandAlone * triggerObjectMatchByCollection(const char *coll, const size_t idx=0) const
const TriggerObjectStandAloneCollection triggerObjectMatchesByType(const unsigned triggerObjectType) const
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 ...
virtual const std::string & typeName() const =0
Human readable name of the concrete type of stored data.
double resolE(const LorentzVector &p4) const
Resolution on energy, given the 4-momentum of the associated Candidate.
const TriggerObjectStandAloneCollection triggerObjectMatchesByType(const trigger::TriggerObjectType triggerObjectType) const
const TriggerObjectStandAloneCollection triggerObjectMatchesByCollection(const char *coll) const
const TriggerObjectStandAloneCollection triggerObjectMatchesByCondition(const std::string &nameCondition) const
get all matched L1 objects used in a succeeding object combination of a certain L1 condition ...
float userFloat(const char *key) const
a CINT-friendly interface
const pat::LookupTableRecord & efficiency(const std::string &name) const
Returns an efficiency given its name.
const TriggerObjectStandAloneCollection triggerObjectMatchesByPath(const std::string &namePath, const unsigned pathLastFilterAccepted, const unsigned pathL3FilterAccepted=1) const
const reco::Candidate * originalObject() const
access to the original object; returns zero for null Ref and throws for unavailable collection ...
Templated PAT object container.
const pat::CandKinResolution & getKinResolution(const std::string &label="") 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
double resolTheta(const std::string &label="") const
Resolution on theta, possibly with a label to specify which resolution to use.
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.
std::vector< int > userIntRange(const std::string &key) const
returns a range of values corresponding to key
std::vector< std::string > overlapLabels_
Overlapping test labels (only if there are any overlaps)
double resolEt(const LorentzVector &p4) const
Resolution on et, given the 4-momentum of the associated Candidate.
const std::vector< std::string > & userFloatNames() const
Get list of user-defined float names.
double resolPt(const LorentzVector &p4) const
Resolution on pt, given the 4-momentum of the associated Candidate.
static const reco::CandidatePtrVector EMPTY_CPV
std::vector< int32_t > userInts_
const TriggerObjectStandAloneCollection triggerObjectMatchesByFilter(const char *labelFilter) const
const std::vector< std::string > & userIntNames() const
Get list of user-defined int names.
const TriggerObjectStandAloneCollection triggerObjectMatchesByAlgorithm(const char *nameAlgorithm, const unsigned algoCondAccepted) const
edm::Ptr< reco::Candidate > refToOrig_
tuple size
Write out results.
void addUserData(const std::string &label, const T &data, bool transientOnly=false, bool overwrite=false)
double resolM(const std::string &label="") const
reco::GenParticleRef genParticleById(int pdgId, int status, uint8_t autoCharge=0) const
void addUserDataFromPtr(const std::string &label, const edm::Ptr< pat::UserData > &data, bool overwrite=false)
const void * bareData() const
T get(const Candidate &c)
double resolEta(const std::string &label="") const
Resolution on eta, possibly with a label to specify which resolution to use.
const std::string & userDataObjectType(const std::string &key) const
Get human-readable type of user data object, for debugging.
const std::vector< std::string > & efficiencyNames() const
Returns the list of the names of the stored efficiencies.
Analysis-level trigger object class (stand-alone)
double resolTheta(const LorentzVector &p4) const
Resolution on theta, given the 4-momentum of the associated Candidate.
std::vector< std::string > userIntLabels_
const std::vector< std::string > & overlapLabels() const
Returns the labels of the overlap tests that found at least one overlap.