HepMC3 event record library
Attribute.h
Go to the documentation of this file.
1// -*- C++ -*-
2//
3// This file is part of HepMC
4// Copyright (C) 2014-2021 The HepMC collaboration (see AUTHORS for details)
5//
6#ifndef HEPMC3_ATTRIBUTE_H
7#define HEPMC3_ATTRIBUTE_H
8/**
9 * @file Attribute.h
10 * @brief Definition of \b class Attribute, \b class IntAttribute and \b class StringAttribute
11 *
12 * @class HepMC3::Attribute
13 * @brief Base class for all attributes
14 *
15 * Contains virtual functions to_string and from_string that
16 * each attribute must implement, as well as init function that
17 * attributes should overload to initialize parsed attribute
18 *
19 * @ingroup attributes
20 *
21 */
22#include <cstdio> // sprintf
23#include <string>
24#include <limits>
25#include <sstream>
26#include <iomanip>
27#include <map>
28
29#include "HepMC3/GenParticle_fwd.h"
30#include "HepMC3/GenVertex_fwd.h"
31
32/** Deprecated */
33using std::string;
34
35namespace HepMC3 {
36
37/** @brief Forward declaration of GenEvent. */
38class GenEvent;
39
40/** @brief Forward declaration of GenRunInfo. */
41class GenRunInfo;
42
43/** @brief Base attribute class. */
44class Attribute {
45//
46// Constructors
47//
48public:
49 /** @brief Default constructor */
50 //Note: m_event should be set to nullptr in case event is deleted!
51 Attribute():m_is_parsed(true) { m_event=nullptr; }
52
53 /** @brief Virtual destructor */
54 virtual ~Attribute() {}
55
56protected:
57 /** @brief Protected constructor that allows to set string
58 *
59 * Used when parsing attributes from file. An StringAttribute class
60 * object is made, which uses this constructor to signify that
61 * it just holds string without parsing it.
62 *
63 * @note There should be no need for user class to ever use this constructor
64 */
65 //Note: m_event should be set to nullptr n case event is deleted!
66 explicit Attribute(const std::string &st):m_is_parsed(false),m_string(st) { m_event=nullptr; }
67
68 /** @brief GenEvent is a friend */
69 friend class GenEvent;
70
71//
72// Virtual Functions
73//
74public:
75 /** @brief Fill class content from string.
76 */
77 virtual bool from_string(const std::string & att) = 0;
78
79 /** @brief Optionally initialize the attribute after from_string.
80 */
81 virtual bool init() {
82 return true;
83 }
84
85 /** @brief Optionally initialize the attribute after from_string
86 *
87 * Is passed a reference to the GenRunInfo object to which the
88 * Attribute belongs.
89 */
90 virtual bool init(const GenRunInfo & ) {
91 return true;
92 }
93
94 /** @brief Fill string from class content */
95 virtual bool to_string(std::string &att) const = 0;
96
97//
98// Accessors
99//
100public:
101 /** @brief Check if this attribute is parsed */
102 bool is_parsed() const { return m_is_parsed; }
103
104 /** @brief Get unparsed string */
105 const std::string& unparsed_string() const { return m_string; }
106
107 /** return the GenEvent to which this Attribute belongs, if at all. */
108 const GenEvent * event() const {
109 return m_event;
110 }
111
112 /** return the GenParticle to which this Attribute belongs, if at all. */
113 GenParticlePtr particle() {
114 return m_particle;
115 }
116
117 /** return the GenParticle to which this Attribute belongs, if at all. */
118 ConstGenParticlePtr particle() const {
119 return std::const_pointer_cast<GenParticle>(m_particle);
120 }
121
122 /** return the GenVertex to which this Attribute belongs, if at all. */
123 GenVertexPtr vertex() {
124 return m_vertex;
125 }
126
127 /** return the GenVertex to which this Attribute belongs, if at all. */
128 ConstGenVertexPtr vertex() const {
129 return std::const_pointer_cast<GenVertex>(m_vertex);
130 }
131
132protected:
133 /** @brief Set is_parsed flag */
134 void set_is_parsed(bool flag) { m_is_parsed = flag; }
135
136 /** @brief Set unparsed string */
137 void set_unparsed_string(const std::string &st) { m_string = st; }
138
139//
140// Fields
141//
142private:
143 bool m_is_parsed; //!< Is this attribute parsed?
144 std::string m_string; //!< Raw (unparsed) string
145 const GenEvent * m_event; //!< Possibility to be aware of the
146 //! controlling GenEvent object.
147 GenParticlePtr m_particle; //!< Particle to which assigned.
148 GenVertexPtr m_vertex; //!< Vertex to which assigned.
149};
150
151/**
152 * @class HepMC3::IntAttribute
153 * @brief Attribute that holds an Integer implemented as an int
154 *
155 * @ingroup attributes
156 */
157class IntAttribute : public Attribute {
158public:
159
160 /** @brief Default constructor */
162
163 /** @brief Constructor initializing attribute value */
164 IntAttribute(int val):Attribute(),m_val(val) {}
165
166 /** @brief Implementation of Attribute::from_string */
167 bool from_string(const std::string &att) override {
168 m_val = atoi( att.c_str() );
169 return true;
170 }
171
172 /** @brief Implementation of Attribute::to_string */
173 bool to_string(std::string &att) const override{
174 att = std::to_string(m_val);
175 return true;
176 }
177
178 /** @brief get the value associated to this Attribute. */
179 int value() const {
180 return m_val;
181 }
182
183 /** @brief set the value associated to this Attribute. */
184 void set_value(const int& i) {
185 m_val = i;
186 }
187
188private:
189 int m_val; ///< Attribute value
190};
191
192/**
193 * @class HepMC3::LongAttribute
194 * @brief Attribute that holds an Integer implemented as an int
195 *
196 * @ingroup attributes
197 */
198class LongAttribute : public Attribute {
199public:
200
201 /** @brief Default constructor */
203
204 /** @brief Constructor initializing attribute value */
205 LongAttribute(long val): Attribute(), m_val(val) {}
206
207 /** @brief Implementation of Attribute::from_string */
208 bool from_string(const std::string &att) override{
209 m_val = atol( att.c_str() );
210 return true;
211 }
212
213 /** @brief Implementation of Attribute::to_string */
214 bool to_string(std::string &att) const override{
215 att = std::to_string(m_val);
216 return true;
217 }
218
219 /** @brief get the value associated to this Attribute. */
220 long value() const {
221 return m_val;
222 }
223
224 /** @brief set the value associated to this Attribute. */
225 void set_value(const long& l) {
226 m_val = l;
227 }
228
229private:
230
231 long m_val; ///< Attribute value
232
233};
234
235/**
236 * @class HepMC3::DoubleAttribute
237 * @brief Attribute that holds a real number as a double.
238 *
239 * @ingroup attributes
240 */
242public:
243
244 /** @brief Default constructor */
246
247 /** @brief Constructor initializing attribute value */
248 DoubleAttribute(double val): Attribute(), m_val(val) {}
249
250 /** @brief Implementation of Attribute::from_string */
251 bool from_string(const std::string &att) override{
252 m_val = atof( att.c_str() );
253 return true;
254 }
255
256 /** @brief Implementation of Attribute::to_string */
257 bool to_string(std::string &att) const override{
258 std::ostringstream oss;
259 oss << std::setprecision(std::numeric_limits<double>::digits10)
260 << m_val;
261 att = oss.str();
262 return true;
263 }
264
265 /** @brief get the value associated to this Attribute. */
266 double value() const {
267 return m_val;
268 }
269
270 /** @brief set the value associated to this Attribute. */
271 void set_value(const double& d) {
272 m_val = d;
273 }
274
275private:
276
277 double m_val; ///< Attribute value
278};
279
280/**
281 * @class HepMC3::FloatAttribute
282 * @brief Attribute that holds a real number as a float.
283 *
284 * @ingroup attributes
285 */
286class FloatAttribute : public Attribute {
287public:
288
289 /** @brief Default constructor */
291
292 /** @brief Constructor initializing attribute value */
293 FloatAttribute(float val): Attribute(), m_val(val) {}
294
295 /** @brief Implementation of Attribute::from_string */
296 bool from_string(const std::string &att) override{
297 m_val = float(atof( att.c_str() ));
298 return true;
299 }
300
301 /** @brief Implementation of Attribute::to_string */
302 bool to_string(std::string &att) const override{
303 std::ostringstream oss;
304 oss << std::setprecision(std::numeric_limits<float>::digits10)
305 << m_val;
306 att = oss.str();
307 return true;
308 }
309
310 /** @brief get the value associated to this Attribute. */
311 float value() const {
312 return m_val;
313 }
314
315 /** @brief set the value associated to this Attribute. */
316 void set_value(const float& f) {
317 m_val = f;
318 }
319
320private:
321
322 float m_val; ///< Attribute value
323};
324
325/**
326 * @class HepMC3::StringAttribute
327 * @brief Attribute that holds a string
328 *
329 * Default attribute constructed when reading input files.
330 * It can be then parsed by other attributes or left as a string.
331 *
332 * @ingroup attributes
333 *
334 */
336public:
337
338 /** @brief Default constructor - empty string */
340
341 /** @brief String-based constructor
342 *
343 * The Attribute constructor used here marks that this is an unparsed
344 * string that can be (but does not have to be) parsed
345 *
346 */
347 StringAttribute(const std::string &st):Attribute(st) {}
348
349 /** @brief Implementation of Attribute::from_string */
350 bool from_string(const std::string &att) override{
352 return true;
353 }
354
355 /** @brief Implementation of Attribute::to_string */
356 bool to_string(std::string &att) const override{
357 att = unparsed_string();
358 return true;
359 }
360
361 /** @brief get the value associated to this Attribute. */
362 std::string value() const {
363 return unparsed_string();
364 }
365
366 /** @brief set the value associated to this Attribute. */
367 void set_value(const std::string& s) {
369 }
370
371};
372
373/**
374 * @class HepMC3::CharAttribute
375 * @brief Attribute that holds an Chareger implemented as an int
376 *
377 * @ingroup attributes
378 */
379class CharAttribute : public Attribute {
380public:
381
382 /** @brief Default constructor */
384
385 /** @brief Constructor initializing attribute value */
386 CharAttribute(char val):Attribute(),m_val(val) {}
387
388 /** @brief Implementation of Attribute::from_string */
389 bool from_string(const std::string &att) override {
390 if (att.size())
391 {
392 m_val = att.at(0);
393 return true;
394 }
395 return false;
396 }
397
398 /** @brief Implementation of Attribute::to_string */
399 bool to_string(std::string &att) const override {
400 att = std::to_string(m_val);
401 return true;
402 }
403
404 /** @brief get the value associated to this Attribute. */
405 char value() const {
406 return m_val;
407 }
408
409 /** @brief set the value associated to this Attribute. */
410 void set_value(const char& i) {
411 m_val = i;
412 }
413
414private:
415 char m_val; ///< Attribute value
416};
417
418/**
419 * @class HepMC3::LongLongAttribute
420 * @brief Attribute that holds an Integer implemented as an int
421 *
422 * @ingroup attributes
423 */
425public:
426
427 /** @brief Default constructor */
429
430 /** @brief Constructor initializing attribute value */
431 LongLongAttribute(long long val): Attribute(), m_val(val) {}
432
433 /** @brief Implementation of Attribute::from_string */
434 bool from_string(const std::string &att) override{
435 m_val = atoll( att.c_str() );
436 return true;
437 }
438
439 /** @brief Implementation of Attribute::to_string */
440 bool to_string(std::string &att) const override{
441 att = std::to_string(m_val);
442 return true;
443 }
444
445 /** @brief get the value associated to this Attribute. */
446 long long value() const {
447 return m_val;
448 }
449
450 /** @brief set the value associated to this Attribute. */
451 void set_value(const long long& l) {
452 m_val = l;
453 }
454
455private:
456
457 long long m_val; ///< Attribute value
458
459};
460
461/**
462 * @class HepMC3::LongDoubleAttribute
463 * @brief Attribute that holds a real number as a double.
464 *
465 * @ingroup attributes
466 */
468public:
469
470 /** @brief Default constructor */
472
473 /** @brief Constructor initializing attribute value */
474 LongDoubleAttribute(long double val): Attribute(), m_val(val) {}
475
476 /** @brief Implementation of Attribute::from_string */
477 bool from_string(const std::string &att) override {
478 m_val = strtold( att.c_str(),NULL);
479 return true;
480 }
481
482 /** @brief Implementation of Attribute::to_string */
483 bool to_string(std::string &att) const override{
484 std::ostringstream oss;
485 oss << std::setprecision(std::numeric_limits<long double>::digits10)
486 << m_val;
487 att = oss.str();
488 return true;
489 }
490
491 /** @brief get the value associated to this Attribute. */
492 long double value() const {
493 return m_val;
494 }
495
496 /** @brief set the value associated to this Attribute. */
497 void set_value(const long double& d) {
498 m_val = d;
499 }
500
501private:
502
503 long double m_val; ///< Attribute value
504};
505
506
507
508/**
509 * @class HepMC3::UIntAttribute
510 * @brief Attribute that holds an unsigned int
511 *
512 * @ingroup attributes
513 */
514class UIntAttribute : public Attribute {
515public:
516
517 /** @brief Default constructor */
519
520 /** @brief Constructor initializing attribute value */
521 UIntAttribute(unsigned int val):Attribute(),m_val(val) {}
522
523 /** @brief Implementation of Attribute::from_string */
524 bool from_string(const std::string &att) override{
525 m_val = strtoul(att.c_str(), NULL, 0);
526 return true;
527 }
528
529 /** @brief Implementation of Attribute::to_string */
530 bool to_string(std::string &att) const override{
531 att = std::to_string(m_val);
532 return true;
533 }
534
535 /** @brief get the value associated to this Attribute. */
536 unsigned int value() const {
537 return m_val;
538 }
539
540 /** @brief set the value associated to this Attribute. */
541 void set_value(const unsigned int& i) {
542 m_val = i;
543 }
544
545private:
546 unsigned int m_val; ///< Attribute value
547};
548
549
550
551/**
552 * @class HepMC3::ULongAttribute
553 * @brief Attribute that holds an unsigned long
554 *
555 * @ingroup attributes
556 */
557class ULongAttribute : public Attribute {
558public:
559
560 /** @brief Default constructor */
562
563 /** @brief Constructor initializing attribute value */
564 ULongAttribute(unsigned long val):Attribute(),m_val(val) {}
565
566 /** @brief Implementation of Attribute::from_string */
567 bool from_string(const std::string &att) override{
568 m_val = strtoul(att.c_str(), NULL, 0);
569 return true;
570 }
571
572 /** @brief Implementation of Attribute::to_string */
573 bool to_string(std::string &att) const override{
574 att = std::to_string(m_val);
575 return true;
576 }
577
578 /** @brief get the value associated to this Attribute. */
579 unsigned long value() const {
580 return m_val;
581 }
582
583 /** @brief set the value associated to this Attribute. */
584 void set_value(const unsigned long& i) {
585 m_val = i;
586 }
587
588private:
589 unsigned long m_val; ///< Attribute value
590};
591
592
593/**
594 * @class HepMC3::ULongLongAttribute
595 * @brief Attribute that holds an unsigned long long
596 *
597 * @ingroup attributes
598 */
600public:
601
602 /** @brief Default constructor */
604
605 /** @brief Constructor initializing attribute value */
606 ULongLongAttribute(unsigned long long val):Attribute(),m_val(val) {}
607
608 /** @brief Implementation of Attribute::from_string */
609 bool from_string(const std::string &att) override{
610 m_val = strtoull(att.c_str(), NULL, 0);
611 return true;
612 }
613
614 /** @brief Implementation of Attribute::to_string */
615 bool to_string(std::string &att) const override{
616 att = std::to_string(m_val);
617 return true;
618 }
619
620 /** @brief get the value associated to this Attribute. */
621 unsigned long long value() const {
622 return m_val;
623 }
624
625 /** @brief set the value associated to this Attribute. */
626 void set_value(const unsigned long long& i) {
627 m_val = i;
628 }
629
630private:
631 unsigned long long m_val; ///< Attribute value
632};
633/**
634 * @class HepMC3::BoolAttribute
635 * @brief Attribute that holds an Booleger implemented as an int
636 *
637 * @ingroup attributes
638 */
639class BoolAttribute : public Attribute {
640public:
641
642 /** @brief Default constructor */
644
645 /** @brief Constructor initializing attribute value */
646 BoolAttribute(bool val):Attribute(),m_val(val) {}
647
648 /** @brief Implementation of Attribute::from_string */
649 bool from_string(const std::string &att) override{
650 if (att.size()!=1) return false;
651 if (att==std::string("1")) {m_val = true; return true;}
652 if (att==std::string("0")) {m_val = false; return true;}
653 return false;
654 }
655
656 /** @brief Implementation of Attribute::to_string */
657 bool to_string(std::string &att) const override{
658 att = std::to_string(m_val);
659 return true;
660 }
661
662 /** @brief get the value associated to this Attribute. */
663 bool value() const {
664 return m_val;
665 }
666
667 /** @brief set the value associated to this Attribute. */
668 void set_value(const bool& i) {
669 m_val = i;
670 }
671
672private:
673 bool m_val; ///< Attribute value
674};
675
676/**
677 * @class HepMC3::VectorCharAttribute
678 * @brief Attribute that holds a vector of charegers of type char
679 *
680 * @ingroup attributes
681 */
683public:
684
685 /** @brief Default constructor */
687
688 /** @brief Constructor initializing attribute value */
689 VectorCharAttribute(std::vector<char> val):Attribute(),m_val(val) {}
690
691 /** @brief Implementation of Attribute::from_string */
692 bool from_string(const std::string &att) override {
693 char datafoo;
694 m_val.clear();
695 std::stringstream datastream(att);
696 while (datastream >> datafoo) m_val.push_back(datafoo);
697 return true;
698 }
699
700 /** @brief Implementation of Attribute::to_string */
701 bool to_string(std::string &att) const override{
702 att.clear();
703 for (auto a: m_val) {if (att.length()) att+=" "; att+=std::to_string(a);}
704 return true;
705 }
706
707 /** @brief get the value associated to this Attribute. */
708 std::vector<char> value() const {
709 return m_val;
710 }
711
712 /** @brief set the value associated to this Attribute. */
713 void set_value(const std::vector<char>& i) {
714 m_val = i;
715 }
716
717private:
718 std::vector<char> m_val; ///< Attribute value
719};
720
721/**
722 * @class HepMC3::VectorFloatAttribute
723 * @brief Attribute that holds a vector of floategers of type float
724 *
725 * @ingroup attributes
726 */
728public:
729
730 /** @brief Default constructor */
732
733 /** @brief Constructor initializing attribute value */
734 VectorFloatAttribute(std::vector<float> val):Attribute(),m_val(val) {}
735
736 /** @brief Implementation of Attribute::from_string */
737 bool from_string(const std::string &att) override {
738 float datafoo;
739 m_val.clear();
740 std::stringstream datastream(att);
741 while (datastream >> datafoo) m_val.push_back(datafoo);
742 return true;
743 }
744
745 /** @brief Implementation of Attribute::to_string */
746 bool to_string(std::string &att) const override{
747 att.clear();
748 for (auto a: m_val) {if (att.length()) att+=" "; att+=std::to_string(a);}
749 return true;
750 }
751
752 /** @brief get the value associated to this Attribute. */
753 std::vector<float> value() const {
754 return m_val;
755 }
756
757 /** @brief set the value associated to this Attribute. */
758 void set_value(const std::vector<float>& i) {
759 m_val = i;
760 }
761
762private:
763 std::vector<float> m_val; ///< Attribute value
764};
765
766
767/**
768 * @class HepMC3::VectorLongDoubleAttribute
769 * @brief Attribute that holds a vector of long doubleegers of type long double
770 *
771 * @ingroup attributes
772 */
774public:
775
776 /** @brief Default constructor */
778
779 /** @brief Constructor initializing attribute value */
780 VectorLongDoubleAttribute(std::vector<long double> val):Attribute(),m_val(val) {}
781
782 /** @brief Implementation of Attribute::from_string */
783 bool from_string(const std::string &att) override {
784 long double datafoo;
785 m_val.clear();
786 std::stringstream datastream(att);
787 while (datastream >> datafoo) m_val.push_back(datafoo);
788 return true;
789 }
790
791 /** @brief Implementation of Attribute::to_string */
792 bool to_string(std::string &att) const override{
793 att.clear();
794 for (auto a: m_val) {if (att.length()) att+=" "; att+=std::to_string(a);}
795 return true;
796 }
797
798 /** @brief get the value associated to this Attribute. */
799 std::vector<long double> value() const {
800 return m_val;
801 }
802
803 /** @brief set the value associated to this Attribute. */
804 void set_value(const std::vector<long double>& i) {
805 m_val = i;
806 }
807
808private:
809 std::vector<long double> m_val; ///< Attribute value
810};
811
812
813
814/**
815 * @class HepMC3::VectorLongLongAttribute
816 * @brief Attribute that holds a vector of long longegers of type long long
817 *
818 * @ingroup attributes
819 */
821public:
822
823 /** @brief Default constructor */
825
826 /** @brief Constructor initializing attribute value */
827 VectorLongLongAttribute(std::vector<long long> val):Attribute(),m_val(val) {}
828
829 /** @brief Implementation of Attribute::from_string */
830 bool from_string(const std::string &att) override {
831 long long datafoo;
832 m_val.clear();
833 std::stringstream datastream(att);
834 while (datastream >> datafoo) m_val.push_back(datafoo);
835 return true;
836 }
837
838 /** @brief Implementation of Attribute::to_string */
839 bool to_string(std::string &att) const override{
840 att.clear();
841 for (auto a: m_val) {if (att.length()) att+=" "; att+=std::to_string(a);}
842 return true;
843 }
844
845 /** @brief get the value associated to this Attribute. */
846 std::vector<long long> value() const {
847 return m_val;
848 }
849
850 /** @brief set the value associated to this Attribute. */
851 void set_value(const std::vector<long long>& i) {
852 m_val = i;
853 }
854
855private:
856 std::vector<long long> m_val; ///< Attribute value
857};
858
859/**
860 * @class HepMC3::VectorUIntAttribute
861 * @brief Attribute that holds a vector of unsigned integers of type unsigned int
862 *
863 * @ingroup attributes
864 */
866public:
867
868 /** @brief Default constructor */
870
871 /** @brief Constructor initializing attribute value */
872 VectorUIntAttribute(std::vector<unsigned int> val):Attribute(),m_val(val) {}
873
874 /** @brief Implementation of Attribute::from_string */
875 bool from_string(const std::string &att) override {
876 unsigned int datafoo;
877 m_val.clear();
878 std::stringstream datastream(att);
879 while (datastream >> datafoo) m_val.push_back(datafoo);
880 return true;
881 }
882
883 /** @brief Implementation of Attribute::to_string */
884 bool to_string(std::string &att) const override{
885 att.clear();
886 for (auto a: m_val) {if (att.length()) att+=" "; att+=std::to_string(a);}
887 return true;
888 }
889
890 /** @brief get the value associated to this Attribute. */
891 std::vector<unsigned int> value() const {
892 return m_val;
893 }
894
895 /** @brief set the value associated to this Attribute. */
896 void set_value(const std::vector<unsigned int>& i) {
897 m_val = i;
898 }
899
900private:
901 std::vector<unsigned int> m_val; ///< Attribute value
902};
903
904/**
905 * @class HepMC3::VectorULongAttribute
906 * @brief Attribute that holds a vector of unsigned longegers of type unsigned long
907 *
908 * @ingroup attributes
909 */
911public:
912
913 /** @brief Default constructor */
915
916 /** @brief Constructor initializing attribute value */
917 VectorULongAttribute(std::vector<unsigned long> val):Attribute(),m_val(val) {}
918
919 /** @brief Implementation of Attribute::from_string */
920 bool from_string(const std::string &att) override {
921 unsigned long datafoo;
922 m_val.clear();
923 std::stringstream datastream(att);
924 while (datastream >> datafoo) m_val.push_back(datafoo);
925 return true;
926 }
927
928 /** @brief Implementation of Attribute::to_string */
929 bool to_string(std::string &att) const override{
930 att.clear();
931 for (auto a: m_val) {if (att.length()) att+=" "; att+=std::to_string(a);}
932 return true;
933 }
934
935 /** @brief get the value associated to this Attribute. */
936 std::vector<unsigned long> value() const {
937 return m_val;
938 }
939
940 /** @brief set the value associated to this Attribute. */
941 void set_value(const std::vector<unsigned long>& i) {
942 m_val = i;
943 }
944
945private:
946 std::vector<unsigned long> m_val; ///< Attribute value
947};
948
949
950/**
951 * @class HepMC3::VectorULongLongAttribute
952 * @brief Attribute that holds a vector of unsigned long longegers of type unsigned long long
953 *
954 * @ingroup attributes
955 */
957public:
958
959 /** @brief Default constructor */
961
962 /** @brief Constructor initializing attribute value */
963 VectorULongLongAttribute(std::vector<unsigned long long> val):Attribute(),m_val(val) {}
964
965 /** @brief Implementation of Attribute::from_string */
966 bool from_string(const std::string &att) override {
967 unsigned long long datafoo;
968 m_val.clear();
969 std::stringstream datastream(att);
970 while (datastream >> datafoo) m_val.push_back(datafoo);
971 return true;
972 }
973
974 /** @brief Implementation of Attribute::to_string */
975 bool to_string(std::string &att) const override{
976 att.clear();
977 for (auto a: m_val) {if (att.length()) att+=" "; att+=std::to_string(a);}
978 return true;
979 }
980
981 /** @brief get the value associated to this Attribute. */
982 std::vector<unsigned long long> value() const {
983 return m_val;
984 }
985
986 /** @brief set the value associated to this Attribute. */
987 void set_value(const std::vector<unsigned long long>& i) {
988 m_val = i;
989 }
990
991private:
992 std::vector<unsigned long long> m_val; ///< Attribute value
993};
994
995/**
996 * @class HepMC3::VectorIntAttribute
997 * @brief Attribute that holds a vector of integers of type int
998 *
999 * @ingroup attributes
1000 */
1002public:
1003
1004 /** @brief Default constructor */
1006
1007 /** @brief Constructor initializing attribute value */
1008 VectorIntAttribute(std::vector<int> val):Attribute(),m_val(val) {}
1009
1010 /** @brief Implementation of Attribute::from_string */
1011 bool from_string(const std::string &att) override {
1012 int datafoo;
1013 m_val.clear();
1014 std::stringstream datastream(att);
1015 while (datastream >> datafoo) m_val.push_back(datafoo);
1016 return true;
1017 }
1018
1019 /** @brief Implementation of Attribute::to_string */
1020 bool to_string(std::string &att) const override{
1021 att.clear();
1022 for (auto a: m_val) {if (att.length()) att+=" "; att+=std::to_string(a);}
1023 return true;
1024 }
1025
1026 /** @brief get the value associated to this Attribute. */
1027 std::vector<int> value() const {
1028 return m_val;
1029 }
1030
1031 /** @brief set the value associated to this Attribute. */
1032 void set_value(const std::vector<int>& i) {
1033 m_val = i;
1034 }
1035
1036private:
1037 std::vector<int> m_val; ///< Attribute value
1038};
1039
1040/**
1041 * @class HepMC3::VectorLongIntAttribute
1042 * @brief Attribute that holds a vector of integers of type int
1043 *
1044 * @ingroup attributes
1045 */
1047public:
1048
1049 /** @brief Default constructor */
1051
1052 /** @brief Constructor initializing attribute value */
1053 VectorLongIntAttribute(std::vector<long int> val):Attribute(),m_val(val) {}
1054
1055 /** @brief Implementation of Attribute::from_string */
1056 bool from_string(const std::string &att) override {
1057 long int datafoo;
1058 m_val.clear();
1059 std::stringstream datastream(att);
1060 while (datastream >> datafoo) m_val.push_back(datafoo);
1061 return true;
1062 }
1063
1064 /** @brief Implementation of Attribute::to_string */
1065 bool to_string(std::string &att) const override{
1066 att.clear();
1067 for (auto a: m_val) {if (att.length()) att+=" "; att+=std::to_string(a);}
1068 return true;
1069 }
1070
1071 /** @brief get the value associated to this Attribute. */
1072 std::vector<long int> value() const {
1073 return m_val;
1074 }
1075
1076 /** @brief set the value associated to this Attribute. */
1077 void set_value(const std::vector<long int>& i) {
1078 m_val = i;
1079 }
1080
1081private:
1082 std::vector<long int> m_val; ///< Attribute value
1083};
1084
1085/**
1086 * @class HepMC3::VectorDoubleAttribute
1087 * @brief Attribute that holds a vector of FPs of type double
1088 *
1089 * @ingroup attributes
1090 */
1092public:
1093
1094 /** @brief Default constructor */
1096
1097 /** @brief Constructor initializing attribute value */
1098 VectorDoubleAttribute(std::vector<double> val):Attribute(),m_val(val) {}
1099
1100 /** @brief Implementation of Attribute::from_string */
1101 bool from_string(const std::string &att) override {
1102 double datafoo;
1103 m_val.clear();
1104 std::stringstream datastream(att);
1105 while (datastream >> datafoo) m_val.push_back(datafoo);
1106 return true;
1107 }
1108
1109 /** @brief Implementation of Attribute::to_string */
1110 bool to_string(std::string &att) const override{
1111 att.clear();
1112 for (auto a: m_val) {if (att.length()) att+=" "; att+=std::to_string(a);}
1113 return true;
1114 }
1115
1116 /** @brief get the value associated to this Attribute. */
1117 std::vector<double> value() const {
1118 return m_val;
1119 }
1120
1121 /** @brief set the value associated to this Attribute. */
1122 void set_value(const std::vector<double>& i) {
1123 m_val = i;
1124 }
1125
1126private:
1127 std::vector<double> m_val; ///< Attribute value
1128};
1129
1130
1131/**
1132 * @class HepMC3::VectorStringAttribute
1133 * @brief Attribute that holds a vector of FPs of type string
1134 *
1135 * @ingroup attributes
1136 */
1138public:
1139
1140 /** @brief Default constructor */
1142
1143 /** @brief Constructor initializing attribute value */
1144 VectorStringAttribute(std::vector<std::string> val):Attribute(),m_val(val) {}
1145
1146 /** @brief Implementation of Attribute::from_string */
1147 bool from_string(const string &att) override {
1148 size_t posb = att.find_first_not_of(' ');
1149 do {
1150 size_t pose = att.find_first_of(' ', posb);
1151 m_val.push_back(att.substr(posb, pose - posb));
1152 posb = att.find_first_not_of(' ', pose);
1153 } while (posb != std::string::npos);
1154 return true;
1155 }
1156
1157 /** @brief Implementation of Attribute::to_string */
1158 bool to_string(std::string &att) const override{
1159 att.clear();
1160 for (auto a: m_val) {if (att.length()) att+=" "; att+=a;}
1161 return true;
1162 }
1163
1164 /** @brief get the value associated to this Attribute. */
1165 std::vector<std::string> value() const {
1166 return m_val;
1167 }
1168
1169 /** @brief set the value associated to this Attribute. */
1170 void set_value(const std::vector<std::string>& i) {
1171 m_val = i;
1172 }
1173
1174private:
1175 std::vector<std::string> m_val; ///< Attribute value
1176};
1177
1178
1179} // namespace HepMC3
1180
1181#endif
Base attribute class.
Definition: Attribute.h:44
virtual ~Attribute()
Virtual destructor.
Definition: Attribute.h:54
const std::string & unparsed_string() const
Get unparsed string.
Definition: Attribute.h:105
Attribute(const std::string &st)
Protected constructor that allows to set string.
Definition: Attribute.h:66
bool is_parsed() const
Check if this attribute is parsed.
Definition: Attribute.h:102
ConstGenVertexPtr vertex() const
Definition: Attribute.h:128
const GenEvent * event() const
Definition: Attribute.h:108
Attribute()
Default constructor.
Definition: Attribute.h:51
ConstGenParticlePtr particle() const
Definition: Attribute.h:118
std::string m_string
Raw (unparsed) string.
Definition: Attribute.h:144
const GenEvent * m_event
Definition: Attribute.h:145
GenParticlePtr particle()
Definition: Attribute.h:113
virtual bool from_string(const std::string &att)=0
Fill class content from string.
GenVertexPtr vertex()
Definition: Attribute.h:123
GenVertexPtr m_vertex
Vertex to which assigned.
Definition: Attribute.h:148
void set_unparsed_string(const std::string &st)
Set unparsed string.
Definition: Attribute.h:137
virtual bool to_string(std::string &att) const =0
Fill string from class content.
GenParticlePtr m_particle
controlling GenEvent object.
Definition: Attribute.h:147
virtual bool init(const GenRunInfo &)
Optionally initialize the attribute after from_string.
Definition: Attribute.h:90
virtual bool init()
Optionally initialize the attribute after from_string.
Definition: Attribute.h:81
void set_is_parsed(bool flag)
Set is_parsed flag.
Definition: Attribute.h:134
bool m_is_parsed
Is this attribute parsed?
Definition: Attribute.h:143
Attribute that holds an Booleger implemented as an int.
Definition: Attribute.h:639
BoolAttribute(bool val)
Constructor initializing attribute value.
Definition: Attribute.h:646
BoolAttribute()
Default constructor.
Definition: Attribute.h:643
bool value() const
get the value associated to this Attribute.
Definition: Attribute.h:663
bool m_val
Attribute value.
Definition: Attribute.h:673
bool from_string(const std::string &att) override
Implementation of Attribute::from_string.
Definition: Attribute.h:649
void set_value(const bool &i)
set the value associated to this Attribute.
Definition: Attribute.h:668
bool to_string(std::string &att) const override
Implementation of Attribute::to_string.
Definition: Attribute.h:657
Attribute that holds an Chareger implemented as an int.
Definition: Attribute.h:379
CharAttribute(char val)
Constructor initializing attribute value.
Definition: Attribute.h:386
CharAttribute()
Default constructor.
Definition: Attribute.h:383
void set_value(const char &i)
set the value associated to this Attribute.
Definition: Attribute.h:410
char value() const
get the value associated to this Attribute.
Definition: Attribute.h:405
bool from_string(const std::string &att) override
Implementation of Attribute::from_string.
Definition: Attribute.h:389
bool to_string(std::string &att) const override
Implementation of Attribute::to_string.
Definition: Attribute.h:399
char m_val
Attribute value.
Definition: Attribute.h:415
Attribute that holds a real number as a double.
Definition: Attribute.h:241
double m_val
Attribute value.
Definition: Attribute.h:277
void set_value(const double &d)
set the value associated to this Attribute.
Definition: Attribute.h:271
double value() const
get the value associated to this Attribute.
Definition: Attribute.h:266
DoubleAttribute()
Default constructor.
Definition: Attribute.h:245
bool from_string(const std::string &att) override
Implementation of Attribute::from_string.
Definition: Attribute.h:251
DoubleAttribute(double val)
Constructor initializing attribute value.
Definition: Attribute.h:248
bool to_string(std::string &att) const override
Implementation of Attribute::to_string.
Definition: Attribute.h:257
Attribute that holds a real number as a float.
Definition: Attribute.h:286
float m_val
Attribute value.
Definition: Attribute.h:322
FloatAttribute()
Default constructor.
Definition: Attribute.h:290
bool from_string(const std::string &att) override
Implementation of Attribute::from_string.
Definition: Attribute.h:296
FloatAttribute(float val)
Constructor initializing attribute value.
Definition: Attribute.h:293
void set_value(const float &f)
set the value associated to this Attribute.
Definition: Attribute.h:316
float value() const
get the value associated to this Attribute.
Definition: Attribute.h:311
bool to_string(std::string &att) const override
Implementation of Attribute::to_string.
Definition: Attribute.h:302
Stores event-related information.
Definition: GenEvent.h:41
Stores run-related information.
Definition: GenRunInfo.h:33
Attribute that holds an Integer implemented as an int.
Definition: Attribute.h:157
int m_val
Attribute value.
Definition: Attribute.h:189
void set_value(const int &i)
set the value associated to this Attribute.
Definition: Attribute.h:184
IntAttribute()
Default constructor.
Definition: Attribute.h:161
int value() const
get the value associated to this Attribute.
Definition: Attribute.h:179
bool from_string(const std::string &att) override
Implementation of Attribute::from_string.
Definition: Attribute.h:167
IntAttribute(int val)
Constructor initializing attribute value.
Definition: Attribute.h:164
bool to_string(std::string &att) const override
Implementation of Attribute::to_string.
Definition: Attribute.h:173
Attribute that holds an Integer implemented as an int.
Definition: Attribute.h:198
long m_val
Attribute value.
Definition: Attribute.h:231
LongAttribute(long val)
Constructor initializing attribute value.
Definition: Attribute.h:205
void set_value(const long &l)
set the value associated to this Attribute.
Definition: Attribute.h:225
long value() const
get the value associated to this Attribute.
Definition: Attribute.h:220
bool from_string(const std::string &att) override
Implementation of Attribute::from_string.
Definition: Attribute.h:208
LongAttribute()
Default constructor.
Definition: Attribute.h:202
bool to_string(std::string &att) const override
Implementation of Attribute::to_string.
Definition: Attribute.h:214
Attribute that holds a real number as a double.
Definition: Attribute.h:467
long double m_val
Attribute value.
Definition: Attribute.h:503
LongDoubleAttribute()
Default constructor.
Definition: Attribute.h:471
LongDoubleAttribute(long double val)
Constructor initializing attribute value.
Definition: Attribute.h:474
bool from_string(const std::string &att) override
Implementation of Attribute::from_string.
Definition: Attribute.h:477
void set_value(const long double &d)
set the value associated to this Attribute.
Definition: Attribute.h:497
long double value() const
get the value associated to this Attribute.
Definition: Attribute.h:492
bool to_string(std::string &att) const override
Implementation of Attribute::to_string.
Definition: Attribute.h:483
Attribute that holds an Integer implemented as an int.
Definition: Attribute.h:424
long long value() const
get the value associated to this Attribute.
Definition: Attribute.h:446
void set_value(const long long &l)
set the value associated to this Attribute.
Definition: Attribute.h:451
bool from_string(const std::string &att) override
Implementation of Attribute::from_string.
Definition: Attribute.h:434
LongLongAttribute(long long val)
Constructor initializing attribute value.
Definition: Attribute.h:431
LongLongAttribute()
Default constructor.
Definition: Attribute.h:428
long long m_val
Attribute value.
Definition: Attribute.h:457
bool to_string(std::string &att) const override
Implementation of Attribute::to_string.
Definition: Attribute.h:440
Attribute that holds a string.
Definition: Attribute.h:335
StringAttribute()
Default constructor - empty string.
Definition: Attribute.h:339
void set_value(const std::string &s)
set the value associated to this Attribute.
Definition: Attribute.h:367
StringAttribute(const std::string &st)
String-based constructor.
Definition: Attribute.h:347
bool from_string(const std::string &att) override
Implementation of Attribute::from_string.
Definition: Attribute.h:350
std::string value() const
get the value associated to this Attribute.
Definition: Attribute.h:362
bool to_string(std::string &att) const override
Implementation of Attribute::to_string.
Definition: Attribute.h:356
Attribute that holds an unsigned int.
Definition: Attribute.h:514
void set_value(const unsigned int &i)
set the value associated to this Attribute.
Definition: Attribute.h:541
unsigned int value() const
get the value associated to this Attribute.
Definition: Attribute.h:536
UIntAttribute(unsigned int val)
Constructor initializing attribute value.
Definition: Attribute.h:521
bool from_string(const std::string &att) override
Implementation of Attribute::from_string.
Definition: Attribute.h:524
unsigned int m_val
Attribute value.
Definition: Attribute.h:546
UIntAttribute()
Default constructor.
Definition: Attribute.h:518
bool to_string(std::string &att) const override
Implementation of Attribute::to_string.
Definition: Attribute.h:530
Attribute that holds an unsigned long.
Definition: Attribute.h:557
ULongAttribute()
Default constructor.
Definition: Attribute.h:561
ULongAttribute(unsigned long val)
Constructor initializing attribute value.
Definition: Attribute.h:564
void set_value(const unsigned long &i)
set the value associated to this Attribute.
Definition: Attribute.h:584
unsigned long m_val
Attribute value.
Definition: Attribute.h:589
unsigned long value() const
get the value associated to this Attribute.
Definition: Attribute.h:579
bool from_string(const std::string &att) override
Implementation of Attribute::from_string.
Definition: Attribute.h:567
bool to_string(std::string &att) const override
Implementation of Attribute::to_string.
Definition: Attribute.h:573
Attribute that holds an unsigned long long.
Definition: Attribute.h:599
unsigned long long m_val
Attribute value.
Definition: Attribute.h:631
unsigned long long value() const
get the value associated to this Attribute.
Definition: Attribute.h:621
ULongLongAttribute()
Default constructor.
Definition: Attribute.h:603
bool from_string(const std::string &att) override
Implementation of Attribute::from_string.
Definition: Attribute.h:609
void set_value(const unsigned long long &i)
set the value associated to this Attribute.
Definition: Attribute.h:626
bool to_string(std::string &att) const override
Implementation of Attribute::to_string.
Definition: Attribute.h:615
ULongLongAttribute(unsigned long long val)
Constructor initializing attribute value.
Definition: Attribute.h:606
Attribute that holds a vector of charegers of type char.
Definition: Attribute.h:682
VectorCharAttribute(std::vector< char > val)
Constructor initializing attribute value.
Definition: Attribute.h:689
std::vector< char > value() const
get the value associated to this Attribute.
Definition: Attribute.h:708
std::vector< char > m_val
Attribute value.
Definition: Attribute.h:718
void set_value(const std::vector< char > &i)
set the value associated to this Attribute.
Definition: Attribute.h:713
bool from_string(const std::string &att) override
Implementation of Attribute::from_string.
Definition: Attribute.h:692
VectorCharAttribute()
Default constructor.
Definition: Attribute.h:686
bool to_string(std::string &att) const override
Implementation of Attribute::to_string.
Definition: Attribute.h:701
Attribute that holds a vector of FPs of type double.
Definition: Attribute.h:1091
std::vector< double > value() const
get the value associated to this Attribute.
Definition: Attribute.h:1117
void set_value(const std::vector< double > &i)
set the value associated to this Attribute.
Definition: Attribute.h:1122
bool from_string(const std::string &att) override
Implementation of Attribute::from_string.
Definition: Attribute.h:1101
std::vector< double > m_val
Attribute value.
Definition: Attribute.h:1127
VectorDoubleAttribute(std::vector< double > val)
Constructor initializing attribute value.
Definition: Attribute.h:1098
bool to_string(std::string &att) const override
Implementation of Attribute::to_string.
Definition: Attribute.h:1110
VectorDoubleAttribute()
Default constructor.
Definition: Attribute.h:1095
Attribute that holds a vector of floategers of type float.
Definition: Attribute.h:727
VectorFloatAttribute(std::vector< float > val)
Constructor initializing attribute value.
Definition: Attribute.h:734
std::vector< float > value() const
get the value associated to this Attribute.
Definition: Attribute.h:753
void set_value(const std::vector< float > &i)
set the value associated to this Attribute.
Definition: Attribute.h:758
bool from_string(const std::string &att) override
Implementation of Attribute::from_string.
Definition: Attribute.h:737
VectorFloatAttribute()
Default constructor.
Definition: Attribute.h:731
std::vector< float > m_val
Attribute value.
Definition: Attribute.h:763
bool to_string(std::string &att) const override
Implementation of Attribute::to_string.
Definition: Attribute.h:746
Attribute that holds a vector of integers of type int.
Definition: Attribute.h:1001
std::vector< int > value() const
get the value associated to this Attribute.
Definition: Attribute.h:1027
std::vector< int > m_val
Attribute value.
Definition: Attribute.h:1037
bool from_string(const std::string &att) override
Implementation of Attribute::from_string.
Definition: Attribute.h:1011
VectorIntAttribute()
Default constructor.
Definition: Attribute.h:1005
bool to_string(std::string &att) const override
Implementation of Attribute::to_string.
Definition: Attribute.h:1020
void set_value(const std::vector< int > &i)
set the value associated to this Attribute.
Definition: Attribute.h:1032
VectorIntAttribute(std::vector< int > val)
Constructor initializing attribute value.
Definition: Attribute.h:1008
Attribute that holds a vector of long doubleegers of type long double.
Definition: Attribute.h:773
std::vector< long double > value() const
get the value associated to this Attribute.
Definition: Attribute.h:799
void set_value(const std::vector< long double > &i)
set the value associated to this Attribute.
Definition: Attribute.h:804
VectorLongDoubleAttribute()
Default constructor.
Definition: Attribute.h:777
std::vector< long double > m_val
Attribute value.
Definition: Attribute.h:809
VectorLongDoubleAttribute(std::vector< long double > val)
Constructor initializing attribute value.
Definition: Attribute.h:780
bool from_string(const std::string &att) override
Implementation of Attribute::from_string.
Definition: Attribute.h:783
bool to_string(std::string &att) const override
Implementation of Attribute::to_string.
Definition: Attribute.h:792
Attribute that holds a vector of integers of type int.
Definition: Attribute.h:1046
VectorLongIntAttribute(std::vector< long int > val)
Constructor initializing attribute value.
Definition: Attribute.h:1053
VectorLongIntAttribute()
Default constructor.
Definition: Attribute.h:1050
std::vector< long int > value() const
get the value associated to this Attribute.
Definition: Attribute.h:1072
bool from_string(const std::string &att) override
Implementation of Attribute::from_string.
Definition: Attribute.h:1056
std::vector< long int > m_val
Attribute value.
Definition: Attribute.h:1082
void set_value(const std::vector< long int > &i)
set the value associated to this Attribute.
Definition: Attribute.h:1077
bool to_string(std::string &att) const override
Implementation of Attribute::to_string.
Definition: Attribute.h:1065
Attribute that holds a vector of long longegers of type long long.
Definition: Attribute.h:820
std::vector< long long > value() const
get the value associated to this Attribute.
Definition: Attribute.h:846
std::vector< long long > m_val
Attribute value.
Definition: Attribute.h:856
bool from_string(const std::string &att) override
Implementation of Attribute::from_string.
Definition: Attribute.h:830
VectorLongLongAttribute()
Default constructor.
Definition: Attribute.h:824
void set_value(const std::vector< long long > &i)
set the value associated to this Attribute.
Definition: Attribute.h:851
VectorLongLongAttribute(std::vector< long long > val)
Constructor initializing attribute value.
Definition: Attribute.h:827
bool to_string(std::string &att) const override
Implementation of Attribute::to_string.
Definition: Attribute.h:839
Attribute that holds a vector of FPs of type string.
Definition: Attribute.h:1137
bool from_string(const string &att) override
Implementation of Attribute::from_string.
Definition: Attribute.h:1147
std::vector< std::string > value() const
get the value associated to this Attribute.
Definition: Attribute.h:1165
void set_value(const std::vector< std::string > &i)
set the value associated to this Attribute.
Definition: Attribute.h:1170
VectorStringAttribute(std::vector< std::string > val)
Constructor initializing attribute value.
Definition: Attribute.h:1144
VectorStringAttribute()
Default constructor.
Definition: Attribute.h:1141
bool to_string(std::string &att) const override
Implementation of Attribute::to_string.
Definition: Attribute.h:1158
std::vector< std::string > m_val
Attribute value.
Definition: Attribute.h:1175
Attribute that holds a vector of unsigned integers of type unsigned int.
Definition: Attribute.h:865
VectorUIntAttribute()
Default constructor.
Definition: Attribute.h:869
std::vector< unsigned int > m_val
Attribute value.
Definition: Attribute.h:901
VectorUIntAttribute(std::vector< unsigned int > val)
Constructor initializing attribute value.
Definition: Attribute.h:872
std::vector< unsigned int > value() const
get the value associated to this Attribute.
Definition: Attribute.h:891
bool from_string(const std::string &att) override
Implementation of Attribute::from_string.
Definition: Attribute.h:875
void set_value(const std::vector< unsigned int > &i)
set the value associated to this Attribute.
Definition: Attribute.h:896
bool to_string(std::string &att) const override
Implementation of Attribute::to_string.
Definition: Attribute.h:884
Attribute that holds a vector of unsigned longegers of type unsigned long.
Definition: Attribute.h:910
void set_value(const std::vector< unsigned long > &i)
set the value associated to this Attribute.
Definition: Attribute.h:941
std::vector< unsigned long > value() const
get the value associated to this Attribute.
Definition: Attribute.h:936
std::vector< unsigned long > m_val
Attribute value.
Definition: Attribute.h:946
bool from_string(const std::string &att) override
Implementation of Attribute::from_string.
Definition: Attribute.h:920
VectorULongAttribute()
Default constructor.
Definition: Attribute.h:914
VectorULongAttribute(std::vector< unsigned long > val)
Constructor initializing attribute value.
Definition: Attribute.h:917
bool to_string(std::string &att) const override
Implementation of Attribute::to_string.
Definition: Attribute.h:929
Attribute that holds a vector of unsigned long longegers of type unsigned long long.
Definition: Attribute.h:956
std::vector< unsigned long long > value() const
get the value associated to this Attribute.
Definition: Attribute.h:982
VectorULongLongAttribute(std::vector< unsigned long long > val)
Constructor initializing attribute value.
Definition: Attribute.h:963
void set_value(const std::vector< unsigned long long > &i)
set the value associated to this Attribute.
Definition: Attribute.h:987
bool from_string(const std::string &att) override
Implementation of Attribute::from_string.
Definition: Attribute.h:966
std::vector< unsigned long long > m_val
Attribute value.
Definition: Attribute.h:992
bool to_string(std::string &att) const override
Implementation of Attribute::to_string.
Definition: Attribute.h:975
VectorULongLongAttribute()
Default constructor.
Definition: Attribute.h:960
HepMC3 main namespace.