4 #include "KVGeoImport.h"
5 #include <KVMultiDetArray.h>
6 #include <KVIonRangeTableMaterial.h>
10 #include <KVNucleusEvent.h>
13 #include <KVRangeTableGeoNavigator.h>
14 #include <KVNamedParameter.h>
15 #include <KVDataAnalyser.h>
40 fCurrentTrajectory.SetAddToNodes(
kFALSE);
41 fCurrentTrajectory.SetPathInTitle(
kFALSE);
42 fCheckDetVolNames =
kFALSE;
44 std::map<std::string, EColor>
colors;
50 TIter next(
g->GetListOfVolumes());
70 if (!detector)
return;
71 detector->GetNode()->SetName(detector->GetName());
92 std::cout <<
"\xd" <<
"Info in <KVGeoImport::ImportGeometry>: tested " <<
count <<
" directions" << std::flush;
101 Info(
"ImportGeometry",
107 while ((
d = (KVDetector*)next())) {
108 d->GetNode()->RehashLists();
136 TIter next_group(groups.get());
138 while ((
gr = (
KVGroup*)next_group()))
gr->RehashParentList();
155 Info(
"ImportGeometry",
179 Info(
"ImportGeometry",
180 "Importing geometry in angular ranges : Theta=[%f,%f:%f] Phi=[%f,%f:%f]", ThetaMin, ThetaMax, dTheta, PhiMin, PhiMax, dPhi);
182 std::cout <<
"\xd" <<
"Info in <KVGeoImport::ImportGeometry>: tested " <<
count <<
" directions" << std::flush;
183 for (
Double_t theta = ThetaMin; theta <= ThetaMax; theta += dTheta) {
184 for (
Double_t phi = PhiMin; phi <= PhiMax; phi += dPhi) {
191 std::cout <<
"Info in <KVGeoImport::ImportGeometry>: tested " <<
count <<
" directions" << std::endl;
193 std::cout << std::endl;
273 if (!detector_volume)
return 0;
278 bool reject_volume =
true;
279 for (
int i = 0; i < nn; ++i) {
281 reject_volume =
false;
285 if (reject_volume)
return 0;
293 if (!det->GetEntranceWindow().ROOTGeo()) {
298 if (!multilay || vol_name.
BeginsWith(
"ACTIVE_")) {
325 if (!multilay || vol_name.
BeginsWith(
"ACTIVE_")) {
341 for (
int i = 0; i < nstruc; i++) {
360 if (!multilay || vol_name.
BeginsWith(
"ACTIVE_")) {
441 while (!curpath.
End()) {
442 auto bpaf = curpath.
Next();
444 if (bpaf.BeginsWith(
"DET"))
break;
447 for (
int i = 0; i < nseg; i++) {
452 node_name.
Begin(
"_");
454 auto node_number = node_name.
Next().
Atoi();
468 for (
int i = 0; i < nlayer; i++) {
486 KVDetector*
d =
nullptr;
490 d->SetName(det_name);
515 Warning(
"AddLayer",
"Unknown material %s/%s used in layer %s of detector %s",
521 Warning(
"AddLayer",
"Unknown shape class %s used in layer %s of detector %s",
527 if (irmat->
IsGas()) {
534 det->AddAbsorber(absorber);
535 if (vnom.
BeginsWith(
"ACTIVE_")) det->SetActiveLayer(absorber);
556 Warning(
"AddSubDetector",
"Unknown material %s/%s used in subdetector %d of detector %s",
557 material->
GetName(), material->
GetTitle(), node_number, det->GetName());
562 Warning(
"AddSubDetector",
"Unknown shape class %s used in subdetector %d of detector %s",
567 KVDetector* absorber;
568 if (irmat->
IsGas()) {
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t g
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
R__EXTERN TGeoManager * gGeoManager
char * Form(const char *fmt,...)
virtual const Char_t * GetType() const
virtual void SetNumber(UInt_t num)
static TPluginHandler * LoadPlugin(const Char_t *base, const Char_t *uri="0")
static Bool_t IsRunningBatchAnalysis()
Path taken by particles through multidetector geometry.
Bool_t Contains(const Char_t *name) const
void Clear(Option_t *="") override
Clear list of nodes in trajectory.
void ReverseOrder()
Reverse the order of the nodes in the trajectory.
void AddLast(KVGeoDetectorNode *n)
Import detector array described by ROOT geometry and set up corresponding KVMultiDetArray object.
void ParticleEntersNewVolume(KVNucleus *) override
All detectors crossed by the particle's trajectory are added to the multidetector.
KVDetector * AddSubDetector(KVSegmentedDetector *, TGeoVolume *, Int_t node_number)
KVNameValueList fAcceptedDetectorNames
KVDetector * GetCurrentDetector()
KVDetector * BuildDetector(TString det_name, TGeoVolume *det_vol, bool segment=false)
virtual KVDetector * instantiate_new_detector(const TString &det_name, bool segmented=false)
KVGeoDNTrajectory fCurrentTrajectory
void ImportGeometry_test_trajectory(double theta, double phi)
void AddAcceptedDetectorName(const char *name)
KVDetector * fLastDetector
KVIonRangeTable * fRangeTable
std::unique_ptr< TVector3 > fOrigin
void AddLayer(KVDetector *, TGeoVolume *)
void ImportGeometry_setup_geo()
void ImportGeometry_init_import()
void PropagateParticle(KVNucleus *, TVector3 *TheOrigin=nullptr) override
void ImportGeometry(Double_t dTheta=0.1, Double_t dPhi=1.0, Double_t ThetaMin=0.0, Double_t PhiMin=0.0, Double_t ThetaMax=180.0, Double_t PhiMax=360.0)
Link physical path to node in geometry with detector.
Base class for propagation of particles through array geometry.
void SetDetectorNameFormat(const Char_t *fmt)
void PropagateEvent(KVEvent *, TVector3 *TheOrigin=0)
const TGeoHMatrix * GetCurrentMatrix() const
Returns pointer to internal copy of current global transformation matrix.
void AbsorbDetectorPaths(KVGeoNavigator *GN)
KVUniqueNameList fDetectorPaths
correspondance between physical node and detector objects
KVNameValueList fStrucNameFmt
list of user-defined formats for structure names
const TClonesArray & CurrentStructures() const
void SetNameCorrespondanceList(const Char_t *)
TEnv * fDetStrucNameCorrespList
list(s) of correspondance for renaming structures/detectors
virtual void PropagateParticle(KVNucleus *, TVector3 *TheOrigin=0)
TGeoVolume * GetCurrentDetectorNameAndVolume(KVString &, Bool_t &, Bool_t &segmented)
TString GetCurrentPath() const
TGeoVolume * GetCurrentVolume() const
KVString fDetNameFmt
user-defined format for detector names
void SetStructureNameFormat(const Char_t *type, const Char_t *fmt)
TGeoManager * GetGeometry() const
Base class describing elements of array geometry.
virtual KVDetector * GetDetector(const Char_t *name) const
Return detector in this structure with given name.
const KVSeqCollection * GetDetectors() const
virtual void Add(KVBase *)
KVSeqCollection * GetStructureTypeList(const Char_t *type) const
KVGeoStrucElement * GetStructure(const Char_t *name) const
Group of detectors which can be treated independently of all others in array.
Material for use in energy loss & range calculations.
Abstract base class for calculation of range & energy loss of charged particles in matter.
KVIonRangeTableMaterial * GetMaterial(const Char_t *material) const
Returns pointer to material of given name or type.
Description of physical materials used to construct detectors & targets; interface to range tables.
Base class for describing the geometry of a detector array.
virtual void DeduceIdentificationTelescopesFromGeometry()
void AddTrajectory(KVGeoDNTrajectory *d)
KVGeoNavigator * GetNavigator() const
void SetGeometry(TGeoManager *)
const TSeqCollection * GetTrajectories() const
void CalculateReconstructionTrajectories()
void AssociateTrajectoriesAndNodes()
void DeduceGroupsFromTrajectories()
KVNamedParameter * GetParameter(Int_t idx) const
return the parameter object with index idx
void SetValue(const Char_t *name, value_type value)
const Char_t * GetNameAt(Int_t idx) const
Int_t GetNpar() const
return the number of stored parameters
A generic named parameter storing values of different types.
const Char_t * GetString() const
Description of properties and kinematics of atomic nuclei.
void SetZAandE(Int_t z, Int_t a, Double_t ekin)
Set atomic number, mass number, and kinetic energy in MeV.
void SetTheta(Double_t theta)
void SetPhi(Double_t phi)
A position-sensitive detector made up of several or many numbered sub-detector segments.
void AddSubDetector(int i, KVDetector *D)
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
void Begin(TString delim) const
KVString Next(Bool_t strip_whitespace=kFALSE) const
void Add(TObject *obj) override
virtual Int_t GetEntries() const
TObject * FindObject(const char *name) const override
virtual Double_t GetDZ() const
virtual Bool_t cd(const char *path="")
Double_t GetTemperature() const
Double_t GetPressure() const
virtual Double_t GetDensity() const
TGeoMaterial * GetMaterial() const
TGeoVolume * GetVolume() const
TGeoMedium * GetMedium() const
TGeoMaterial * GetMaterial() const
Int_t GetNdaughters() const
void SetTransparency(Char_t transparency=0)
TGeoNode * GetNode(const char *name) const
void SetLineColor(Color_t lcolor) override
TGeoShape * GetShape() const
const char * GetName() const override
const char * GetTitle() const override
Int_t GetEntries() const override
virtual const char * ClassName() const
virtual void Warning(const char *method, const char *msgfmt,...) const
virtual void Info(const char *method, const char *msgfmt,...) const
Longptr_t ExecPlugin(int nargs)
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const