CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FiberG4Hit.h
Go to the documentation of this file.
1 #ifndef SimG4CMS_ShowerLibraryProducer_FiberG4Hit_h
2 #define SimG4CMS_ShowerLibraryProducer_FiberG4Hit_h
3 
6 
7 #include "G4VHit.hh"
8 #include "G4THitsCollection.hh"
9 #include "G4Allocator.hh"
10 #include "G4LogicalVolume.hh"
11 
12 #include <boost/cstdint.hpp>
13 #include <vector>
14 
15 class FiberG4Hit : public G4VHit {
16 
17 public:
18 
19  FiberG4Hit();
20  FiberG4Hit(G4LogicalVolume* logVol, G4int tower, G4int depth, G4int tkID);
21  virtual ~FiberG4Hit();
22  FiberG4Hit(const FiberG4Hit &right);
23  const FiberG4Hit& operator=(const FiberG4Hit &right);
24  G4int operator==(const FiberG4Hit &right) const;
25 
26  inline void *operator new(size_t);
27  inline void operator delete(void *aHit);
28 
29 private:
30 
31  G4int theTowerId;
32  G4int theDepth;
33  G4int theTrackId;
34  G4int theNpe;
35  G4double theTime;
37  std::vector<HFShowerPhoton> thePhoton;
38  const G4LogicalVolume* theLogV;
39 
40 public:
41 
42  inline void setTowerId(G4int tower) {theTowerId = tower;}
43  inline void setDepth(G4int depth) {theDepth = depth;}
44  inline void setNpe(G4int npe) {theNpe = npe;}
45  inline void setPos(const math::XYZPoint& xyz) {theHitPos = xyz;}
46  inline void setTime(G4double t) {theTime = t; }
47  inline void setPhoton(const std::vector<HFShowerPhoton>& photon) {thePhoton = photon; }
48 
49  inline G4int towerId() const {return theTowerId;}
50  inline G4int depth() const {return theDepth;}
51  inline G4int trackId() const {return theTrackId;}
52  inline G4int npe() const {return theNpe;}
53  math::XYZPoint hitPos() const {return theHitPos;};
54  inline G4double time() const {return theTime;}
55  std::vector<HFShowerPhoton> photon() const {return thePhoton;}
56  inline void add(G4int npe) {theNpe +=npe;}
57 };
58 
59 typedef G4THitsCollection<FiberG4Hit> FiberG4HitsCollection;
60 
61 extern G4ThreadLocal G4Allocator<FiberG4Hit> *fFiberG4HitAllocator;
62 
63 inline void* FiberG4Hit::operator new(size_t) {
65  new G4Allocator<FiberG4Hit>;
66  return (void*)fFiberG4HitAllocator->MallocSingle();
67 }
68 
69 inline void FiberG4Hit::operator delete(void *aHit) {
70  fFiberG4HitAllocator->FreeSingle((FiberG4Hit*) aHit);
71 }
72 #endif
G4int theTrackId
Definition: FiberG4Hit.h:33
G4int depth() const
Definition: FiberG4Hit.h:50
G4double theTime
Definition: FiberG4Hit.h:35
void setNpe(G4int npe)
Definition: FiberG4Hit.h:44
G4int operator==(const FiberG4Hit &right) const
Definition: FiberG4Hit.cc:40
std::vector< HFShowerPhoton > thePhoton
Definition: FiberG4Hit.h:37
G4int theTowerId
Definition: FiberG4Hit.h:31
G4int towerId() const
Definition: FiberG4Hit.h:49
std::vector< HFShowerPhoton > photon() const
Definition: FiberG4Hit.h:55
G4double time() const
Definition: FiberG4Hit.h:54
void setTowerId(G4int tower)
Definition: FiberG4Hit.h:42
const FiberG4Hit & operator=(const FiberG4Hit &right)
Definition: FiberG4Hit.cc:30
math::XYZPoint hitPos() const
Definition: FiberG4Hit.h:53
const G4LogicalVolume * theLogV
Definition: FiberG4Hit.h:38
void setPos(const math::XYZPoint &xyz)
Definition: FiberG4Hit.h:45
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
G4THitsCollection< FiberG4Hit > FiberG4HitsCollection
Definition: FiberG4Hit.h:59
G4int theNpe
Definition: FiberG4Hit.h:34
G4int npe() const
Definition: FiberG4Hit.h:52
virtual ~FiberG4Hit()
Definition: FiberG4Hit.cc:19
math::XYZPoint theHitPos
Definition: FiberG4Hit.h:36
void setTime(G4double t)
Definition: FiberG4Hit.h:46
G4ThreadLocal G4Allocator< FiberG4Hit > * fFiberG4HitAllocator
Definition: FiberG4Hit.cc:5
void add(G4int npe)
Definition: FiberG4Hit.h:56
G4int theDepth
Definition: FiberG4Hit.h:32
G4int trackId() const
Definition: FiberG4Hit.h:51
void setPhoton(const std::vector< HFShowerPhoton > &photon)
Definition: FiberG4Hit.h:47
void setDepth(G4int depth)
Definition: FiberG4Hit.h:43