output for nu and anti_nu

parent 747bc3d6
......@@ -52,7 +52,8 @@ class B1EventAction : public G4UserEventAction
virtual void BeginOfEventAction(const G4Event* event);
virtual void EndOfEventAction(const G4Event* event);
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,
std::ofstream& nu_e, std::ofstream& nu_mu, std::ofstream& anti_nu_e, std::ofstream& anti_nu_mu, G4double position);
void WriteHistogram(const G4String name, G4int Detec);
void AddEdep(G4double edep) { fEdep += edep; };
G4double SetPosition(G4int detec);
......
......@@ -75,9 +75,9 @@ G4VPhysicalVolume* B1DetectorConstruction::Construct()
//
//caracteristicas do cilíndro -> world
G4double raio_i = 0;
G4double raio_e = 9*m;
G4double h_detector = 0.100*m;
G4double h = 9*m;
G4double raio_e = 25*m;
G4double h_detector = 1*cm;
G4double h = 50*m;
G4double theta_0 = 0.*deg;
G4double theta_f = 360.*deg;
G4Material* world_mat = nist->FindOrBuildMaterial("G4_AIR");
......@@ -181,25 +181,80 @@ 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);
G4LogicalVolume* logicDetector20 = new G4LogicalVolume(detector,
world_mat,
"detector20");
G4LogicalVolume* logicDetector21 = new G4LogicalVolume(detector,
world_mat,
"detector21");
G4LogicalVolume* logicDetector22 = new G4LogicalVolume(detector,
world_mat,
"detector22");
G4LogicalVolume* logicDetector23 = new G4LogicalVolume(detector,
world_mat,
"detector23");
G4LogicalVolume* logicDetector24 = new G4LogicalVolume(detector,
world_mat,
"detector24");
G4LogicalVolume* logicDetector25 = new G4LogicalVolume(detector,
world_mat,
"detector25");
G4LogicalVolume* logicDetector26 = new G4LogicalVolume(detector,
world_mat,
"detector26");
G4LogicalVolume* logicDetector27 = new G4LogicalVolume(detector,
world_mat,
"detector27");
G4LogicalVolume* logicDetector28 = new G4LogicalVolume(detector,
world_mat,
"detector28");
G4LogicalVolume* logicDetector29 = new G4LogicalVolume(detector,
world_mat,
"detector29");
G4LogicalVolume* logicDetector30 = new G4LogicalVolume(detector,
world_mat,
"detector30");
G4LogicalVolume* logicDetector31 = new G4LogicalVolume(detector,
world_mat,
"detector31");
G4LogicalVolume* logicDetector32 = new G4LogicalVolume(detector,
world_mat,
"detector32");
G4double safe_distance = 0.003*km;
G4int num_detector = 32;
G4double total_safe = h_detector + safe_distance;
G4double delta_h = (2*h - 2*safe_distance - 4*h_detector)/(num_detector - 1);
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,(initial_pos)),
logicDetector1,
......@@ -415,19 +470,182 @@ new G4PVPlacement(0,
checkOverlaps);
/*
positions.push_back(final_pos);
G4double pos19 = (initial_pos + 18*delta_h);
positions.push_back(pos19);
new G4PVPlacement(0,
G4ThreeVector(0,0,(final_pos)),
G4ThreeVector(0,0,(pos19)),
logicDetector19,
"detector19",
logicWorld,
false,
1,
checkOverlaps);
*/
G4double pos20 = (initial_pos + 19*delta_h);
positions.push_back(pos20);
new G4PVPlacement(0,
G4ThreeVector(0,0,(pos20)),
logicDetector20,
"detector20",
logicWorld,
false,
1,
checkOverlaps);
G4double pos21 = (initial_pos + 20*delta_h);
positions.push_back(pos21);
new G4PVPlacement(0,
G4ThreeVector(0,0,(pos21)),
logicDetector21,
"detector21",
logicWorld,
false,
1,
checkOverlaps);
G4double pos22 = (initial_pos + 21*delta_h);
positions.push_back(pos22);
new G4PVPlacement(0,
G4ThreeVector(0,0,(pos22)),
logicDetector22,
"detector22",
logicWorld,
false,
1,
checkOverlaps);
G4double pos23 = (initial_pos + 22*delta_h);
positions.push_back(pos23);
new G4PVPlacement(0,
G4ThreeVector(0,0,(pos23)),
logicDetector23,
"detector23",
logicWorld,
false,
1,
checkOverlaps);
G4double pos24 = (initial_pos + 23*delta_h);
positions.push_back(pos24);
new G4PVPlacement(0,
G4ThreeVector(0,0,(pos24)),
logicDetector24,
"detector24",
logicWorld,
false,
1,
checkOverlaps);
G4double pos25 = (initial_pos + 24*delta_h);
positions.push_back(pos25);
new G4PVPlacement(0,
G4ThreeVector(0,0,(pos25)),
logicDetector25,
"detector25",
logicWorld,
false,
1,
checkOverlaps);
G4double pos26 = (initial_pos + 25*delta_h);
positions.push_back(pos26);
new G4PVPlacement(0,
G4ThreeVector(0,0,(pos26)),
logicDetector26,
"detector26",
logicWorld,
false,
1,
checkOverlaps);
G4double pos27 = (initial_pos + 26*delta_h);
positions.push_back(pos27);
new G4PVPlacement(0,
G4ThreeVector(0,0,(pos27)),
logicDetector27,
"detector27",
logicWorld,
false,
1,
checkOverlaps);
G4double pos28 = (initial_pos + 27*delta_h);
positions.push_back(pos28);
new G4PVPlacement(0,
G4ThreeVector(0,0,(pos28)),
logicDetector28,
"detector28",
logicWorld,
false,
1,
checkOverlaps);
G4double pos29 = (initial_pos + 28*delta_h);
positions.push_back(pos29);
new G4PVPlacement(0,
G4ThreeVector(0,0,(pos29)),
logicDetector29,
"detector29",
logicWorld,
false,
1,
checkOverlaps);
G4double pos30 = (initial_pos + 29*delta_h);
positions.push_back(pos30);
new G4PVPlacement(0,
G4ThreeVector(0,0,(pos30)),
logicDetector30,
"detector30",
logicWorld,
false,
1,
checkOverlaps);
G4double pos31 = (initial_pos + 30*delta_h);
positions.push_back(pos31);
new G4PVPlacement(0,
G4ThreeVector(0,0,(pos31)),
logicDetector31,
"detector31",
logicWorld,
false,
1,
checkOverlaps);
G4double pos32 = (initial_pos + 31*delta_h);
positions.push_back(pos32);
new G4PVPlacement(0,
G4ThreeVector(0,0,(pos32)),
logicDetector32,
"detector32",
logicWorld,
false,
1,
checkOverlaps);
//fScoringDetector = logicDetector;
......@@ -525,13 +743,79 @@ G4String SDname17;
sdman->AddNewDetector(sensitive18);
logicDetector18->SetSensitiveDetector(sensitive18);
/*
G4String SDname19;
auto sensitive19 = new B1SD(SDname19= "SD19");
sdman->AddNewDetector(sensitive19);
logicDetector19->SetSensitiveDetector(sensitive19);
*/
G4String SDname20;
auto sensitive20 = new B1SD(SDname20= "SD20");
sdman->AddNewDetector(sensitive20);
logicDetector20->SetSensitiveDetector(sensitive20);
G4String SDname21;
auto sensitive21 = new B1SD(SDname21= "SD21");
sdman->AddNewDetector(sensitive21);
logicDetector21->SetSensitiveDetector(sensitive21);
G4String SDname22;
auto sensitive22 = new B1SD(SDname22= "SD22");
sdman->AddNewDetector(sensitive22);
logicDetector22->SetSensitiveDetector(sensitive22);
G4String SDname23;
auto sensitive23 = new B1SD(SDname23= "SD23");
sdman->AddNewDetector(sensitive23);
logicDetector23->SetSensitiveDetector(sensitive23);
G4String SDname24;
auto sensitive24 = new B1SD(SDname24= "SD24");
sdman->AddNewDetector(sensitive24);
logicDetector24->SetSensitiveDetector(sensitive24);
G4String SDname25;
auto sensitive25 = new B1SD(SDname25= "SD25");
sdman->AddNewDetector(sensitive25);
logicDetector25->SetSensitiveDetector(sensitive25);
G4String SDname26;
auto sensitive26 = new B1SD(SDname26= "SD26");
sdman->AddNewDetector(sensitive26);
logicDetector26->SetSensitiveDetector(sensitive26);
G4String SDname27;
auto sensitive27 = new B1SD(SDname27= "SD27");
sdman->AddNewDetector(sensitive27);
logicDetector27->SetSensitiveDetector(sensitive27);
G4String SDname28;
auto sensitive28 = new B1SD(SDname28= "SD28");
sdman->AddNewDetector(sensitive28);
logicDetector28->SetSensitiveDetector(sensitive28);
G4String SDname29;
auto sensitive29 = new B1SD(SDname29= "SD29");
sdman->AddNewDetector(sensitive29);
logicDetector29->SetSensitiveDetector(sensitive29);
G4String SDname30;
auto sensitive30 = new B1SD(SDname30= "SD30");
sdman->AddNewDetector(sensitive30);
logicDetector30->SetSensitiveDetector(sensitive30);
G4String SDname31;
auto sensitive31 = new B1SD(SDname31= "SD31");
sdman->AddNewDetector(sensitive31);
logicDetector31->SetSensitiveDetector(sensitive31);
G4String SDname32;
auto sensitive32 = new B1SD(SDname32= "SD32");
sdman->AddNewDetector(sensitive32);
logicDetector32->SetSensitiveDetector(sensitive32);
//colocando cor vermelha para detector
G4VisAttributes* worldVisAtt1 = new G4VisAttributes(G4Colour(1.0,0.0,0.0));
worldVisAtt1->SetVisibility(true);
......@@ -554,7 +838,20 @@ G4String SDname17;
logicDetector16->SetVisAttributes(worldVisAtt1);
logicDetector17->SetVisAttributes(worldVisAtt1);
logicDetector18->SetVisAttributes(worldVisAtt1);
//logicDetector19->SetVisAttributes(worldVisAtt1);
logicDetector19->SetVisAttributes(worldVisAtt1);
logicDetector20->SetVisAttributes(worldVisAtt1);
logicDetector21->SetVisAttributes(worldVisAtt1);
logicDetector22->SetVisAttributes(worldVisAtt1);
logicDetector23->SetVisAttributes(worldVisAtt1);
logicDetector24->SetVisAttributes(worldVisAtt1);
logicDetector25->SetVisAttributes(worldVisAtt1);
logicDetector26->SetVisAttributes(worldVisAtt1);
logicDetector27->SetVisAttributes(worldVisAtt1);
logicDetector28->SetVisAttributes(worldVisAtt1);
logicDetector29->SetVisAttributes(worldVisAtt1);
logicDetector30->SetVisAttributes(worldVisAtt1);
logicDetector31->SetVisAttributes(worldVisAtt1);
logicDetector32->SetVisAttributes(worldVisAtt1);
return physWorld;
}
......
......@@ -98,8 +98,20 @@ 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");
auto Col20 = SDman->GetCollectionID("SD20");
auto Col21 = SDman->GetCollectionID("SD21");
auto Col22 = SDman->GetCollectionID("SD22");
auto Col23 = SDman->GetCollectionID("SD23");
auto Col24 = SDman->GetCollectionID("SD24");
auto Col25 = SDman->GetCollectionID("SD25");
auto Col26 = SDman->GetCollectionID("SD26");
auto Col27 = SDman->GetCollectionID("SD27");
auto Col28 = SDman->GetCollectionID("SD28");
auto Col29 = SDman->GetCollectionID("SD29");
auto Col30 = SDman->GetCollectionID("SD30");
auto Col31 = SDman->GetCollectionID("SD31");
auto Col32 = SDman->GetCollectionID("SD32");
G4HCofThisEvent* HCE = event->GetHCofThisEvent();
......@@ -121,7 +133,21 @@ void B1EventAction::EndOfEventAction(const G4Event* event)
B1HitsCollection* HitsCol16 = 0;
B1HitsCollection* HitsCol17 = 0;
B1HitsCollection* HitsCol18 = 0;
// B1HitsCollection* HitsCol19 = 0;
B1HitsCollection* HitsCol19 = 0;
B1HitsCollection* HitsCol20 = 0;
B1HitsCollection* HitsCol21 = 0;
B1HitsCollection* HitsCol22 = 0;
B1HitsCollection* HitsCol23 = 0;
B1HitsCollection* HitsCol24 = 0;
B1HitsCollection* HitsCol25 = 0;
B1HitsCollection* HitsCol26 = 0;
B1HitsCollection* HitsCol27 = 0;
B1HitsCollection* HitsCol28 = 0;
B1HitsCollection* HitsCol29 = 0;
B1HitsCollection* HitsCol30 = 0;
B1HitsCollection* HitsCol31 = 0;
B1HitsCollection* HitsCol32 = 0;
if(HCE) {
HitsCol1 = (B1HitsCollection*)(HCE->GetHC(Col1));
......@@ -142,13 +168,31 @@ 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));
HitsCol20 = (B1HitsCollection*)(HCE->GetHC(Col20));
HitsCol21 = (B1HitsCollection*)(HCE->GetHC(Col21));
HitsCol22 = (B1HitsCollection*)(HCE->GetHC(Col22));
HitsCol23 = (B1HitsCollection*)(HCE->GetHC(Col23));
HitsCol24 = (B1HitsCollection*)(HCE->GetHC(Col24));
HitsCol25 = (B1HitsCollection*)(HCE->GetHC(Col25));
HitsCol26 = (B1HitsCollection*)(HCE->GetHC(Col26));
HitsCol27 = (B1HitsCollection*)(HCE->GetHC(Col27));
HitsCol28 = (B1HitsCollection*)(HCE->GetHC(Col28));
HitsCol29 = (B1HitsCollection*)(HCE->GetHC(Col29));
HitsCol30 = (B1HitsCollection*)(HCE->GetHC(Col30));
HitsCol31 = (B1HitsCollection*)(HCE->GetHC(Col31));
HitsCol32 = (B1HitsCollection*)(HCE->GetHC(Col32));
}
//G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
std::ofstream gammafile("gamma.txt");
std::ofstream mu_plusfile("mu+.txt");
std::ofstream mu_minusfile("mu-.txt");
std::ofstream nu_e_file("nu_e.txt");
std::ofstream nu_mu_file("nu_mu.txt");
std::ofstream anti_nu_e_file("anti_nu_e.txt");
std::ofstream anti_nu_mu_file("anti_nu_mu.txt");
detectorConstruction = (B1DetectorConstruction*) G4RunManager::GetRunManager()->GetUserDetectorConstruction();
......@@ -173,7 +217,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event)
fparticles[name]++;
WriteHistogram(name, 1);
}
PrintParticles(fparticles, gammafile, mu_plusfile, mu_minusfile, pos_detec);
PrintParticles(fparticles, gammafile, mu_plusfile, mu_minusfile, nu_e_file, nu_mu_file, anti_nu_e_file, anti_nu_mu_file, pos_detec);
fparticles.clear();
}
......@@ -190,7 +234,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event)
fparticles[name]++;
WriteHistogram(name, 2);
}
PrintParticles(fparticles, gammafile, mu_plusfile, mu_minusfile, pos_detec);
PrintParticles(fparticles, gammafile, mu_plusfile, mu_minusfile, nu_e_file, nu_mu_file, anti_nu_e_file, anti_nu_mu_file, pos_detec);
fparticles.clear();
}
......@@ -207,7 +251,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event)
fparticles[name]++;
WriteHistogram(name, 3);
}
PrintParticles(fparticles, gammafile, mu_plusfile, mu_minusfile, pos_detec);
PrintParticles(fparticles, gammafile, mu_plusfile, mu_minusfile, nu_e_file, nu_mu_file, anti_nu_e_file, anti_nu_mu_file, pos_detec);
fparticles.clear();
}
......@@ -224,7 +268,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event)
fparticles[name]++;
//WriteHistogram(name, 4);
}
PrintParticles(fparticles, gammafile, mu_plusfile, mu_minusfile, pos_detec);
PrintParticles(fparticles, gammafile, mu_plusfile, mu_minusfile, nu_e_file, nu_mu_file, anti_nu_e_file, anti_nu_mu_file, pos_detec);
fparticles.clear();
}
......@@ -241,7 +285,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event)
fparticles[name]++;
WriteHistogram(name, 5);
}
PrintParticles(fparticles, gammafile, mu_plusfile, mu_minusfile, pos_detec);
PrintParticles(fparticles, gammafile, mu_plusfile, mu_minusfile, nu_e_file, nu_mu_file, anti_nu_e_file, anti_nu_mu_file, pos_detec);
fparticles.clear();
}
......@@ -258,7 +302,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event)
fparticles[name]++;
WriteHistogram(name, 6);
}
PrintParticles(fparticles, gammafile, mu_plusfile, mu_minusfile, pos_detec);
PrintParticles(fparticles, gammafile, mu_plusfile, mu_minusfile, nu_e_file, nu_mu_file, anti_nu_e_file, anti_nu_mu_file, pos_detec);
fparticles.clear();
}
if(HitsCol7) {
......@@ -274,7 +318,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event)
fparticles[name]++;
WriteHistogram(name, 7);
}
PrintParticles(fparticles, gammafile, mu_plusfile, mu_minusfile, pos_detec);
PrintParticles(fparticles, gammafile, mu_plusfile, mu_minusfile, nu_e_file, nu_mu_file, anti_nu_e_file, anti_nu_mu_file, pos_detec);
fparticles.clear();
}
if(HitsCol8) {
......@@ -290,7 +334,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event)
fparticles[name]++;
// WriteHistogram(name, 8);
}
PrintParticles(fparticles, gammafile, mu_plusfile, mu_minusfile, pos_detec);
PrintParticles(fparticles, gammafile, mu_plusfile, mu_minusfile, nu_e_file, nu_mu_file, anti_nu_e_file, anti_nu_mu_file, pos_detec);
fparticles.clear();
}
......@@ -307,7 +351,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event)
fparticles[name]++;
// WriteHistogram(name, 9);
}
PrintParticles(fparticles, gammafile, mu_plusfile, mu_minusfile, pos_detec);
PrintParticles(fparticles, gammafile, mu_plusfile, mu_minusfile, nu_e_file, nu_mu_file, anti_nu_e_file, anti_nu_mu_file, pos_detec);
fparticles.clear();
}
......@@ -324,7 +368,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event)
fparticles[name]++;
// WriteHistogram(name, 10);
}
PrintParticles(fparticles, gammafile, mu_plusfile, mu_minusfile, pos_detec);
PrintParticles(fparticles, gammafile, mu_plusfile, mu_minusfile, nu_e_file, nu_mu_file, anti_nu_e_file, anti_nu_mu_file, pos_detec);
fparticles.clear();
}
......@@ -341,7 +385,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event)
fparticles[name]++;
// WriteHistogram(name, 11);
}
PrintParticles(fparticles, gammafile, mu_plusfile, mu_minusfile, pos_detec);
PrintParticles(fparticles, gammafile, mu_plusfile, mu_minusfile, nu_e_file, nu_mu_file, anti_nu_e_file, anti_nu_mu_file, pos_detec);
fparticles.clear();
}
if(HitsCol12) {
......@@ -357,7 +401,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event)
fparticles[name]++;
// WriteHistogram(name, 12);
}
PrintParticles(fparticles, gammafile, mu_plusfile, mu_minusfile, pos_detec);
PrintParticles(fparticles, gammafile, mu_plusfile, mu_minusfile, nu_e_file, nu_mu_file, anti_nu_e_file, anti_nu_mu_file, pos_detec);
fparticles.clear();
}
if(HitsCol13) {
......@@ -373,7 +417,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event)
fparticles[name]++;
// WriteHistogram(name, 13);
}
PrintParticles(fparticles, gammafile, mu_plusfile, mu_minusfile, pos_detec);
PrintParticles(fparticles, gammafile, mu_plusfile, mu_minusfile, nu_e_file, nu_mu_file, anti_nu_e_file, anti_nu_mu_file, pos_detec);
fparticles.clear();
}
if(HitsCol14) {
......@@ -389,7 +433,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event)
fparticles[name]++;
// WriteHistogram(name, 14);
}
PrintParticles(fparticles, gammafile, mu_plusfile, mu_minusfile, pos_detec);
PrintParticles(fparticles, gammafile, mu_plusfile, mu_minusfile, nu_e_file, nu_mu_file, anti_nu_e_file, anti_nu_mu_file, pos_detec);
fparticles.clear();
}
......@@ -406,7 +450,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event)
fparticles[name]++;
// WriteHistogram(name, 15);
}
PrintParticles(fparticles, gammafile, mu_plusfile, mu_minusfile, pos_detec);
PrintParticles(fparticles, gammafile, mu_plusfile, mu_minusfile, nu_e_file, nu_mu_file, anti_nu_e_file, anti_nu_mu_file, pos_detec);
fparticles.clear();
}
if(HitsCol16) {
......@@ -422,7 +466,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event)
fparticles[name]++;
WriteHistogram(name, 6);
}
PrintParticles(fparticles, gammafile, mu_plusfile, mu_minusfile, pos_detec);
PrintParticles(fparticles, gammafile, mu_plusfile, mu_minusfile, nu_e_file, nu_mu_file, anti_nu_e_file, anti_nu_mu_file, pos_detec);
fparticles.clear();
}
if(HitsCol17) {
......@@ -438,7 +482,7 @@ void B1EventAction::EndOfEventAction(const G4Event* event)
fparticles[name]++;
WriteHistogram(name, 6);
}
PrintParticles(fparticles, gammafile, mu_plusfile, mu_minusfile, pos_detec);
PrintParticles(fparticles, gammafile, mu_plusfile, mu_minusfile, nu_e_file, nu_mu_file, anti_nu_e_file, anti_nu_mu_file, pos_detec);
fparticles.clear();
}
if(HitsCol18) {
......@@ -454,10 +498,10 @@ void B1EventAction::EndOfEventAction(const G4Event* event)
fparticles[name]++;
WriteHistogram(name, 6);
}
PrintParticles(fparticles, gammafile, mu_plusfile, mu_minusfile, pos_detec);
PrintParticles(fparticles, gammafile, mu_plusfile, mu_minusfile, nu_e_file, nu_mu_file, anti_nu_e_file, anti_nu_mu_file, pos_detec);
fparticles.clear();
}
/*
if(HitsCol19) {
G4double pos_detec = SetPosition(19);
int n_hit = HitsCol19->entries();
......@@ -471,25 +515,252 @@ void B1EventAction::EndOfEventAction(const G4Event* event)
fparticles[name]++;
WriteHistogram(name, 6);
}
PrintParticles(fparticles, gammafile, mu_plusfile, mu_minusfile, pos_detec);
PrintParticles(fparticles, gammafile, mu_plusfile, mu_minusfile, nu_e_file, nu_mu_file, anti_nu_e_file, anti_nu_mu_file, pos_detec);
fparticles.clear();
}
if(HitsCol20) {
G4double pos_detec = SetPosition(20);
int n_hit = HitsCol20->entries();
G4cout << "My detector 20 has " << n_hit << "hits" << G4endl;
B1Hits* hit = new B1Hits;
std::map<const G4String, int> fparticles;
for(int i1 = 0; i1 < n_hit; i1++) {
B1Hits* hit = (*HitsCol20)[i1];
const G4String name = hit->getParticleInTarget();
//G4cout << name << G4endl;
fparticles[name]++;
WriteHistogram(name, 6);
}
PrintParticles(fparticles, gammafile, mu_plusfile, mu_minusfile, nu_e_file, nu_mu_file, anti_nu_e_file, anti_nu_mu_file, pos_detec);
fparticles.clear();
}
if(HitsCol21) {
G4double pos_detec = SetPosition(21);
int n_hit = HitsCol21->entries();
G4cout << "My detector 21 has " << n_hit << "hits" << G4endl;
B1Hits* hit = new B1Hits;
std::map<const G4String, int> fparticles;
for(int i1 = 0; i1 < n_hit; i1++) {
B1Hits* hit = (*HitsCol21)[i1];
const G4String name = hit->getParticleInTarget();
//G4cout << name << G4endl;
fparticles[name]++;
WriteHistogram(name, 6);
}
PrintParticles(fparticles, gammafile, mu_plusfile, mu_minusfile, nu_e_file, nu_mu_file, anti_nu_e_file, anti_nu_mu_file, pos_detec);
fparticles.clear();
}
if(HitsCol22) {
G4double pos_detec = SetPosition(22);
int n_hit = HitsCol22->entries();
G4cout << "My detector 22 has " << n_hit << "hits" << G4endl;
B1Hits* hit = new B1Hits;
std::map<const G4String, int> fparticles;
for(int i1 = 0; i1 < n_hit; i1++) {
B1Hits* hit = (*HitsCol22)[i1];
const G4String name = hit->getParticleInTarget();
//G4cout << name << G4endl;
fparticles[name]++;
WriteHistogram(name, 6);
}
PrintParticles(fparticles, gammafile, mu_plusfile, mu_minusfile, nu_e_file, nu_mu_file, anti_nu_e_file, anti_nu_mu_file, pos_detec);
fparticles.clear();
}
if(HitsCol23) {
G4double pos_detec = SetPosition(23);
int n_hit = HitsCol23->entries();
G4cout << "My detector 23 has " << n_hit << "hits" << G4endl;
B1Hits* hit = new B1Hits;
std::map<const G4String, int> fparticles;
for(int i1 = 0; i1 < n_hit; i1++) {
B1Hits* hit = (*HitsCol23)[i1];
const G4String name = hit->getParticleInTarget();
//G4cout << name << G4endl;
fparticles[name]++;
WriteHistogram(name, 6);
}
PrintParticles(fparticles, gammafile, mu_plusfile, mu_minusfile, nu_e_file, nu_mu_file, anti_nu_e_file, anti_nu_mu_file, pos_detec);
fparticles.clear();
}
if(HitsCol24) {
G4double pos_detec = SetPosition(24);
int n_hit = HitsCol24->entries();
G4cout << "My detector 24 has " << n_hit << "hits" << G4endl;
B1Hits* hit = new B1Hits;
std::map<const G4String, int> fparticles;
for(int i1 = 0; i1 < n_hit; i1++) {