Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
geant4-projects
cosmic-rays
Commits
747bc3d6
Commit
747bc3d6
authored
Jul 29, 2019
by
MARCOS ANTONIO DE OLIVEIRA DEROS
Browse files
code, separation between detectors and output more automatic
parent
d0929469
Changes
6
Hide whitespace changes
Inline
Side-by-side
include/B1DetectorConstruction.hh
View file @
747bc3d6
...
...
@@ -34,12 +34,14 @@
#include "G4SDManager.hh"
#include "globals.hh"
#include "G4VisAttributes.hh"
#include <vector>
class
B1SD
;
class
G4VPhysicalVolume
;
class
G4LogicalVolume
;
class
G4VSensitiveDetector
;
using
namespace
std
;
/// Detector construction class to define materials and geometry.
class
B1DetectorConstruction
:
public
G4VUserDetectorConstruction
...
...
@@ -52,10 +54,19 @@ class B1DetectorConstruction : public G4VUserDetectorConstruction
G4LogicalVolume
*
GetScoringVolume
()
const
{
return
fScoringVolume
;
}
G4LogicalVolume
*
GetScoringDetector
()
const
{
return
fScoringDetector
;
}
G4double
get_delta
(){
return
delta
;}
G4double
get_size
()
{
return
size
;}
G4double
GetDetecPos
(
G4int
num_detec
);
std
::
vector
<
G4double
>&
GetPositions
()
{
return
positions
;}
protected:
G4LogicalVolume
*
fScoringVolume
;
G4LogicalVolume
*
fScoringDetector
;
std
::
vector
<
G4double
>
positions
;
G4double
delta
;
G4double
size
;
};
...
...
include/B1EventAction.hh
View file @
747bc3d6
...
...
@@ -33,14 +33,16 @@
#include "G4UserEventAction.hh"
#include "globals.hh"
#include <map>
#include <vector>
#include "G4ParticleDefinition.hh"
#include <iostream>
#include <fstream>
class
B1RunAction
;
class
B1DetectorConstruction
;
/// Event action class
///
using
namespace
std
;
class
B1EventAction
:
public
G4UserEventAction
{
...
...
@@ -53,10 +55,15 @@ class B1EventAction : public G4UserEventAction
void
PrintParticles
(
std
::
map
<
const
G4String
,
int
>&
container
,
std
::
ofstream
&
gamma
,
std
::
ofstream
&
mu_minus
,
std
::
ofstream
&
mu_plus
,
G4double
position
);
void
WriteHistogram
(
const
G4String
name
,
G4int
Detec
);
void
AddEdep
(
G4double
edep
)
{
fEdep
+=
edep
;
};
G4double
SetPosition
(
G4int
detec
);
private:
B1RunAction
*
fRunAction
;
G4double
fEdep
;
std
::
vector
<
G4double
>
dec_pos
;
B1DetectorConstruction
*
detectorConstruction
;
G4double
half_height
;
G4double
variation
;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
...
...
include/B1SD.hh
View file @
747bc3d6
...
...
@@ -3,12 +3,14 @@
#include "G4VSensitiveDetector.hh"
#include "B1Hits.hh"
#include <vector>
class
G4Step
;
class
G4HCofThisEvent
;
class
G4TouchableHistory
;
class
B1Hits
;
using
namespace
std
;
class
B1SD
:
public
G4VSensitiveDetector
{
public:
...
...
@@ -25,7 +27,9 @@ public:
private:
B1HitsCollection
*
hitCollection
;
G4int
HCID
;
std
::
vector
<
G4int
>
tracks
;
G4int
track_id
;
G4String
sdname
;
};
#endif
src/B1DetectorConstruction.cc
View file @
747bc3d6
...
...
@@ -76,7 +76,7 @@ G4VPhysicalVolume* B1DetectorConstruction::Construct()
//caracteristicas do cilíndro -> world
G4double
raio_i
=
0
;
G4double
raio_e
=
9
*
m
;
G4double
h_detector
=
2.
*
c
m
;
G4double
h_detector
=
0.100
*
m
;
G4double
h
=
9
*
m
;
G4double
theta_0
=
0.
*
deg
;
G4double
theta_f
=
360.
*
deg
;
...
...
@@ -109,6 +109,7 @@ G4VPhysicalVolume* B1DetectorConstruction::Construct()
G4Tubs
*
detector
=
new
G4Tubs
(
"detector"
,
raio_i
,
raio_e
,
h_detector
,
theta_0
,
theta_f
);
G4LogicalVolume
*
logicDetector1
=
new
G4LogicalVolume
(
detector
,
world_mat
,
"detector1"
);
...
...
@@ -180,17 +181,27 @@ G4LogicalVolume* logicDetector17 = new G4LogicalVolume(detector,
G4LogicalVolume
*
logicDetector18
=
new
G4LogicalVolume
(
detector
,
world_mat
,
"detector18"
);
/*
G4LogicalVolume* logicDetector19 = new G4LogicalVolume(detector,
world_mat,
"detector19");
*/
G4double
safe_distance
=
0.005
*
m
;
G4int
num_detector
=
19
;
G4double
total_safe
=
2
*
h_detector
+
safe_distance
;
G4double
delta_h
=
(
2
*
h
-
2
*
safe_distance
-
4
*
h_detector
)
/
(
num_detector
-
2
);
G4double
initial_pos
=
-
h
+
total_safe
;
G4double
final_pos
=
h
-
total_safe
;
size
=
h
;
delta
=
delta_h
;
//colocando mais detetores
G4double
pos1
=
initial_pos
;
G4cout
<<
pos1
<<
G4endl
;
positions
.
push_back
(
pos1
);
G4cout
<<
positions
[
0
];
new
G4PVPlacement
(
0
,
G4ThreeVector
(
0
,
0
,
-
8.99
*
m
),
G4ThreeVector
(
0
,
0
,
(
initial_pos
)
),
logicDetector1
,
"detector1"
,
logicWorld
,
...
...
@@ -198,8 +209,10 @@ G4LogicalVolume* logicDetector19 = new G4LogicalVolume(detector,
1
,
checkOverlaps
);
G4double
pos2
=
(
initial_pos
+
delta_h
);
positions
.
push_back
(
pos2
);
new
G4PVPlacement
(
0
,
G4ThreeVector
(
0
,
0
,
-
7.99
*
m
),
G4ThreeVector
(
0
,
0
,
(
pos2
)
),
logicDetector2
,
"detector2"
,
logicWorld
,
...
...
@@ -207,9 +220,11 @@ G4LogicalVolume* logicDetector19 = new G4LogicalVolume(detector,
1
,
checkOverlaps
);
G4double
pos3
=
(
initial_pos
+
2
*
delta_h
);
positions
.
push_back
(
pos3
);
new
G4PVPlacement
(
0
,
G4ThreeVector
(
0
,
0
,
-
6.99
*
m
),
G4ThreeVector
(
0
,
0
,
(
pos3
)
),
logicDetector3
,
"detector3"
,
logicWorld
,
...
...
@@ -217,8 +232,11 @@ G4LogicalVolume* logicDetector19 = new G4LogicalVolume(detector,
1
,
checkOverlaps
);
G4double
pos4
=
(
initial_pos
+
3
*
delta_h
);
positions
.
push_back
(
pos4
);
G4cout
<<
h
<<
G4endl
;
new
G4PVPlacement
(
0
,
G4ThreeVector
(
0
,
0
,
-
5.99
*
m
),
G4ThreeVector
(
0
,
0
,
(
pos4
)
),
logicDetector4
,
"detector4"
,
logicWorld
,
...
...
@@ -226,8 +244,12 @@ G4LogicalVolume* logicDetector19 = new G4LogicalVolume(detector,
1
,
checkOverlaps
);
G4double
pos5
=
(
initial_pos
+
4
*
delta_h
);
positions
.
push_back
(
pos5
);
new
G4PVPlacement
(
0
,
G4ThreeVector
(
0
,
0
,
-
4.99
*
m
),
G4ThreeVector
(
0
,
0
,
(
pos5
)
),
logicDetector5
,
"detector5"
,
logicWorld
,
...
...
@@ -235,8 +257,12 @@ G4LogicalVolume* logicDetector19 = new G4LogicalVolume(detector,
1
,
checkOverlaps
);
G4double
pos6
=
(
initial_pos
+
5
*
delta_h
);
positions
.
push_back
(
pos6
);
new
G4PVPlacement
(
0
,
G4ThreeVector
(
0
,
0
,
-
3.99
*
m
),
G4ThreeVector
(
0
,
0
,
(
pos6
)
),
logicDetector6
,
"detector6"
,
logicWorld
,
...
...
@@ -244,8 +270,11 @@ G4LogicalVolume* logicDetector19 = new G4LogicalVolume(detector,
1
,
checkOverlaps
);
G4double
pos7
=
(
initial_pos
+
6
*
delta_h
);
positions
.
push_back
(
pos7
);
new
G4PVPlacement
(
0
,
G4ThreeVector
(
0
,
0
,
-
2.99
*
m
),
G4ThreeVector
(
0
,
0
,
(
pos7
)
),
logicDetector7
,
"detector7"
,
logicWorld
,
...
...
@@ -253,9 +282,11 @@ G4LogicalVolume* logicDetector19 = new G4LogicalVolume(detector,
1
,
checkOverlaps
);
G4double
pos8
=
(
initial_pos
+
7
*
delta_h
);
positions
.
push_back
(
pos8
);
new
G4PVPlacement
(
0
,
G4ThreeVector
(
0
,
0
,
-
1.99
*
m
),
G4ThreeVector
(
0
,
0
,
(
pos8
)
),
logicDetector8
,
"detector8"
,
logicWorld
,
...
...
@@ -263,8 +294,11 @@ G4LogicalVolume* logicDetector19 = new G4LogicalVolume(detector,
1
,
checkOverlaps
);
G4double
pos9
=
(
initial_pos
+
8
*
delta_h
);
positions
.
push_back
(
pos9
);
new
G4PVPlacement
(
0
,
G4ThreeVector
(
0
,
0
,
-
0.99
*
m
),
G4ThreeVector
(
0
,
0
,
(
pos9
)
),
logicDetector9
,
"detector9"
,
logicWorld
,
...
...
@@ -272,8 +306,11 @@ G4LogicalVolume* logicDetector19 = new G4LogicalVolume(detector,
1
,
checkOverlaps
);
G4double
pos10
=
(
initial_pos
+
9
*
delta_h
);
positions
.
push_back
(
pos10
);
new
G4PVPlacement
(
0
,
G4ThreeVector
(
0
,
0
,
0.01
*
m
),
G4ThreeVector
(
0
,
0
,
pos10
),
logicDetector10
,
"detector10"
,
logicWorld
,
...
...
@@ -281,24 +318,35 @@ G4LogicalVolume* logicDetector19 = new G4LogicalVolume(detector,
1
,
checkOverlaps
);
G4double
pos11
=
(
initial_pos
+
10
*
delta_h
);
positions
.
push_back
(
pos11
);
new
G4PVPlacement
(
0
,
G4ThreeVector
(
0
,
0
,
1.01
*
m
),
G4ThreeVector
(
0
,
0
,
pos11
),
logicDetector11
,
"detector11"
,
logicWorld
,
false
,
1
,
checkOverlaps
);
G4double
pos12
=
(
initial_pos
+
11
*
delta_h
);
positions
.
push_back
(
pos12
);
new
G4PVPlacement
(
0
,
G4ThreeVector
(
0
,
0
,
2.01
*
m
),
G4ThreeVector
(
0
,
0
,
pos12
),
logicDetector12
,
"detector12"
,
logicWorld
,
false
,
1
,
checkOverlaps
);
G4double
pos13
=
(
initial_pos
+
12
*
delta_h
);
positions
.
push_back
(
pos13
);
new
G4PVPlacement
(
0
,
G4ThreeVector
(
0
,
0
,
3.01
*
m
),
G4ThreeVector
(
0
,
0
,
pos13
),
logicDetector13
,
"detector13"
,
logicWorld
,
...
...
@@ -306,8 +354,11 @@ G4LogicalVolume* logicDetector19 = new G4LogicalVolume(detector,
1
,
checkOverlaps
);
G4double
pos14
=
(
initial_pos
+
13
*
delta_h
);
positions
.
push_back
(
pos14
);
new
G4PVPlacement
(
0
,
G4ThreeVector
(
0
,
0
,
4.01
*
m
),
G4ThreeVector
(
0
,
0
,
pos14
),
logicDetector14
,
"detector14"
,
logicWorld
,
...
...
@@ -315,8 +366,11 @@ G4LogicalVolume* logicDetector19 = new G4LogicalVolume(detector,
1
,
checkOverlaps
);
G4double
pos15
=
(
initial_pos
+
14
*
delta_h
);
positions
.
push_back
(
pos15
);
new
G4PVPlacement
(
0
,
G4ThreeVector
(
0
,
0
,
5.01
*
m
),
G4ThreeVector
(
0
,
0
,
pos15
),
logicDetector15
,
"detector15"
,
logicWorld
,
...
...
@@ -324,8 +378,11 @@ G4LogicalVolume* logicDetector19 = new G4LogicalVolume(detector,
1
,
checkOverlaps
);
G4double
pos16
=
(
initial_pos
+
15
*
delta_h
);
positions
.
push_back
(
pos16
);
new
G4PVPlacement
(
0
,
G4ThreeVector
(
0
,
0
,
6.01
*
m
),
G4ThreeVector
(
0
,
0
,
pos16
),
logicDetector16
,
"detector16"
,
logicWorld
,
...
...
@@ -333,8 +390,11 @@ G4LogicalVolume* logicDetector19 = new G4LogicalVolume(detector,
1
,
checkOverlaps
);
G4double
pos17
=
(
initial_pos
+
16
*
delta_h
);
positions
.
push_back
(
pos17
);
new
G4PVPlacement
(
0
,
G4ThreeVector
(
0
,
0
,
7.01
*
m
),
G4ThreeVector
(
0
,
0
,
pos17
),
logicDetector17
,
"detector17"
,
logicWorld
,
...
...
@@ -342,8 +402,11 @@ new G4PVPlacement(0,
1
,
checkOverlaps
);
G4double
pos18
=
(
initial_pos
+
17
*
delta_h
);
positions
.
push_back
(
pos18
);
new
G4PVPlacement
(
0
,
G4ThreeVector
(
0
,
0
,
8.01
*
m
),
G4ThreeVector
(
0
,
0
,
pos18
),
logicDetector18
,
"detector18"
,
logicWorld
,
...
...
@@ -352,15 +415,19 @@ new G4PVPlacement(0,
checkOverlaps
);
/*
positions.push_back(final_pos);
new G4PVPlacement(0,
G4ThreeVector
(
0
,
0
,
8.99
*
m
),
G4ThreeVector(0,0,
(final_pos)
),
logicDetector19,
"detector19",
logicWorld,
false,
1,
checkOverlaps);
*/
//fScoringDetector = logicDetector;
...
...
@@ -458,15 +525,13 @@ G4String SDname17;
sdman
->
AddNewDetector
(
sensitive18
);
logicDetector18
->
SetSensitiveDetector
(
sensitive18
);
/*
G4String SDname19;
auto sensitive19 = new B1SD(SDname19= "SD19");
sdman->AddNewDetector(sensitive19);
logicDetector19->SetSensitiveDetector(sensitive19);
*/
//colocando cor vermelha para detector
G4VisAttributes
*
worldVisAtt1
=
new
G4VisAttributes
(
G4Colour
(
1.0
,
0.0
,
0.0
));
worldVisAtt1
->
SetVisibility
(
true
);
...
...
@@ -489,9 +554,10 @@ G4String SDname17;
logicDetector16
->
SetVisAttributes
(
worldVisAtt1
);
logicDetector17
->
SetVisAttributes
(
worldVisAtt1
);
logicDetector18
->
SetVisAttributes
(
worldVisAtt1
);
logicDetector19
->
SetVisAttributes
(
worldVisAtt1
);
//
logicDetector19->SetVisAttributes(worldVisAtt1);
return
physWorld
;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
src/B1EventAction.cc
View file @
747bc3d6
...
...
@@ -30,6 +30,7 @@
#include "B1EventAction.hh"
#include "B1RunAction.hh"
#include "B1Hits.hh"
#include "B1DetectorConstruction.hh"
#include "G4Event.hh"
#include "G4RunManager.hh"
...
...
@@ -65,6 +66,8 @@ void B1EventAction::BeginOfEventAction(const G4Event* event)
{
fEdep
=
0.
;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
...
...
@@ -95,7 +98,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event)
auto
Col16
=
SDman
->
GetCollectionID
(
"SD16"
);
auto
Col17
=
SDman
->
GetCollectionID
(
"SD17"
);
auto
Col18
=
SDman
->
GetCollectionID
(
"SD18"
);
auto
Col19
=
SDman
->
GetCollectionID
(
"SD19"
);
//
auto Col19 = SDman->GetCollectionID("SD19");
...
...
@@ -118,7 +121,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event)
B1HitsCollection
*
HitsCol16
=
0
;
B1HitsCollection
*
HitsCol17
=
0
;
B1HitsCollection
*
HitsCol18
=
0
;
B1HitsCollection
*
HitsCol19
=
0
;
//
B1HitsCollection* HitsCol19 = 0;
if
(
HCE
)
{
HitsCol1
=
(
B1HitsCollection
*
)(
HCE
->
GetHC
(
Col1
));
...
...
@@ -139,7 +142,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event)
HitsCol16
=
(
B1HitsCollection
*
)(
HCE
->
GetHC
(
Col16
));
HitsCol17
=
(
B1HitsCollection
*
)(
HCE
->
GetHC
(
Col17
));
HitsCol18
=
(
B1HitsCollection
*
)(
HCE
->
GetHC
(
Col18
));
HitsCol19
=
(
B1HitsCollection
*
)(
HCE
->
GetHC
(
Col19
));
//
HitsCol19 = (B1HitsCollection*)(HCE->GetHC(Col19));
}
//G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
...
...
@@ -148,8 +151,17 @@ void B1EventAction::EndOfEventAction(const G4Event* event)
std
::
ofstream
mu_minusfile
(
"mu-.txt"
);
detectorConstruction
=
(
B1DetectorConstruction
*
)
G4RunManager
::
GetRunManager
()
->
GetUserDetectorConstruction
();
G4cout
<<
"tttttt"
<<
G4endl
;
dec_pos
=
detectorConstruction
->
GetPositions
();
half_height
=
detectorConstruction
->
get_size
();
variation
=
detectorConstruction
->
get_delta
();
if
(
HitsCol1
)
{
G4double
pos_detec
=
0.01
;
G4cout
<<
"test"
<<
G4endl
;
G4double
pos_detec
=
SetPosition
(
1
);
G4cout
<<
"RRRRRRR"
<<
G4endl
;
int
n_hit
=
HitsCol1
->
entries
();
G4cout
<<
"My detector 1 has "
<<
n_hit
<<
"hits"
<<
G4endl
;
B1Hits
*
hit
=
new
B1Hits
;
...
...
@@ -166,7 +178,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event)
}
if
(
HitsCol2
)
{
G4double
pos_detec
=
1.01
;
G4double
pos_detec
=
SetPosition
(
2
)
;
int
n_hit
=
HitsCol2
->
entries
();
G4cout
<<
"My detector 2 has "
<<
n_hit
<<
"hits"
<<
G4endl
;
B1Hits
*
hit
=
new
B1Hits
;
...
...
@@ -183,7 +195,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event)
}
if
(
HitsCol3
)
{
G4double
pos_detec
=
2.01
;
G4double
pos_detec
=
SetPosition
(
3
)
;
int
n_hit
=
HitsCol3
->
entries
();
G4cout
<<
"My detector 3 has "
<<
n_hit
<<
"hits"
<<
G4endl
;
B1Hits
*
hit
=
new
B1Hits
;
...
...
@@ -200,7 +212,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event)
}
if
(
HitsCol4
)
{
G4double
pos_detec
=
3.01
;
G4double
pos_detec
=
SetPosition
(
4
)
;
int
n_hit
=
HitsCol4
->
entries
();
G4cout
<<
"My detector 4 has "
<<
n_hit
<<
"hits"
<<
G4endl
;
B1Hits
*
hit
=
new
B1Hits
;
...
...
@@ -217,7 +229,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event)
}
if
(
HitsCol5
)
{
G4double
pos_detec
=
4.01
;
G4double
pos_detec
=
SetPosition
(
5
)
;
int
n_hit
=
HitsCol5
->
entries
();
G4cout
<<
"My detector 5 has "
<<
n_hit
<<
"hits"
<<
G4endl
;
B1Hits
*
hit
=
new
B1Hits
;
...
...
@@ -234,7 +246,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event)
}
if
(
HitsCol6
)
{
G4double
pos_detec
=
5.01
;
G4double
pos_detec
=
SetPosition
(
6
)
;
int
n_hit
=
HitsCol6
->
entries
();
G4cout
<<
"My detector 6 has "
<<
n_hit
<<
"hits"
<<
G4endl
;
B1Hits
*
hit
=
new
B1Hits
;
...
...
@@ -250,7 +262,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event)
fparticles
.
clear
();
}
if
(
HitsCol7
)
{
G4double
pos_detec
=
6.01
;
G4double
pos_detec
=
SetPosition
(
7
)
;
int
n_hit
=
HitsCol7
->
entries
();
G4cout
<<
"My detector 7 has "
<<
n_hit
<<
"hits"
<<
G4endl
;
B1Hits
*
hit
=
new
B1Hits
;
...
...
@@ -266,7 +278,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event)
fparticles
.
clear
();
}
if
(
HitsCol8
)
{
G4double
pos_detec
=
7.01
;
G4double
pos_detec
=
SetPosition
(
8
)
;
int
n_hit
=
HitsCol8
->
entries
();
G4cout
<<
"My detector 8 has "
<<
n_hit
<<
"hits"
<<
G4endl
;
B1Hits
*
hit
=
new
B1Hits
;
...
...
@@ -283,7 +295,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event)
}
if
(
HitsCol9
)
{
G4double
pos_detec
=
8.01
;
G4double
pos_detec
=
SetPosition
(
9
)
;
int
n_hit
=
HitsCol9
->
entries
();
G4cout
<<
"My detector 9 has "
<<
n_hit
<<
"hits"
<<
G4endl
;
B1Hits
*
hit
=
new
B1Hits
;
...
...
@@ -300,7 +312,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event)
}
if
(
HitsCol10
)
{
G4double
pos_detec
=
9.01
;
G4double
pos_detec
=
SetPosition
(
10
)
;
int
n_hit
=
HitsCol10
->
entries
();
G4cout
<<
"My detector 10 has "
<<
n_hit
<<
"hits"
<<
G4endl
;
B1Hits
*
hit
=
new
B1Hits
;
...
...
@@ -317,7 +329,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event)
}
if
(
HitsCol11
)
{
G4double
pos_detec
=
10.01
;
G4double
pos_detec
=
SetPosition
(
11
)
;
int
n_hit
=
HitsCol11
->
entries
();
G4cout
<<
"My detector 11 has "
<<
n_hit
<<
"hits"
<<
G4endl
;
B1Hits
*
hit
=
new
B1Hits
;
...
...
@@ -333,7 +345,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event)
fparticles
.
clear
();
}
if
(
HitsCol12
)
{
G4double
pos_detec
=
11.01
;
G4double
pos_detec
=
SetPosition
(
12
)
;
int
n_hit
=
HitsCol12
->
entries
();
G4cout
<<
"My detector 12 has "
<<
n_hit
<<
"hits"
<<
G4endl
;
B1Hits
*
hit
=
new
B1Hits
;
...
...
@@ -349,7 +361,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event)
fparticles
.
clear
();
}
if
(
HitsCol13
)
{
G4double
pos_detec
=
12.01
;
G4double
pos_detec
=
SetPosition
(
13
)
;
int
n_hit
=
HitsCol13
->
entries
();
G4cout
<<
"My detector 13 has "
<<
n_hit
<<
"hits"
<<
G4endl
;
B1Hits
*
hit
=
new
B1Hits
;
...
...
@@ -365,9 +377,9 @@ void B1EventAction::EndOfEventAction(const G4Event* event)
fparticles
.
clear
();
}
if
(
HitsCol14
)
{
G4double
pos_detec
=
13.01
;
G4double
pos_detec
=
SetPosition
(
14
)
;
int
n_hit
=
HitsCol14
->
entries
();
G4cout
<<
"My detector 1 has "
<<
n_hit
<<
"hits"
<<
G4endl
;
G4cout
<<
"My detector 1
4
has "
<<
n_hit
<<
"hits"
<<
G4endl
;
B1Hits
*
hit
=
new
B1Hits
;
std
::
map
<
const
G4String
,
int
>
fparticles
;
for
(
int
i1
=
0
;
i1
<
n_hit
;
i1
++
)
{
...
...
@@ -382,7 +394,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event)
}
if
(
HitsCol15
)
{
G4double
pos_detec
=
14.01
;
G4double
pos_detec
=
SetPosition
(
15
)
;
int
n_hit
=
HitsCol15
->
entries
();
G4cout
<<
"My detector 15 has "
<<
n_hit
<<
"hits"
<<
G4endl
;
B1Hits
*
hit
=
new
B1Hits
;
...
...
@@ -398,7 +410,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event)
fparticles
.
clear
();
}
if
(
HitsCol16
)
{
G4double
pos_detec
=
15.01
;
G4double
pos_detec
=
SetPosition
(
16
)
;
int
n_hit
=
HitsCol16
->
entries
();
G4cout
<<
"My detector 16 has "
<<
n_hit
<<
"hits"
<<
G4endl
;
B1Hits
*
hit
=
new
B1Hits
;
...
...
@@ -414,7 +426,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event)
fparticles
.
clear
();
}
if
(
HitsCol17
)
{
G4double
pos_detec
=
16.01
;
G4double
pos_detec
=
SetPosition
(
17
)
;
int
n_hit
=
HitsCol17
->
entries
();
G4cout
<<
"My detector 17 has "
<<
n_hit
<<
"hits"
<<
G4endl
;
B1Hits
*
hit
=
new
B1Hits
;
...
...
@@ -430,7 +442,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event)
fparticles
.
clear
();
}
if
(
HitsCol18
)
{
G4double
pos_detec
=
17.01
;
G4double
pos_detec
=
SetPosition
(
18
)
;
int
n_hit
=
HitsCol18
->
entries
();
G4cout
<<
"My detector 18 has "
<<
n_hit
<<
"hits"
<<
G4endl
;
B1Hits
*
hit
=
new
B1Hits
;
...
...
@@ -445,8 +457,9 @@ void B1EventAction::EndOfEventAction(const G4Event* event)
PrintParticles
(
fparticles
,
gammafile
,
mu_plusfile
,
mu_minusfile
,
pos_detec
);
fparticles
.
clear
();
}
/*
if(HitsCol19) {
G4double
pos_detec
=
17.98
;
G4double pos_detec =
SetPosition(19)
;
int n_hit = HitsCol19->entries();
G4cout << "My detector 19 has " << n_hit << "hits" << G4endl;
B1Hits* hit = new B1Hits;
...
...
@@ -462,6 +475,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event)
fparticles.clear();
}
*/