138 return sDetectorRightName +
"_0";
143 return sDetectorLeftName +
"_1";
155 inline static const std::string sDetectorName =
"FV0";
156 inline static const std::string sDetectorRightName = sDetectorName +
"RIGHT";
157 inline static const std::string sDetectorLeftName = sDetectorName +
"LEFT";
160 static constexpr float sEpsilon = 0.01;
161 static constexpr float sDzScintillator = 4;
162 static constexpr float sDzPlastic = 1;
164 static constexpr float sXGlobal = 0;
165 static constexpr float sYGlobal = 0;
167 static constexpr float sZGlobal = 320 - sDzScintillator / 2;
168 static constexpr float sDxHalvesSeparation = 0;
169 static constexpr float sDyHalvesSeparation = 0;
170 static constexpr float sDzHalvesSeparation = 0;
173 static constexpr int sNumberOfCellSectors = 4;
174 static constexpr int sNumberOfCellRings = 5;
175 static constexpr int sNumberOfCells = sNumberOfCellRings * sNumberOfCellSectors * 2;
176 static constexpr int sNumberOfReadoutChannels = sNumberOfCells + sNumberOfCellSectors * 2;
179 static constexpr int sCellToRing[sNumberOfCells] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4};
180 static constexpr int sCellToSector[sNumberOfCells] = {0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7};
183 static constexpr float sCellRingRadii[sNumberOfCellRings + 1]{4.01, 7.3, 12.9, 21.25, 38.7, 72.115};
184 static constexpr char sCellTypes[sNumberOfCellSectors]{
'a',
'b',
'b',
'a'};
186 static constexpr float sDrSeparationScint = 0.03 + 0.04;
189 static constexpr float sXShiftInnerRadiusScintillator = -0.15;
191 static constexpr float sDxHoleExtensionScintillator = 0.2;
192 static constexpr float sDrHoleSmallScintillator = 0.265;
193 static constexpr float sDrHoleLargeScintillator = 0.415;
196 static constexpr float sDzContainer = 30;
197 static constexpr float sDrContainerHole = 4.05;
198 static constexpr float sXShiftContainerHole = -0.15;
199 static constexpr float sDrMaxContainerBack = 83.1;
200 static constexpr float sDzContainerBack = 1;
201 static constexpr float sDrMinContainerFront = 45.7;
202 static constexpr float sDrMaxContainerFront = 83.1;
203 static constexpr float sDzContainerFront = 1;
204 static constexpr float sDxContainerStand = 40;
205 static constexpr float sDyContainerStand = 3;
206 static constexpr float sDrMinContainerCone = 24.3;
207 static constexpr float sDzContainerCone = 16.2;
208 static constexpr float sThicknessContainerCone = 0.6;
209 static constexpr float sXYThicknessContainerCone = 0.975;
210 static constexpr float sDrMinContainerOuterShield = 82.5;
211 static constexpr float sDrMaxContainerOuterShield = 82.65;
212 static constexpr float sDrMinContainerInnerShield = 4;
213 static constexpr float sDrMaxContainerInnerShield = 4.05;
214 static constexpr float sDxContainerCover = 0.15;
215 static constexpr float sDxContainerStandBottom = 38.5;
216 static constexpr float sDyContainerStandBottom = 2;
219 static constexpr int sNumberOfPMTs = 24;
220 static constexpr int sNumberOfPMTsPerSector = 6;
221 static constexpr float sDrPmt = 3.75;
222 static constexpr float sDzPmt = 12.199;
223 static constexpr float sMPmt = 376.77;
224 static constexpr float sDensityPmt = sMPmt / (M_PI * sDrPmt * sDrPmt * sDzPmt);
227 static constexpr int sNumberOfPMTFiberVolumes = 5;
229 static constexpr int sPMTFiberCellOrder[sNumberOfPMTsPerSector] = {2, 5, 4, 3, 5, 1};
234 static constexpr float sXScintillator = sDxContainerCover;
236 static constexpr float sZScintillator = 0;
238 static constexpr float sZPlastic = sZScintillator + sDzScintillator / 2 + sDzPlastic / 2;
240 static constexpr float sZContainerBack = sZScintillator - sDzScintillator / 2 - sDzContainerBack / 2;
242 static constexpr float sZContainerFront = sZContainerBack - sDzContainerBack / 2 + sDzContainer - sDzContainerFront / 2;
244 static constexpr float sZContainerMid = (sZContainerBack + sZContainerFront) / 2;
246 static constexpr float sZFiber = (sZPlastic + sZContainerFront) / 2;
248 static constexpr float sZCone = sZContainerFront + sDzContainerFront / 2 - sDzContainerCone / 2;
250 static constexpr float sXShiftScrews = sXScintillator;
252 static constexpr float sXPmt[sNumberOfPMTs] = {8.023, 16.612, 24.987, 33.042, 40.671, 47.778, 59.646, 64.73, 68.982, 72.348, 74.783, 76.257, 76.330, 74.931, 72.569, 69.273, 65.088, 60.065, 48.3, 41.238, 33.645, 25.62, 17.265, 8.688};
254 static constexpr float sYPmt[sNumberOfPMTs] = {76.33, 74.931, 72.569, 69.273, 65.088, 60.065, 48.3, 41.238, 33.645, 25.62, 17.265, 8.688, -8.023, -16.612, -24.987, -33.042, -40.671, -47.778, -59.646, -64.73, -68.982, -72.348, -74.783, -76.257};
256 static constexpr float sZPmt = sZContainerBack + sDzContainerBack / 2 + sDzPmt / 2;
261 static constexpr int sNumberOfScrewTypes = 6;
263 static constexpr float sDrMinScrewTypes[sNumberOfScrewTypes]{0.25, 0.25, 0.4, 0.4, 0.4, 0.4};
265 static constexpr float sDrMaxScrewTypes[sNumberOfScrewTypes]{0, 0.5, 0.6, 0.6, 0.6, 0};
267 static constexpr float sDzMaxScrewTypes[sNumberOfScrewTypes]{6.02, 13.09, 13.1, 23.1, 28.3, 5};
269 static constexpr float sDzMinScrewTypes[sNumberOfScrewTypes]{0, 6.78, 6.58, 15.98, 21.48, 0};
271 static constexpr float sZShiftScrew = 0;
274 static constexpr int sNumberOfRodTypes = 4;
276 static constexpr float sDxMinRodTypes[sNumberOfRodTypes]{0.366, 0.344, 0.344, 0.344};
278 static constexpr float sDxMaxRodTypes[sNumberOfRodTypes]{0.536, 0.566, 0.566, 0.716};
280 static constexpr float sDyMinRodTypes[sNumberOfRodTypes]{0.5, 0.8, 0.8, 0.8};
282 static constexpr float sDyMaxRodTypes[sNumberOfRodTypes]{0.9, 1.2, 1.2, 1.2};
284 static constexpr float sDzMaxRodTypes[sNumberOfRodTypes]{12.5, 12.5, 22.5, 27.7};
286 static constexpr float sDzMinRodTypes[sNumberOfRodTypes]{7.45, 7.45, 17.45, 22.65};
288 static constexpr float sZShiftRod = -0.05;
291 inline static const std::string sScintillatorName =
"SCINT";
292 inline static const std::string sPlasticName =
"PLAST";
293 inline static const std::string sSectorName =
"SECTOR";
294 inline static const std::string sCellName =
"CELL";
295 inline static const std::string sScintillatorSectorName = sScintillatorName + sSectorName;
296 inline static const std::string sScintillatorCellName = sScintillatorName + sCellName;
297 inline static const std::string sPlasticSectorName = sPlasticName + sSectorName;
298 inline static const std::string sPlasticCellName = sPlasticName + sCellName;
299 inline static const std::string sPmtName =
"PMT";
300 inline static const std::string sFiberName =
"FIBER";
301 inline static const std::string sScrewName =
"SCREW";
302 inline static const std::string sScrewHolesCSName =
"FV0SCREWHOLES";
303 inline static const std::string sRodName =
"ROD";
304 inline static const std::string sRodHolesCSName =
"FV0RODHOLES";
305 inline static const std::string sContainerName =
"CONTAINER";
308 void initializeGeometry();
311 void initializeMaps();
314 void initializeVectors();
317 void initializeTransformations();
320 void initializeCellRingRadii();
323 void initializeSectorTransformations();
326 void initializeFiberVolumeRadii();
329 void initializeFiberMedium();
332 void initializeScrewAndRodRadii();
335 void initializeScrewTypeMedium();
338 void initializeRodTypeMedium();
344 void addScrewProperties(
int screwTypeID,
int iRing,
float phi);
349 void addRodProperties(
int rodTypeID,
int iRing);
352 void initializeScrewAndRodPositionsAndDimensions();
355 void initializeSensVols();
358 void initializeNonSensVols();
362 void initializeScrewHoles();
366 void initializeRodHoles();
373 void initializeCells(
const std::string& cellType,
const float zThickness,
const TGeoMedium* medium,
bool isSensitive);
376 void initializeScintCells();
379 void initializePlasticCells();
382 void initializePmts();
385 void initializeFibers();
388 void initializeScrews();
391 void initializeRods();
394 void initializeMetalContainer();
399 void assembleSensVols(TGeoVolume* vFV0Right, TGeoVolume* vFV0Left)
const;
404 void assembleNonSensVols(TGeoVolume* vFV0Right, TGeoVolume* vFV0Left)
const;
409 void assembleScintSectors(TGeoVolume* vFV0Right, TGeoVolume* vFV0Left)
const;
414 void assemblePlasticSectors(TGeoVolume* vFV0Right, TGeoVolume* vFV0Left)
const;
419 void assemblePmts(TGeoVolume* vFV0Right, TGeoVolume* vFV0Left)
const;
424 void assembleFibers(TGeoVolume* vFV0Right, TGeoVolume* vFV0Left)
const;
429 void assembleScrews(TGeoVolume* vFV0Right, TGeoVolume* vFV0Left)
const;
434 void assembleRods(TGeoVolume* vFV0Right, TGeoVolume* vFV0Left)
const;
439 void assembleMetalContainer(TGeoVolume* vFV0Right, TGeoVolume* vFV0Left)
const;
444 TGeoVolumeAssembly* buildSectorAssembly(
const std::string& cellName)
const;
450 TGeoVolumeAssembly* buildSector(
const std::string& cellType,
int iSector)
const;
459 TGeoShape* createScrewShape(
const std::string& shapeName,
int screwTypeID,
float xEpsilon = 0,
float yEpsilon = 0,
460 float zEpsilon = 0)
const;
469 TGeoShape* createRodShape(
const std::string& shapeName,
int rodTypeID,
float xEpsilon = 0,
float yEpsilon = 0,
470 float zEpsilon = 0)
const;
478 TGeoTranslation* createAndRegisterTrans(
const std::string&
name,
double dx = 0,
double dy = 0,
double dz = 0)
const;
486 TGeoRotation* createAndRegisterRot(
const std::string&
name,
double phi = 0,
double theta = 0,
double psi = 0)
const;
492 const std::string createVolumeName(
const std::string& volumeType,
int number = -1)
const;
495 void initializeCellCenters();
496 void initializeReadoutCenters();
498 std::vector<std::string> mSensitiveVolumeNames;
503 std::vector<float> mRAvgRing;
504 std::vector<float> mRMinScintillator;
505 std::vector<float> mRMaxScintillator;
506 std::vector<float> mRMinFiber;
507 std::vector<float> mRMaxFiber;
511 std::vector<TGeoMedium*> mMediumFiberRings;
512 std::vector<TGeoMedium*> mMediumFiberPMTs;
514 std::vector<float> mRScrewAndRod;
516 std::vector<float> mDrMinScrews;
517 std::vector<float> mDrMaxScrews;
518 std::vector<float> mDzMaxScrews;
519 std::vector<float> mDzMinScrews;
521 std::vector<float> mRScrews;
522 std::vector<int> mScrewTypeIDs;
524 std::vector<float> mDxMinRods;
525 std::vector<float> mDxMaxRods;
526 std::vector<float> mDyMinRods;
527 std::vector<float> mDyMaxRods;
528 std::vector<float> mDzMaxRods;
529 std::vector<float> mDzMinRods;
530 std::vector<int> mRodTypeIDs;
532 std::vector<TGeoMatrix*> mSectorTrans;
533 std::vector<std::vector<float>> mScrewPos;
534 std::vector<std::vector<float>> mRodPos;
535 std::vector<TGeoMedium*> mMediumScrewTypes;
536 std::vector<TGeoMedium*> mMediumRodTypes;
538 const int mGeometryType;
539 std::map<EGeoComponent, bool> mEnabledComponents;
540 TGeoMatrix* mLeftTransformation;
541 TGeoMatrix* mRightTransformation;
544 std::array<Point3Dsimple, sNumberOfCells> mCellCenter;
545 std::array<Point3Dsimple, sNumberOfReadoutChannels> mReadoutCenter;