68 if ( !
sc.isFailure() && pobjs !=
nullptr )
return dump_collection(pobjs,
"Pseudojet");
79 if ( pobjs !=
nullptr ) {
98 std::string myname =
"JetDumper::print: ";
112 return cui.
label() +
" pseudojet";
114 return "No-CUI pseudojet";
122 const double mevtogev = 0.001;
124 std::ostringstream ssjetline;
125 double px = mevtogev*
jet.px();
126 double py = mevtogev*
jet.py();
127 double pt = sqrt(px*px+py*py);
129 ssjetline <<
"pT =" << std::setw(6) << std::fixed << std::setprecision(1) << pt <<
" GeV";
130 ssjetline <<
", m =" << std::setw(6) << std::fixed << std::setprecision(1)
131 << mevtogev*
jet.m() <<
" GeV";
132 ssjetline <<
", eta =" << std::setw(5) << std::fixed << std::setprecision(2) <<
jet.eta();
133 ssjetline <<
", phi =" << std::setw(5) << std::fixed << std::setprecision(2) <<
jet.phi();
143 if ( pseg ==
nullptr )
return 1;
145 const double mmtom = 0.001;
147 std::ostringstream ssline;
148 double x = mmtom*seg.
x();
149 double y = mmtom*seg.
y();
150 double z = mmtom*seg.
z();
151 double r = sqrt(
x*
x+
y*
y);
152 double phi = atan2(
y,
x);
153 ssline <<
"r =" << std::setw(7) << std::fixed << std::setprecision(2) <<
r <<
" m";
154 ssline <<
", z =" << std::setw(7) << std::fixed << std::setprecision(2) <<
z <<
" m";
155 ssline <<
", phi =" << std::setw(7) << std::fixed << std::setprecision(2) <<
phi;
164 if ( name.empty() || name ==
"jetP4()" ) val = pjet->
jetP4();
171 std::vector<int>& vals)
const {
172 typedef std::vector<int> T;
179 std::vector<float>& vals)
const {
180 typedef std::vector<float> T;
222 std::ostringstream sout;
228 sout <<
"Jet " << eljet.
dataID() <<
"[" << eljet.
index() <<
"]";
235 sout <<
"Vertex " << elvtx.
dataID() <<
"[" << elvtx.
index() <<
"]";
242 sout <<
"IParticle " << elobj.
dataID() <<
"[" << elobj.
index() <<
"]";
246 return "Not a known element link.";
254 out <<
", ncon = " << ncon;
259 string lab =
", size/ncon=";
260 out << lab << scon <<
"/" << ncon;
264 if ( ppj ==
nullptr ) {
265 out <<
", No pseudojet";
267 out <<
", npjcon=" << ppj->constituents().size();
275 if ( ppsj ==
nullptr ) {
276 out <<
", Null pseudojet";
279 const fastjet::PseudoJet& psj = *ppsj;
280 if ( psj.has_user_info() ) {
282 if ( linedetail > 1 ) {
283 out <<
", ilab=" << cui.
index();
284 if ( linedetail > 2 ) {
286 if ( pip ==
nullptr ) {
287 out <<
", Associated particle is null";
289 out <<
" [" << pip->container() <<
"/" << pip->index() <<
"]";
290 if ( linedetail > 3 ) out <<
", IParticle @ " << pip;
293 if ( cui.
isGhost() ) out <<
", ghost";
296 out <<
", No user info";
Scalar phi() const
phi method
IJetConstituentsRetriever::NameList NameList
JetDumper::NameList get_moment_keys< Jet, int >(const Jet *)
JetDumper::NameList get_moment_keys< Jet, float >(const Jet *)
static const Attributes_t empty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ServiceHandle< StoreGateSvc > & evtStore()
ElementLink implementation for ROOT usage.
const ID_type & dataID() const
Get the key that we reference, as a string.
index_type index() const
Get the index of the element inside of its container.
JetDumper(const std::string &myname)
void getAssociatedLinks(TObj *pobj, std::string name, APELVector &val) const
NameList m_bmoms
Int moments.
NameList m_fvmoms
String moments.
NameList m_imoms
Float moments.
std::vector< MSEL > MSELVector
void getAssociatedParticles(TObj *pobj, std::string name, APVector &val) const
std::vector< APEL > APELVector
void get_moment(TObj *pobj, std::string name, TMom &val) const
std::vector< const xAOD::MuonSegment * > MSVector
std::string get_moment_as_string(const TObj &obj, std::string name) const
NameList m_smoms
Bool stored as char moments.
NameList m_cbmoms
Bool moments.
NameList m_vfmoms
Vector<int> moments.
NameList m_vimoms
Element link moments.
int dump_object_after_prefix(const T *pjet, const std::string &objtypename) const
void extra_info(const T *, std::ostream &out, int) const
NameList m_elmoms
Four-vector moments.
std::vector< const xAOD::IParticle * > APVector
std::string object_label(const T *pjet, const std::string &label) const
int execute() const
Method to be called for each event.
int dump_collection(const TList *pjets, const std::string &objtypename="Unknown") const
void print() const
Print the state of the tool.
xAOD::JetFourMom_t FourVector
std::vector< Name > NameList
NameList m_apmoms
Vector<float> moments.
virtual Label label() const =0
virtual bool isGhost() const
Returns true if this constituent is a ghost.
virtual const xAOD::IParticle * particle() const =0
virtual Index index() const
Class providing the definition of the 4-vector interface.
size_t size() const
number of constituents
size_t numConstituents() const
Number of constituents in this jets (this is valid even when reading a file where the constituents ha...
JetConstituentVector getConstituents() const
Return a vector of consituents. The object behaves like vector<const IParticle*>. See JetConstituentV...
const fastjet::PseudoJet * getPseudoJet() const
std::vector< const T * > getAssociatedObjects(const std::string &name) const
get associated objects as a vector<object> this compact form throws an exception if the object is not...
bool getAttribute(AttributeID type, T &value) const
Retrieve attribute moment by enum.
JetFourMom_t jetP4() const
The full 4-momentum of the particle : internal jet type.
float y() const
Returns the x position.
float z() const
Returns the y position.
bool contains(const std::string &s, const std::string ®x)
does a string contain the substring
std::string label(const std::string &format, int i)
std::vector< fastjet::PseudoJet > PseudoJetVector
Jet_v1 Jet
Definition of the current "jet version".
MuonSegmentContainer_v1 MuonSegmentContainer
Definition of the current "MuonSegment container version".
CaloClusterContainer_v1 CaloClusterContainer
Define the latest version of the calorimeter cluster container.
JetContainer_v1 JetContainer
Definition of the current "jet container version".
MuonSegment_v1 MuonSegment
Reference the current persistent version: