|
ATLAS Offline Software
|
Go to the documentation of this file.
26 #include "CLHEP/Units/SystemOfUnits.h"
27 #include "CLHEP/Vector/LorentzVector.h"
28 #include "GaudiKernel/MsgStream.h"
74 return fabs(
p1-
p2)< epsilon ;
82 #define JET_CONSTRUCTOR_BASE m_constituentsN(0) \
83 , m_RoIword(0xFFFFFFFF) \
84 , m_jetId(Jet::s_defaultJetId) \
85 , m_collection(NULL) \
86 , m_jetAuthor(Jet::s_defaultJetAuthor) \
89 , m_constituentSigState(P4SignalState::UNKNOWN) \
90 , m_num_combinedLikelihood(0) \
119 const constituent_t* pConst,
121 : base_t(3, signalstate_t(1)),
141 : base_t(3, signalstate_t(1)),
155 : base_t(3, signalstate_t(1)),
157 this->
setup(
hlv_t(pMom->px(),pMom->py(),pMom->pz(),pMom->e()));
167 : base_t(3, signalstate_t(1)),
169 this->
setup(
hlv_t(rMom.px(),rMom.py(),rMom.pz(),rMom.e()));
178 : base_t(3, signalstate_t(1)),
193 : base_t(3, signalstate_t(1)),
203 : base_t((
const base_t) *pJet) ,
212 Jet::Jet(
const Jet* pJet,
bool copyStores,
bool copyConstituents)
213 : base_t( (
const base_t) *pJet),
229 CopyDataMembers cmd0, CopyDataMembers cmd1,
230 CopyDataMembers cmd2, CopyDataMembers cmd3)
231 : base_t( (
const base_t) *pJet ),
292 for ( ; firstConst != lastConst; ++firstConst )
295 if ( pJet->
getIndex(firstConst,theIndex) )
313 if ( oMap !=
nullptr ){
339 for (
size_t i = 0;
i <
old.size();
i++)
350 for (
size_t i = 0;
i <
old.size();
i++)
508 for ( ; fC != lC ; ++fC )
521 return pJet->
size() > 0;
531 unsigned int aCtr = 0;
533 if ( this->
size() > 0 )
537 for ( ; fC != lC; ++fC )
579 Jet* newjet =
new Jet(
this,
true,
true);
592 if ( pJet->
size() != this->size() )
return false;
594 if( pJet->
size() == 0 ){
612 while ( ( fK != lK ) && ((*fC) != (*fK) ||
625 std::ostringstream
out;
626 out <<
jetAuthor() <<
": NConstituents: " <<
size() <<
"; Eta: " <<
eta() <<
"; Phi: " <<
phi() <<
"; Pt: " <<
pt();
631 void diff(
const Jet& rJet1,
const Jet& rJet2, std::map<std::string,double> varDiff)
635 double ignoreWeight = 1.0e-06;
638 varDiff[
"NConstituents"] = rJet1.
size() - rJet2.
size();
641 if(fabs(rJet1.
e() - rJet2.
e()) > ignoreWeight)
642 varDiff[
"e"] = rJet1.
e() - rJet2.
e();
643 if(fabs(rJet1.
px() - rJet2.
px()) > ignoreWeight)
644 varDiff[
"px"] = rJet1.
px() - rJet2.
px();
645 if(fabs(rJet1.
py() - rJet2.
py()) > ignoreWeight)
646 varDiff[
"py"] = rJet1.
py() - rJet2.
py();
647 if(fabs(rJet1.
pz() - rJet2.
pz()) > ignoreWeight)
648 varDiff[
"pz"] = rJet1.
pz() - rJet2.
pz();
656 if ( pJet->
size() == 0 || this->size() == 0 )
return (
Jet*)
nullptr;
661 std::vector<const constituent_type*> constituents (this->
begin(),
668 Jet* newJet =
nullptr;
672 for ( ; fC != lC; ++fC )
675 if (
std::find (constituents.begin(), constituents.end(),
c) !=
679 newJet =
new Jet(
this,
true,
false);
704 hlv_t fmom(0.,0.,0.,0.);
718 hlv_t fmom(0.,0.,0.,0.);
784 Jet*
jet =
new Jet(
this, copyStores,copyConstituents);
798 bool createIfMissing)
const
808 if ( map !=
nullptr )
819 std::vector<Jet::mkey_t>
keys;
821 if ( pMap !=
nullptr )
825 for (
size_t i(0);
i <
n; ++
i )
970 const std::string
base=
"LikeLihood_";
981 const std::string
base=
"LikeLihood_";
992 if ( this->
jetAuthor().
find(
"Atlfast") != std::string::npos) {
996 if (pos !=
nullptr) {
997 std::vector<double>
prob =
pos->tagLikelihood();
1001 if (
pb != 0 &&
pu != 0)
1018 if( pos !=
nullptr ) {
1020 std::vector<double>
prob =
pos->tagLikelihood();
1024 if (
pb > 0. &&
pu > 0.) {
1025 if(
pb!=1.||
pu!=1.e9) {
1034 if( pos !=
nullptr ) {
1036 std::vector<double>
prob =
pos->tagLikelihood();
1040 if (
pb > 0. &&
pu > 0.)
1053 if(
pos !=
nullptr ) {
1054 std::vector<double>
prob =
pos->tagLikelihood();
1055 if(
prob.size() == 1) {
1058 if(
prob.size() > 1) {
1063 }
else if (
pu<=0.) {
1099 size_t pos = full_auth.find_first_of(
'_');
1101 if(
pos != std::string::npos)
1112 size_t found=full_auth.find_first_of(
'_');
1113 return found != std::string::npos ? full_auth.substr(0 ,
found) : full_auth;
1130 std::string full_tag =
""; full_tag+=
"_"; full_tag+=
tag;
1131 return ( full_auth.find(full_tag) != std::string::npos );
1136 size_t p = full_auth.find_first_of(
'_');
1138 while(
p != std::string::npos){
1140 p = full_auth.find_first_of(
'_',
p+1);
1147 size_t p = full_auth.find_first_of(
'_');
1149 while(
p != std::string::npos){
1152 return full_auth.substr(
p+1,full_auth.find_first_of(
'_',
p+1)-
p-1);
1154 p = full_auth.find_first_of(
'_',
p+1);
1161 full_auth +=
"_"+
tag;
1190 mapname +=
"MomentMap";
1206 double pz =
pt*std::sinh(
eta) ;
void setPtEtaPhiM(double a, double b, double c, double d)
Jet * getOverlap(const Jet &rJet, bool noKine=false) const
Retrieve constituent overlap between jets.
virtual void setE(double e)
Kinematics are now handled by the base class, except for the following.
static const size_t s_defaultJetAuthor
virtual double pxi() const
const_iterator end() const
End iterator for constituent store.
char data[hepevt_bytes_allocation_ATLAS]
virtual double py() const
y component of momentum
size_t m_num_combinedLikelihood
virtual CLHEP::HepLorentzVector hlv() const
CLHEP HepLorentzVector.
virtual CLHEP::HepLorentzVector hlv(P4SignalState::State s) const =0
obtain the CLHEP HepLorentzVector
virtual void setPz(double pz)
static const double m_ignoreWeight
Maximum difference up to which weights are considered equal.
const shape_map_t * getMomentMap(bool addIfMissing) const
static JetConstituentIterator first(const Jet *jet)
get a default iterator
virtual double eta() const
pseudo rapidity
virtual double e() const
energy
Scalar phi() const
phi method
void setCalE(double e)
Sets calibrated
void setJetAuthorAndCalibTags(const std::string &author)
Set the full author-and-tag string.
shape_t getShape(const mkey_t &shapeName, bool addIfMissing=false) const
Retrieve shape variable.
double getFlavourTagWeight() const
get the final b-tag result from the default tagger
JetKeyDescriptorInstance * keyDesc() const
std::string find(const std::string &s)
return a remapped string
Basic data class defines behavior for all Jet objects The Jet class is the principal data class for...
navigable_t::external_index_type index_t
Scalar eta() const
pseudorapidity method
bool removeConstituent(const constituent_t *pConst)
Remove a constituent.
virtual void setPx(double Px)
void setup(const hlv_t &v)
const assoc_t * getAssociationBase(const mkey_t &key) const
virtual double px() const
We re-define here extra class routines that will allow direct access to signal state kinematics witho...
static const key_t ShapeCat
Index category for jet shapes.
void setCScalePz(double pz)
Sets uncalibrated .
virtual double ei() const
void setEEtaPhiM(double a, double b, double c, double d)
bool cleanUp()
Remove all constituents with kinematic weight = 0.
double getCScalePy() const
void scale_momentum(double scale_factor)
scale the jet 4mom by scale_factor
void setCScalePx(double px)
Sets uncalibrated .
const taginfo_t * tagInfo(const mkey_t &key) const
Retrieve tag info object.
virtual ~Jet()
Destructor.
double getCScaleE() const
static const key_t TagCat
Index category for jet tag info.
navigable_t::external_index_type index_type
Constituent index type (obsolete)
void setCScaleE(double e)
Sets uncalibrated
virtual Jet * clone() const
clone method : do not clone stores and constituent
bool const RAWDATA *ch2 const
virtual double pzi() const
#define JET_CONSTRUCTOR_BASE
const_iterator firstConstituent() const
(obsolete) begin iterator for constituent store
bool hasCalibTag(const std::string &tag) const
test if jet has calib tag tag
virtual CLHEP::HepLorentzVector hlv() const =0
CLHEP HepLorentzVector.
std::vector< const assoc_t * > assostore_t
void setShape(const mkey_t &shapeName, shape_t shape, bool addIfMissing=true) const
Set shape variable.
JetKeyDescriptor::key_t mkey_t
static OrphanJetMomentMap instance
bool checkKey(const mcat_t &cat, const mkey_t &key, size_t &aInd, bool createIfMissing) const
const shape_map_t * getMomentMap() const
static JetKeyDescriptorInstance * instance()
navigable_t::object_iter const_iterator
std::vector< const taginfo_t * > tagstore_t
virtual size_t numberOfMoments(size_t jetIndex) const
virtual double p() const
mass momentum magnitude
virtual double pti() const
void removeInfo(const mkey_t &key)
(depreciated) Remove tag info object
size_t id() const
returns this jet unique identifier in its collection
virtual void removeRecord(size_t jetIndex) const
remove a record
void setRawPy(double py)
Sets uncalibrated .
std::string getCalibTag(int i) const
retrieve calib tag number i (start at 1).
const JetCollection * parentCollection() const
a pointer to the collection this jet belongs to (can be NULL)
static const key_t AssoCat
Index category for jet associations.
void setCalPx(double px)
Sets calibrated .
Jet()
Default constructor.
virtual void setupKine(const hlv_t &v)
hlv_t constituent_sum4Mom() const
Sum of weighted constituent four-momentums.
void diff(const Jet &rJet1, const Jet &rJet2, std::map< std::string, double > varDiff)
Difference between jets - Non-Class function required by trigger.
void setRawE(double e)
Sets uncalibrated
void setCombinedLikelihood(const std::vector< double > &combinedLikelihood)
(depreciated) Likelihood store setter
JetMoment::float_t shape_t
size_t size() const
Size of constituent store.
const_iterator lastConstituent() const
(obsolere) end iterator for constituent store
bool isEqual(double x1, double x2, double thresh=1e-6)
int numCalibTag() const
number of calib tags for this jet
bool getIndex(const constituent_t *pConst, index_t &ind) const
Retrieve index of object in container.
std::vector< mkey_t > getShapeKeys() const
Retrieve list of avalailable keys.
std::string getMomentMapName() const
bool finalScaleEqualsEMScale() const
True if JETFINAL state equals JETEMSCALE state within 0.1 MeV on each E,px,pypz components.
base_t::record_t record_t
Jet * get_scaled_copy(double scale_factor) const
return a NEW copy of this jet with 4mom scaled
std::string jetAuthor() const
Author and calibration history are encoded in a simple way inside the jet object.
tagstore_t * m_tagInfoStore
Tag info store.
const collection_t * getContainer(const constituent_t *pConst) const
Retrieve pointer to constituent object container.
const key_t & getKey(const category_t &cat, size_t index) const
void insertElement(const collection_t *pColl, const constituent_t *pConst, double wght=1.0, size_t sizeHint=0)
insert element without checking
const std::vector< mkey_t > & getAssociationKeys() const
void setCalPz(double pz)
Sets calibrated .
const JetCollection * m_collection
Shape store link.
void setConstituentSignalState(signalstate_t s)
Set the current Signal state of the jet constituents.
bool isIdentical(const Jet &rJet) const
Test if Jet is identical to given Jet.
void addCalibTag(const std::string &tag)
set calib tag tag must be of the form "AAA"
void setRawPz(double pz)
Sets uncalibrated .
void setPtEtaPhiE(double a, double b, double c, double d)
const navigable_type & navigableBase() const
access to underlying base type (INavigable-like)
virtual double phi() const
phi in [-pi,pi[
std::vector< double > combinedLikelihood() const
(depreciated) Likelihood store access
int32_t index_t
The index type of the node in the vector.
static const key_t InfoCat
Index category for general jet info.
const std::vector< key_t > & getKeys(const category_t &cat) const
void setCalPy(double py)
Sets calibrated .
bool addConstituent(const collection_t *pColl, const constituent_t *pConst, double wght=1.0)
Add a constituent with optional kinematic weight.
void copy_from_jet(const Jet *pjet, CopyDataMembers cdm0, CopyDataMembers cdm1=CopyNone, CopyDataMembers cdm2=CopyNone, CopyDataMembers cdm3=CopyNone)
size_t m_jetAuthor
Jet author store.
const_iterator begin() const
Begin iterator for constituent store.
bool jet_component_identity(double p1, double p2, double epsilon=0.1)
void setCScalePy(double py)
Sets uncalibrated .
std::string to_string(const DetectorType &type)
void putElement(const collection_t *pColl, const constituent_t *pConst, double wght=1.0, size_t sizeHint=0)
Add element with checking.
CLHEP::HepLorentzVector hlv_t
const Jet::constituent_t * get_real_constit()
access to the real constituent pointer
signalstate_t m_constituentSigState
Constituent Signal State.
bool addJet(const Jet *pJet, double wght=1.0)
Add a jet.
virtual void assignRecord(size_t jetIndex, record_t *rec) const
assign a given record to a given jet
const JetMomentMap * getMomentMap() const
JetKeyDescriptorInstance * keyDesc() const
assostore_t * m_assocStore
key descriptor for all jet stores
signalstate_t constituentSignalState() const
Get the current Signal state of the jet constituents.
double getWeight(const constituent_t *pConst) const
Retrieve kinematic weight of constituent.
A safe iterator on jet constituents.
virtual CLHEP::HepLorentzVector hlv() const
CLHEP HepLorentzVector.
double getCScalePx() const
@ Likelihood
needed by TauJet_v1/2
virtual bool setSignalState(state_t s)
set the current signal state
virtual double pt() const
transverse momentum
size_t m_jetId
the identifier of this jet within its collection.
virtual const record_t * getRecord(size_t jetIndex) const
get the full record for a given jet
static const size_t s_defaultJetId
bool reweight(const constituent_t *pConst, double wght)
Change kinematic weight of constituent.
virtual void updateKine()
Resummation of kinematics from constituents.
std::string str()
Jet print-out function.
virtual void setPy(double py)
static JetConstituentIterator last(const Jet *jet)
get the end iterator
size_t getIndex(const category_t &cat, const key_t &key, bool createIfMissing=true)
void setPxPyPzE(double px, double py, double pz, double e)
compatibility with analysis EDM
bool contains(const constituent_t *pConst) const
Check on containment.
std::string jetAuthorAndCalibTags() const
Retrieve the full author-and-tag string of this Jet.
std::string getKey(const std::string &key, const std::string &encoded)
MsgStream & operator<<(MsgStream &out)
Output operator.
virtual double pz() const
z component of momentum
double getCScalePz() const
const fastjet::PseudoJet * m_pseudoJet
Pointer to the fastjet object this jet is build from.
virtual bool setMoment(size_t jetIndex, size_t keyIndex, float_t moment)
void setTagInfo(const mkey_t &key, const taginfo_t *pTagInfo, bool useLink=false)
Set tag info object.
numconstit_t m_constituentsN
void setRawPx(double px)
Sets uncalibrated .
bool checkKeyStore(const mcat_t &cat, const mkey_t &key, STORE *&store, size_t &aInd, bool createIfMissing) const
Check key validity with automatic store generation.
void setJetAuthor(const std::string &author)
Set author of this Jet (only the author, tags unchanged)
CopyDataMembers
@ brief fine control over what's copied in the various stores and constituents
virtual void set4Mom(const I4Momentum &p4)
virtual double pyi() const
virtual bool getMoment(size_t jetIndex, size_t keyIndex, float_t &moment) const