#ifndef TG4VHit_hxx_seen #define TG4VHit_hxx_seen #include #include #include "IDatum.hxx" #include "IG4Trajectory.hxx" #include "IHandle.hxx" #include "ITrackIDMap.hxx" namespace COMET { class IG4VHit; class IG4HitContainer; } /// DO NOT USE THIS CLASS IN ANALYSIS CODE. /// /// This is an abstract base class used to save G4Hit objects into a root /// output file. It contains the information that all hits from the /// simulation should save into the output file, and allows the rest of the /// code to handle hits in a polymorphic way. It must be inherited by an /// specific instance class to actually save MC information. The SIMG4 /// expects the electronics response to be simulated off-line, and to assign /// the sensor identifiers to each hit. /// /// In the SIMG4, this class is multiply inherited with G4VHit to create a /// class that can be used in a G4HitCollection. The behavior is designed so /// that the IG4VHit inherited classes in oaEvent contain all of the payload /// for the hit, and class in COMETmc contains all of the interface related to /// the G4 infrastructure. class COMET::IG4VHit: public TObject { public: IG4VHit(); IG4VHit(const IG4VHit& rhs); virtual ~IG4VHit(); /// Print the hit information. virtual void ls(Option_t * = "") const; /// Get the TrackId of the "interesting" particle that is associated with /// this hit. This changes depending on the type of hit the concrete class /// is, but should be the "track of primary importance". virtual int GetPrimaryId(void) const {return fPrimaryId;} /// Impose a new mapping from old primary track id to new primary track id /// Technically a setter function... virtual void MapTrackIDs(ITrackIDMap* aMap) {fPrimaryId = aMap->Get(fPrimaryId);}; /// Return the trajectory that corresponds to the primaryId, NULL if it /// cannot be found virtual const COMET::IHandle GetTrajectory()const; /// The X position of the hit virtual double GetPosX(void) const = 0; /// The Y position of the hit virtual double GetPosY(void) const = 0; /// The Z position of the hit virtual double GetPosZ(void) const = 0; /// The time of the hit virtual double GetPosT(void) const = 0; /// Get the magnitude of the momentum of the incident particle virtual double GetMomentumMag(void) const = 0; /// Get the weight of the trajectory giving this hit. /// Return -1 if the trajectory is not available virtual float GetWeight() const; protected: Int_t fPrimaryId; /// The track id of the primary trajectory ClassDef(IG4VHit,4); }; /// A container for the G4 hit detector element information. class COMET::IG4HitContainer : public IDatum, public std::vector { public: IG4HitContainer(const char* name="G4hits", const char* title="G4 Hit Information") : IDatum(name,title) {}; virtual ~IG4HitContainer(); /// Print the data vector information. virtual void ls(Option_t* opt = "") const; private: /// Copying a IG4HitContainer is illegal. A IG4HitContainer cannot be copied /// since the members are pointers to hits. A copy /// of a IG4HitContainer would result in double deletes of objects, or require /// that the object is not completely copied. Since neither option is /// acceptable (i.e. illegal, or doesn't meet the required symantics for a /// copy), there is no copy constructor. IG4HitContainer(const IG4HitContainer&); /// Assigning a IG4HitContainer is illegal. Assignment is illegal for the /// same reasons as the copy constructor. IG4HitContainer& operator = (const IG4HitContainer&); ClassDef(IG4HitContainer,1); }; #endif