17#include "TVirtualMC.h"
19#include <TGeoMedium.h>
20#include <TGeoManager.h>
24#include <fairlogger/Logger.h>
30#include "rapidjson/document.h"
31#include "rapidjson/istreamwrapper.h"
32#include "rapidjson/ostreamwrapper.h"
33#include "rapidjson/prettywriter.h"
38namespace rj = rapidjson;
43template <
typename K,
typename V>
44void writeSingleJSONParamBatch(std::unordered_map<K, const char*>
const& idToName, std::map<K, V>
const& valMap, V defaultValue, rapidjson::Value& parent, rapidjson::Document::AllocatorType&
a)
46 for (
auto& itName : idToName) {
47 auto itVal = valMap.find(itName.first);
48 if (itVal != valMap.end()) {
49 parent.AddMember(rj::Value(itName.second, std::strlen(itName.second),
a), rj::Value(itVal->second),
a);
52 parent.AddMember(rj::Value(itName.second, std::strlen(itName.second),
a), rj::Value(defaultValue),
a);
57static constexpr const char* jsonKeyID =
"local_id";
58static constexpr const char* jsonKeyIDGlobal =
"global_id";
59static constexpr const char* jsonKeyDefault =
"default";
60static constexpr const char* jsonKeyCuts =
"cuts";
61static constexpr const char* jsonKeyProcesses =
"processes";
62static constexpr const char* jsonKeyEnableSpecialCuts =
"enableSpecialCuts";
63static constexpr const char* jsonKeyEnableSpecialProcesses =
"enableSpecialProcesses";
66const std::unordered_map<EProc, const char*> MaterialManager::mProcessIDToName = {
67 {EProc::kPAIR,
"PAIR"},
68 {EProc::kCOMP,
"COMP"},
69 {EProc::kPHOT,
"PHOT"},
70 {EProc::kPFIS,
"PFIS"},
71 {EProc::kDRAY,
"DRAY"},
72 {EProc::kANNI,
"ANNI"},
73 {EProc::kBREM,
"BREM"},
74 {EProc::kHADR,
"HADR"},
75 {EProc::kMUNU,
"MUNU"},
76 {EProc::kDCAY,
"DCAY"},
77 {EProc::kLOSS,
"LOSS"},
78 {EProc::kMULS,
"MULS"},
79 {EProc::kCKOV,
"CKOV"},
80 {EProc::kRAYL,
"RAYL"},
81 {EProc::kLABS,
"LABS"}};
83const std::unordered_map<ECut, const char*> MaterialManager::mCutIDToName = {
84 {ECut::kCUTGAM,
"CUTGAM"},
85 {ECut::kCUTELE,
"CUTELE"},
86 {ECut::kCUTNEU,
"CUTNEU"},
87 {ECut::kCUTHAD,
"CUTHAD"},
88 {ECut::kCUTMUO,
"CUTMUO"},
89 {ECut::kBCUTE,
"BCUTE"},
90 {ECut::kBCUTM,
"BCUTM"},
91 {ECut::kDCUTE,
"DCUTE"},
92 {ECut::kDCUTM,
"DCUTM"},
93 {ECut::kPPCUTM,
"PPCUTM"},
94 {ECut::kTOFMAX,
"TOFMAX"}};
97void MaterialManager::initDensityMap()
100 if (globalDensityFactor < 0) {
101 LOG(fatal) <<
"Negative value "
102 << globalDensityFactor
103 <<
" found for global material density!\n";
106 std::istringstream input(
108 std::vector<std::string> inputModuleNames;
109 std::vector<std::string> inputDensityValues;
110 while (std::getline(input, token,
',')) {
111 std::size_t
pos = token.find(
':');
112 inputModuleNames.push_back(token.substr(0,
pos));
113 inputDensityValues.push_back(token.substr(
pos + 1));
115 for (std::size_t
i = 0;
i < inputModuleNames.size();
i++) {
116 if (std::stof(inputDensityValues[
i]) < 0) {
117 LOG(fatal) <<
"Negative value " << std::stof(inputDensityValues[
i])
118 <<
" found for material density in module "
119 << inputModuleNames[
i] <<
"!\n";
121 mDensityMap[inputModuleNames[
i]] = std::stof(inputDensityValues[
i]);
123 mDensityMapInitialized =
true;
126float MaterialManager::getDensity(std::string
const& modname, std::string
const& matname)
134 auto debug = getenv(
"O2SIM_MATMGR_LOCALDENSITY_DEBUG");
136 if (!mDensityMapInitialized) {
141 std::string lookupstring = modname +
"/" + matname;
142 auto iter = mDensityMap.find(lookupstring);
143 if (iter != mDensityMap.end()) {
145 LOG(info) <<
"MatManager - " << modname <<
"/" << matname <<
" : applying density " << iter->second <<
" from material match";
150 iter = mDensityMap.find(modname);
151 if (iter != mDensityMap.end()) {
153 LOG(info) <<
"MatManager - " << modname <<
"/" << matname <<
" : applying density " << iter->second <<
" from module match";
159 if (
debug && global != 1.0) {
160 LOG(info) <<
"MatManager - " << modname <<
"/" << matname <<
" : applying global density " << iter->second;
168 TString uniquename = modname;
169 auto densityFactor = getDensity(modname,
name);
171 uniquename.Append(
"_");
172 uniquename.Append(
name);
173 if (TVirtualMC::GetMC()) {
176 TVirtualMC::GetMC()->Material(kmat, uniquename.Data(),
a,
z,
177 dens * densityFactor, radl, absl,
buf, nwbuf);
178 mMaterialMap[modname][imat] = kmat;
179 insertMaterialName(uniquename.Data(), kmat);
181 auto uid = gGeoManager->GetListOfMaterials()->GetSize();
182 auto mat = gGeoManager->Material(uniquename.Data(),
a,
z,
183 dens * densityFactor, uid, radl, absl);
184 mMaterialMap[modname][imat] = uid;
185 insertMaterialName(uniquename.Data(), uid);
204 TString uniquename = modname;
205 auto densityFactor = getDensity(modname,
name);
206 uniquename.Append(
"_");
207 uniquename.Append(
name);
209 if (TVirtualMC::GetMC()) {
212 TVirtualMC::GetMC()->Mixture(kmat, uniquename.Data(),
a,
z,
213 dens * densityFactor, nlmat, wmat);
214 mMaterialMap[modname][imat] = kmat;
215 insertMaterialName(uniquename.Data(), kmat);
218 auto uid = gGeoManager->GetListOfMaterials()->GetSize();
223 for (
i = 0;
i < nlmat;
i++) {
224 amol +=
a[
i] * wmat[
i];
226 for (
i = 0;
i < nlmat;
i++) {
227 wmat[
i] *=
a[
i] / amol;
230 auto mix = gGeoManager->Mixture(uniquename.Data(),
a,
z,
231 dens * densityFactor, nlmat, wmat, uid);
232 mMaterialMap[modname][imat] = uid;
233 insertMaterialName(uniquename.Data(), uid);
241 TString uniquename = modname;
242 uniquename.Append(
"_");
243 uniquename.Append(
name);
245 if (TVirtualMC::GetMC()) {
249 TVirtualMC::GetMC()->Medium(kmed, uniquename.Data(), kmat, isvol, ifield, fieldm, tmaxfd, stemax, deemax, epsil,
251 mMediumMap[modname][numed] = kmed;
252 insertMediumName(uniquename.Data(), kmed);
253 insertTGeoMedium(modname, numed);
255 auto uid = gGeoManager->GetListOfMedia()->GetSize();
256 auto med = gGeoManager->Medium(uniquename.Data(), uid,
getMaterialID(modname, nmat), isvol, ifield, fieldm, tmaxfd,
257 stemax, deemax, epsil, stmin);
258 mMediumMap[modname][numed] = uid;
259 insertMediumName(uniquename.Data(), uid);
260 insertTGeoMedium(modname, numed);
264void MaterialManager::Processes(ESpecial special,
int globalindex,
265 const std::initializer_list<std::pair<EProc, int>>& parIDValMap)
267 for (
auto&
m : parIDValMap) {
268 Process(special, globalindex,
m.first,
m.second);
272void MaterialManager::Cuts(ESpecial special,
int globalindex,
273 const std::initializer_list<std::pair<ECut, Float_t>>& parIDValMap)
275 for (
auto&
m : parIDValMap) {
276 Cut(special, globalindex,
m.first,
m.second);
280void MaterialManager::Cut(ESpecial special,
int globalindex,
ECut cut,
Float_t val)
288 LOG(info) <<
"Due to low energy neutrons, neutron cut value " <<
val <<
" discarded and reset to 5e-12";
292 auto it = mCutIDToName.find(cut);
293 if (it == mCutIDToName.end()) {
297 auto ins = mDefaultCutMap.insert({cut,
val});
299 TVirtualMC::GetMC()->SetCut(it->second,
val);
302 }
else if (mApplySpecialCuts) {
303 auto ins = mMediumCutMap[globalindex].insert({cut,
val});
305 TVirtualMC::GetMC()->Gstpar(globalindex, it->second,
val);
310void MaterialManager::Process(ESpecial special,
int globalindex,
EProc process,
int val)
316 auto it = mProcessIDToName.find(
process);
317 if (it == mProcessIDToName.end()) {
321 auto ins = mDefaultProcessMap.insert({
process,
val});
323 TVirtualMC::GetMC()->SetProcess(it->second,
val);
326 }
else if (mApplySpecialProcesses) {
327 auto ins = mMediumProcessMap[globalindex].insert({
process,
val});
329 TVirtualMC::GetMC()->Gstpar(globalindex, it->second,
val);
336 for (
auto& p : mMaterialMap) {
338 std::cout <<
"Materials for key " <<
name <<
"\n";
339 for (
auto& e : p.second) {
340 std::cout <<
"internal id " << e.first <<
" to " << e.second <<
"\n";
347 for (
auto& p : mMediumMap) {
349 std::cout <<
"Tracking media for key " <<
name <<
"\n";
350 for (
auto& e : p.second) {
352 std::cout << medname <<
" ";
353 std::cout <<
"internal id " << e.first <<
" to " << e.second <<
"\n";
360 stream <<
"Summary of process settings per media.\n";
361 stream <<
"-- Default process settings:\n";
362 for (
auto& p : mDefaultProcessMap) {
363 auto it = mProcessIDToName.find(p.first);
364 if (it != mProcessIDToName.end()) {
365 stream <<
"\t" << it->second <<
" = " << p.second <<
"\n";
368 if (mApplySpecialProcesses && mMediumProcessMap.size() > 0) {
369 stream <<
"-- Custom process settings for single media:\n";
370 for (
auto&
m : mMediumProcessMap) {
373 for (
auto& p :
m.second) {
374 auto it = mProcessIDToName.find(p.first);
375 if (it != mProcessIDToName.end()) {
376 stream <<
"\t" << it->second <<
" = " << p.second <<
"\n";
385 stream <<
"Summary of cut settings per media.\n";
386 stream <<
"-- Default cut settings:\n";
387 for (
auto&
c : mDefaultCutMap) {
388 auto it = mCutIDToName.find(
c.first);
389 if (it != mCutIDToName.end()) {
390 stream <<
"\t" << it->second <<
" = " <<
c.second <<
"\n";
393 if (mApplySpecialCuts && mMediumCutMap.size() > 0) {
394 stream <<
"-- Custom cut settings for single media:\n";
395 for (
auto&
m : mMediumCutMap) {
398 for (
auto&
c :
m.second) {
399 auto it = mCutIDToName.find(
c.first);
400 if (it != mCutIDToName.end()) {
401 stream <<
"\t" << it->second <<
" = " <<
c.second <<
"\n";
409void MaterialManager::insertMaterialName(
const char* uniquename,
int index)
411 assert(mMaterialNameToGlobalIndexMap.find(uniquename) == mMaterialNameToGlobalIndexMap.end());
412 mMaterialNameToGlobalIndexMap[uniquename] =
index;
416void MaterialManager::insertTGeoMedium(std::string modname,
int localindex)
418 auto p = std::make_pair(modname, localindex);
419 assert(mTGeoMediumMap.find(p) == mTGeoMediumMap.end());
420 auto list = gGeoManager->GetListOfMedia();
421 mTGeoMediumMap[p] = (TGeoMedium*)
list->At(
list->GetEntries() - 1);
423 LOG(
debug) <<
"mapping " << modname <<
" " << localindex <<
" to " << mTGeoMediumMap[p]->GetName();
426void MaterialManager::insertMediumName(
const char* uniquename,
int index)
428 assert(mMediumNameToGlobalIndexMap.find(uniquename) == mMediumNameToGlobalIndexMap.end());
429 mMediumNameToGlobalIndexMap[uniquename] =
index;
435 auto p = std::make_pair(modname, localindex);
436 auto iter = mTGeoMediumMap.find(p);
437 if (iter == mTGeoMediumMap.end()) {
438 LOG(warning) <<
"No medium registered for " << modname <<
" index " << localindex <<
"\n";
448 auto med = gGeoManager->GetMedium(mediumname);
449 assert(med !=
nullptr);
456 if (filenameIn.empty()) {
459 std::ifstream is(filenameIn);
461 LOG(fatal) <<
"Cannot open MC cuts/processes file " << filenameIn;
464 auto digestCutsFromJSON = [
this](
int globalindex, rj::Value& cuts) {
466 for (
auto& cut : cuts.GetObject()) {
467 auto name = cut.name.GetString();
469 for (
auto& cn : mCutIDToName) {
470 if (std::strcmp(
name, cn.second) == 0) {
471 Cut(special, globalindex, cn.first, cut.value.GetFloat());
476 LOG(warn) <<
"Unknown cut parameter " <<
name;
480 auto digestProcessesFromJSON = [
this](
int globalindex, rj::Value& processes) {
482 for (
auto& proc : processes.GetObject()) {
483 auto name = proc.name.GetString();
484 for (
auto& pn : mProcessIDToName) {
485 if (std::strcmp(
name, pn.second) == 0) {
486 Process(special, globalindex, pn.first, proc.value.GetInt());
492 rj::IStreamWrapper isw(is);
498 auto& defaultParams = d[jsonKeyDefault];
499 if (defaultParams.HasMember(jsonKeyCuts)) {
500 digestCutsFromJSON(-1, defaultParams[jsonKeyCuts]);
502 if (defaultParams.HasMember(jsonKeyProcesses)) {
503 digestProcessesFromJSON(-1, defaultParams[jsonKeyProcesses]);
507 if (d.HasMember(jsonKeyEnableSpecialCuts)) {
510 if (d.HasMember(jsonKeyEnableSpecialProcesses)) {
514 for (
auto&
m : d.GetObject()) {
515 if (
m.name.GetString()[0] ==
'\0' || !
m.value.IsArray()) {
519 for (
auto& batch :
m.value.GetArray()) {
520 if (std::strcmp(
m.name.GetString(), jsonKeyDefault) == 0) {
529 if (batch.HasMember(jsonKeyCuts)) {
530 digestCutsFromJSON(
index, batch[jsonKeyCuts]);
532 if (batch.HasMember(jsonKeyProcesses)) {
533 digestProcessesFromJSON(
index, batch[jsonKeyProcesses]);
543 if (filenameOut.empty()) {
548 std::ofstream os(filenameOut);
550 LOG(error) <<
"Cannot create file " << filenameOut;
555 rj::Document::AllocatorType&
a = d.GetAllocator();
559 for (
auto& itMed : mMediumMap) {
561 rj::Value toAdd(rj::kArrayType);
563 for (
auto& locToGlob : itMed.second) {
564 auto globalindex = locToGlob.second;
565 auto itCut = mMediumCutMap.find(globalindex);
566 auto itProc = mMediumProcessMap.find(globalindex);
568 rj::Value oLoc(rj::kObjectType);
570 oLoc.AddMember(rj::Value(jsonKeyID, std::strlen(jsonKeyID),
a), rj::Value(locToGlob.first),
a);
571 oLoc.AddMember(rj::Value(jsonKeyIDGlobal, std::strlen(jsonKeyIDGlobal)), rj::Value(locToGlob.second),
a);
573 auto mediumIt = mTGeoMediumMap.find({itMed.first, locToGlob.first});
574 const char* medName = mediumIt->second->GetName();
575 const char* matName = mediumIt->second->GetMaterial()->GetName();
577 oLoc.AddMember(rj::Value(
"medium_name", 11,
a), rj::Value(medName, std::strlen(medName),
a),
a);
578 oLoc.AddMember(rj::Value(
"material_name", 13,
a), rj::Value(matName, std::strlen(matName),
a),
a);
580 if (itCut != mMediumCutMap.end()) {
581 rj::Value cutMap(rj::kObjectType);
582 writeSingleJSONParamBatch(mCutIDToName, itCut->second, -1.f, cutMap,
a);
583 oLoc.AddMember(rj::Value(jsonKeyCuts, std::strlen(jsonKeyCuts),
a), cutMap,
a);
586 if (itProc != mMediumProcessMap.end()) {
587 rj::Value procMap(rj::kObjectType);
588 writeSingleJSONParamBatch(mProcessIDToName, itProc->second, -1, procMap,
a);
589 oLoc.AddMember(rj::Value(jsonKeyProcesses, std::strlen(jsonKeyProcesses),
a), procMap,
a);
592 toAdd.PushBack(oLoc,
a);
595 d.AddMember(rj::Value(itMed.first.c_str(), itMed.first.size(),
a), toAdd,
a);
598 rj::Value cutMapDef(rj::kObjectType);
599 rj::Value procMapDef(rj::kObjectType);
600 writeSingleJSONParamBatch(mCutIDToName, mDefaultCutMap, -1.f, cutMapDef,
a);
601 writeSingleJSONParamBatch(mProcessIDToName, mDefaultProcessMap, -1, procMapDef,
a);
602 rj::Value defaultParams(rj::kObjectType);
603 defaultParams.AddMember(rj::Value(jsonKeyCuts, std::strlen(jsonKeyCuts),
a), cutMapDef,
a);
604 defaultParams.AddMember(rj::Value(jsonKeyProcesses, std::strlen(jsonKeyProcesses),
a), procMapDef,
a);
605 d.AddMember(rj::Value(jsonKeyDefault, std::strlen(jsonKeyDefault),
a), defaultParams,
a);
607 d.AddMember(rj::Value(jsonKeyEnableSpecialCuts, std::strlen(jsonKeyEnableSpecialCuts),
a), rj::Value(mApplySpecialCuts),
a);
608 d.AddMember(rj::Value(jsonKeyEnableSpecialProcesses, std::strlen(jsonKeyEnableSpecialProcesses),
a), rj::Value(mApplySpecialProcesses),
a);
610 rj::OStreamWrapper osw(os);
611 rj::PrettyWriter<rj::OStreamWrapper> writer(osw);
612 writer.SetIndent(
' ', 2);
623 const int NCUTS = 10;
624 const int NFLAGS = 12;
655 if (!cutfile.is_open()) {
656 LOG(warn) <<
"File " <<
filename <<
" does not exist; Cannot apply cuts";
667 while (cutfile.getline(line, 256)) {
669 for (
int i = 0;
i < NCUTS;
i++) {
672 for (
int i = 0;
i < NFLAGS;
i++) {
675 if (strlen(line) == 0) {
679 if (line[0] ==
'*') {
683 iret = sscanf(line,
"%6s %d %f %f %f %f %f %f %f %f %f %f %d %d %d %d %d %d %d %d %d %d %d %d",
684 detName, &itmed, &cut[0], &cut[1], &cut[2], &cut[3], &cut[4], &cut[5], &cut[6], &cut[7], &cut[8],
685 &cut[9], &flag[0], &flag[1], &flag[2], &flag[3], &flag[4], &flag[5], &flag[6], &flag[7],
686 &flag[8], &flag[9], &flag[10], &flag[11]);
693 for (
int i = 0;
i < NCUTS; ++
i) {
700 for (
int i = 0;
i < NFLAGS - 1; ++
i) {
712 const std::initializer_list<std::pair<ECut, Float_t>>& parIDValMap)
714 int globalindex =
getMediumID(modname, localindex);
715 if (globalindex != -1) {
722 int globalindex =
getMediumID(modname, localindex);
723 if (globalindex != -1) {
726 LOG(warn) <<
"SpecialCut: NO GLOBALINDEX FOUND FOR " << modname <<
" " << localindex;
733 int globalindex =
getMediumID(modname, localindex);
734 if (globalindex != -1) {
737 LOG(warn) <<
"SpecialProcess: NO GLOBALINDEX FOUND FOR " << modname <<
" " << localindex;
743 auto lookupiter = mMaterialMap.find(modname);
744 if (lookupiter == mMaterialMap.end()) {
747 auto lookup = lookupiter->second;
749 auto iter =
lookup.find(imat);
750 if (iter !=
lookup.end()) {
758 auto lookupiter = mMediumMap.find(modname);
759 if (lookupiter == mMediumMap.end()) {
762 auto lookup = lookupiter->second;
764 auto iter =
lookup.find(imed);
765 if (iter !=
lookup.end()) {
777 auto lookupiter = mMediumMap.find(modname);
778 if (lookupiter == mMediumMap.end()) {
781 auto lookup = lookupiter->second;
784 auto maxkey =
lookup.rbegin()->first;
786 mapping.resize(maxkey + 1, -1);
789 mapping[p.first] = p.second;
796 mediumProcessVector.clear();
799 mediumProcessVector.resize(mMediumProcessMap.size(), -1);
801 for (
auto&
m : mMediumProcessMap) {
803 for (
auto& p :
m.second) {
806 mediumProcessVector[
m.first] = p.second;
816 mediumCutVector.clear();
819 mediumCutVector.resize(mMediumCutMap.size(), -1.);
821 for (
auto&
m : mMediumCutMap) {
823 for (
auto&
c :
m.second) {
825 if (
c.first == cut) {
826 mediumCutVector[
m.first] =
c.second;
836 processVector.clear();
837 for (
auto&
m : mDefaultProcessMap) {
838 processVector.emplace_back(
m.first,
m.second);
845 for (
auto&
m : mDefaultCutMap) {
846 cutVector.emplace_back(
m.first,
m.second);
852 processVector.clear();
853 if (mMediumProcessMap.find(globalindex) != mMediumProcessMap.end()) {
854 for (
auto&
m : mMediumProcessMap[globalindex]) {
855 processVector.emplace_back(
m.first,
m.second);
862 int globalindex =
getMediumID(modname, localindex);
863 if (globalindex != -1) {
871 if (mMediumCutMap.find(globalindex) != mMediumCutMap.end()) {
872 for (
auto&
m : mMediumCutMap[globalindex]) {
873 cutVector.emplace_back(
m.first,
m.second);
880 int globalindex =
getMediumID(modname, localindex);
881 if (globalindex != -1) {
889 for (
auto&
m : mMediumMap) {
890 for (
auto&
i :
m.second) {
892 if (
i.second == globalindex) {
895 return m.first.c_str();
908 for (
auto&
n : mMediumNameToGlobalIndexMap) {
909 if (
n.second == globalindex) {
912 return n.first.c_str();
922 auto vol = gGeoManager->FindVolumeFast(volumename.c_str());
923 if (vol ==
nullptr) {
924 LOG(warn) <<
"No volume found; Cannot query medias";
926 std::set<TGeoMedium const*> media;
930 std::function<
void(TGeoVolume
const* vol, std::set<TGeoMedium const*>& mediumset)> recursivevisitor;
931 recursivevisitor = [&recursivevisitor](TGeoVolume
const* vol, std::set<TGeoMedium const*>& mediumset) {
933 if (!vol->IsAssembly()) {
934 mediumset.insert(vol->GetMedium());
936 const int n = vol->GetNdaughters();
937 for (
int i = 0;
i <
n; ++
i) {
938 auto daughter = vol->GetNode(
i)->GetVolume();
939 recursivevisitor(daughter, mediumset);
942 recursivevisitor(vol, media);
945 for (
auto m : media) {
946 std::cout <<
m->GetName() <<
"\n";
uint8_t lookup(const char input) noexcept
void printCuts(std::ostream &stream) const
Print all cuts for all media as well as defaults.
void getSpecialCuts(int globalindex, std::vector< std::pair< ECut, Float_t > > &cutVector)
Get special cuts for global medium ID.
void SpecialCuts(const char *modname, int localindex, const std::initializer_list< std::pair< ECut, Float_t > > &parIDValMap)
void getMediumIDMappingAsVector(const char *modname, std::vector< int > &mapping) const
void getDefaultProcesses(std::vector< std::pair< EProc, int > > &processVector)
Fill vector with default processes.
void printProcesses(std::ostream &stream) const
Print all processes for all media as well as defaults.
void enableSpecialCuts(bool val=true)
void writeCutsAndProcessesToJSON(std::string const &filename="")
void loadCutsAndProcessesFromFile(const char *modname, const char *filename)
load cuts and process flags from a data file (like AliRoot did)
void loadCutsAndProcessesFromJSON(ESpecial special=ESpecial::kFALSE, std::string const &filename="")
void getMediaWithSpecialProcess(EProc process, std::vector< int > &mediumProcessVector) const
get global medium IDs where special process is set along with process value
int getMediumID(const char *modname, int imed) const
void getSpecialProcesses(int globalindex, std::vector< std::pair< EProc, int > > &processVector)
Get special processes for global medium ID.
const char * getMediumNameFromMediumID(int globalindex) const
Get medium name from global medium ID.
void getMediaWithSpecialCut(ECut cut, std::vector< Float_t > &mediumCutVector) const
get global medium IDs where special cut is set along with cut value
static void printContainingMedia(std::string const &volumename)
void Mixture(const char *modname, Int_t imat, const char *name, Float_t *a, Float_t *z, Float_t dens, Int_t nlmat, Float_t *wmat)
void SpecialProcess(const char *modname, int localindex, EProc parID, int val)
Custom setting of process or cut given parameter name and value.
void printMaterials() const
void Medium(const char *modname, Int_t numed, const char *name, Int_t nmat, Int_t isvol, Int_t ifield, Float_t fieldm, Float_t tmaxfd, Float_t stemax, Float_t deemax, Float_t epsil, Float_t stmin, Float_t *ubuf=nullptr, Int_t nbuf=0)
void SpecialCut(const char *modname, int localindex, ECut parID, Float_t val)
Custom setting of process or cut given parameter name and value.
void Material(const char *modname, Int_t imat, const char *name, Float_t a, Float_t z, Float_t dens, Float_t radl, Float_t absl, Float_t *buf=nullptr, Int_t nwbuf=0)
void enableSpecialProcesses(bool val=true)
Set flags whether to use special cuts and process settings.
const char * getModuleFromMediumID(int globalindex) const
Get module name which has medium of a certain global medium ID.
ESpecial
scoped enum to decide whether settings are done globally or for a certain medium
int getMaterialID(const char *modname, int imat) const
void getDefaultCuts(std::vector< std::pair< ECut, Float_t > > &cutVector)
Fill vector with default cuts.
TGeoMedium * getTGeoMedium(const std::string &modname, int localid)
static const SimMaterialParams & Instance()
GLuint const GLchar * name
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
GLboolean GLboolean GLboolean GLboolean a
GLenum GLuint GLenum GLsizei const GLchar * buf
GLdouble GLdouble GLdouble z
float globalDensityFactor
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"