CMS 3D CMS Logo

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 <vector>
13 
14 class FiberG4Hit : public G4VHit {
15 public:
16  FiberG4Hit();
17  FiberG4Hit(G4LogicalVolume *logVol, G4int tower, G4int depth, G4int tkID);
18  ~FiberG4Hit() override;
19  FiberG4Hit(const FiberG4Hit &right);
20  const FiberG4Hit &operator=(const FiberG4Hit &right);
21  G4int operator==(const FiberG4Hit &right) const;
22 
23  inline void *operator new(size_t);
24  inline void operator delete(void *aHit);
25 
26 private:
27  G4int theTowerId;
28  G4int theDepth;
29  G4int theTrackId;
30  G4int theNpe;
31  G4double theTime;
33  std::vector<HFShowerPhoton> thePhoton;
34  const G4LogicalVolume *theLogV;
35 
36 public:
37  inline void setTowerId(G4int tower) { theTowerId = tower; }
38  inline void setDepth(G4int depth) { theDepth = depth; }
39  inline void setNpe(G4int npe) { theNpe = npe; }
40  inline void setPos(const math::XYZPoint &xyz) { theHitPos = xyz; }
41  inline void setTime(G4double t) { theTime = t; }
42  inline void setPhoton(const std::vector<HFShowerPhoton> &photon) { thePhoton = photon; }
43 
44  inline G4int towerId() const { return theTowerId; }
45  inline G4int depth() const { return theDepth; }
46  inline G4int trackId() const { return theTrackId; }
47  inline G4int npe() const { return theNpe; }
48  math::XYZPoint hitPos() const { return theHitPos; };
49  inline G4double time() const { return theTime; }
50  std::vector<HFShowerPhoton> photon() const { return thePhoton; }
51  inline void add(G4int npe) { theNpe += npe; }
52 };
53 
54 typedef G4THitsCollection<FiberG4Hit> FiberG4HitsCollection;
55 
56 extern G4ThreadLocal G4Allocator<FiberG4Hit> *fFiberG4HitAllocator;
57 
58 inline void *FiberG4Hit::operator new(size_t) {
60  fFiberG4HitAllocator = new G4Allocator<FiberG4Hit>;
61  return (void *)fFiberG4HitAllocator->MallocSingle();
62 }
63 
64 inline void FiberG4Hit::operator delete(void *aHit) { fFiberG4HitAllocator->FreeSingle((FiberG4Hit *)aHit); }
65 #endif
FiberG4Hit::theTowerId
G4int theTowerId
Definition: FiberG4Hit.h:27
fFiberG4HitAllocator
G4ThreadLocal G4Allocator< FiberG4Hit > * fFiberG4HitAllocator
Definition: FiberG4Hit.cc:4
FiberG4Hit::operator=
const FiberG4Hit & operator=(const FiberG4Hit &right)
Definition: FiberG4Hit.cc:26
FiberG4Hit::setPos
void setPos(const math::XYZPoint &xyz)
Definition: FiberG4Hit.h:40
FiberG4Hit::setTowerId
void setTowerId(G4int tower)
Definition: FiberG4Hit.h:37
hgcalTowerProducer_cfi.tower
tower
Definition: hgcalTowerProducer_cfi.py:3
FiberG4Hit::theLogV
const G4LogicalVolume * theLogV
Definition: FiberG4Hit.h:34
FiberG4Hit::trackId
G4int trackId() const
Definition: FiberG4Hit.h:46
FiberG4Hit::theHitPos
math::XYZPoint theHitPos
Definition: FiberG4Hit.h:32
FiberG4Hit::theNpe
G4int theNpe
Definition: FiberG4Hit.h:30
Utilities.operator
operator
Definition: Utilities.py:24
FiberG4Hit::add
void add(G4int npe)
Definition: FiberG4Hit.h:51
FiberG4Hit
Definition: FiberG4Hit.h:14
FiberG4Hit::npe
G4int npe() const
Definition: FiberG4Hit.h:47
FiberG4Hit::setPhoton
void setPhoton(const std::vector< HFShowerPhoton > &photon)
Definition: FiberG4Hit.h:42
FiberG4Hit::setTime
void setTime(G4double t)
Definition: FiberG4Hit.h:41
FiberG4Hit::setDepth
void setDepth(G4int depth)
Definition: FiberG4Hit.h:38
FiberG4Hit::theDepth
G4int theDepth
Definition: FiberG4Hit.h:28
FiberG4Hit::time
G4double time() const
Definition: FiberG4Hit.h:49
FiberG4Hit::theTrackId
G4int theTrackId
Definition: FiberG4Hit.h:29
OrderedSet.t
t
Definition: OrderedSet.py:90
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
FiberG4Hit::depth
G4int depth() const
Definition: FiberG4Hit.h:45
FiberG4Hit::towerId
G4int towerId() const
Definition: FiberG4Hit.h:44
FiberG4Hit::hitPos
math::XYZPoint hitPos() const
Definition: FiberG4Hit.h:48
FiberG4Hit::theTime
G4double theTime
Definition: FiberG4Hit.h:31
FiberG4Hit::~FiberG4Hit
~FiberG4Hit() override
Definition: FiberG4Hit.cc:15
FiberG4Hit::setNpe
void setNpe(G4int npe)
Definition: FiberG4Hit.h:39
FiberG4Hit::operator==
G4int operator==(const FiberG4Hit &right) const
Definition: FiberG4Hit.cc:36
FiberG4Hit::FiberG4Hit
FiberG4Hit()
Definition: FiberG4Hit.cc:6
Point3D.h
FiberG4Hit::thePhoton
std::vector< HFShowerPhoton > thePhoton
Definition: FiberG4Hit.h:33
HFShowerPhoton.h
FiberG4HitsCollection
G4THitsCollection< FiberG4Hit > FiberG4HitsCollection
Definition: FiberG4Hit.h:54
FiberG4Hit::photon
std::vector< HFShowerPhoton > photon() const
Definition: FiberG4Hit.h:50