7 #include <FairLogger.h>
9 #include <TGenericClassInfo.h>
11 #include <TGeoManager.h>
12 #include <TGeoMaterial.h>
13 #include <TGeoVolume.h>
15 #include <TObjArray.h>
27 , fPercentNobleGas(0.)
33 LOG(fatal) <<
"CbmTrdGas::CbmTrdGas Singleton instance already exists.";
48 (TGeoVolume*) gGeoManager->GetListOfVolumes()->FindObject(
"gas");
50 TObjArray* volList = gGeoManager->GetListOfVolumes();
51 TObjArrayIter iter(volList);
52 TGeoVolume* vol =
nullptr;
53 LOG(error) <<
"********** List of available volumes ************ ";
54 while ((vol = (TGeoVolume*) iter.Next())) {
55 LOG(error) << vol->GetName();
57 LOG(error) <<
"***************** End of List ******************* \n"
58 <<
" -E- Could not find volume <gas>. \n"
59 <<
" -E- If there is no list above this text then probably \n"
60 <<
" -E- the geometry was not loaded in the macro.\n"
61 <<
" -E- Please do it with fRun->LoadGeometry(). \n "
62 <<
" -E- If you see a list probably the names of the \n"
63 <<
" -E- volumes have changed and CbmTrdRadiator has to \n"
64 <<
" -E- be changed accordingly. ";
65 LOG(fatal) <<
"CbmTrdGas::Init: No volumes defined.";
71 (TGeoVolume*) gGeoManager->GetListOfVolumes()->FindObject(
"trd1mb");
74 TGeoBBox*
shape = (TGeoBBox*) fm->GetShape();
83 LOG(info) <<
"CbmTrdGas::Init: Detector type : double sided geometry (1) ";
84 LOG(info) <<
"CbmTrdGas::Init: Gas thickness : " <<
fGasThick <<
" cm";
88 LOG(info) <<
"CbmTrdGas::Init: Detector type : standard GSI geometry (2) ";
89 LOG(info) <<
"CbmTrdGas::Init: Gas thickness : " <<
fGasThick <<
" cm";
93 TGeoMixture* mixt = (TGeoMixture*) fm->GetMaterial();
94 Int_t nmixt = mixt->GetNelements();
96 LOG(error) <<
"CbmTrdGas::Init: This is not a mixture composed out of "
97 "three different elements.";
99 <<
"CbmTrdGas::Init: Don't know what to do, so stop execution here.";
100 LOG(fatal) <<
"CbmTrdGas::Init: Unknown gas mixture.";
103 Bool_t foundCarbon = kFALSE;
104 Bool_t foundOxygen = kFALSE;
109 Double_t* elem = mixt->GetZmixt();
110 Double_t* weight = mixt->GetWmixt();
111 Double_t* amixt = mixt->GetAmixt();
113 for (Int_t
i = 0;
i < nmixt;
i++) {
114 if (elem[
i] == 6.0) {
117 }
else if (elem[
i] == 8.0) {
123 if (!(foundCarbon && foundOxygen)) {
124 LOG(error) <<
"CbmTrdGas::Init: This gas mixture has no CO2 admixture \n"
125 <<
"CbmTrdGas::Init: If you want to use this mixture you have "
127 <<
"CbmTrdGas::Init: CbmTrdRadiator to be consistent \n";
128 LOG(fatal) <<
"CbmTrdGas::Init: Unknown gas mixture.";
130 if (elem[noblegas] != 54) {
131 LOG(error) <<
"CbmTrdGas::Init: This gas mixture has no Xe admixture \n"
132 <<
"CbmTrdGas::Init: If you want to use this mixture you have "
134 <<
"CbmTrdGas::Init: CbmTrdRadiator to be consistent";
135 LOG(fatal) <<
"CbmTrdGas::Init: Unknown gas mixture.";
140 Double_t massC = amixt[carbon];
141 Double_t massO = amixt[oxygen];
142 Double_t massXe = amixt[noblegas];
143 Double_t
x = weight[noblegas];
144 Double_t percentNoblegas =
146 * (((massC *
x) + (2 * massO *
x))
147 / (massXe + massC *
x + 2 * massO *
x - massXe *
x));
152 if (elem[noblegas] == 54) {
153 LOG(info) <<
"CbmTrdGas::Init: Percent (Xe) : "
156 LOG(info) <<
"CbmTrdGas::Init: Percent (CO2) : " << (
fPercentCO2 * 100);
162 if (method.Contains(
"Like")) {
164 }
else if (method.Contains(
"ANN")) {
168 <<
"CbmTrdGas::GetFileName: Electron ID method " << method
170 <<
"CbmTrdGas::GetFileName: The input must be either Like or ANN";
177 Int_t thickness = TMath::Nint(
fGasThick * 10);
179 const char* detector =
"";
185 LOG(error) <<
"CbmTrdGas::SetFileName: Detector type " <<
fDetType
187 LOG(error) <<
"CbmTrdGas::SetFileName: Stop execution of program due to "
188 "initialization error.";
189 LOG(fatal) <<
"CbmTrdGas::SetFileName: Unknown detector type.";
191 const char* gastype =
"";
195 LOG(error) <<
"CbmTrdGas::SetFileName: Gas type " <<
fNobleGasType
197 LOG(error) <<
"CbmTrdGas::SetFileName: Stop execution of program due to "
198 "initialization error.";
199 LOG(fatal) <<
"CbmTrdGas::SetFileName: Unknown gas type.";
202 TString path = getenv(
"VMCWORKDIR");
203 path = path +
"/parameters/trd/";
205 "Likelihood_%s_%d_%s_%d.root", gastype, fraction, detector, thickness);
207 "ANN_%s_%d_%s_%d.root", gastype, fraction, detector, thickness);