ACTARSim
ACTAR TPC Simulation Reference Guide
ActarSimROOTAnalGas.hh
Go to the documentation of this file.
1 // - AUTHOR: Hector Alvarez-Pol 04/2008
2 /******************************************************************
3  * Copyright (C) 2005-2016, Hector Alvarez-Pol *
4  * All rights reserved. *
5  * *
6  * License according to GNU LESSER GPL (see lgpl-3.0.txt). *
7  * For the list of contributors see CREDITS. *
8  ******************************************************************/
9 
10 #ifndef ActarSimROOTAnalGas_h
11 #define ActarSimROOTAnalGas_h 1
12 
13 #include "ActarSimROOTAnalysis.hh"
14 
15 class G4VPhysicalVolume;
16 class G4Event;
17 class G4Run;
18 class G4Track;
19 class G4Step;
20 
21 #include "G4ClassificationOfNewTrack.hh"
22 #include "G4TrackStatus.hh"
23 #include "G4Types.hh"
24 #include "G4PrimaryParticle.hh"
25 #include "ActarSimGasGeantHit.hh"
26 
27 class TH1D;
28 class TH2D;
29 class TH3D;
30 class TTree;
31 //class TBranch;
32 class TFile;
33 class TClonesArray;
34 class TProfile; // for hbeamEnergyAtRange, to get the energy loss as a function of the path length
35 
36 class ActarSimData;
37 class ActarSimTrack;
39 
41 private:
42  char* dirName;
43 
44  ActarSimData* theData; ///< Pointer to data
45  ActarSimTrack* theTracks; ///< Pointer to tracks
46 
47  ActarSimSimpleTrack** simpleTrack; ///< Pointer to simple tracks
48  TClonesArray* simpleTrackCA; ///< ClonesArray for simple tracks
49 
50  TFile* simFile; ///< Local pointer to simFile
51  TTree* eventTree; ///< Local pointer to the event tree
52  TTree* tracksTree; ///< Local pointer to the tracks tree
53 
54  TH1D *hStepSumLengthOnGas1; ///< Histogram: step Length on gas for first primary
55  TH1D *hStepSumLengthOnGas2; ///< Histogram: step Length on gas for second primary
56 
57  TH1D *hTotELossOnGas1; ///< Histogram: energy Loss on gas for first primary
58  TH1D *hTotELossOnGas2; ///< Histogram: energy Loss on gas for second primary
59 
60  TH2D *htrackInPads; ///< Histogram: all tracks projected in pads
61  TH2D *htrack1InPads; ///< Histogram: first primary track projected in pads
62  TH2D *htrack2InPads; ///< Histogram: second primary track projected in pads
63 
64  TH1D *hEdepInGas; ///< Histogram: energy deposit in Gas over the distance
65 
66  TProfile *hbeamEnergyAtRange; ///< Histogram profile: ccumulated energy loss and track length of each step
67 
68  TH2D *htrackFromBeam; ///< Histogram: tracks from beam direction
69 
70  TH3D *htrack; ///< Histogram: 3D track
71 
72  G4double minStrideLength; ///< Control of minimum simpleTrack stride length
73 
74  G4PrimaryParticle* primary; ///< Storing the primary for accesing during UserStep
75  G4int primNbOfParticles; ///< Number of primaries
76  G4double primEnergy; ///< Energy of primary
77  G4double primTheta; ///< Theta of primary
78  G4double primPhi; ///< Phi of primary
79 
80  G4int theRunID; ///< Run ID
81  G4int theEventID; ///< Event ID
82 
83 public:
86 
87  void init();
88 
89  TTree* GetEventTree(){return eventTree;}
90  void SetEventTree(TTree* tree) {eventTree = tree;}
91  TTree* GetTracksTree(){return tracksTree;}
92  void SetTracksTree(TTree* tree) {tracksTree = tree;}
93 
94  G4int GetTheEventID(){return theEventID;}
95  void SetTheEventID(G4int id){theEventID = id;}
96  G4int GetTheRunID(){return theRunID;}
97  void SetTheRunID(G4int id){theRunID = id;}
98 
100  G4double GetPrimEnergy(){return primEnergy;}
101  G4double GetPrimTheta(){return primTheta;}
102  G4double GetPrimPhi(){return primPhi;}
103 
104  void SetPrimNbOfParticles(G4int nb){primNbOfParticles = nb;}
105  void SetPrimEnergy(G4double pe){primEnergy = pe;}
106  void SetPrimTheta(G4double pt){primTheta = pt;}
107  void SetPrimPhi(G4double pp){primPhi = pp;}
108 
109  void SetMinStrideLength(G4double val) {minStrideLength = val;};
110 
111  TClonesArray* getSimpleTrackCA(void){return simpleTrackCA;}
112  void SetSimpleTrackCA(TClonesArray* CA) {simpleTrackCA = CA;}
113 
114  void GeneratePrimaries(const G4Event*);
115 
116  void BeginOfRunAction(const G4Run*);
117  void EndOfRunAction(const G4Run*);
118 
119  void BeginOfEventAction(const G4Event*);
120  void EndOfEventAction(const G4Event*);
121 
122  void UserSteppingAction(const G4Step*);
123 };
124 #endif
void SetMinStrideLength(G4double val)
void SetTracksTree(TTree *tree)
void SetPrimPhi(G4double pp)
void SetPrimNbOfParticles(G4int nb)
TTree * eventTree
Local pointer to the event tree.
TH1D * hStepSumLengthOnGas1
Histogram: step Length on gas for first primary.
ActarSimROOTAnalGas()
Default constructor... Simply inits.
TTree * tracksTree
Local pointer to the tracks tree.
void SetTheRunID(G4int id)
void EndOfRunAction(const G4Run *)
Actions to perform in the analysis at the end of the run.
TH3D * htrack
Histogram: 3D track.
G4PrimaryParticle * primary
Storing the primary for accesing during UserStep.
TH2D * htrackInPads
Histogram: all tracks projected in pads.
void SetEventTree(TTree *tree)
TClonesArray * simpleTrackCA
ClonesArray for simple tracks.
G4double primTheta
Theta of primary.
ActarSimTrack * theTracks
Pointer to tracks.
~ActarSimROOTAnalGas()
Destructor. Makes nothing.
void SetSimpleTrackCA(TClonesArray *CA)
void BeginOfEventAction(const G4Event *)
Actions to perform in the analysis at the begining of the event.
void BeginOfRunAction(const G4Run *)
Actions to perform in the analysis at the begining of the run.
G4double primPhi
Phi of primary.
TH2D * htrack2InPads
Histogram: second primary track projected in pads.
void SetTheEventID(G4int id)
void SetPrimEnergy(G4double pe)
ActarSimData * theData
Pointer to data.
void GeneratePrimaries(const G4Event *)
Actions to perform in the analysis when generating the primaries.
TProfile * hbeamEnergyAtRange
Histogram profile: ccumulated energy loss and track length of each step.
G4int primNbOfParticles
Number of primaries.
TFile * simFile
Local pointer to simFile.
G4double primEnergy
Energy of primary.
void SetPrimTheta(G4double pt)
TH1D * hEdepInGas
Histogram: energy deposit in Gas over the distance.
TH1D * hTotELossOnGas1
Histogram: energy Loss on gas for first primary.
G4double minStrideLength
Control of minimum simpleTrack stride length.
TClonesArray * getSimpleTrackCA(void)
TH1D * hStepSumLengthOnGas2
Histogram: step Length on gas for second primary.
void init()
Makes most of the work of a constructor...
G4int theEventID
Event ID.
ActarSimSimpleTrack ** simpleTrack
Pointer to simple tracks.
void EndOfEventAction(const G4Event *)
Actions to perform in the analysis at the end of the event.
TH2D * htrackFromBeam
Histogram: tracks from beam direction.
TH2D * htrack1InPads
Histogram: first primary track projected in pads.
void UserSteppingAction(const G4Step *)
Actions to perform in the ACTAR gas detector analysis after each step.
TH1D * hTotELossOnGas2
Histogram: energy Loss on gas for second primary.