er  dev
ERBeamDet.h
1 /********************************************************************************
2  * Copyright (C) Joint Institute for Nuclear Research *
3  * *
4  * This software is distributed under the terms of the *
5  * GNU Lesser General Public Licence version 3 (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
8 
9 #ifndef ERBeamDet_H
10 #define ERBeamDet_H
11 
12 #include "TLorentzVector.h"
13 #include "TClonesArray.h"
14 
15 #include "ERDetector.h"
16 #include "ERBeamDetTOFPoint.h"
17 #include "ERBeamDetMWPCPoint.h"
18 #include "ERBeamDetTargetPoint.h"
19 #include "ERBeamDetTrack.h"
20 #include "ERBeamDetParticle.h"
21 #include "ERBeamDetSetup.h"
22 
31 class ERBeamDet : public ERDetector {
32  public:
34  ERBeamDet();
40  ERBeamDet(const char* name, Bool_t active, Int_t verbose);
42  virtual ~ERBeamDet();
43  void SetIonName(const TString& ionName) {fIonName = ionName; fIonPIDIsSet = kTRUE;}
44  void SetIonPID(int ionPID) {fIonPID = ionPID; fIonPIDIsSet = kTRUE;}
45  public:
50  virtual Bool_t ProcessHits(FairVolume* vol = 0);
54  virtual void EndOfEvent();
57  virtual void Register();
60  virtual TClonesArray* GetCollection(Int_t iColl) const;
63  virtual void Print(Option_t *option="") const;
66  virtual void Reset();
72  virtual void CopyClones(TClonesArray* cl1, TClonesArray* cl2, Int_t offset);
75  virtual void Initialize();
81  virtual Bool_t CheckIfSensitive(std::string name);
85  virtual void ConstructGeometry();
86  private:
87  ERBeamDetSetup* fSetup = nullptr;
94  private:
95  TClonesArray* fToFPoints = nullptr;
96  TClonesArray* fMWPCPoints = nullptr;
97  TClonesArray* fTargetPoints = nullptr;
98  Int_t fEventID = -1;
99  Int_t fTrackID = -1;
100  Int_t Mot0TrackID = -1; //< mother track index
101  Int_t fPID = -1;
102  TLorentzVector fPosIn;
103  TLorentzVector fPosOut;
104  TLorentzVector fMomIn;
105  TLorentzVector fMomOut;
106  Double32_t fTime = 0.;
107  Double32_t fLength = 0.;
108  Double32_t ELoss = 0.;
109  Double32_t fLightYield = 0.;
110  Int_t fToFNb = -1;
111  Int_t fMWPCNb = -1;
112  Int_t fMWPCPlaneNb = -1;
113  Int_t fMWPCWireNb = -1;
114  Bool_t fSensitiveTargetIsSet = kFALSE;
115  TString fIonName;
116  Int_t fIonPID = -1;
117  Bool_t fIonPIDIsSet = kFALSE;
118  ClassDef(ERBeamDet,1);
119 };
120 
121 #endif
ERBeamDetTOFPoint * AddTOFPoint()
Adds a ERBeamDetToFPoint to the ToFPoints Collection.
Definition: ERBeamDet.cxx:156
Class for the MC transport of the BeamDet.
Definition: ERBeamDet.h:31
virtual ~ERBeamDet()
Destructor.
Definition: ERBeamDet.cxx:41
virtual Bool_t ProcessHits(FairVolume *vol=0)
Defines the action to be taken when a step is inside the active volume. Creates a ERBeamDetPoint and ...
Definition: ERBeamDet.cxx:188
ERBeamDet()
Default constructor.
Definition: ERBeamDet.cxx:23
TClonesArray * fTargetPoints
The TargetPoint collection.
Definition: ERBeamDet.h:97
virtual void Reset()
Clears the point collection. Virtual from FairDetector.
Definition: ERBeamDet.cxx:110
virtual TClonesArray * GetCollection(Int_t iColl) const
Accessor to the point collection . Abstract from FairDetector.
Definition: ERBeamDet.cxx:76
Int_t fEventID
event index
Definition: ERBeamDet.h:98
virtual void EndOfEvent()
If verbosity level is set, print point collection at the end of the event. Virtual from FairDetector...
Definition: ERBeamDet.cxx:54
TClonesArray * fMWPCPoints
The MWPCPoint collection.
Definition: ERBeamDet.h:96
ERBeamDetMWPCPoint * AddMWPCPoint()
Adds a ERBeamDetMWPCPoint to the MWPCPoints Collection.
Definition: ERBeamDet.cxx:144
ERBeamDetTargetPoint * AddTargetPoint()
Adds a ERBeamDetTargetPoint to the TargetPoints Collection.
Definition: ERBeamDet.cxx:131
TClonesArray * fToFPoints
The ToFPoint collection.
Definition: ERBeamDet.h:95
virtual void Initialize()
Initialize ERBeamDet data. Abstract from FairDetector.
Definition: ERBeamDet.cxx:50
Int_t fMWPCNb
MWPC station number.
Definition: ERBeamDet.h:111
virtual void Register()
Registers the point collection in the ROOT manager. Virtual from FairDetector.
Definition: ERBeamDet.cxx:60
virtual void ConstructGeometry()
Builds geometry and writes it to temporary file trough parameters from ERBeamDetSetup class object...
Definition: ERBeamDet.cxx:181
TLorentzVector fMomOut
point finish momentum
Definition: ERBeamDet.h:105
Int_t fMWPCWireNb
wire number in gas strip array
Definition: ERBeamDet.h:113
Double32_t fTime
point start time
Definition: ERBeamDet.h:106
TLorentzVector fMomIn
point start momentum
Definition: ERBeamDet.h:104
virtual Bool_t CheckIfSensitive(std::string name)
Check whether a volume is sensitive.
Definition: ERBeamDet.cxx:167
TLorentzVector fPosOut
point finish position
Definition: ERBeamDet.h:103
Double32_t fLightYield
light yield
Definition: ERBeamDet.h:109
Double32_t ELoss
energy loss
Definition: ERBeamDet.h:108
virtual void Print(Option_t *option="") const
Screen output of hit collection. Virtual from TObject.
Definition: ERBeamDet.cxx:88
Double32_t fLength
length
Definition: ERBeamDet.h:107
TLorentzVector fPosIn
point start position
Definition: ERBeamDet.h:102
virtual void CopyClones(TClonesArray *cl1, TClonesArray *cl2, Int_t offset)
Copies the hit collection with a given track index offset.
Definition: ERBeamDet.cxx:117
Int_t fToFNb
ToF plastic number.
Definition: ERBeamDet.h:110
The base class for detector simulation in er sim.
Definition: ERDetector.h:32
Int_t fPID
particle PDG
Definition: ERBeamDet.h:101
Int_t fTrackID
track index
Definition: ERBeamDet.h:99
Int_t fMWPCPlaneNb
gas strip array number in MWPC station
Definition: ERBeamDet.h:112