Skip to content

Commit ffa30ca

Browse files
Merge pull request #6 from mslupeck/dev
Fixed material definition in FIT-V0+
2 parents a04fde0 + dcb3915 commit ffa30ca

File tree

2 files changed

+8
-156
lines changed

2 files changed

+8
-156
lines changed

Detectors/FIT/V0/base/src/Geometry.cxx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ void Geometry::buildGeometry(){
8282
}
8383

8484
TGeoVolumeAssembly* Geometry::buildSector(uint16_t iSector){
85-
new TGeoBBox("boolBoxScintSeparator", mvrMaxScint.at(mvrMaxScint.size() - 1), sDySeparationScint * 2, sDzScint + sEpsilon);
85+
new TGeoBBox("boolBoxScintSeparator", mvrMaxScint.at(mvrMaxScint.size()-1), sDySeparationScint*2, sDzScint+sEpsilon);
8686

8787
std::stringstream ssName;
8888
ssName << "sector" << iSector+1;
@@ -100,8 +100,8 @@ TGeoVolumeAssembly* Geometry::buildSector(uint16_t iSector){
100100
booleanFormula += (std::string)"-boolBoxScintSeparator" + ":rotPhiSector1"; // subtract clockwise box (same but rotated by 45 degrees)
101101
TGeoCompositeShape* geoCell = new TGeoCompositeShape(ssNameGeoComposite.str().c_str(), booleanFormula.c_str());
102102

103-
TGeoMedium* kMed = gGeoManager->GetMedium("V0_Scintillator");
104-
TGeoVolume *volCell = new TGeoVolume("cell", geoCell, kMed);
103+
TGeoMedium* kMed = gGeoManager->GetMedium("V0_Scintillator$");
104+
TGeoVolume *volCell = new TGeoVolume("V0cell", geoCell, kMed);
105105

106106
volCell->SetLineColor(kYellow);
107107
sector->AddNode(volCell, iCell+1);
@@ -110,7 +110,6 @@ TGeoVolumeAssembly* Geometry::buildSector(uint16_t iSector){
110110
}
111111

112112
void Geometry::assembleSectors(TGeoVolumeAssembly *volV0){
113-
// for(uint16_t isector=0; isector<1; isector++){
114113
for(uint16_t isector=0; isector<mvPhiRot.size(); isector++){
115114
TGeoVolumeAssembly *sector = buildSector(isector);
116115
volV0->AddNode(sector, isector+1, mvPhiRot.at(isector));

Detectors/FIT/V0/simulation/src/Detector.cxx

Lines changed: 5 additions & 152 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ Detector::Detector(Bool_t isActive)
6161

6262
void Detector::InitializeO2Detector()
6363
{
64-
LOG(INFO) << "Initializing FIT V0 geometry\n";
64+
LOG(INFO) << "FIT_V0: Initializing O2 detector";
6565

66-
TGeoVolume* volSensitive = gGeoManager->GetVolume("cell");
66+
TGeoVolume* volSensitive = gGeoManager->GetVolume("V0cell");
6767
if (!volSensitive) {
6868
LOG(FATAL) << "Can't find FIT V0 sensitive volume: cell";
6969
}
@@ -151,6 +151,7 @@ o2::v0::Hit* Detector::addHit(Int_t trackId, Int_t cellId, Int_t particleId,
151151
// TODO: -> verify Todos inside the function
152152
void Detector::createMaterials()
153153
{
154+
LOG(INFO) << "FIT_V0: Creating materials";
154155
// Air mixture
155156
const Int_t nAir = 4;
156157
Float_t aAir[nAir] = { 12.0107, 14.0067, 15.9994, 39.948 };
@@ -195,7 +196,7 @@ void Detector::createMaterials()
195196
o2::Base::Detector::Mixture(++matId, "Air$", aAir, zAir, dAir, nAir, wAir);
196197
o2::Base::Detector::Medium(Air, "Air$", matId, unsens, fieldType, maxField, tmaxfd, stemax, deemax, epsil, stmin);
197198

198-
o2::Base::Detector::Mixture(++matId, "Scintillator", aScint, zScint, dScint, nScint, wScint);
199+
o2::Base::Detector::Mixture(++matId, "Scintillator$", aScint, zScint, dScint, nScint, wScint);
199200
o2::Base::Detector::Medium(Scintillator, "Scintillator$", matId, unsens, fieldType, maxField, tmaxfd, stemax, deemax, epsil, stmin);
200201

201202
// o2::Base::Detector::Material(++matId, "Alu$", aAlu, zAlu, dAlu, radAlu, absAlu);
@@ -206,7 +207,7 @@ void Detector::createMaterials()
206207

207208
void Detector::ConstructGeometry()
208209
{
209-
LOG(DEBUG) << "Creating FIT V0 geometry\n";
210+
LOG(INFO) << "FIT_V0: Constructing geometry";
210211
createMaterials();
211212
mGeometry = new Geometry(Geometry::eOnlySensitive);
212213
}
@@ -233,151 +234,3 @@ void Detector::Reset()
233234
mHits->clear();
234235
}
235236
}
236-
237-
238-
239-
240-
241-
242-
/*void Detector::DefineOpticalProperties()
243-
{
244-
// Path of the optical properties input file
245-
TString inputDir;
246-
const char* aliceO2env = std::getenv("O2_ROOT");
247-
if (aliceO2env)
248-
inputDir = aliceO2env;
249-
inputDir += "/share/Detectors/T0/files/";
250-
251-
TString optPropPath = inputDir + "quartzOptProperties.txt";
252-
optPropPath = gSystem->ExpandPathName(optPropPath.Data()); // Expand $(ALICE_ROOT) into real system path
253-
254-
if (ReadOptProperties(optPropPath.Data()) < 0) {
255-
// Error reading file
256-
LOG(ERROR) << "Could not read FIT optical properties" << FairLogger::endl;
257-
return;
258-
}
259-
Int_t nBins = mPhotonEnergyD.size();
260-
// set QE
261-
mPMTeff = new TGraph(nBins, &(mPhotonEnergyD[0]), &(mQuantumEfficiency[0]));
262-
263-
// Prepare pointers for arrays with constant and hardcoded values (independent on wavelength)
264-
FillOtherOptProperties();
265-
266-
// Quick conversion from vector<Double_t> to Double_t*: photonEnergyD -> &(photonEnergyD[0])
267-
TVirtualMC::GetMC()->SetCerenkov(getMediumID(kOpGlass), nBins, &(mPhotonEnergyD[0]), &(mAbsorptionLength[0]),
268-
&(mEfficAll[0]), &(mRefractionIndex[0]));
269-
// TVirtualMC::GetMC()->SetCerenkov (getMediumID(kOpGlassCathode), kNbins, aPckov, aAbsSiO2, effCathode, rindexSiO2);
270-
TVirtualMC::GetMC()->SetCerenkov(getMediumID(kOpGlassCathode), nBins, &(mPhotonEnergyD[0]), &(mAbsorptionLength[0]),
271-
&(mEfficAll[0]), &(mRefractionIndex[0]));
272-
273-
// Define a border for radiator optical properties
274-
//TVirtualMC::GetMC()->DefineOpSurface("surfRd", kGlisur, kDielectric_metal, kPolished, 0.);
275-
TVirtualMC::GetMC()->DefineOpSurface("surfRd", kUnified, kDielectric_metal, kPolished, 0.);
276-
TVirtualMC::GetMC()->SetMaterialProperty("surfRd", "EFFICIENCY", nBins, &(mPhotonEnergyD[0]), &(mEfficMet[0]));
277-
TVirtualMC::GetMC()->SetMaterialProperty("surfRd", "REFLECTIVITY", nBins, &(mPhotonEnergyD[0]), &(mReflMet[0]));
278-
}
279-
280-
void Detector::FillOtherOptProperties()
281-
{
282-
// Set constant values to the other arrays
283-
for (Int_t i = 0; i < mPhotonEnergyD.size(); i++) {
284-
mEfficAll.push_back(1.);
285-
mRindexAir.push_back(1.);
286-
mAbsorAir.push_back(0.3);
287-
mRindexCathodeNext.push_back(0.);
288-
mAbsorbCathodeNext.push_back(0.);
289-
mEfficMet.push_back(0.);
290-
mReflMet.push_back(1.);
291-
}
292-
}
293-
294-
//------------------------------------------------------------------------
295-
Bool_t Detector::RegisterPhotoE(float energy)
296-
{
297-
// Float_t hc=197.326960*1.e6; //mev*nm
298-
float hc = 1.973 * 1.e-6; // gev*nm
299-
float lambda = hc / energy;
300-
float eff = mPMTeff->Eval(lambda);
301-
float p = gRandom->Rndm();
302-
303-
if (p > eff)
304-
return kFALSE;
305-
306-
return kTRUE;
307-
}
308-
309-
Int_t Detector::ReadOptProperties(const std::string filePath)
310-
{
311-
std::ifstream infile;
312-
infile.open(filePath.c_str());
313-
314-
// Check if file is opened correctly
315-
if (infile.fail() == true) {
316-
// AliFatal(Form("Error opening ascii file: %s", filePath.c_str()));
317-
return -1;
318-
}
319-
320-
std::string comment; // dummy, used just to read 4 first lines and move the cursor to the 5th, otherwise unused
321-
if (!getline(infile, comment)) { // first comment line
322-
// AliFatal(Form("Error opening ascii file (it is probably a folder!): %s", filePath.c_str()));
323-
return -2;
324-
}
325-
getline(infile, comment); // 2nd comment line
326-
327-
// Get number of elements required for the array
328-
Int_t nLines;
329-
infile >> nLines;
330-
if (nLines < 0 || nLines > 1e4) {
331-
// AliFatal(Form("Input arraySize out of range 0..1e4: %i. Check input file: %s", kNbins, filePath.c_str()));
332-
return -4;
333-
}
334-
335-
getline(infile, comment); // finish 3rd line after the nEntries are read
336-
getline(infile, comment); // 4th comment line
337-
338-
// read the main body of the file (table of values: energy, absorption length and refractive index)
339-
Int_t iLine = 0;
340-
std::string sLine;
341-
getline(infile, sLine);
342-
while (!infile.eof()) {
343-
if (iLine >= nLines) {
344-
// AliFatal(Form("Line number: %i reaches range of declared arraySize: %i. Check input file: %s", iLine,
345-
// kNbins, filePath.c_str()));
346-
return -5;
347-
}
348-
std::stringstream ssLine(sLine);
349-
// First column:
350-
Double_t energy;
351-
ssLine >> energy;
352-
energy *= 1e-9; // Convert eV -> GeV immediately
353-
mPhotonEnergyD.push_back(energy);
354-
// Second column:
355-
Double_t absorption;
356-
ssLine >> absorption;
357-
mAbsorptionLength.push_back(absorption);
358-
// Third column:
359-
Double_t refraction;
360-
ssLine >> refraction;
361-
mRefractionIndex.push_back(refraction);
362-
// Fourth column:
363-
Double_t efficiency;
364-
ssLine >> efficiency;
365-
mQuantumEfficiency.push_back(efficiency);
366-
if (!(ssLine.good() || ssLine.eof())) { // check if there were problems with numbers conversion
367-
// AliFatal(Form("Error while reading line %i: %s", iLine, ssLine.str().c_str()));
368-
return -6;
369-
}
370-
getline(infile, sLine);
371-
iLine++;
372-
}
373-
if (iLine != mPhotonEnergyD.size()) {
374-
// AliFatal(Form("Total number of lines %i is different than declared %i. Check input file: %s", iLine, kNbins,
375-
// filePath.c_str()));
376-
return -7;
377-
}
378-
379-
// AliInfo(Form("Optical properties taken from the file: %s. Number of lines read: %i",filePath.c_str(),iLine));
380-
return 0;
381-
}
382-
*/
383-

0 commit comments

Comments
 (0)