GEMC  1.8
Geant4 Monte-Carlo Framework
MDetectorConstruction.cc
Go to the documentation of this file.
1 // %%%%%%%%%%
2 // G4 headers
3 // %%%%%%%%%%
4 #include "G4Box.hh"
5 #include "G4GeometryManager.hh"
6 #include "G4LogicalVolumeStore.hh"
7 #include "G4LogicalVolume.hh"
8 #include "G4PhysicalVolumeStore.hh"
9 #include "G4ProductionCuts.hh"
10 #include "G4PVPlacement.hh"
11 #include "G4RunManager.hh"
12 #include "G4SolidStore.hh"
13 #include "G4VisAttributes.hh"
14 #include "G4SDManager.hh"
15 #include "G4OpBoundaryProcess.hh"
16 
17 // %%%%%%%%%%%%
18 // gemc headers
19 // %%%%%%%%%%%%
20 #include "MDetectorConstruction.h"
21 #include "MDetectorMessenger.h"
22 
23 // %%%%%%%%%%%
24 // C++ headers
25 // %%%%%%%%%%%
26 #include <sstream>
27 using namespace std;
28 
30 {
31  gemcOpt = Opts;
32  // mdetectorMessenger = new MDetectorMessenger(this);
33 }
34 
36 {
37  ;
38 }
39 
40 
42 {
43  string hd_msg = gemcOpt.args["LOG_MSG"].args + " Construction: >> ";
44  double VERB = gemcOpt.args["G4P_VERBOSITY"].arg ;
45  string catch_v = gemcOpt.args["CATCH"].args;
46 
47 
48  // Clean old geometry, if any
49  G4GeometryManager::GetInstance()->OpenGeometry();
50  G4PhysicalVolumeStore::GetInstance()->Clean();
51  G4LogicalVolumeStore::GetInstance()->Clean();
52  G4SolidStore::GetInstance()->Clean();
53 
54 
55  // Experimental hall is a 40 meters box
56  (*Hall_Map)["root"].create_solid(gemcOpt, Hall_Map);
57  (*Hall_Map)["root"].create_logical_volume(mats, gemcOpt);
58  (*Hall_Map)["root"].create_physical_volumes(gemcOpt, NULL);
59  HasMagfield((*Hall_Map)["root"], gemcOpt);
60 
61 
62  if(VERB > 3 || catch_v == "root") cout << hd_msg << " " << (*Hall_Map)["root"] ;
63 
64 
65  cout << hd_msg << " Building Detector from Geometry STL Map..." << endl << endl;
66 
67 
68  // ########################################################################
69  // Resetting Detector Map "scanned". Propagating "exist" to all generations
70  // ########################################################################
71  if(VERB > 2) cout << hd_msg << " Mapping Physical Detector..." << endl << endl;
72 
73  for(map<string, detector>::iterator i = Hall_Map->begin(); i!=Hall_Map->end(); i++)
74  {
75  if(VERB > 3) cout << hd_msg << " Scanning Detector " << i->first << " - existance: " << i->second.exist << endl;
76 
77  // Find the mother up to "root" - disable kid if ancestor does not exist
78  detector mother = FindDetector(i->second.mother);
79 
80  while(mother.name != "akasha" && mother.name != "notfound")
81  {
82  if(mother.exist == 0)
83  {
84  if(VERB > 2) cout << hd_msg << "\t" << i->second.mother << " is not activated. Its child " << i->second.name
85  << " will be disactivated as well." << endl;
86  i->second.exist = 0;
87  }
88  mother = FindDetector(mother.mother);
89  }
90  if(i->first != "root") i->second.scanned = 0;
91  }
92 
93 
94  // ########################################################################
95  // Building Solids, Logical Volumes, Physical Volumes from the detector Map
96  // ########################################################################
97  vector<string> relatives;
98  string mom, kid;
99  for( map<string, detector>::iterator i = Hall_Map->begin(); i!=Hall_Map->end(); i++)
100  {
101  // don't build anything if it doesn't exist
102  if(i->second.exist == 0) continue;
103 
104  // put the first volume in relatives
105  // typically it's the first in alphabetical order
106  if(i->first != "root") relatives.push_back(i->second.name);
107 
108  while(relatives.size() > 0)
109  {
110  detector kid = FindDetector(relatives.back());
111  detector mom = FindDetector(kid.mother);
112 
113  // Mom doesn't exists in the Hall_Map. Stopping everything.
114  if(mom.name != "akasha" && mom.name == "notfound")
115  {
116  cout << hd_msg << " Mom <" << mom.name<< "> was not created for <" << kid.name << ">. "
117  << " We have a No Child Left Behind policy. Exiting. " << endl << endl;
118  exit(0);
119  }
120 
121  // output the Geneaology
122  if(VERB > 3 || kid.name.find(catch_v) != string::npos)
123  {
124  for(unsigned int ir=0; ir<relatives.size()-1; ir++) cout << "\t";
125  cout << hd_msg << " Checking " << kid.name << ", child of " << mom.name
126  << ", for a living ancestor. "
127  << " This Geneaology Depth is " << relatives.size() << "." << endl;
128  }
129 
130  // Mom is built, kid not built yet.
131  if(kid.scanned == 0 && mom.scanned == 1)
132  {
133  if(VERB > 3 || kid.name.find(catch_v) != string::npos)
134  {
135  for(unsigned int ir=0; ir<relatives.size()-1; ir++) cout << "\t";
136  cout << hd_msg << " Found: " << kid.name
137  << " is not built yet but its mommie " << mom.name << " is."
138  << " Building " << kid.name << " of type: " << kid.type << "..." << endl;
139  }
140 
141  // Check kid dependency on copies
142  if(kid.type.find("CopyOf") == 0)
143  {
144 
145  stringstream ops;
146  string operands(kid.type, 6, kid.type.size());
147  ops << operands;
148  string original;
149  ops >> original;
150 
151  detector dorig = FindDetector(original);
152  // if dependency is not built yet, then
153  // add it to the relative list
154  if(dorig.scanned == 0)
155  {
156  relatives.push_back(original);
157  if(VERB > 3 || kid.name.find(catch_v) != string::npos)
158  {
159  for(unsigned int ir=0; ir<relatives.size()-1; ir++) cout << "\t";
160  cout << hd_msg << kid.name << " is copied volume. "
161  << " Must build: " << original << " first " << endl;
162  }
163  }
164  // otherwise can build the kid
165  else
166  {
167  BuildDetector(kid.name);
168  kid.scanned = 1;
169  }
170  }
171  // Check kid dependency on operations
172  else if(kid.type.find("Operation:") == 0)
173  {
174  int sstart = 10;
175  if(kid.type.find("Operation:~") == 0 || kid.type.find("Operation:@") == 0 ) sstart = 11;
176 
177  stringstream ops;
178  string operands(kid.type, sstart, kid.type.size());
179  ops << operands;
180  string firstop, secondop, tmpop;
181  ops >> firstop >> tmpop >> secondop;
182 
183  // if dependency is not built yet, then
184  // add it to the relative list
185  detector dsecondop = FindDetector(secondop);
186  if(dsecondop.scanned == 0)
187  {
188  relatives.push_back(secondop);
189  if(VERB > 3 || kid.name.find(catch_v) != string::npos)
190  {
191  for(unsigned int ir=0; ir<relatives.size()-1; ir++) cout << "\t";
192  cout << hd_msg << kid.name << " is the result of an operation. "
193  << " Must build: " << secondop << " first " << endl;
194  }
195  }
196  detector dfirstop = FindDetector(firstop);
197  if(dfirstop.scanned == 0)
198  {
199  relatives.push_back(firstop);
200  if(VERB > 3 || kid.name.find(catch_v) != string::npos)
201  {
202  for(unsigned int ir=0; ir<relatives.size()-1; ir++) cout << "\t";
203  cout << hd_msg << kid.name << " is the result of an operation. "
204  << " Must build: " << firstop << " first " << endl;
205  }
206  }
207 
208  // otherwise can build the kid
209  if(dsecondop.scanned == 1 && dfirstop.scanned == 1)
210  {
211  BuildDetector(kid.name);
212  kid.scanned = 1;
213  }
214  }
215  else
216  // no dependencies found, build the kid
217  {
218  BuildDetector(kid.name);
219  kid.scanned = 1;
220  }
221  }
222 
223  // if the kid still doesn't exists and its mom doesn't exist.
224  // adding mom to the relatives list
225  if(kid.scanned == 0 && mom.scanned == 0)
226  {
227  relatives.push_back(kid.mother);
228  }
229 
230  // the kid has been built. Can go down one step in geneaology
231  if(kid.scanned == 1 && relatives.size())
232  {
233  if(VERB > 3 || kid.name.find(catch_v) != string::npos)
234  cout << hd_msg << " " << kid << " is built." << endl << endl;
235 
236  relatives.pop_back();
237 
238  }
239 
240  }
241  }
242 
243  // %%%%%%%
244  // Mirrors
245  // %%%%%%%
246 
247  // creating STL vector of Mirrors.
248  // the array of photon energies has size "2"
249  // but all mirror properties are independent of energy
250  const int nEntries_Mirror = 2;
251  double PhotonEnergy_Mirror[nEntries_Mirror] = { 1.034*eV, 5.144*eV };
252 
253  vector<G4OpticalSurface*> Mirror_Surfaces;
254  vector<G4MaterialPropertiesTable*> Mirror_MPT;
255  vector<G4LogicalBorderSurface*> Mirrors;
256  vector<G4LogicalSkinSurface*> SMirrors;
257 
258 
259 
260  // now going through all volumes with the Identifier set to "Mirror:"
261  // the second entry is the volume that borders with the one considered
262  // the third entry is the reflectivity (double number, between zero and one)
263  // the fourth entry is the refractive index (double number, between zero and one)
264  for( map<string, detector>::iterator i = Hall_Map->begin(); i!=Hall_Map->end(); i++)
265  {
266  // looking for Mirrors
267  if(i->second.identity.size())
268  if(i->second.identity[0].name == "Mirror" && i->second.identity[0].rule == "WithSurface:")
269  {
270  string name = i->first;
271  string borderv = "";
272  string model[2] = {"unified", "LUT"};
273  string finish[2] = {"polished", "ground"};
274  string surfaces[2] = {"dielectric_metal", "dielectric_dielectric"};
275  string material = "";
276  double refraction = 1.0;
277  double efficiency = 1.0;
278  double reflection = 1.0;
279  int surfaceType = 0;
280  int finishType = 0;
281  int modelType = 0;
282 
283  for(unsigned int j=0; j<i->second.identity.size(); j++)
284  {
285 
286  // Border Volume
287  if(i->second.identity[j].name == "WithBorderVolume:")
288  {
289  borderv = i->second.identity[j].rule;
290  }
291 
292  // Surface Type:
293  // 0: dielectric dielectric
294  // 1: metal dielectric
295  if(i->second.identity[j].rule == "WithSurface:")
296  {
297  surfaceType = i->second.identity[j].id;
298  }
299 
300  // Finish
301  // 0: polished
302  // 1: ground
303  if(i->second.identity[j].name == "With" && i->second.identity[j].rule == "Finish:")
304  {
305  finishType = i->second.identity[j].id;
306  }
307 
308 
309  // Refraction Index is ID / 1,000,000
310  if(i->second.identity[j].name == "Refraction" && i->second.identity[j].rule == "Index:")
311  {
312  refraction = i->second.identity[j].id/1000000.0;
313  }
314 
315  // Reflectivity is ID / 1,000,000
316  if(i->second.identity[j].name == "With" && i->second.identity[j].rule == "Reflectivity:")
317  {
318  reflection = i->second.identity[j].id/1000000.0;
319  }
320 
321  // Efficiency is ID / 1,000,000
322  if(i->second.identity[j].name == "With" && i->second.identity[j].rule == "Efficiency:")
323  {
324  efficiency = i->second.identity[j].id/1000000.0;
325  }
326 
327  // Model
328  // 0: unified
329  // 1: LUT
330  if(i->second.identity[j].name == "With" && i->second.identity[j].rule == "Model:")
331  {
332  modelType = i->second.identity[j].id;
333  }
334 
335  // AJRP: Use predefined material for the interface?
336  if( i->second.identity[j].name == "WithMaterial:" )
337  {
338  material = i->second.identity[j].rule;
339 
340  if(VERB > 3 || name.find(catch_v) != string::npos)
341  cout << hd_msg << " Using properties of material " << material << " for mirror boundary of volume name " << name << endl;
342 
343  }
344 
345  }
346 
347  if(!(*Hall_Map)[borderv].GetPhysical() && borderv != "MirrorSkin")
348  {
349  cout << hd_msg << " Border volume " << borderv << " is not found for volume " << name << ". Exiting." << endl;
350  exit(0);
351  }
352 
353  string mirror_surf = "Mirror_Surface_for_" + name + "_and_" + borderv;
354  if(borderv == "MirrorSkin")
355  {
356  mirror_surf = "Mirror_Skin_Surface_for_" + name;
357  }
358 
359 
360  Mirror_Surfaces.push_back(new G4OpticalSurface(mirror_surf));
361 
362  //AJRP: If a material was given for this interface, AND a material properties table has been defined for said mirror, use this instead of a new table!
363  bool MPT_exists = false;
364  if( material != "" && ( (*mats)[material] )->GetMaterialPropertiesTable() )
365  {
366  Mirror_MPT.push_back( ( (*mats)[material] )->GetMaterialPropertiesTable() );
367  MPT_exists = true;
368  }
369  else
370  {
371  Mirror_MPT.push_back(new G4MaterialPropertiesTable());
372  }
373 
374  // surface type
375  if(surfaceType == 0) Mirror_Surfaces.back()->SetType(dielectric_metal);
376  if(surfaceType == 1) Mirror_Surfaces.back()->SetType(dielectric_dielectric);
377 
378  // surface finish
379  if(finishType == 0) Mirror_Surfaces.back()->SetFinish(polished);
380  if(finishType == 1) Mirror_Surfaces.back()->SetFinish(ground);
381 
382  // surface model
383  if(modelType == 0) Mirror_Surfaces.back()->SetModel(unified);
384  if(modelType == 1) Mirror_Surfaces.back()->SetModel(LUT);
385 
386 
387  double r_index[2] = {refraction, refraction};
388  double reflect[2] = {reflection, reflection};
389  double efficie[2] = {efficiency, efficiency};
390  double spike[2] = {1.0, 1.0};
391  double slobe[2] = {0.0, 0.0};
392  double sback[2] = {0.0, 0.0};
393  double sdiff[2] = {0.0, 0.0};
394 
395  if( !MPT_exists )
396  {
397  Mirror_MPT.back()->AddProperty("RINDEX", PhotonEnergy_Mirror, r_index, nEntries_Mirror);
398  Mirror_MPT.back()->AddProperty("REFLECTIVITY", PhotonEnergy_Mirror, reflect, nEntries_Mirror);
399  Mirror_MPT.back()->AddProperty("EFFICIENCY", PhotonEnergy_Mirror, efficie, nEntries_Mirror);
400  Mirror_MPT.back()->AddProperty("SPECULARSPIKECONSTANT", PhotonEnergy_Mirror, spike, nEntries_Mirror);
401  Mirror_MPT.back()->AddProperty("SPECULARLOBECONSTANT", PhotonEnergy_Mirror, slobe, nEntries_Mirror);
402  Mirror_MPT.back()->AddProperty("BACKSCATTERCONSTANT", PhotonEnergy_Mirror, sback, nEntries_Mirror);
403  Mirror_MPT.back()->AddProperty("DIFFUSELOBECONSTANT", PhotonEnergy_Mirror, sdiff, nEntries_Mirror);
404  }
405 
406  Mirror_Surfaces.back()->SetMaterialPropertiesTable(Mirror_MPT.back());
407 
408  if(borderv=="MirrorSkin")
409  {
410  SMirrors.push_back(new G4LogicalSkinSurface(name,
411  (*Hall_Map)[name].GetLogical(), Mirror_Surfaces.back()));
412  }
413  else
414  {
415 
416  Mirrors.push_back(new G4LogicalBorderSurface(name,
417  (*Hall_Map)[borderv].GetPhysical(),
418  (*Hall_Map)[name].GetPhysical(), Mirror_Surfaces.back()));
419  }
420 
421 
422  if(VERB > 3 || name.find(catch_v) != string::npos)
423  {
424  cout << hd_msg << " " << name << " is a mirror:" << endl;
425  cout << " > Border Volume: " << borderv << endl;
426  cout << " > Surface Type: " << surfaces[surfaceType] << endl;
427  cout << " > Finish: " << finish[finishType] << endl;
428  cout << " > Refraction Index: " << refraction << endl;
429  cout << " > Reflectivity: " << reflection << endl;
430  cout << " > Efficiency: " << efficiency << endl;
431  cout << " > Model: " << model[modelType] << endl;
432 
433 
434  Mirror_MPT.back()->DumpTable();
435 
436 
437  }
438  }
439  }
440 
441  // BEGIN reflectivity from CLAS12 TDR HTCC for RICH
442  const G4int RICHmirror_Len=7;
443  G4double RICHmirror_PhoE[RICHmirror_Len]=
444  { 1.9074*eV, 2.0664*eV, 2.2543*eV, 3.5424*eV, 4.1328*eV, 4.9594*eV, 6.1992*eV };
445  G4double RICHmirror_Ref[RICHmirror_Len]=
446  { 0.88, 0.89, 0.90, 0.90, 0.88, 0.85, 0.74 };
447  G4double RICHmirror_PhoE2[2]={ 1.9074*eV, 6.1992*eV };
448  G4double RICHmirror_Eff[2] ={ 0., 0. };
449 
450  G4MaterialPropertiesTable* RICHmirror_MPT = new G4MaterialPropertiesTable();
451  RICHmirror_MPT->AddProperty("REFLECTIVITY", RICHmirror_PhoE, RICHmirror_Ref, RICHmirror_Len);
452  RICHmirror_MPT->AddProperty("EFFICIENCY", RICHmirror_PhoE2, RICHmirror_Eff, 2);
453 
454  G4OpticalSurface* RICHmirror_OptSurf = new G4OpticalSurface("RICHmirror_OptSurf");
455  RICHmirror_OptSurf->SetType(dielectric_metal);
456  RICHmirror_OptSurf->SetFinish(polished);
457  RICHmirror_OptSurf->SetModel(unified);
458  RICHmirror_OptSurf->SetMaterialPropertiesTable(RICHmirror_MPT);
459 
460 // G4LogicalSkinSurface* RICHmirror_SkinSurf1 = new G4LogicalSkinSurface("RICHmirror_SkinSurf1",
461 // (*Hall_Map)["AAr_rich_mirror1"].GetLogical(), RICHmirror_OptSurf);
462 // G4LogicalSkinSurface* RICHmirror_SkinSurf2 = new G4LogicalSkinSurface("RICHmirror_SkinSurf2",
463 // (*Hall_Map)["PREMIRROR"].GetLogical(), RICHmirror_OptSurf);
464  // END reflectivity from CLAS12 TDR HTCC for RICH
465 
466 
467 
468  return (*Hall_Map)["root"].GetPhysical();
469 }
470 
471 #include "G4UserLimits.hh"
472 
474 {
475  string hd_msg = gemcOpt.args["LOG_MSG"].args + " Sensitivity: >> ";
476  double VERB = gemcOpt.args["HIT_VERBOSITY"].arg ;
477  string catch_v = gemcOpt.args["CATCH"].args;
478 
479  string sensi = detect.sensitivity;
480 
481  if(sensi != "no")
482  {
483  // Sensitive_region->AddRootLogicalVolume(detect.GetLogical());
484  G4SDManager* SDman = G4SDManager::GetSDMpointer();
485  if (!SDman) throw "Can't get G4SDManager";
486 
487  if(VERB > 5 || detect.name.find(catch_v) != string::npos)
488  cout << hd_msg << " " << detect.name << " is sensitive." << endl;
489 
490  // The key for the SD, Region, PC maps is the same so we can only check SD
491  map<string, MSensitiveDetector*>::iterator itr = SeDe_Map.find(sensi);
492  if(itr == SeDe_Map.end())
493  {
494  if(VERB > 3 || detect.name.find(catch_v) != string::npos)
495  cout << endl << hd_msg << " Sensitive detector <" << sensi
496  << "> doesn't exist yet. Adding <" << sensi << ">. " << endl;
497 
498  SeDe_Map[sensi] = new MSensitiveDetector(sensi, gemcOpt);
499 
500  // Creating G4 Region, assigning Production Cut to it.
501  SeRe_Map[sensi] = new G4Region(sensi);
502  SePC_Map[sensi] = new G4ProductionCuts;
503  SePC_Map[sensi] ->SetProductionCut(SeDe_Map[sensi]->SDID.ProdThreshold);
504  SeRe_Map[sensi]->SetProductionCuts(SePC_Map[sensi]);
505 
506  if(VERB > 3 || detect.name.find(catch_v) != string::npos)
507  cout << hd_msg << " Max Step for Sensitive detector <" << sensi
508  << ">: " << SeDe_Map[sensi]->SDID.MaxStep/mm << " mm." << endl
509  << hd_msg << " Production Cut for Sensitive detector <" << sensi
510  << ">: " << SeDe_Map[sensi]->SDID.ProdThreshold/mm << " mm." << endl << endl;
511 
512  // Pass Detector Map Pointer to Sensitive Detector
513  SeDe_Map[sensi]->Hall_Map = Hall_Map;
514 
515  SDman->AddNewDetector( SeDe_Map[sensi]);
516 
517  }
518  detect.setSensitivity(SeDe_Map[sensi]);
519 
520  // Setting Max Acceptable Step for this SD
521  detect.SetUserLimits(new G4UserLimits(SeDe_Map[sensi]->SDID.MaxStep, SeDe_Map[sensi]->SDID.MaxStep));
522 
523  map<string, G4Region*>::iterator itrRE = SeRe_Map.find(sensi);
524  if(itrRE != SeRe_Map.end()) SeRe_Map[sensi]->AddRootLogicalVolume(detect.GetLogical());
525  else
526  {
527  cout << hd_msg << " Attention: " << sensi << " doesn't exist in the sensitive detector list. Aborting. " << endl;
528  exit(9);
529  }
530 
531  }
532 
533 }
534 
535 
537 {
538  string hd_msg = gemcOpt.args["LOG_MSG"].args + " Magnetic Field: >> ";
539  double VERB = gemcOpt.args["MGN_VERBOSITY"].arg ;
540  string catch_v = gemcOpt.args["CATCH"].args;
541  string field = gemcOpt.args["NO_FIELD"].args;
542 
543  if(field == "all" || detect.name.find(field) != string::npos)
544  return;
545 
546  string magf = detect.magfield;
547 
548  if(magf != "no")
549  {
550  if(VERB > 5 || detect.name.find(catch_v) != string::npos)
551  cout << hd_msg << " " << detect.name << " is inside " << magf << " magnetic field." << endl;
552 
553  map<string, MagneticField>::iterator itr = FieldMap->find(magf);
554  if(itr == FieldMap->end())
555  {
556  cout << hd_msg << " Magnetic Field <" << magf
557  << "> is not defined. Exiting." << endl;
558  exit(0);
559  }
560  if(itr->second.get_MFM() == NULL)
561  {
562  cout << hd_msg << " Magnetic Field <" << magf
563  << "> doesn't exist yet. Adding <" << magf << ">. " << endl;
564  itr->second.create_MFM();
565  }
566 
567  if(itr->second.get_MFM() != NULL)
568  {
569  detect.AssignMFM(itr->second.get_MFM());
570 
571  if(VERB > 6 || detect.name.find(catch_v) != string::npos)
572  cout << hd_msg << " Field <" << magf << "> assigned to " << detect.name << "." << endl;
573 
574  }
575  }
576 
577 }
578 
579 
581 {
582  cout << "Updating geometry... " << endl;
583  G4RunManager::GetRunManager()->GeometryHasBeenModified();
584 }
585 
586 detector MDetectorConstruction::FindDetector(string name)
587 {
588  map<string, detector>::iterator it = Hall_Map->find(name);
589  if(it != Hall_Map->end())
590  return it->second;
591 
592  detector notfound;
593  notfound.name = "notfound";
594  notfound.mother = "notfound";
595 
596  return notfound;
597 
598 }
599 
600 void MDetectorConstruction::BuildDetector(string name)
601 {
602  detector kid = FindDetector(name);
603  detector mom = FindDetector(kid.mother);
604 
605  if(kid.name != "notfound" || mom.name != "notfound")
606  {
607 
608  (*Hall_Map)[kid.name].create_solid(gemcOpt, Hall_Map);
609  // creating logical volume
610  if((*Hall_Map)[kid.name].create_logical_volume(mats, gemcOpt))
611  {
612  // creating physical volume
613  (*Hall_Map)[kid.name].create_physical_volumes(gemcOpt, mom.GetLogical());
614  IsSensitive((*Hall_Map)[kid.name], gemcOpt);
615  HasMagfield((*Hall_Map)[kid.name], gemcOpt);
616  }
617  (*Hall_Map)[kid.name].scanned = 1;
618  }
619 
620  if(kid.name == "notfound" )
621  cout << " Attention: " << kid.name << " not found. " << endl;
622  if(mom.name == "notfound" )
623  cout << " Attention: " << mom.name << " not found. " << endl;
624 
625 
626 }
627 
628 
629 
630 
631 
632 
G4VPhysicalVolume * Construct()
MDetectorConstruction(gemc_opts Opts)
G4LogicalVolume * GetLogical()
Returns Logical Volume pointer.
Definition: detector.h:93
string sensitivity
Defines the Sensitive Detector. possible choices: "no" "hits collection name".
Definition: detector.h:75
string mother
Mother Volume name.
Definition: detector.h:54
void AssignMFM(G4FieldManager *MFM)
Assigns Magnetic Field Manager to LogicV.
Definition: detector.h:98
STL namespace.
string name
Name of the volume. Since this is the key of the STL map, it has to be unique.
Definition: detector.h:53
void IsSensitive(detector, gemc_opts)
void SetUserLimits(G4UserLimits *L)
Definition: detector.h:100
string magfield
Magnetic Field. The string "no" means that the field is inherited from the mother volume...
Definition: detector.h:66
void HasMagfield(detector, gemc_opts)
int exist
detector ON/OFF switch
Definition: detector.h:71
string type
solid type. This follows the GEANT4 definitions
Definition: detector.h:62
int scanned
for use during construction
Definition: detector.h:79
void setSensitivity(G4VSensitiveDetector *SD)
Assign the sensitive detector to the Logical Volume.
Definition: detector.h:90