code, separation between detectors and output more automatic

parent d0929469
...@@ -34,12 +34,14 @@ ...@@ -34,12 +34,14 @@
#include "G4SDManager.hh" #include "G4SDManager.hh"
#include "globals.hh" #include "globals.hh"
#include "G4VisAttributes.hh" #include "G4VisAttributes.hh"
#include <vector>
class B1SD; class B1SD;
class G4VPhysicalVolume; class G4VPhysicalVolume;
class G4LogicalVolume; class G4LogicalVolume;
class G4VSensitiveDetector; class G4VSensitiveDetector;
using namespace std;
/// Detector construction class to define materials and geometry. /// Detector construction class to define materials and geometry.
class B1DetectorConstruction : public G4VUserDetectorConstruction class B1DetectorConstruction : public G4VUserDetectorConstruction
...@@ -52,10 +54,19 @@ class B1DetectorConstruction : public G4VUserDetectorConstruction ...@@ -52,10 +54,19 @@ class B1DetectorConstruction : public G4VUserDetectorConstruction
G4LogicalVolume* GetScoringVolume() const { return fScoringVolume; } G4LogicalVolume* GetScoringVolume() const { return fScoringVolume; }
G4LogicalVolume* GetScoringDetector() const { return fScoringDetector; } 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: protected:
G4LogicalVolume* fScoringVolume; G4LogicalVolume* fScoringVolume;
G4LogicalVolume* fScoringDetector; G4LogicalVolume* fScoringDetector;
std::vector<G4double> positions;
G4double delta;
G4double size;
}; };
......
...@@ -33,14 +33,16 @@ ...@@ -33,14 +33,16 @@
#include "G4UserEventAction.hh" #include "G4UserEventAction.hh"
#include "globals.hh" #include "globals.hh"
#include <map> #include <map>
#include <vector>
#include "G4ParticleDefinition.hh" #include "G4ParticleDefinition.hh"
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
class B1RunAction; class B1RunAction;
class B1DetectorConstruction;
/// Event action class /// Event action class
/// ///
using namespace std;
class B1EventAction : public G4UserEventAction class B1EventAction : public G4UserEventAction
{ {
...@@ -53,10 +55,15 @@ 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 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 WriteHistogram(const G4String name, G4int Detec);
void AddEdep(G4double edep) { fEdep += edep; }; void AddEdep(G4double edep) { fEdep += edep; };
G4double SetPosition(G4int detec);
private: private:
B1RunAction* fRunAction; B1RunAction* fRunAction;
G4double fEdep; G4double fEdep;
std::vector<G4double> dec_pos;
B1DetectorConstruction* detectorConstruction;
G4double half_height;
G4double variation;
}; };
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
......
...@@ -3,12 +3,14 @@ ...@@ -3,12 +3,14 @@
#include "G4VSensitiveDetector.hh" #include "G4VSensitiveDetector.hh"
#include "B1Hits.hh" #include "B1Hits.hh"
#include <vector>
class G4Step; class G4Step;
class G4HCofThisEvent; class G4HCofThisEvent;
class G4TouchableHistory; class G4TouchableHistory;
class B1Hits; class B1Hits;
using namespace std;
class B1SD: public G4VSensitiveDetector class B1SD: public G4VSensitiveDetector
{ {
public: public:
...@@ -25,7 +27,9 @@ public: ...@@ -25,7 +27,9 @@ public:
private: private:
B1HitsCollection* hitCollection; B1HitsCollection* hitCollection;
G4int HCID; G4int HCID;
std::vector<G4int> tracks;
G4int track_id; G4int track_id;
G4String sdname;
}; };
#endif #endif
...@@ -76,7 +76,7 @@ G4VPhysicalVolume* B1DetectorConstruction::Construct() ...@@ -76,7 +76,7 @@ G4VPhysicalVolume* B1DetectorConstruction::Construct()
//caracteristicas do cilíndro -> world //caracteristicas do cilíndro -> world
G4double raio_i = 0; G4double raio_i = 0;
G4double raio_e = 9*m; G4double raio_e = 9*m;
G4double h_detector = 2.*cm; G4double h_detector = 0.100*m;
G4double h = 9*m; G4double h = 9*m;
G4double theta_0 = 0.*deg; G4double theta_0 = 0.*deg;
G4double theta_f = 360.*deg; G4double theta_f = 360.*deg;
...@@ -109,6 +109,7 @@ G4VPhysicalVolume* B1DetectorConstruction::Construct() ...@@ -109,6 +109,7 @@ G4VPhysicalVolume* B1DetectorConstruction::Construct()
G4Tubs* detector = new G4Tubs("detector", raio_i, raio_e, h_detector, theta_0, theta_f); G4Tubs* detector = new G4Tubs("detector", raio_i, raio_e, h_detector, theta_0, theta_f);
G4LogicalVolume* logicDetector1 = new G4LogicalVolume(detector, G4LogicalVolume* logicDetector1 = new G4LogicalVolume(detector,
world_mat, world_mat,
"detector1"); "detector1");
...@@ -180,17 +181,27 @@ G4LogicalVolume* logicDetector17 = new G4LogicalVolume(detector, ...@@ -180,17 +181,27 @@ G4LogicalVolume* logicDetector17 = new G4LogicalVolume(detector,
G4LogicalVolume* logicDetector18 = new G4LogicalVolume(detector, G4LogicalVolume* logicDetector18 = new G4LogicalVolume(detector,
world_mat, world_mat,
"detector18"); "detector18");
/*
G4LogicalVolume* logicDetector19 = new G4LogicalVolume(detector, G4LogicalVolume* logicDetector19 = new G4LogicalVolume(detector,
world_mat, world_mat,
"detector19"); "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 //colocando mais detetores
G4double pos1 = initial_pos;
G4cout << pos1 << G4endl;
positions.push_back(pos1);
G4cout << positions[0];
new G4PVPlacement(0, new G4PVPlacement(0,
G4ThreeVector(0,0,-8.99*m), G4ThreeVector(0,0,(initial_pos)),
logicDetector1, logicDetector1,
"detector1", "detector1",
logicWorld, logicWorld,
...@@ -198,8 +209,10 @@ G4LogicalVolume* logicDetector19 = new G4LogicalVolume(detector, ...@@ -198,8 +209,10 @@ G4LogicalVolume* logicDetector19 = new G4LogicalVolume(detector,
1, 1,
checkOverlaps); checkOverlaps);
G4double pos2 = (initial_pos + delta_h);
positions.push_back(pos2);
new G4PVPlacement(0, new G4PVPlacement(0,
G4ThreeVector(0,0,-7.99*m), G4ThreeVector(0,0,(pos2)),
logicDetector2, logicDetector2,
"detector2", "detector2",
logicWorld, logicWorld,
...@@ -207,9 +220,11 @@ G4LogicalVolume* logicDetector19 = new G4LogicalVolume(detector, ...@@ -207,9 +220,11 @@ G4LogicalVolume* logicDetector19 = new G4LogicalVolume(detector,
1, 1,
checkOverlaps); checkOverlaps);
G4double pos3 = (initial_pos + 2*delta_h);
positions.push_back(pos3);
new G4PVPlacement(0, new G4PVPlacement(0,
G4ThreeVector(0,0,-6.99*m), G4ThreeVector(0,0,(pos3)),
logicDetector3, logicDetector3,
"detector3", "detector3",
logicWorld, logicWorld,
...@@ -217,8 +232,11 @@ G4LogicalVolume* logicDetector19 = new G4LogicalVolume(detector, ...@@ -217,8 +232,11 @@ G4LogicalVolume* logicDetector19 = new G4LogicalVolume(detector,
1, 1,
checkOverlaps); checkOverlaps);
G4double pos4 = (initial_pos + 3*delta_h);
positions.push_back(pos4);
G4cout << h << G4endl;
new G4PVPlacement(0, new G4PVPlacement(0,
G4ThreeVector(0,0,-5.99*m), G4ThreeVector(0,0,(pos4)),
logicDetector4, logicDetector4,
"detector4", "detector4",
logicWorld, logicWorld,
...@@ -226,8 +244,12 @@ G4LogicalVolume* logicDetector19 = new G4LogicalVolume(detector, ...@@ -226,8 +244,12 @@ G4LogicalVolume* logicDetector19 = new G4LogicalVolume(detector,
1, 1,
checkOverlaps); checkOverlaps);
G4double pos5 = (initial_pos + 4*delta_h);
positions.push_back(pos5);
new G4PVPlacement(0, new G4PVPlacement(0,
G4ThreeVector(0,0,-4.99*m), G4ThreeVector(0,0,(pos5)),
logicDetector5, logicDetector5,
"detector5", "detector5",
logicWorld, logicWorld,
...@@ -235,8 +257,12 @@ G4LogicalVolume* logicDetector19 = new G4LogicalVolume(detector, ...@@ -235,8 +257,12 @@ G4LogicalVolume* logicDetector19 = new G4LogicalVolume(detector,
1, 1,
checkOverlaps); checkOverlaps);
G4double pos6 = (initial_pos + 5*delta_h);
positions.push_back(pos6);
new G4PVPlacement(0, new G4PVPlacement(0,
G4ThreeVector(0,0,-3.99*m), G4ThreeVector(0,0,(pos6)),
logicDetector6, logicDetector6,
"detector6", "detector6",
logicWorld, logicWorld,
...@@ -244,8 +270,11 @@ G4LogicalVolume* logicDetector19 = new G4LogicalVolume(detector, ...@@ -244,8 +270,11 @@ G4LogicalVolume* logicDetector19 = new G4LogicalVolume(detector,
1, 1,
checkOverlaps); checkOverlaps);
G4double pos7 = (initial_pos + 6*delta_h);
positions.push_back(pos7);
new G4PVPlacement(0, new G4PVPlacement(0,
G4ThreeVector(0,0,-2.99*m), G4ThreeVector(0,0,(pos7)),
logicDetector7, logicDetector7,
"detector7", "detector7",
logicWorld, logicWorld,
...@@ -253,9 +282,11 @@ G4LogicalVolume* logicDetector19 = new G4LogicalVolume(detector, ...@@ -253,9 +282,11 @@ G4LogicalVolume* logicDetector19 = new G4LogicalVolume(detector,
1, 1,
checkOverlaps); checkOverlaps);
G4double pos8 = (initial_pos + 7*delta_h);
positions.push_back(pos8);
new G4PVPlacement(0, new G4PVPlacement(0,
G4ThreeVector(0,0,-1.99*m), G4ThreeVector(0,0,(pos8)),
logicDetector8, logicDetector8,
"detector8", "detector8",
logicWorld, logicWorld,
...@@ -263,8 +294,11 @@ G4LogicalVolume* logicDetector19 = new G4LogicalVolume(detector, ...@@ -263,8 +294,11 @@ G4LogicalVolume* logicDetector19 = new G4LogicalVolume(detector,
1, 1,
checkOverlaps); checkOverlaps);
G4double pos9 = (initial_pos + 8*delta_h);
positions.push_back(pos9);
new G4PVPlacement(0, new G4PVPlacement(0,
G4ThreeVector(0,0,-0.99*m), G4ThreeVector(0,0,(pos9)),
logicDetector9, logicDetector9,
"detector9", "detector9",
logicWorld, logicWorld,
...@@ -272,8 +306,11 @@ G4LogicalVolume* logicDetector19 = new G4LogicalVolume(detector, ...@@ -272,8 +306,11 @@ G4LogicalVolume* logicDetector19 = new G4LogicalVolume(detector,
1, 1,
checkOverlaps); checkOverlaps);
G4double pos10 = (initial_pos + 9*delta_h);
positions.push_back(pos10);
new G4PVPlacement(0, new G4PVPlacement(0,
G4ThreeVector(0,0,0.01*m), G4ThreeVector(0,0,pos10),
logicDetector10, logicDetector10,
"detector10", "detector10",
logicWorld, logicWorld,
...@@ -281,24 +318,35 @@ G4LogicalVolume* logicDetector19 = new G4LogicalVolume(detector, ...@@ -281,24 +318,35 @@ G4LogicalVolume* logicDetector19 = new G4LogicalVolume(detector,
1, 1,
checkOverlaps); checkOverlaps);
G4double pos11 = (initial_pos + 10*delta_h);
positions.push_back(pos11);
new G4PVPlacement(0, new G4PVPlacement(0,
G4ThreeVector(0,0,1.01*m), G4ThreeVector(0,0,pos11),
logicDetector11, logicDetector11,
"detector11", "detector11",
logicWorld, logicWorld,
false, false,
1, 1,
checkOverlaps); checkOverlaps);
G4double pos12 = (initial_pos + 11*delta_h);
positions.push_back(pos12);
new G4PVPlacement(0, new G4PVPlacement(0,
G4ThreeVector(0,0,2.01*m), G4ThreeVector(0,0,pos12),
logicDetector12, logicDetector12,
"detector12", "detector12",
logicWorld, logicWorld,
false, false,
1, 1,
checkOverlaps); checkOverlaps);
G4double pos13 = (initial_pos + 12*delta_h);
positions.push_back(pos13);
new G4PVPlacement(0, new G4PVPlacement(0,
G4ThreeVector(0,0,3.01*m), G4ThreeVector(0,0,pos13),
logicDetector13, logicDetector13,
"detector13", "detector13",
logicWorld, logicWorld,
...@@ -306,8 +354,11 @@ G4LogicalVolume* logicDetector19 = new G4LogicalVolume(detector, ...@@ -306,8 +354,11 @@ G4LogicalVolume* logicDetector19 = new G4LogicalVolume(detector,
1, 1,
checkOverlaps); checkOverlaps);
G4double pos14 = (initial_pos + 13*delta_h);
positions.push_back(pos14);
new G4PVPlacement(0, new G4PVPlacement(0,
G4ThreeVector(0,0,4.01*m), G4ThreeVector(0,0,pos14),
logicDetector14, logicDetector14,
"detector14", "detector14",
logicWorld, logicWorld,
...@@ -315,8 +366,11 @@ G4LogicalVolume* logicDetector19 = new G4LogicalVolume(detector, ...@@ -315,8 +366,11 @@ G4LogicalVolume* logicDetector19 = new G4LogicalVolume(detector,
1, 1,
checkOverlaps); checkOverlaps);
G4double pos15 = (initial_pos + 14*delta_h);
positions.push_back(pos15);
new G4PVPlacement(0, new G4PVPlacement(0,
G4ThreeVector(0,0,5.01*m), G4ThreeVector(0,0,pos15),
logicDetector15, logicDetector15,
"detector15", "detector15",
logicWorld, logicWorld,
...@@ -324,8 +378,11 @@ G4LogicalVolume* logicDetector19 = new G4LogicalVolume(detector, ...@@ -324,8 +378,11 @@ G4LogicalVolume* logicDetector19 = new G4LogicalVolume(detector,
1, 1,
checkOverlaps); checkOverlaps);
G4double pos16 = (initial_pos + 15*delta_h);
positions.push_back(pos16);
new G4PVPlacement(0, new G4PVPlacement(0,
G4ThreeVector(0,0,6.01*m), G4ThreeVector(0,0,pos16),
logicDetector16, logicDetector16,
"detector16", "detector16",
logicWorld, logicWorld,
...@@ -333,8 +390,11 @@ G4LogicalVolume* logicDetector19 = new G4LogicalVolume(detector, ...@@ -333,8 +390,11 @@ G4LogicalVolume* logicDetector19 = new G4LogicalVolume(detector,
1, 1,
checkOverlaps); checkOverlaps);
G4double pos17 = (initial_pos + 16*delta_h);
positions.push_back(pos17);
new G4PVPlacement(0, new G4PVPlacement(0,
G4ThreeVector(0,0,7.01*m), G4ThreeVector(0,0,pos17),
logicDetector17, logicDetector17,
"detector17", "detector17",
logicWorld, logicWorld,
...@@ -342,8 +402,11 @@ new G4PVPlacement(0, ...@@ -342,8 +402,11 @@ new G4PVPlacement(0,
1, 1,
checkOverlaps); checkOverlaps);
G4double pos18 = (initial_pos + 17*delta_h);
positions.push_back(pos18);
new G4PVPlacement(0, new G4PVPlacement(0,
G4ThreeVector(0,0,8.01*m), G4ThreeVector(0,0,pos18),
logicDetector18, logicDetector18,
"detector18", "detector18",
logicWorld, logicWorld,
...@@ -352,15 +415,19 @@ new G4PVPlacement(0, ...@@ -352,15 +415,19 @@ new G4PVPlacement(0,
checkOverlaps); checkOverlaps);
/*
positions.push_back(final_pos);
new G4PVPlacement(0, new G4PVPlacement(0,
G4ThreeVector(0,0,8.99*m), G4ThreeVector(0,0,(final_pos)),
logicDetector19, logicDetector19,
"detector19", "detector19",
logicWorld, logicWorld,
false, false,
1, 1,
checkOverlaps); checkOverlaps);
*/
//fScoringDetector = logicDetector; //fScoringDetector = logicDetector;
...@@ -458,15 +525,13 @@ G4String SDname17; ...@@ -458,15 +525,13 @@ G4String SDname17;
sdman->AddNewDetector(sensitive18); sdman->AddNewDetector(sensitive18);
logicDetector18->SetSensitiveDetector(sensitive18); logicDetector18->SetSensitiveDetector(sensitive18);
/*
G4String SDname19; G4String SDname19;
auto sensitive19 = new B1SD(SDname19= "SD19"); auto sensitive19 = new B1SD(SDname19= "SD19");
sdman->AddNewDetector(sensitive19); sdman->AddNewDetector(sensitive19);
logicDetector19->SetSensitiveDetector(sensitive19); logicDetector19->SetSensitiveDetector(sensitive19);
*/
//colocando cor vermelha para detector //colocando cor vermelha para detector
G4VisAttributes* worldVisAtt1 = new G4VisAttributes(G4Colour(1.0,0.0,0.0)); G4VisAttributes* worldVisAtt1 = new G4VisAttributes(G4Colour(1.0,0.0,0.0));
worldVisAtt1->SetVisibility(true); worldVisAtt1->SetVisibility(true);
...@@ -489,9 +554,10 @@ G4String SDname17; ...@@ -489,9 +554,10 @@ G4String SDname17;
logicDetector16->SetVisAttributes(worldVisAtt1); logicDetector16->SetVisAttributes(worldVisAtt1);
logicDetector17->SetVisAttributes(worldVisAtt1); logicDetector17->SetVisAttributes(worldVisAtt1);
logicDetector18->SetVisAttributes(worldVisAtt1); logicDetector18->SetVisAttributes(worldVisAtt1);
logicDetector19->SetVisAttributes(worldVisAtt1); //logicDetector19->SetVisAttributes(worldVisAtt1);
return physWorld; return physWorld;
} }
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include "B1EventAction.hh" #include "B1EventAction.hh"
#include "B1RunAction.hh" #include "B1RunAction.hh"
#include "B1Hits.hh" #include "B1Hits.hh"
#include "B1DetectorConstruction.hh"
#include "G4Event.hh" #include "G4Event.hh"
#include "G4RunManager.hh" #include "G4RunManager.hh"
...@@ -65,6 +66,8 @@ void B1EventAction::BeginOfEventAction(const G4Event* event) ...@@ -65,6 +66,8 @@ void B1EventAction::BeginOfEventAction(const G4Event* event)
{ {
fEdep = 0.; fEdep = 0.;
} }
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
...@@ -95,7 +98,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event) ...@@ -95,7 +98,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event)
auto Col16 = SDman->GetCollectionID("SD16"); auto Col16 = SDman->GetCollectionID("SD16");
auto Col17 = SDman->GetCollectionID("SD17"); auto Col17 = SDman->GetCollectionID("SD17");
auto Col18 = SDman->GetCollectionID("SD18"); 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) ...@@ -118,7 +121,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event)
B1HitsCollection* HitsCol16 = 0; B1HitsCollection* HitsCol16 = 0;
B1HitsCollection* HitsCol17 = 0; B1HitsCollection* HitsCol17 = 0;
B1HitsCollection* HitsCol18 = 0; B1HitsCollection* HitsCol18 = 0;
B1HitsCollection* HitsCol19 = 0; // B1HitsCollection* HitsCol19 = 0;
if(HCE) { if(HCE) {
HitsCol1 = (B1HitsCollection*)(HCE->GetHC(Col1)); HitsCol1 = (B1HitsCollection*)(HCE->GetHC(Col1));
...@@ -139,7 +142,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event) ...@@ -139,7 +142,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event)
HitsCol16 = (B1HitsCollection*)(HCE->GetHC(Col16)); HitsCol16 = (B1HitsCollection*)(HCE->GetHC(Col16));
HitsCol17 = (B1HitsCollection*)(HCE->GetHC(Col17)); HitsCol17 = (B1HitsCollection*)(HCE->GetHC(Col17));
HitsCol18 = (B1HitsCollection*)(HCE->GetHC(Col18)); HitsCol18 = (B1HitsCollection*)(HCE->GetHC(Col18));
HitsCol19 = (B1HitsCollection*)(HCE->GetHC(Col19)); // HitsCol19 = (B1HitsCollection*)(HCE->GetHC(Col19));
} }
//G4AnalysisManager* analysisManager = G4AnalysisManager::Instance(); //G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
...@@ -148,8 +151,17 @@ void B1EventAction::EndOfEventAction(const G4Event* event) ...@@ -148,8 +151,17 @@ void B1EventAction::EndOfEventAction(const G4Event* event)
std::ofstream mu_minusfile("mu-.txt"); 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) { if(HitsCol1) {
G4double pos_detec = 0.01; G4cout << "test" << G4endl;
G4double pos_detec = SetPosition(1);
G4cout << "RRRRRRR" << G4endl;
int n_hit = HitsCol1->entries(); int n_hit = HitsCol1->entries();
G4cout << "My detector 1 has " << n_hit << "hits" << G4endl; G4cout << "My detector 1 has " << n_hit << "hits" << G4endl;
B1Hits* hit = new B1Hits; B1Hits* hit = new B1Hits;
...@@ -166,7 +178,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event) ...@@ -166,7 +178,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event)
} }
if(HitsCol2) { if(HitsCol2) {
G4double pos_detec = 1.01; G4double pos_detec = SetPosition(2);
int n_hit = HitsCol2->entries(); int n_hit = HitsCol2->entries();
G4cout << "My detector 2 has " << n_hit << "hits" << G4endl; G4cout << "My detector 2 has " << n_hit << "hits" << G4endl;
B1Hits* hit = new B1Hits; B1Hits* hit = new B1Hits;
...@@ -183,7 +195,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event) ...@@ -183,7 +195,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event)
} }
if(HitsCol3) { if(HitsCol3) {
G4double pos_detec = 2.01; G4double pos_detec = SetPosition(3);
int n_hit = HitsCol3->entries(); int n_hit = HitsCol3->entries();
G4cout << "My detector 3 has " << n_hit << "hits" << G4endl; G4cout << "My detector 3 has " << n_hit << "hits" << G4endl;
B1Hits* hit = new B1Hits; B1Hits* hit = new B1Hits;
...@@ -200,7 +212,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event) ...@@ -200,7 +212,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event)
} }
if(HitsCol4) { if(HitsCol4) {
G4double pos_detec = 3.01; G4double pos_detec = SetPosition(4);
int n_hit = HitsCol4->entries(); int n_hit = HitsCol4->entries();
G4cout << "My detector 4 has " << n_hit << "hits" << G4endl; G4cout << "My detector 4 has " << n_hit << "hits" << G4endl;
B1Hits* hit = new B1Hits; B1Hits* hit = new B1Hits;
...@@ -217,7 +229,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event) ...@@ -217,7 +229,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event)
} }
if(HitsCol5) { if(HitsCol5) {
G4double pos_detec = 4.01; G4double pos_detec = SetPosition(5);
int n_hit = HitsCol5->entries(); int n_hit = HitsCol5->entries();
G4cout << "My detector 5 has " << n_hit << "hits" << G4endl; G4cout << "My detector 5 has " << n_hit << "hits" << G4endl;
B1Hits* hit = new B1Hits; B1Hits* hit = new B1Hits;
...@@ -234,7 +246,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event) ...@@ -234,7 +246,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event)
} }
if(HitsCol6) { if(HitsCol6) {
G4double pos_detec = 5.01; G4double pos_detec = SetPosition(6);
int n_hit = HitsCol6->entries(); int n_hit = HitsCol6->entries();
G4cout << "My detector 6 has " << n_hit << "hits" << G4endl; G4cout << "My detector 6 has " << n_hit << "hits" << G4endl;
B1Hits* hit = new B1Hits; B1Hits* hit = new B1Hits;
...@@ -250,7 +262,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event) ...@@ -250,7 +262,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event)
fparticles.clear();