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