// McParent.hpp #ifndef gtr_McParent_H #define gtr_McParent_H #include // // This class describes the parents of a Monte Carlo // particle. To save space, only important parenthood // is preserved. This information is stored by setting // bits in the parentword. Users can either query the // McParent object for its pedigree through predefined // methods (e.g. bool from_z() ), or request a set // of all parents registered. // Note that we use the PDG numbering scheme, and deal // with int values. This is not typesafe and it is up // to the user to ensure that the input and/or output // values are used correctly. // A better design would define an McId object which would // encapsulate the particular numbering scheme, ensure // compile-time integrity, and provide users flexibility // in their particular choice of numbering schemes. // class McParent { private: // attributes // Version number int _version; // Particle Parentage int _parentword; private: //enums enum ParticleBit { UDS=1, CHARM=2, CBAR=4, BOTTOM=8, BBAR=16, TOP=32, TBAR=64, ZZERO=128, WMINUS=256, WPLUS=512, PSI=1024, UPSILON=2048, TAUMINUS=4096, TAUPLUS=8192}; public: //typedefs typedef std::set ParentList; public: //methods // Default constructor // Leaves object in an invalid state. McParent(); // Constructor from Parent word McParent( int parentword ); // Destructor ~McParent(); //Set the parentage, given the PDG ID of a parent void set_parent(int pdgid); //Return the parentword int get_parentword() const; // Return the list of parents for this track as // a set of integers representing the PDG particle ID. // Note that uds will return an ID=1 for brevity // Use a set to allow a quick "find" of a parent type. const ParentList parents() const; // Is particle from Z? bool from_z() const; // Is particle from W+? bool from_w_plus() const; // Is particle from W-? bool from_w_minus() const; // Is particle from tau+? bool from_tau_plus() const; // Is particle from tau-? bool from_tau_minus() const; // Is particle from psi? bool from_psi() const; // Is particle from upsilon? bool from_upsilon() const; // Is particle from top quark? bool from_t() const; // Is particle from anti-top quark? bool from_t_bar() const; // Is particle from bottom quark? bool from_b() const; // Is particle from anti-bottom quark? bool from_b_bar() const; // Is particle from charm quark? bool from_c() const; // Is particle from anti-charm quark? bool from_c_bar() const; // Is particle from u,d or s quark? bool from_uds() const; }; #endif