From 0347edf6b4570bcc154e33d5d2183bd4f4003668 Mon Sep 17 00:00:00 2001 From: Alla Maevskaya Date: Sun, 17 Sep 2017 21:31:02 +0200 Subject: [PATCH 01/18] detector FIT --- Detectors/FIT/CMakeLists.txt | 18 + Detectors/FIT/base/CMakeLists.txt | 23 + Detectors/FIT/base/FITBaseLinkDef.h | 21 + Detectors/FIT/base/README.md | 1 + .../FIT/base/files/quartzOptProperties.txt | 884 ++++++++++++++++++ Detectors/FIT/base/include/FITBase/Geometry.h | 88 ++ Detectors/FIT/base/include/FITBase/Hit.h | 46 + Detectors/FIT/base/include/README.md | 0 Detectors/FIT/base/src/FITBaseLinkDef.h | 20 + Detectors/FIT/base/src/Geometry.cxx | 54 ++ Detectors/FIT/base/src/Hit.cxx | 27 + Detectors/FIT/base/src/README.md | 2 + Detectors/FIT/macros/test/run_test.sh | 16 + Detectors/FIT/simulation/CMakeLists.txt | 16 + .../include/FITSimulation/Detector.h | 127 +++ Detectors/FIT/simulation/src/Detector.cxx | 549 +++++++++++ .../FIT/simulation/src/FITSimulationLinkDef.h | 19 + Detectors/FIT/simulation/src/README.md | 2 + 18 files changed, 1913 insertions(+) create mode 100644 Detectors/FIT/CMakeLists.txt create mode 100644 Detectors/FIT/base/CMakeLists.txt create mode 100644 Detectors/FIT/base/FITBaseLinkDef.h create mode 100644 Detectors/FIT/base/README.md create mode 100644 Detectors/FIT/base/files/quartzOptProperties.txt create mode 100644 Detectors/FIT/base/include/FITBase/Geometry.h create mode 100644 Detectors/FIT/base/include/FITBase/Hit.h create mode 100644 Detectors/FIT/base/include/README.md create mode 100644 Detectors/FIT/base/src/FITBaseLinkDef.h create mode 100644 Detectors/FIT/base/src/Geometry.cxx create mode 100644 Detectors/FIT/base/src/Hit.cxx create mode 100644 Detectors/FIT/base/src/README.md create mode 100755 Detectors/FIT/macros/test/run_test.sh create mode 100644 Detectors/FIT/simulation/CMakeLists.txt create mode 100644 Detectors/FIT/simulation/include/FITSimulation/Detector.h create mode 100644 Detectors/FIT/simulation/src/Detector.cxx create mode 100644 Detectors/FIT/simulation/src/FITSimulationLinkDef.h create mode 100644 Detectors/FIT/simulation/src/README.md diff --git a/Detectors/FIT/CMakeLists.txt b/Detectors/FIT/CMakeLists.txt new file mode 100644 index 0000000000000..d986b027851dc --- /dev/null +++ b/Detectors/FIT/CMakeLists.txt @@ -0,0 +1,18 @@ +# ************************************************************************** +# * Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. * +# * * +# * Author: The ALICE Off-line Project. * +# * Contributors are mentioned in the code where appropriate. * +# * * +# * Permission to use, copy, modify and distribute this software and its * +# * documentation strictly for non-commercial purposes is hereby granted * +# * without fee, provided that the above copyright notice appears in all * +# * copies and that both the copyright notice and this permission notice * +# * appear in the supporting documentation. The authors make no claims * +# * about the suitability of this software for any purpose. It is * +# * provided "as is" without express or implied warranty. * +# ************************************************************************** + +# Libraries +add_subdirectory(base) +add_subdirectory(simulation) diff --git a/Detectors/FIT/base/CMakeLists.txt b/Detectors/FIT/base/CMakeLists.txt new file mode 100644 index 0000000000000..8410daf2a5899 --- /dev/null +++ b/Detectors/FIT/base/CMakeLists.txt @@ -0,0 +1,23 @@ +set(MODULE_NAME "FITBase") + +O2_SETUP(NAME ${MODULE_NAME}) + +set(SRCS + src/Geometry.cxx + ) + +set(HEADERS + include/${MODULE_NAME}/Geometry.h + ) + + +Set(LINKDEF src/FITBaseLinkDef.h) +Set(LIBRARY_NAME ${MODULE_NAME}) +set(BUCKET_NAME fit_base_bucket) + +O2_GENERATE_LIBRARY() + +install( + DIRECTORY files + DESTINATION share/Detectors/FIT/ +) diff --git a/Detectors/FIT/base/FITBaseLinkDef.h b/Detectors/FIT/base/FITBaseLinkDef.h new file mode 100644 index 0000000000000..a87f7f4992a2b --- /dev/null +++ b/Detectors/FIT/base/FITBaseLinkDef.h @@ -0,0 +1,21 @@ +// Copyright CERN and copyright holders of ALICE O2. This software is +// distributed under the terms of the GNU General Public License v3 (GPL +// Version 3), copied verbatim in the file "COPYING". +// +// See https://alice-o2.web.cern.ch/ for full licensing information. +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +#ifdef __CLING__ + +#pragma link off all globals; +#pragma link off all classes; +#pragma link off all functions; + +#pragma link C++ class o2::FIT::Digit; +#pragma link C++ class o2::FIT::Hit; + + +#endif diff --git a/Detectors/FIT/base/README.md b/Detectors/FIT/base/README.md new file mode 100644 index 0000000000000..ec5c9be244ccf --- /dev/null +++ b/Detectors/FIT/base/README.md @@ -0,0 +1 @@ +# Base classes diff --git a/Detectors/FIT/base/files/quartzOptProperties.txt b/Detectors/FIT/base/files/quartzOptProperties.txt new file mode 100644 index 0000000000000..00f77b1ed0894 --- /dev/null +++ b/Detectors/FIT/base/files/quartzOptProperties.txt @@ -0,0 +1,884 @@ +# Optical properties of quartz Spectrasil2000 & QE of MCP-PMT XP85012 +# Number of elements: +880 +# PhotonEnergy [eV] AbsorptionLength [cm] RefractionIndex QuantumEfficiency + 1.24104 3421.18 1.45043 0 + 1.24228 3187.97 1.45044 0 + 1.24353 2820.29 1.45045 0 + 1.24478 2574.7 1.45046 0 + 1.24603 2699.84 1.45048 0 + 1.24728 2737.22 1.45049 0 + 1.24854 2507.31 1.4505 0 + 1.2498 2314.62 1.45051 0 + 1.25106 2479.35 1.45053 0 + 1.25232 2472.61 1.45054 0 + 1.25359 2248.48 1.45055 0 + 1.25486 2145.82 1.45057 0 + 1.25613 2037.05 1.45058 0 + 1.2574 2011.96 1.45059 0 + 1.25868 2019.61 1.45061 0 + 1.25996 1936.23 1.45062 0 + 1.26124 1846.23 1.45063 0 + 1.26253 1721.89 1.45064 0 + 1.26381 1711.03 1.45066 0 + 1.2651 1640.42 1.45067 0 + 1.26639 1588.92 1.45068 0 + 1.26769 1498.78 1.4507 0 + 1.26899 1424.72 1.45071 0 + 1.27029 1384.31 1.45072 0 + 1.27159 1314.28 1.45073 0 + 1.2729 1232.36 1.45075 0 + 1.2742 1189.45 1.45076 0 + 1.27551 1170.79 1.45077 0 + 1.27683 1089.01 1.45079 0 + 1.27814 1044.86 1.4508 0 + 1.27946 996.898 1.45081 0 + 1.28079 958.358 1.45082 0 + 1.28211 894.071 1.45084 0 + 1.28344 852.745 1.45085 0 + 1.28477 817.429 1.45086 0 + 1.2861 778.062 1.45088 0 + 1.28744 724.415 1.45089 0 + 1.28877 684.809 1.4509 0 + 1.29011 637.656 1.45092 0 + 1.29146 608.727 1.45093 0 + 1.29281 572.549 1.45094 0 + 1.29415 535.834 1.45096 0 + 1.29551 503.829 1.45097 0 + 1.29686 472.131 1.45098 0 + 1.29822 444.765 1.451 0 + 1.29958 421.134 1.45101 0 + 1.30094 400.311 1.45102 0 + 1.30231 380.157 1.45104 0 + 1.30368 364.707 1.45105 0 + 1.30505 349.772 1.45106 0 + 1.30643 338.073 1.45108 0 + 1.30781 326.177 1.45109 0 + 1.30919 320.817 1.4511 0 + 1.31057 320.247 1.45112 0 + 1.31196 323.879 1.45113 0 + 1.31335 328.772 1.45114 0 + 1.31474 338.753 1.45116 0 + 1.31614 354.774 1.45117 0 + 1.31753 374.608 1.45118 0 + 1.31894 402.916 1.4512 0 + 1.32034 443.293 1.45121 0 + 1.32175 491.579 1.45122 0 + 1.32316 553.494 1.45124 0 + 1.32457 621.13 1.45125 0 + 1.32599 705.315 1.45126 0 + 1.32741 808.477 1.45128 0 + 1.32883 941.607 1.45129 0 + 1.33026 1120.52 1.4513 0 + 1.33169 1311.39 1.45132 0 + 1.33312 1555.4 1.45133 0 + 1.33455 1772.21 1.45134 0 + 1.33599 2049.9 1.45136 0 + 1.33743 2469.52 1.45137 0 + 1.33888 3234.15 1.45139 0 + 1.34032 4075.02 1.4514 0 + 1.34177 5238.78 1.45141 0 + 1.34323 6346.16 1.45143 0 + 1.34469 8609.41 1.45144 0 + 1.34615 14356.7 1.45146 0 + 1.34761 28235.8 1.45147 0 + 1.34908 31902.9 1.45148 0 + 1.35054 30650.1 1.4515 0 + 1.35202 16845.3 1.45151 0 + 1.35349 23981.6 1.45153 0 + 1.35497 33594.5 1.45154 0 + 1.35646 31844.8 1.45155 0 + 1.35794 20637.2 1.45157 0 + 1.35943 21299.3 1.45158 0 + 1.36092 25968.8 1.4516 0 + 1.36242 19319.9 1.45161 0 + 1.36392 19084.6 1.45162 0 + 1.36542 22465.1 1.45164 0 + 1.36692 21680.1 1.45165 0 + 1.36843 23287.1 1.45167 0 + 1.36994 18774.5 1.45168 0 + 1.37146 22270.5 1.45169 0 + 1.37298 18643.6 1.45171 0 + 1.3745 18862.8 1.45172 0 + 1.37603 13847.8 1.45174 0 + 1.37756 13591.2 1.45175 0 + 1.37909 14707.3 1.45176 0 + 1.38062 14086.8 1.45178 0 + 1.38216 13242.3 1.45179 0 + 1.38371 16987 1.45181 0 + 1.38525 19030.4 1.45182 0 + 1.3868 16546.3 1.45184 0 + 1.38835 17337.1 1.45185 0 + 1.38991 22495.4 1.45187 0 + 1.39147 17355.2 1.45188 0 + 1.39303 16113.4 1.45189 0 + 1.3946 18332.7 1.45191 0 + 1.39617 15573.7 1.45192 0 + 1.39775 14509.7 1.45194 0 + 1.39932 14027.5 1.45195 0 + 1.4009 16695 1.45197 0 + 1.40249 14687 1.45198 0 + 1.40408 13213.8 1.452 0 + 1.40567 19363 1.45201 0 + 1.40726 15111 1.45203 0 + 1.40886 13874.6 1.45204 0 + 1.41047 17189.1 1.45206 0 + 1.41207 21826.3 1.45207 0 + 1.41368 14468.3 1.45209 0 + 1.4153 15494.6 1.4521 0 + 1.41691 30339.7 1.45212 0 + 1.41854 23447.4 1.45213 0 + 1.42016 18049.6 1.45215 0 + 1.42179 16864.9 1.45216 0 + 1.42342 15929.2 1.45218 0 + 1.42506 14080.8 1.45219 0 + 1.4267 15859 1.45221 0 + 1.42834 19753.6 1.45222 0 + 1.42999 14587.8 1.45223 0 + 1.43164 13548.8 1.45225 0 + 1.43329 13530.3 1.45227 0 + 1.43495 13504.1 1.45228 0 + 1.43662 17036.4 1.4523 0 + 1.43828 12763.5 1.45231 0 + 1.43995 40956.2 1.45233 0 + 1.44163 28235.8 1.45234 0 + 1.44331 31902.9 1.45236 0 + 1.44499 30650.1 1.45237 0 + 1.44667 16845.3 1.45239 0 + 1.44836 23981.6 1.4524 0 + 1.45006 33594.5 1.45242 0 + 1.45176 31844.8 1.45243 0 + 1.45346 20637.2 1.45245 0 + 1.45516 21299.3 1.45246 0 + 1.45687 25968.8 1.45248 0 + 1.45859 19319.9 1.4525 0 + 1.46031 19084.6 1.45251 0 + 1.46203 22465.1 1.45253 0 + 1.46375 21680.1 1.45254 0 + 1.46548 23287.1 1.45256 0 + 1.46722 18774.5 1.45257 0 + 1.46896 22270.5 1.45259 0 + 1.4707 18643.6 1.45261 0 + 1.47245 18862.8 1.45262 0 + 1.4742 13847.8 1.45264 0 + 1.47595 13591.2 1.45265 0 + 1.47771 14707.3 1.45267 0 + 1.47947 14086.8 1.45268 0 + 1.48124 13242.3 1.4527 0 + 1.48301 16987 1.45272 0 + 1.48479 19030.4 1.45273 0 + 1.48657 16546.3 1.45275 0 + 1.48836 17337.1 1.45276 0 + 1.49014 22495.4 1.45278 0 + 1.49194 17355.2 1.4528 0 + 1.49373 16113.4 1.45281 0 + 1.49554 18332.7 1.45283 0 + 1.49734 15573.7 1.45285 0 + 1.49915 14509.7 1.45286 0 + 1.50097 14027.5 1.45288 0 + 1.50279 16695 1.45289 0 + 1.50461 13045.7 1.45291 0 + 1.50644 13777.4 1.45293 0 + 1.50827 13538.5 1.45294 0 + 1.51011 9940.26 1.45296 0 + 1.51195 12057.5 1.45298 0 + 1.5138 14083.7 1.45299 0 + 1.51565 13766.6 1.45301 0 + 1.5175 11149.1 1.45303 0 + 1.51936 11339.5 1.45304 0 + 1.52123 12540 1.45306 0 + 1.5231 10753 1.45308 0 + 1.52497 10679.7 1.45309 0 + 1.52685 11661.7 1.45311 0 + 1.52873 11446.6 1.45313 0 + 1.53062 11879.4 1.45314 0 + 1.53251 10581.9 1.45316 0 + 1.53441 11609 1.45318 0 + 1.53631 10540.2 1.45319 0 + 1.53821 10609.9 1.45321 0 + 1.54012 8814.39 1.45323 0 + 1.54204 8709.73 1.45325 0 + 1.54396 9154.92 1.45326 0 + 1.54589 8910.62 1.45328 0 + 1.54782 8565.09 1.4533 0 + 1.54975 9989.43 1.45331 0 + 1.55169 10662.7 1.45333 0 + 1.55363 9835.36 1.45335 0 + 1.55558 10109.5 1.45337 0 + 1.55754 11669.9 1.45338 0 + 1.5595 10115.6 1.4534 0 + 1.56146 9680.78 1.45342 0 + 1.56343 10440.1 1.45344 0 + 1.5654 9483.31 1.45345 0 + 1.56738 9077.99 1.45347 0 + 1.56937 8886.83 1.45349 0 + 1.57136 9887.74 1.45351 0 + 1.57335 9147.07 1.45353 0 + 1.57535 8553.17 1.45354 0 + 1.57735 10766.3 1.45356 0 + 1.57936 9309.77 1.45358 0 + 1.58138 8825.23 1.4536 0 + 1.5834 10059 1.45361 0 + 1.58542 11487.2 1.45363 0 + 1.58745 9061.75 1.45365 0 + 1.58949 9453.94 1.45367 0 + 1.59153 13477.6 1.45369 0 + 1.59357 11920.9 1.45371 0 + 1.59562 10347.7 1.45372 0 + 1.59768 9947.08 1.45374 0 + 1.59974 9613.99 1.45376 0 + 1.60181 8908.22 1.45378 0 + 1.60388 9588.38 1.4538 0 + 1.60596 10886 1.45382 0 + 1.60804 9108.47 1.45383 0 + 1.61013 8692.28 1.45385 0 + 1.61222 8684.64 1.45387 0 + 1.61432 8673.85 1.45389 0 + 1.61643 10006.5 1.45391 0 + 1.61854 8362.2 1.45393 0 + 1.62065 8499.98 1.45395 0 + 1.62277 8196.07 1.45397 0 + 1.6249 8503.37 1.45398 0 + 1.62703 8703.71 1.454 0 + 1.62917 8247.21 1.45402 0 + 1.63132 8968.87 1.45404 0 + 1.63347 10025.4 1.45406 0 + 1.63562 8495.1 1.45408 0 + 1.63778 9090.44 1.4541 0 + 1.63995 7348.7 1.45412 0 + 1.64212 6985.31 1.45414 0 + 1.6443 8265.87 1.45416 0 + 1.64648 8196.47 1.45418 0 + 1.64867 8417.99 1.4542 0 + 1.65087 8220.7 1.45422 0 + 1.65307 7929.1 1.45423 0 + 1.65527 7089.84 1.45425 0 + 1.65749 7142.57 1.45427 0 + 1.65971 6029.66 1.45429 0 + 1.66193 6652.67 1.45431 0 + 1.66416 6090.11 1.45433 0 + 1.6664 6668.48 1.45435 0 + 1.66864 6745.95 1.45437 0 + 1.67089 6193.83 1.45439 0 + 1.67314 5448.14 1.45441 0 + 1.67541 5113.36 1.45443 0 + 1.67767 5263.34 1.45445 0 + 1.67995 5051.55 1.45447 0 + 1.68223 5287.77 1.45449 0 + 1.68451 4977.7 1.45451 0 + 1.6868 4618.24 1.45453 0 + 1.6891 4305.09 1.45456 0 + 1.69141 4278.88 1.45458 0 + 1.69372 4104.84 1.4546 0 + 1.69603 3972.64 1.45462 0 + 1.69836 3824.7 1.45464 0 + 1.70069 3321.36 1.45466 0 + 1.70302 3404.79 1.45468 0 + 1.70536 3224.11 1.4547 0 + 1.70771 3170.67 1.45472 0 + 1.71007 3338.81 1.45474 0 + 1.71243 3266.66 1.45476 0 + 1.7148 3498.6 1.45479 0 + 1.71717 3681.34 1.45481 0 + 1.71956 3846.83 1.45483 0 + 1.72194 4164 1.45485 0 + 1.72434 4452.22 1.45487 0 + 1.72674 5582.66 1.45489 0 + 1.72915 5852.34 1.45491 0 + 1.73156 6717.85 1.45494 0 + 1.73399 6897.01 1.45496 0 + 1.73641 8024.52 1.45498 0 + 1.73885 7052.72 1.455 0 + 1.74129 7266.13 1.45502 0 + 1.74374 7555.4 1.45504 0 + 1.7462 8204.14 1.45507 0 + 1.74866 6842.3 1.45509 0 + 1.75113 6577.01 1.45511 0 + 1.75361 6665.74 1.45513 0 + 1.75609 7791.78 1.45516 0 + 1.75858 7159.82 1.45518 0 + 1.76108 7329.74 1.4552 0 + 1.76358 6550.73 1.45522 0 + 1.7661 7658.27 1.45524 0 + 1.76862 7527.43 1.45527 0 + 1.77114 6680.9 1.45529 0 + 1.77368 6921.32 1.45531 0 + 1.77622 7534.53 1.45534 0 + 1.77877 7105.91 1.45536 0 + 1.78132 6576.86 1.45538 0 + 1.78388 7105.52 1.45541 0 + 1.78646 7516.12 1.45543 0 + 1.78903 6586.22 1.45545 0 + 1.79162 6678.6 1.45548 0 + 1.79421 6528.98 1.4555 0 + 1.79681 6754.96 1.45552 0 + 1.79942 6190.62 1.45555 0 + 1.80203 6633.9 1.45557 0 + 1.80466 6118.1 1.45559 0 + 1.80729 6332.51 1.45562 0 + 1.80993 6914.27 1.45564 0 + 1.81257 6516.36 1.45567 0 + 1.81523 6239.68 1.45569 0 + 1.81789 6485.72 1.45571 0 + 1.82056 6374.42 1.45574 0 + 1.82324 6764.41 1.45576 0 + 1.82592 6742.36 1.45579 0 + 1.82861 6572.9 1.45581 0 + 1.83131 6307.78 1.45584 0 + 1.83402 6397.4 1.45586 0 + 1.83674 6387.81 1.45589 0 + 1.83947 6378.99 1.45591 0 + 1.8422 6463.05 1.45593 0 + 1.84494 6303.98 1.45596 0 + 1.84769 6722.72 1.45598 0 + 1.85045 6406.16 1.45601 0 + 1.85321 6565.68 1.45603 0 + 1.85599 6819.33 1.45606 0 + 1.85877 6328.03 1.45609 0 + 1.86156 6090.01 1.45611 0 + 1.86436 6770.2 1.45614 0 + 1.86717 5914.52 1.45616 0 + 1.86998 5752.02 1.45619 0 + 1.87281 6257.32 1.45621 0 + 1.87564 6413.27 1.45624 0 + 1.87848 5903.16 1.45627 0 + 1.88134 5793.12 1.45629 0 + 1.88419 5770.87 1.45632 0 + 1.88706 6059.61 1.45635 0 + 1.88994 5976.07 1.45637 0 + 1.89282 5776.72 1.4564 0 + 1.89572 5679.77 1.45643 0 + 1.89862 5875.57 1.45645 0 + 1.90153 5844.96 1.45648 0 + 1.90445 5827.5 1.45651 0 + 1.90738 6085.94 1.45654 0 + 1.91032 5735.58 1.45656 0 + 1.91327 5706.5 1.45659 0 + 1.91623 6058.46 1.45662 0 + 1.9192 6025.58 1.45664 0 + 1.92217 5732.59 1.45667 0 + 1.92516 5292.18 1.4567 0 + 1.92815 5346.84 1.45673 0 + 1.93115 5517.05 1.45676 0 + 1.93417 5371.91 1.45678 0 + 1.93719 5128.82 1.45681 0 + 1.94022 5283.72 1.45684 0 + 1.94326 5522.64 1.45687 0 + 1.94631 5623.17 1.4569 0 + 1.94937 5801.2 1.45692 0 + 1.95244 5416.49 1.45695 0 + 1.95552 5253.11 1.45698 0 + 1.95861 5106.41 1.45701 0 + 1.96171 5271.79 1.45704 0 + 1.96482 5350.39 1.45707 0 + 1.96794 4918.41 1.4571 0 + 1.97107 4775.55 1.45713 0 + 1.9742 5048.62 1.45716 0 + 1.97735 4791.19 1.45719 0 + 1.98051 5175.5 1.45722 0 + 1.98368 4889.51 1.45725 0 + 1.98686 4715.69 1.45728 0 + 1.99005 4655.05 1.45731 0 + 1.99325 4546.09 1.45734 0 + 1.99646 4686.26 1.45737 0 + 1.99968 4685.33 1.4574 0 + 2.00291 4782.69 1.45743 0 + 2.00615 4791.15 1.45746 0 + 2.0094 4567 1.45749 0 + 2.01266 4555.15 1.45752 0.000603488 + 2.01593 4630.48 1.45756 0.00132496 + 2.01922 4449.01 1.45759 0.00204879 + 2.02251 4489.24 1.45762 0.00277497 + 2.02582 4195.16 1.45765 0.00350353 + 2.02913 4350.13 1.45768 0.00423448 + 2.03246 4486.32 1.45771 0.00496782 + 2.0358 4311.57 1.45775 0.00570357 + 2.03914 4346.81 1.45778 0.00644174 + 2.0425 4370.95 1.45781 0.00718234 + 2.04587 4457.37 1.45784 0.00792538 + 2.04926 4564.34 1.45787 0.00867089 + 2.05265 4528.91 1.45791 0.00941886 + 2.05605 4279.44 1.45794 0.0101693 + 2.05947 4361.76 1.45797 0.0109223 + 2.0629 4266.35 1.458 0.0116777 + 2.06633 4380.62 1.45804 0.0124357 + 2.06978 4391.72 1.45807 0.0131962 + 2.07324 4371.55 1.4581 0.0139592 + 2.07672 4522 1.45814 0.0147248 + 2.0802 4557.19 1.45817 0.015493 + 2.0837 4344.64 1.4582 0.0162637 + 2.08721 4223.66 1.45824 0.0170371 + 2.09073 4226.52 1.45827 0.017813 + 2.09426 4214.77 1.45831 0.0185916 + 2.0978 4265.91 1.45834 0.0193728 + 2.10136 4314.81 1.45838 0.0201567 + 2.10492 4180.91 1.45841 0.0209422 + 2.1085 4281.24 1.45845 0.0217303 + 2.1121 4487.77 1.45848 0.0225212 + 2.1157 4466.63 1.45852 0.0233148 + 2.11932 4605.61 1.45856 0.024111 + 2.12295 4516.4 1.45859 0.0242948 + 2.12659 4357.74 1.45863 0.0244792 + 2.13024 4676.07 1.45866 0.0246642 + 2.13391 4929.74 1.4587 0.0248498 + 2.13759 4863.94 1.45874 0.0250361 + 2.14128 4666.59 1.45877 0.0255008 + 2.14498 4647.73 1.45881 0.0259671 + 2.1487 4514.46 1.45885 0.026435 + 2.15243 4308.44 1.45889 0.0269046 + 2.15617 4599 1.45892 0.0273757 + 2.15993 4918.94 1.45896 0.0276054 + 2.1637 4857.92 1.459 0.0278359 + 2.16748 4740.43 1.45903 0.0280672 + 2.17128 4850.82 1.45907 0.0282992 + 2.17509 4726.37 1.45911 0.0285322 + 2.17891 4617.67 1.45915 0.0296464 + 2.18275 4517.97 1.45919 0.0307646 + 2.1866 4246.9 1.45922 0.0318868 + 2.19046 4323.95 1.45926 0.0330129 + 2.19434 4539.88 1.4593 0.034143 + 2.19823 4566.95 1.45934 0.034927 + 2.20213 4862.73 1.45938 0.0357138 + 2.20605 5121.36 1.45942 0.0365035 + 2.20998 4887.94 1.45946 0.0372959 + 2.21393 4875.82 1.4595 0.0380912 + 2.21789 5110.65 1.45954 0.0388852 + 2.22186 5101.39 1.45958 0.0396821 + 2.22585 5100.88 1.45962 0.0404818 + 2.22986 5185.85 1.45966 0.0412845 + 2.23387 5183.42 1.4597 0.04209 + 2.23791 5350 1.45975 0.0427888 + 2.24195 5545.73 1.45979 0.04349 + 2.24601 5462.92 1.45983 0.0441939 + 2.25009 5245.71 1.45987 0.0449003 + 2.25418 5359.82 1.45991 0.0456092 + 2.25829 5399.1 1.45996 0.046386 + 2.26241 5248.18 1.46 0.0471657 + 2.26654 5572.24 1.46004 0.0479482 + 2.2707 5647.23 1.46009 0.0487335 + 2.27486 5441.83 1.46013 0.0495218 + 2.27904 5424.38 1.46017 0.0503124 + 2.28324 5654.86 1.46022 0.0511058 + 2.28745 5589.6 1.46026 0.0519023 + 2.29168 5627.61 1.46031 0.0527016 + 2.29593 5938.15 1.46035 0.0535039 + 2.30019 5874.43 1.46039 0.0545754 + 2.30446 5955.23 1.46044 0.0556509 + 2.30875 5887.32 1.46048 0.0567303 + 2.31306 6014.47 1.46053 0.0578138 + 2.31738 5925.86 1.46057 0.0589014 + 2.32172 5759.84 1.46062 0.0607477 + 2.32608 5831.67 1.46066 0.0626009 + 2.33045 6416.52 1.46071 0.0644611 + 2.33484 6792.22 1.46075 0.0663283 + 2.33925 6558.62 1.4608 0.0682026 + 2.34367 6339.55 1.46085 0.0701951 + 2.34811 6171.57 1.46089 0.0721951 + 2.35256 5976.79 1.46094 0.0742028 + 2.35703 6074.57 1.46099 0.0762181 + 2.36152 6251.36 1.46103 0.078241 + 2.36603 6178.66 1.46108 0.0812495 + 2.37055 6174.3 1.46113 0.0842695 + 2.3751 6349.78 1.46118 0.087301 + 2.37965 6112.55 1.46123 0.0903442 + 2.38423 6322.74 1.46128 0.0933991 + 2.38882 5874.7 1.46133 0.0966295 + 2.39344 6160.3 1.46138 0.0998724 + 2.39807 6100.82 1.46144 0.103128 + 2.40271 6043.85 1.46149 0.106396 + 2.40738 5584.07 1.46154 0.109677 + 2.41206 5230.66 1.46159 0.11218 + 2.41676 5150.21 1.46164 0.114692 + 2.42148 5486.7 1.46169 0.117215 + 2.42622 6018.45 1.46175 0.119747 + 2.43098 5334.08 1.4618 0.12229 + 2.43576 4945.97 1.46185 0.123772 + 2.44055 4938.44 1.4619 0.12526 + 2.44536 5076.67 1.46196 0.126754 + 2.4502 4888.5 1.46201 0.128254 + 2.45505 4509.28 1.46206 0.12976 + 2.45992 4692.47 1.46212 0.130429 + 2.46481 4902.71 1.46217 0.1311 + 2.46972 4767.89 1.46223 0.131774 + 2.47465 4860.02 1.46228 0.132451 + 2.4796 4860.22 1.46233 0.13313 + 2.48457 4842.79 1.46239 0.133825 + 2.48956 5264.15 1.46244 0.134521 + 2.49457 5457.33 1.4625 0.135221 + 2.4996 5138.56 1.46255 0.135924 + 2.50465 4850.35 1.46261 0.136629 + 2.50972 4712.94 1.46267 0.13674 + 2.51481 4533.44 1.46272 0.136851 + 2.51992 4522.65 1.46278 0.136963 + 2.52505 4870.09 1.46284 0.137075 + 2.5302 5018.23 1.46289 0.137188 + 2.53538 4967.84 1.46295 0.137946 + 2.54057 5081.86 1.46301 0.138708 + 2.54579 4896.89 1.46308 0.139472 + 2.55103 5035.75 1.46314 0.14024 + 2.55629 4823.14 1.4632 0.141011 + 2.56157 5600.66 1.46326 0.143063 + 2.56687 6008.92 1.46332 0.145124 + 2.5722 6060.05 1.46339 0.147193 + 2.57755 6381.85 1.46345 0.149271 + 2.58292 6865.87 1.46351 0.151357 + 2.58831 6959.87 1.46358 0.152411 + 2.59372 7010.76 1.46364 0.153469 + 2.59916 7078.14 1.46371 0.154532 + 2.60462 7304.25 1.46377 0.155599 + 2.61011 7093.41 1.46383 0.15667 + 2.61561 6934.71 1.4639 0.158349 + 2.62114 6769.26 1.46396 0.160034 + 2.62669 6637.03 1.46403 0.161727 + 2.63227 7790.4 1.4641 0.163427 + 2.63787 6967.7 1.46416 0.165135 + 2.6435 7336.66 1.46423 0.165215 + 2.64915 7168.11 1.4643 0.165296 + 2.65482 6766.29 1.46436 0.165377 + 2.66052 6934.87 1.46443 0.165458 + 2.66624 7055.96 1.4645 0.16554 + 2.67198 7782.03 1.46456 0.168134 + 2.67775 7346.41 1.46463 0.170739 + 2.68355 7847.76 1.4647 0.173355 + 2.68937 8341.04 1.46477 0.175983 + 2.69522 7745.01 1.46484 0.178622 + 2.70109 7177.32 1.46491 0.180839 + 2.70699 7488.85 1.46498 0.183065 + 2.71291 7990.88 1.46505 0.1853 + 2.71886 7955.46 1.46512 0.187546 + 2.72484 8104.51 1.46519 0.189801 + 2.73084 7602.15 1.46526 0.190908 + 2.73687 8572.2 1.46534 0.19202 + 2.74292 9542.06 1.46542 0.193137 + 2.749 8293.76 1.4655 0.194259 + 2.75511 8744.62 1.46557 0.195385 + 2.76125 8213.58 1.46565 0.197107 + 2.76741 9258.11 1.46573 0.198836 + 2.7736 8754.93 1.46581 0.200572 + 2.77982 8776.55 1.46589 0.202317 + 2.78607 8673.88 1.46597 0.204069 + 2.79234 9232.67 1.46605 0.205326 + 2.79865 8087.54 1.46613 0.206588 + 2.80498 9828.85 1.46621 0.207856 + 2.81134 11918.4 1.46629 0.20913 + 2.81773 9656.51 1.46637 0.21041 + 2.82415 9084.49 1.46646 0.210022 + 2.83059 9402.49 1.46654 0.209633 + 2.83707 10386.4 1.46662 0.209241 + 2.84358 11590.7 1.4667 0.208848 + 2.85011 11397.6 1.46679 0.208453 + 2.85668 8793.37 1.46687 0.209131 + 2.86328 11625.7 1.46696 0.209811 + 2.86991 10560.2 1.46704 0.210495 + 2.87657 11182.2 1.46713 0.211182 + 2.88326 10639.5 1.46721 0.211873 + 2.88998 11209.4 1.4673 0.213663 + 2.89673 10839.7 1.46738 0.215462 + 2.90351 10583.9 1.46747 0.217269 + 2.91033 11584.1 1.46756 0.219085 + 2.91718 12219.4 1.46764 0.220909 + 2.92406 9336.2 1.46773 0.221313 + 2.93097 9654.91 1.46782 0.221719 + 2.93791 11366.8 1.46791 0.222127 + 2.94489 11299.8 1.468 0.222537 + 2.9519 11385.7 1.46809 0.222949 + 2.95895 9915.4 1.46819 0.224175 + 2.96603 10685.8 1.46828 0.225406 + 2.97314 10674 1.46838 0.226644 + 2.98029 12964 1.46848 0.227887 + 2.98747 11843.6 1.46859 0.229137 + 2.99469 11543 1.46869 0.229239 + 3.00194 13338.8 1.46879 0.229342 + 3.00922 10463.9 1.46889 0.229446 + 3.01655 14787.8 1.46899 0.22955 + 3.0239 11856.7 1.4691 0.229654 + 3.0313 12075.4 1.4692 0.230149 + 3.03873 12705 1.4693 0.230646 + 3.04619 10609.6 1.46941 0.231146 + 3.05369 10013.2 1.46951 0.231649 + 3.06123 10626.4 1.46962 0.232153 + 3.06881 12890.3 1.46973 0.233597 + 3.07643 13581.1 1.46983 0.235049 + 3.08408 11229.7 1.46994 0.236507 + 3.09177 11472.1 1.47005 0.237973 + 3.0995 10195.6 1.47016 0.239446 + 3.10727 10548.6 1.47026 0.239794 + 3.11508 9966.17 1.47037 0.240144 + 3.12292 9673.65 1.47048 0.240496 + 3.13081 10448 1.47059 0.240849 + 3.13873 9235.51 1.47071 0.241205 + 3.1467 10901.9 1.47082 0.241242 + 3.15471 9225.32 1.47093 0.241279 + 3.16276 11731.5 1.47104 0.241317 + 3.17084 9566.08 1.47116 0.241355 + 3.17897 12271.8 1.47127 0.241393 + 3.18715 14356.1 1.47138 0.24078 + 3.19536 10715.1 1.4715 0.240164 + 3.20362 10488.9 1.47162 0.239545 + 3.21192 11085 1.47173 0.238923 + 3.22026 10754.4 1.47185 0.238297 + 3.22865 11265.8 1.47198 0.238017 + 3.23708 10101.9 1.47211 0.237736 + 3.24555 9025.44 1.47224 0.237453 + 3.25407 11559.7 1.47238 0.237168 + 3.26263 10259.3 1.47251 0.236882 + 3.27124 9857.02 1.47264 0.236787 + 3.27989 12999.2 1.47278 0.236691 + 3.28859 13345.5 1.47292 0.236595 + 3.29734 23646.7 1.47305 0.236498 + 3.30613 15601.3 1.47319 0.236401 + 3.31497 15518.7 1.47333 0.236576 + 3.32386 19566.8 1.47347 0.236752 + 3.3328 14939.7 1.47361 0.236929 + 3.34178 15236.9 1.47375 0.237106 + 3.35081 11883 1.47389 0.237285 + 3.35989 13499.1 1.47403 0.237076 + 3.36902 11113.4 1.47417 0.236867 + 3.3782 12880.7 1.47432 0.236656 + 3.38743 11690.4 1.47446 0.236444 + 3.39671 11697.1 1.47461 0.236231 + 3.40604 10168.6 1.47475 0.236046 + 3.41543 10994.1 1.4749 0.23586 + 3.42486 9144.58 1.47505 0.235673 + 3.43435 9802.3 1.47519 0.235485 + 3.44389 8845.76 1.47534 0.235296 + 3.45348 8441.16 1.47549 0.234754 + 3.46313 7968.34 1.47564 0.234209 + 3.47283 8982.26 1.4758 0.233661 + 3.48258 8789.07 1.47595 0.23311 + 3.49239 8059.54 1.4761 0.232556 + 3.50226 7160.54 1.47626 0.232441 + 3.51218 8608.07 1.47641 0.232326 + 3.52216 8334.9 1.47657 0.23221 + 3.53219 8199.58 1.47672 0.232093 + 3.54229 7473.83 1.47688 0.231976 + 3.55244 7992.58 1.47706 0.232028 + 3.56264 7598.74 1.47724 0.232081 + 3.57291 7569.08 1.47743 0.232134 + 3.58324 7586.28 1.47761 0.232188 + 3.59362 7994.28 1.4778 0.232241 + 3.60407 7676.33 1.47798 0.232159 + 3.61458 8582.41 1.47817 0.232076 + 3.62515 8527.88 1.47836 0.231993 + 3.63578 8731.97 1.47855 0.231909 + 3.64647 7097.15 1.47874 0.231825 + 3.65723 7442.32 1.47893 0.231847 + 3.66805 7232.72 1.47912 0.23187 + 3.67893 7802.04 1.47931 0.231893 + 3.68988 6815.36 1.47951 0.231916 + 3.7009 8112.69 1.47971 0.231939 + 3.71198 7976.21 1.4799 0.232056 + 3.72312 7518.95 1.4801 0.232174 + 3.73434 7129.07 1.4803 0.232292 + 3.74562 6605.36 1.4805 0.232412 + 3.75697 6938.29 1.4807 0.232532 + 3.76839 7343.29 1.48091 0.232449 + 3.77988 7465.4 1.48111 0.232366 + 3.79144 7620.21 1.48132 0.232282 + 3.80307 6652.65 1.48152 0.232198 + 3.81477 5868.5 1.48173 0.232114 + 3.82654 5987.61 1.48194 0.231788 + 3.83839 6544.72 1.48215 0.23146 + 3.85031 7304.02 1.48237 0.23113 + 3.86231 6785.85 1.48258 0.230798 + 3.87437 6568.61 1.48279 0.230463 + 3.88652 6541.39 1.48301 0.229834 + 3.89874 4918.77 1.48323 0.229201 + 3.91104 6681.45 1.48345 0.228564 + 3.92342 6168.32 1.48367 0.227922 + 3.93587 5868.57 1.48389 0.227277 + 3.94841 6118.12 1.48415 0.226647 + 3.96102 6149.43 1.48441 0.226014 + 3.97372 6258.03 1.48468 0.225376 + 3.9865 5824.66 1.48494 0.224734 + 3.99935 5797.65 1.48521 0.224088 + 4.0123 5594.66 1.48548 0.223465 + 4.02532 5747.69 1.48575 0.222838 + 4.03844 5789.42 1.48603 0.222206 + 4.05163 5818.49 1.4863 0.221571 + 4.06492 5543.46 1.48658 0.220931 + 4.07829 5211.72 1.48686 0.219714 + 4.09175 5046.62 1.48714 0.218488 + 4.1053 4957.41 1.48742 0.217255 + 4.11894 5128.48 1.48771 0.216013 + 4.13267 5187.96 1.48799 0.214764 + 4.14649 4927.56 1.48828 0.213563 + 4.1604 4821.81 1.48857 0.212355 + 4.17441 4891.24 1.48886 0.211139 + 4.18851 5177.64 1.48916 0.209914 + 4.20271 5124.2 1.48945 0.208681 + 4.21701 5151.36 1.48975 0.207758 + 4.2314 5236.82 1.49005 0.206829 + 4.24589 4869.67 1.49035 0.205894 + 4.26048 4871.71 1.49066 0.204952 + 4.27517 4666.08 1.49096 0.204003 + 4.28997 4383.56 1.49127 0.202881 + 4.30486 4203.12 1.49158 0.201751 + 4.31986 4402.24 1.4919 0.200613 + 4.33497 4587.1 1.49221 0.199468 + 4.35018 4471.17 1.49253 0.198314 + 4.36549 4267.72 1.49285 0.197222 + 4.38092 3992.98 1.49317 0.196122 + 4.39645 3874.69 1.49349 0.195014 + 4.4121 3779.49 1.49382 0.193898 + 4.42786 3675.45 1.49415 0.192774 + 4.44373 3602.88 1.49455 0.19185 + 4.45971 3671.33 1.49496 0.19092 + 4.47581 3876.48 1.49537 0.189982 + 4.49203 3613.91 1.49578 0.189038 + 4.50836 3411.4 1.4962 0.188087 + 4.52482 3493.46 1.49661 0.186929 + 4.54139 3400.96 1.49704 0.185763 + 4.55809 3248.27 1.49746 0.184588 + 4.57491 3104.18 1.49789 0.183405 + 4.59185 3007.9 1.49832 0.182212 + 4.60892 2914.21 1.49876 0.181477 + 4.62612 2870.88 1.49919 0.180735 + 4.64345 2941.63 1.49963 0.179989 + 4.6609 2910.71 1.50008 0.179236 + 4.67849 2728.11 1.50053 0.178478 + 4.69621 2603.23 1.50098 0.177884 + 4.71407 2627.66 1.50143 0.177285 + 4.73206 2577.68 1.50189 0.176682 + 4.75019 2442.49 1.50235 0.176074 + 4.76846 2408.94 1.50282 0.175461 + 4.78687 2386.65 1.50329 0.174629 + 4.80543 2334 1.50376 0.173789 + 4.82412 2278.74 1.50424 0.172944 + 4.84297 2217.99 1.50472 0.172091 + 4.86196 2134.06 1.5052 0.171232 + 4.8811 2097.74 1.50569 0.170733 + 4.9004 2097.77 1.50618 0.17023 + 4.91984 2055.2 1.50667 0.169723 + 4.93944 1992.34 1.50717 0.169212 + 4.9592 1951.1 1.50767 0.168697 + 4.97912 1923.29 1.50818 0.168375 + 4.99919 1923.66 1.50869 0.168051 + 5.01943 1908.47 1.50921 0.167725 + 5.03984 1850.26 1.50973 0.167395 + 5.06041 1785.48 1.51025 0.167063 + 5.08115 1756.03 1.51094 0.166787 + 5.10206 1709.54 1.51163 0.166509 + 5.12314 1640.42 1.51233 0.166228 + 5.1444 1615.88 1.51304 0.165945 + 5.16583 1594.34 1.51376 0.16566 + 5.18745 1520.19 1.51447 0.165735 + 5.20924 1486.17 1.5152 0.16581 + 5.23122 1476.55 1.51593 0.165886 + 5.25339 1450.24 1.51667 0.165962 + 5.27574 1403.36 1.51741 0.166039 + 5.29829 1358.23 1.51817 0.16609 + 5.32103 1357.9 1.51892 0.166142 + 5.34397 1321.94 1.51969 0.166194 + 5.3671 1279.2 1.52046 0.166247 + 5.39043 1264.16 1.52123 0.1663 + 5.41397 1233.16 1.52202 0.166164 + 5.43772 1202.8 1.52281 0.166027 + 5.46167 1167.21 1.52361 0.165889 + 5.48584 1136.48 1.52441 0.16575 + 5.51022 1111.15 1.52522 0.165609 + 5.53482 1078.99 1.52604 0.165417 + 5.55964 1055.39 1.52687 0.165223 + 5.58468 1028.72 1.5277 0.165027 + 5.60995 1001.34 1.52854 0.16483 + 5.63545 962.885 1.52939 0.164631 + 5.66119 939.395 1.53025 0.164954 + 5.68716 926.548 1.53111 0.165281 + 5.71336 904.427 1.53199 0.16561 + 5.73981 881.682 1.53287 0.165943 + 5.76651 848.42 1.53375 0.166278 + 5.79346 818.019 1.53465 0.167092 + 5.82066 788.519 1.53556 0.167914 + 5.84811 769.593 1.53647 0.168743 + 5.87583 747.919 1.53739 0.169581 + 5.90381 722.293 1.53833 0.170426 + 5.93206 704.71 1.53939 0.171972 + 5.96058 682.603 1.54048 0.173534 + 5.98937 653.73 1.54159 0.17511 + 6.01845 641.046 1.54272 0.176702 + 6.0478 617.682 1.54387 0.178309 + 6.07745 600.051 1.54504 0.180543 + 6.10739 580.477 1.54623 0.182799 + 6.13762 562.153 1.54744 0.185077 + 6.16816 545.291 1.54867 0.187379 + 6.199 529.478 1.54993 0.189703 + 6.23015 514.628 1.55121 0.192684 + 6.26162 513.434 1.55251 0.195696 + 6.2934 512.133 1.55384 0.198738 + 6.32551 511.447 1.55519 0.201811 + 6.35795 439.93 1.55656 0.204916 + 6.39072 428.416 1.55797 0.208053 + 6.42383 366.054 1.55939 0.211703 + 6.45729 353.782 1.56085 0.215597 + 6.4911 320.244 1.56233 0.219533 + 6.52526 307.814 1.56384 0.22351 + 6.55979 275.783 1.56537 0.227529 + 6.59468 262.084 1.56694 0.231591 + 6.62995 238.497 1.56854 0.233567 + 6.66559 213.698 1.57017 0.235325 + 6.70162 188.606 1.57182 0.237103 + 6.73804 165.035 1.57351 0.2389 + 6.77486 139.914 1.57524 0.240717 + 6.81209 119.153 1.577 0.241684 + 6.84972 96.5308 1.57879 0.240623 + 6.88778 76.5459 1.58061 0.239549 + 6.92626 56.442 1.58248 0.238464 + 6.96517 42.4659 1.58438 0.237367 + 7.00452 30.8679 1.58631 0.236257 + 7.04432 22.1757 1.58829 0.235135 + 7.08457 16.0269 1.5903 0.234 + 7.12529 11.435 1.59236 0.225402 + 7.16647 8.15213 1.59446 0.216705 + 7.20814 5.90063 1.5966 0.207907 + 7.25029 4.31129 1.59878 0.199006 + 7.29294 2.51662 1.60101 0.19 + 7.33609 1.40588 1.60329 0.165996 + 7.37976 0.90473 1.60561 0.141707 + 7.42395 0.607825 1.60798 0.117127 + 7.46867 0.406217 1.6104 0.0922502 + 7.51394 0.280283 1.61288 0.0670723 + 7.55976 0.200589 1.6154 0.0504302 + 7.60613 0.147386 1.61798 0.0358083 + 7.65309 0.114884 1.62061 0.0210059 + 7.70062 0.0912859 1.6233 0.00601963 + 7.74875 0.0734036 1.62605 0.00263214 + 7.79748 0.0589519 1.62885 0.00216712 + 7.84684 0.0469131 1.63172 0.0016962 + 7.89682 0.0371046 1.63465 0.00121929 + 7.94744 0.0294007 1.63765 0.000736264 + 7.99871 0.0241944 1.64071 0.000247005 + 8.05065 0.0206966 1.64384 8.324e-05 + 8.10327 0.0194338 1.64704 0.000251352 + 8.15658 0.0193915 1.65031 0.000421676 + 8.2106 0.0189303 1.65366 0.000594257 + 8.26533 0.0185381 1.65708 0.000769138 + 8.32081 0.0190375 1.66058 0.000946367 + 8.37703 0.0187298 1.66416 0.001 + 8.43401 0.018829 1.66783 0.001 + 8.49178 0.0187354 1.67158 0.001 + 8.55034 0.0192285 1.67542 0.001 + 8.60972 0.0188919 1.67935 0.001 + 8.66993 0.0192815 1.68337 0.001 + 8.73099 0.0194481 1.68748 0.001 + 8.79291 0.019913 1.6917 0.001 + 8.85571 0.0195815 1.69602 0.000940787 + 8.91942 0.0192759 1.70044 0.000741565 + 8.98406 0.0191289 1.70497 0.000539456 + 9.04964 0.0203454 1.70961 0.000334396 + 9.11618 0.0208513 1.71437 0.000126321 + 9.1837 0.0197308 1.71925 3.71556e-05 + 9.25224 0.0191745 1.72425 0.000131015 + 9.3218 0.019876 1.72937 0.000226286 + 9.39242 0.019708 1.73462 0.000323 + 9.46412 0.0205427 1.74001 0.000421191 + 9.53692 0.0190949 1.74554 0.000520892 + 9.61085 0.0188724 1.75121 0.00062214 + 9.68594 0.0186789 1.75703 0.000724969 + 9.7622 0.0182816 1.763 0.000829417 + 9.83968 0.0182196 1.76913 0.000935524 + 9.9184 0.018432 1.77542 0.001 + 9.99839 0.0182141 1.78189 0.001 + 10.0797 0.0182135 1.78852 0.001 + 10.1623 0.0186466 1.79534 0.001 + 10.2463 0.0184323 1.80234 0.00116253 + 10.3317 0.0184357 1.80954 0.00143704 diff --git a/Detectors/FIT/base/include/FITBase/Geometry.h b/Detectors/FIT/base/include/FITBase/Geometry.h new file mode 100644 index 0000000000000..1ea2beb06e157 --- /dev/null +++ b/Detectors/FIT/base/include/FITBase/Geometry.h @@ -0,0 +1,88 @@ +// Copyright CERN and copyright holders of ALICE O2. This software is +// distributed under the terms of the GNU General Public License v3 (GPL +// Version 3), copied verbatim in the file "COPYING". +// +// See https://alice-o2.web.cern.ch/ for full licensing information. +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +#ifndef ALICEO2_FIT_GEOMETRY_H_ +#define ALICEO2_FIT_GEOMETRY_H_ +//////////////////////////////////////////////// +// Full geomrtry hits classes for detector: FIT // +//////////////////////////////////////////////// + +#include +#include +namespace o2 +{ +namespace FIT +{ + +class Geometry : public TNamed +{ + public: + /// + /// Default constructor. + /// It must be kept public for root persistency purposes, + /// but should never be called by the outside world + Geometry() = default; + + /// + /// Constructor for normal use. + /// + /// + Geometry(const Text_t* name, const Text_t* title = "", const Text_t* mcname = "", const Text_t* mctitle = ""); + + /// + /// Copy constructor. + /// + Geometry(const Geometry& geom); + + /// + /// Destructor. + /// + ~Geometry() ; + + /// + /// Assign operator. + /// + Geometry& operator=(const Geometry& rvalue); + + /// + /// \return the pointer of the unique instance of the geometry + /// + /// It should have been set before. + /// + static Geometry* GetInstance(); + + /// + /// \return the pointer of the unique instance of the geometry + /// + /// + // static Geometry* GetInstance(const Text_t* name, const Text_t* title = "", const Text_t* mcname = "TGeant3", + // const Text_t* mctitle = ""); + + /// + /// Instanciate geometry depending on the run number. Mostly used in analysis and MC anchors. + /// + /// \return the pointer of the unique instance + /// +////////// + // General + // + // static Bool_t IsInitialized() { return Geometry::sGeom != nullptr; } + // static const Char_t* GetDefaultGeometryName() {return EMCGeometry::fgkDefaultGeometryName;} + + private: + static Geometry* sGeom; ///< Pointer to the unique instance of the singleton + static const Char_t* sDefaultGeometryName; ///< Default name of geometry + + private: + ClassDef(Geometry, 1); +}; +} +} +#endif diff --git a/Detectors/FIT/base/include/FITBase/Hit.h b/Detectors/FIT/base/include/FITBase/Hit.h new file mode 100644 index 0000000000000..3cc31e6afbf13 --- /dev/null +++ b/Detectors/FIT/base/include/FITBase/Hit.h @@ -0,0 +1,46 @@ +// Copyright CERN and copyright holders of ALICE O2. This software is +// distributed under the terms of the GNU General Public License v3 (GPL +// Version 3), copied verbatim in the file "COPYING". +// +// See https://alice-o2.web.cern.ch/ for full licensing information. +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +#ifndef ALICEO2_FIT_HIT_H +#define ALICEO2_FIT_HIT_H + +#include "SimulationDataFormat/BaseHits.h" + +namespace o2 { + namespace FIT { + /// \class Hit + /// \brief TOF simulation hit information + class Hit : public o2::BasicXYZEHit { + public: + + /// \brief Default constructor + Hit() = default; + + /// \brief Hit constructor + /// \param shunt + /// \param trackID Index of the track + /// \param detID ID of the detector segment + /// \param pos Position vector of the point + /// \param tof Time of the hit + Hit( Float_t x, Float_t y, Float_t z, Float_t time, Float_t energy, Int_t trackId, Int_t detId): + o2::BasicXYZEHit ( x, y, z, time, energy, trackId, detId) + {} + /// \brief Destructor + ~Hit() override = default; + + void PrintStream(std::ostream &stream) const; + + ClassDef(Hit, 1); + + // std::ostream &operator<<(std::ostream &stream, const Hit &point); + }; + } +} +#endif diff --git a/Detectors/FIT/base/include/README.md b/Detectors/FIT/base/include/README.md new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/Detectors/FIT/base/src/FITBaseLinkDef.h b/Detectors/FIT/base/src/FITBaseLinkDef.h new file mode 100644 index 0000000000000..4ef9430bb1d6d --- /dev/null +++ b/Detectors/FIT/base/src/FITBaseLinkDef.h @@ -0,0 +1,20 @@ +// Copyright CERN and copyright holders of ALICE O2. This software is +// distributed under the terms of the GNU General Public License v3 (GPL +// Version 3), copied verbatim in the file "COPYING". +// +// See https://alice-o2.web.cern.ch/ for full licensing information. +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +#ifdef __CLING__ + +#pragma link off all globals; +#pragma link off all classes; +#pragma link off all functions; + +#pragma link C++ class o2::FIT::Geometry; + + +#endif diff --git a/Detectors/FIT/base/src/Geometry.cxx b/Detectors/FIT/base/src/Geometry.cxx new file mode 100644 index 0000000000000..580cbe4867d4b --- /dev/null +++ b/Detectors/FIT/base/src/Geometry.cxx @@ -0,0 +1,54 @@ +// Copyright CERN and copyright holders of ALICE O2. This software is +// distributed under the terms of the GNU General Public License v3 (GPL +// Version 3), copied verbatim in the file "COPYING". +// +// See https://alice-o2.web.cern.ch/ for full licensing information. +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +#include + +#include +#include +#include +#include +#include "FITBase/Geometry.h" + +#include + +ClassImp(o2::FIT::Geometry); + +using namespace o2::FIT; + +// these initialisations are needed for a singleton +Geometry* Geometry::sGeom = nullptr; +const Char_t* Geometry::sDefaultGeometryName = "fit"; + +Geometry::Geometry(const Geometry& geo) + : TNamed(geo) +{ + +} +Geometry::Geometry(const Text_t* name, const Text_t* title, const Text_t* mcname, const Text_t* mctitle) + : TNamed(name, title) +{ + +} +Geometry& Geometry::operator=(const Geometry& /*rvalue*/) +{ + // LOG(FATAL) << "assignment operator, not implemented\n"; + return *this; +} +Geometry::~Geometry() +{ + if (this == sGeom) { + // LOG(ERROR) << "Do not call delete on me\n"; + return; + } +} +Geometry* Geometry::GetInstance() +{ + Geometry* rv = static_cast(sGeom); + return rv; +} diff --git a/Detectors/FIT/base/src/Hit.cxx b/Detectors/FIT/base/src/Hit.cxx new file mode 100644 index 0000000000000..2ead918573d9d --- /dev/null +++ b/Detectors/FIT/base/src/Hit.cxx @@ -0,0 +1,27 @@ +// Copyright CERN and copyright holders of ALICE O2. This software is +// distributed under the terms of the GNU General Public License v3 (GPL +// Version 3), copied verbatim in the file "COPYING". +// +// See https://alice-o2.web.cern.ch/ for full licensing information. +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +#include "FITBase/Hit.h" + +ClassImp(o2::FIT::Hit) + +using namespace o2::FIT; + +void Hit::PrintStream(std::ostream &stream) const { + stream << "FIT point: " << " in detector segment " << GetDetectorID() + << " at position (" << GetX() << "|" << GetY() << "|" << GetZ(); +} + + +std::ostream &operator<<(std::ostream &stream, const Hit &p) { + p.PrintStream(stream); + return stream; +} + diff --git a/Detectors/FIT/base/src/README.md b/Detectors/FIT/base/src/README.md new file mode 100644 index 0000000000000..cefd65a356cbc --- /dev/null +++ b/Detectors/FIT/base/src/README.md @@ -0,0 +1,2 @@ +# Src directory: +Here you find the source files and the private headers diff --git a/Detectors/FIT/macros/test/run_test.sh b/Detectors/FIT/macros/test/run_test.sh new file mode 100755 index 0000000000000..ae25be63799ac --- /dev/null +++ b/Detectors/FIT/macros/test/run_test.sh @@ -0,0 +1,16 @@ +# +nEvents=10 +mcEngine=\"TGeant3\" +#To de-activate the ALPIDE response, set alp=kFALSE +alp=kTRUE +# +root.exe -b -q $O2_ROOT/share/macro/run_sim_its_ALP3.C+\($nEvents,$mcEngine\) >& sim.log +#root.exe -b -q $O2_ROOT/share/macro/run_sim_its.C+\($nEvents,$mcEngine\) >& sim.log +root.exe -b -q $O2_ROOT/share/macro/run_digi_its.C+\($nEvents,$mcEngine,$alp\) >& digi.log +root.exe -b -q CheckDigits.C+\($nEvents,$mcEngine\) >& CheckDigits.log +root.exe -b -q $O2_ROOT/share/macro/run_clus_its.C+\($nEvents,$mcEngine\) >& clus.log +root.exe -b -q CheckClusters.C+\($nEvents,$mcEngine\) >& CheckClusters.log +root.exe -b -q $O2_ROOT/share/macro/run_trac_its.C+\($nEvents,$mcEngine\) >& trac.log +root.exe -b -q CheckTracks.C+\($nEvents,$mcEngine\) >& CheckTracks.log +root.exe DisplayTrack.C+\($nEvents,$mcEngine\) + diff --git a/Detectors/FIT/simulation/CMakeLists.txt b/Detectors/FIT/simulation/CMakeLists.txt new file mode 100644 index 0000000000000..9d6ea7834981a --- /dev/null +++ b/Detectors/FIT/simulation/CMakeLists.txt @@ -0,0 +1,16 @@ +set(MODULE_NAME "FITSimulation") + +O2_SETUP(NAME ${MODULE_NAME}) + +set(SRCS + src/Detector.cxx + ) +set(HEADERS + include/${MODULE_NAME}/Detector.h + ) + +Set(LINKDEF src/FITSimulationLinkDef.h) +Set(LIBRARY_NAME ${MODULE_NAME}) +set(BUCKET_NAME fit_simulation_bucket) + +O2_GENERATE_LIBRARY() diff --git a/Detectors/FIT/simulation/include/FITSimulation/Detector.h b/Detectors/FIT/simulation/include/FITSimulation/Detector.h new file mode 100644 index 0000000000000..bc65255bbd6f2 --- /dev/null +++ b/Detectors/FIT/simulation/include/FITSimulation/Detector.h @@ -0,0 +1,127 @@ +// Copyright CERN and copyright holders of ALICE O2. This software is +// distributed under the terms of the GNU General Public License v3 (GPL +// Version 3), copied verbatim in the file "COPYING". +// +// See https://alice-o2.web.cern.ch/ for full licensing information. +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +/// \file Detector.h +/// \brief Definition of the Detector class + +#ifndef ALICEO2_FIT_DETECTOR_H_ +#define ALICEO2_FIT_DETECTOR_H_ + +#include "DetectorsBase/Detector.h" // for Detector +#include "SimulationDataFormat/BaseHits.h" +#include "FITBase/Geometry.h" +#include + +class FairModule; + +class FairVolume; +class TClonesArray; +class TGeoVolume; + +class TParticle; + +class TString; + +namespace o2 { namespace FIT { class Geometry; }} + +namespace o2 { +namespace FIT { +using HitType = o2::BasicXYZEHit; +//class Hit; +class Geometry; +class Detector : public o2::Base::Detector +{ + + public: + enum constants {kAir=1, kVac=3, kGlass=6, kOpAir=7, kAl=15, kOpGlass=16, kOpGlassCathode=19,kSensAir=22}; //materials + + /// Name : Detector Name + /// Active: kTRUE for active detectors (ProcessHits() will be called) + /// kFALSE for inactive detectors + Detector(const char *Name, Bool_t Active); + + /// Default constructor + Detector() {} + + /// Initialization of the detector is done here + void Initialize() override; + + /// This method is called for each step during simulation (see FairMCApplication::Stepping()) + Bool_t ProcessHits(FairVolume *v = nullptr) override; + o2::BasicXYZEHit* AddHit(float x, float y, float z, float time, float energy, Int_t trackId, Int_t detId); + + void Register() override; + + TClonesArray* GetCollection(Int_t iColl) const final; + + void Reset() override; + + + /// Base class to create the detector geometry + void CreateMaterials(); + void ConstructGeometry() override; + void SetOneMCP(TGeoVolume *stl); +// Optical properties reader: e-Energy, abs-AbsorptionLength[cm], n-refractive index + Int_t ReadOptProperties(const std::string inputFilePath, Float_t **e, + Double_t **de, Float_t **abs, Float_t **n, Float_t **qe, Int_t &kNbins) const; + void DefineOpticalProperties(); + void FillOtherOptProperties(Float_t **efficAll, Float_t **rindexAir, Float_t **absorAir, + Float_t **rindexCathodeNext, Float_t **absorbCathodeNext, + Double_t **efficMet, Double_t **aReflMet, const Int_t kNbins) const; + void DeleteOptPropertiesArr(Float_t **e, Double_t **de, Float_t **abs, + Float_t **n, Float_t **efficAll, Float_t **rindexAir, Float_t **absorAir, + Float_t **rindexCathodeNext, Float_t **absorbCathodeNext, + Double_t **efficMet, Double_t **aReflMet) const; + Bool_t RegisterPhotoE(Double_t energy); + + // Geometry* GetGeometry(); + + /// Prints out the content of this class in ASCII format + /// \param ostream *os The output stream + void Print(std::ostream *os) const; + + /// Reads in the content of this class in the format of Print + /// \param istream *is The input stream + void Read(std::istream *is); + + + /// Clone this object (used in MT mode only) + // FairModule *CloneModule() const override; + + + private: + + Int_t fIdSens1; // Sensetive volume in T0 + TGraph *fPMTeff; //pmt registration effeicincy + + /// Container for data points + TClonesArray *mHitCollection; + + + /// Define the sensitive volumes of the geometry + void defineSensitiveVolumes(); + + Detector(const Detector &); + + Detector &operator=(const Detector &); + + Geometry *mGeometry; //! Geometry + + ClassDefOverride(Detector, 1) +}; + +// Input and output function for standard C++ input/output. +std::ostream &operator<<(std::ostream &os, Detector &source); + +std::istream &operator>>(std::istream &os, Detector &source); +} +} + +#endif diff --git a/Detectors/FIT/simulation/src/Detector.cxx b/Detectors/FIT/simulation/src/Detector.cxx new file mode 100644 index 0000000000000..1e8a364dc3b4a --- /dev/null +++ b/Detectors/FIT/simulation/src/Detector.cxx @@ -0,0 +1,549 @@ +// Copyright CERN and copyright holders of ALICE O2. This software is +// distributed under the terms of the GNU General Public License v3 (GPL +// Version 3), copied verbatim in the file "COPYING". +// +// See https://alice-o2.web.cern.ch/ for full licensing information. +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +#include "TSystem.h" +#include "TVirtualMC.h" +#include "TClonesArray.h" +#include "TGeoManager.h" // for TGeoManager +#include "TLorentzVector.h" +#include "TMath.h" +#include "TString.h" + +#include "FairLogger.h" +#include "FairRootManager.h" +#include "FairVolume.h" + +#include "FairRootManager.h" +#include "FairVolume.h" + +#include "FITBase/Geometry.h" +#include "FITSimulation/Detector.h" + +using namespace o2::FIT; + +ClassImp(Detector); + +Detector::Detector(const char* Name, Bool_t Active) + : o2::Base::Detector(Name, Active), + fIdSens1(0), + fPMTeff(0x0), + mHitCollection(new TClonesArray("o2::FIT::HitType")) +{ + // Geometry *geo = GetGeometry() ; + + // TString gn(geo->GetName()); + +} + +void Detector::Initialize() {} + +void Detector::ConstructGeometry() +{ + LOG(DEBUG) << "Creating FIT geometry\n"; + CreateMaterials(); + + /* + Geometry * geom = GetGeometry() ; + TString gn(geom->GetName()); + gn.ToUpper(); + + if(!(geom->IsInitialized())) + { + LOG(ERROR) << "ConstructGeometry: FIT Geometry class has not been set up.\n"; + } + */ + Float_t zdetA = 333; + Float_t zdetC = 82; + + Int_t idrotm[999]; + Double_t x,y,z; + Float_t pstartC[3] = {20., 20 ,5}; + Float_t pstartA[3] = {20, 20 ,5}; + Float_t pinstart[3] = {2.95,2.95,4.34}; + Float_t pmcp[3] = {2.949, 2.949, 2.8}; //MCP + + Matrix(idrotm[901], 90., 0., 90., 90., 180., 0.); + + + //C side Concave Geometry + + Double_t crad = 82.; //define concave c-side radius here + + Double_t dP = pmcp[0]; //side length of mcp divided by 2 + + //uniform angle between detector faces== + Double_t btta = 2*TMath::ATan(dP/crad); + + //get noncompensated translation data + Double_t grdin[6] = {-3, -2, -1, 1, 2, 3}; + Double_t gridpoints[6]; + for(Int_t i = 0; i < 6; i++){ + gridpoints[i] = crad*TMath::Sin((1 - 1/(2*TMath::Abs(grdin[i])))*grdin[i]*btta); + } + + Double_t xi[28] = {gridpoints[1],gridpoints[2],gridpoints[3],gridpoints[4], + gridpoints[0],gridpoints[1],gridpoints[2],gridpoints[3],gridpoints[4],gridpoints[5], + gridpoints[0],gridpoints[1],gridpoints[4],gridpoints[5], + gridpoints[0],gridpoints[1],gridpoints[4],gridpoints[5], + gridpoints[0],gridpoints[1],gridpoints[2],gridpoints[3],gridpoints[4],gridpoints[5], + gridpoints[1],gridpoints[2],gridpoints[3],gridpoints[4]}; + Double_t yi[28] = {gridpoints[5],gridpoints[5],gridpoints[5],gridpoints[5], + gridpoints[4],gridpoints[4],gridpoints[4],gridpoints[4],gridpoints[4],gridpoints[4], + gridpoints[3],gridpoints[3],gridpoints[3],gridpoints[3], + gridpoints[2],gridpoints[2],gridpoints[2],gridpoints[2], + gridpoints[1],gridpoints[1],gridpoints[1],gridpoints[1],gridpoints[1],gridpoints[1], + gridpoints[0],gridpoints[0],gridpoints[0],gridpoints[0]}; + Double_t zi[28]; + for(Int_t i = 0; i < 28; i++) { + zi[i] = TMath::Sqrt(TMath::Power(crad, 2) - TMath::Power(xi[i], 2) - TMath::Power(yi[i], 2)); + } + + //get rotation data + Double_t ac[28], bc[28], gc[28]; + for(Int_t i = 0; i < 28; i++) { + ac[i] = TMath::ATan(yi[i]/xi[i]) - TMath::Pi()/2 + 2*TMath::Pi(); + if(xi[i] < 0){ + bc[i] = TMath::ACos(zi[i]/crad); + } + else { + bc[i] = -1 * TMath::ACos(zi[i]/crad); + } + } + Double_t xc2[28], yc2[28], zc2[28]; + + + //compensation based on node position within individual detector geometries + //determine compensated radius + Double_t rcomp = crad + pstartC[2] / 2.0; // + for(Int_t i = 0; i < 28; i++) { + //Get compensated translation data + xc2[i] = rcomp*TMath::Cos(ac[i] + TMath::Pi()/2)*TMath::Sin(-1*bc[i]); + yc2[i] = rcomp*TMath::Sin(ac[i] + TMath::Pi()/2)*TMath::Sin(-1*bc[i]); + zc2[i] = rcomp*TMath::Cos(bc[i]); + + //Convert angles to degrees + ac[i]*=180/TMath::Pi(); + bc[i]*=180/TMath::Pi(); + gc[i] = -1 * ac[i]; + } + //A Side + + Float_t xa[24] = {-11.8, -5.9, 0, 5.9, 11.8, + -11.8, -5.9, 0, 5.9, 11.8, + -12.8, -6.9, 6.9, 12.8, + -11.8, -5.9, 0, 5.9, 11.8, + -11.8, -5.9, 0, 5.9, 11.8 }; + + Float_t ya[24] = { 11.9, 11.9, 12.9, 11.9, 11.9, + 6.0, 6.0, 7.0, 6.0, 6.0, + -0.1, -0.1, 0.1, 0.1, + -6.0, -6.0, -7.0, -6.0, -6.0, + -11.9, -11.9, -12.9, -11.9, -11.9 }; + + + TGeoVolumeAssembly * stlinA = new TGeoVolumeAssembly("0STL"); // A side mother + TGeoVolumeAssembly * stlinC = new TGeoVolumeAssembly("0STR"); // C side mother + + //FIT interior + TVirtualMC::GetMC()->Gsvolu("0INS","BOX",getMediumID(kAir),pinstart,3); + TGeoVolume *ins = gGeoManager->GetVolume("0INS"); + // + TGeoTranslation *tr[52]; + TString nameTr; + + + //A side Translations + for (Int_t itr=0; itr<24; itr++) { + nameTr = Form("0TR%i",itr+1); + z=-pstartA[2]+pinstart[2]; + tr[itr] = new TGeoTranslation(nameTr.Data(),xa[itr],ya[itr], z ); + printf(" itr %i A %f %f %f \n",itr, xa[itr], ya[itr], z+zdetA); + tr[itr]->RegisterYourself(); + stlinA->AddNode(ins,itr,tr[itr]); + } + + TGeoRotation *rot[28]; + TString nameRot; + + TGeoCombiTrans *com[28]; + TString nameCom; + + //C Side Transformations + for (Int_t itr=24;itr<52; itr++) { + nameTr = Form("0TR%i",itr+1); + nameRot = Form("0Rot%i",itr+1); + //nameCom = Form("0Com%i",itr+1); + rot[itr-24] = new TGeoRotation(nameRot.Data(),ac[itr-24],bc[itr-24],gc[itr-24]); + rot[itr-24]->RegisterYourself(); + + tr[itr] = new TGeoTranslation(nameTr.Data(),xc2[itr-24],yc2[itr-24], (zc2[itr-24]-80.) ); + tr[itr]->RegisterYourself(); + + // com[itr-24] = new TGeoCombiTrans(tr[itr],rot[itr-24]); + com[itr-24] = new TGeoCombiTrans(xc2[itr-24],yc2[itr-24], (zc2[itr-24]-80),rot[itr-24]); + TGeoHMatrix hm = *com[itr-24]; + TGeoHMatrix *ph = new TGeoHMatrix(hm); + stlinC->AddNode(ins,itr,ph); + } + + TGeoVolume *alice = gGeoManager->GetVolume("cave"); + alice->AddNode(stlinA,1,new TGeoTranslation(0,0, zdetA ) ); + // alice->AddNode(stlinC,1,new TGeoTranslation(0,0, -zdetC ) ); + TGeoRotation * rotC = new TGeoRotation( "rotC",90., 0., 90., 90., 180., 0.); + alice->AddNode(stlinC,1, new TGeoCombiTrans(0., 0., -zdetC , rotC) ); + + // MCP + 4 x wrapped radiator + 4xphotocathod + MCP + Al top in front of radiators + SetOneMCP(ins); + +} +//_________________________________________ +void Detector::SetOneMCP(TGeoVolume *ins) +{ + Double_t x,y,z; + Float_t pinstart[3] = {2.95,2.95,4.34}; + Float_t pmcp[3] = {2.949, 2.949, 2.8}; //MCP + Float_t ptop[3] = {1.324, 1.324, 1.};//cherenkov radiator + Float_t ptopref[3] = {1.3241, 1.3241, 1.};//cherenkov radiator wrapped with reflection + Float_t preg[3] = {1.324, 1.324, 0.005};//photcathode + Double_t prfv[3]= {0.0002,1.323, 1.};//vertical refracting layer bettwen radiators and bettwen radiator and not optical Air + Double_t prfh[3]= {1.323,0.0002, 1.};//horizontal refracting layer bettwen radiators a + Double_t pal[3]= {2.648,2.648, 0.25}; // 5mm Al top on th eeach radiator + // Entry window (glass) + TVirtualMC::GetMC()->Gsvolu("0TOP","BOX",getMediumID(kOpGlass),ptop,3); //glass radiator + TGeoVolume *top = gGeoManager->GetVolume("0TOP"); + TVirtualMC::GetMC()->Gsvolu("0TRE","BOX",getMediumID(kAir),ptopref,3); //air: wrapped radiator + TGeoVolume *topref = gGeoManager->GetVolume("0TRE"); + TVirtualMC::GetMC()->Gsvolu ("0REG", "BOX", getMediumID(kOpGlassCathode), preg, 3); + TGeoVolume *cat = gGeoManager->GetVolume("0REG"); + TVirtualMC::GetMC()->Gsvolu("0MCP","BOX",getMediumID(kGlass),pmcp,3); //glass + TGeoVolume *mcp = gGeoManager->GetVolume("0MCP"); + TVirtualMC::GetMC()->Gsvolu("0RFV","BOX",getMediumID(kOpAir),prfv,3); //optical Air vertical + TGeoVolume *rfv = gGeoManager->GetVolume("0RFV"); + TVirtualMC::GetMC()->Gsvolu("0RFH","BOX",getMediumID(kOpAir),prfh,3); //optical Air horizontal + TGeoVolume *rfh = gGeoManager->GetVolume("0RFH"); + + TVirtualMC::GetMC()->Gsvolu("0PAL","BOX",getMediumID(kAl),pal,3); // 5mmAl top on the radiator + TGeoVolume *altop = gGeoManager->GetVolume("0PAL"); + + + //wrapped radiator + reflectiong layers + Int_t ntops=0, nrfvs=0, nrfhs=0; + Float_t xin=0, yin=0, xinv=0, yinv=0,xinh=0,yinh=0; + x=y=z=0; + topref->AddNode(top, 1, new TGeoTranslation(0,0,0) ); + xinv = -ptop[0] - prfv[0]; + topref->AddNode(rfv, 1, new TGeoTranslation(xinv,0,0) ); + printf(" GEOGEO refv %f , 0,0 \n",xinv); + xinv = ptop[0] + prfv[0]; + topref->AddNode(rfv, 2, new TGeoTranslation(xinv,0,0) ); + printf(" GEOGEO refv %f , 0,0 \n",xinv); + yinv = -ptop[1] - prfh[1]; + topref->AddNode(rfh, 1, new TGeoTranslation(0,yinv,0) ); + printf(" GEOGEO refh , 0, %f, 0 \n",yinv); + yinv = ptop[1] + prfh[1]; + topref->AddNode(rfh, 2, new TGeoTranslation(0,yinv,0) ); + + //container for radiator, cathod + for (Int_t ix=0; ix<2; ix++) { + xin = - pinstart[0] + 0.3 + (ix+0.5)*2*ptopref[0] ; + for (Int_t iy=0; iy<2 ; iy++) { + z = - pinstart[2] + 2*pal[2] + ptopref[2]; + yin = - pinstart[1] + 0.3 + (iy+0.5)*2*ptopref[1]; + ntops++; + ins->AddNode(topref, ntops, new TGeoTranslation(xin,yin,z) ); + printf(" 0TOP full %i x %f y %f z %f \n", ntops, xin, yin, z); + z = -pinstart[2] + 2*pal[2] + 2 * ptopref[2] + preg[2]; + ins->AddNode(cat, ntops, new TGeoTranslation(xin, yin, z) ); + // cat->Print(); + printf(" GEOGEO CATHOD x=%f , y= %f z= %f num %i\n", xin, yin, z, ntops); + } + } + //Al top + z=-pinstart[2] + pal[2]; + ins->AddNode(altop, 1 , new TGeoTranslation(0,0,z) ); + + // MCP + z=-pinstart[2] + 2*pal[2] + 2*ptopref[2] + 2*preg[2] + pmcp[2]; + // z=-pinstart[2] + 2*ptopref[2] + preg[2]; + ins->AddNode(mcp, 1 , new TGeoTranslation(0,0,z) ); +} + +Bool_t Detector::ProcessHits(FairVolume* v) +{ + TLorentzVector position; + printf("@@@FIT ProcessHits enter \n"); + static auto* refMC = TVirtualMC::GetMC(); + if(refMC->IsTrackEntering()) { + refMC->TrackPosition(position); + float x = position.X(); + float y = position.Y(); + float z = position.Z(); + + float time = refMC->TrackTime() * 1.0e12; + int trackID = refMC->GetStack()->GetCurrentTrackNumber(); + int detID = v->getMCid(); + float etot = refMC->Etot(); + int iPart= refMC->TrackPid(); + float enDep = refMC->Edep(); + printf("@@@FIT ProcessHits x %f y %f z %f DetID %i \n", x,y,z, detID); + if (iPart == 50000050) // If particles is photon then ... + { + if(RegisterPhotoE(etot)) { + // fIshunt = 2; + AddHit(x,y,z, time, enDep, trackID, detID); + + } + } + return kTRUE; + } +} + +HitType* Detector::AddHit(float x, float y, float z, float time, float energy, Int_t trackId, Int_t detId) +{ + TClonesArray& clref = *mHitCollection; + + Int_t size = clref.GetEntriesFast(); + + HitType* hit = new (clref[size]) HitType(x, y, z, time, energy, trackId, detId); + +} + +void Detector::Register() { + FairRootManager::Instance()->Register("FITHit", "FIT", mHitCollection, kTRUE); +} + +TClonesArray* Detector::GetCollection(Int_t iColl) const +{ + if (iColl == 0) + return mHitCollection; + return nullptr; +} + +void Detector::Reset() {} + + +void Detector::CreateMaterials() +{ + + Int_t isxfld = 2; // magneticField->Integ(); + Float_t sxmgmx = 10.; // magneticField->Max(); + + // Float_t a,z,d,radl,absl,buf[1]; + // Int_t nbuf; + // AIR + + Float_t aAir[4]={12.0107,14.0067,15.9994,39.948}; + Float_t zAir[4]={6.,7.,8.,18.}; + Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827}; + Float_t dAir = 1.20479E-3; + Float_t dAir1 = 1.20479E-11; + // Radiator glass SiO2 + Float_t aglass[2]={28.0855,15.9994}; + Float_t zglass[2]={14.,8.}; + Float_t wglass[2]={1.,2.}; + Float_t dglass=2.65; + // MCP glass SiO2 + Float_t dglass_mcp=1.3; + //*** Definition Of avaible FIT materials *** + Mixture(1, "Vacuum$", aAir, zAir, dAir1,4,wAir); + Mixture(2, "Air$", aAir, zAir, dAir,4,wAir); + Mixture( 4, "MCP glass $",aglass,zglass,dglass_mcp,-2,wglass); + Mixture( 24, "Radiator Optical glass$",aglass,zglass,dglass,-2,wglass); + Material(11, "Aliminium$", 26.98, 13.0, 2.7, 8.9,999); + + Medium(1, "Air$", 2, 0, isxfld, sxmgmx, 10., .1, 1., .003, .003); + Medium(3, "Vacuum$", 1, 0, isxfld, sxmgmx, 10., .01, .1, .003, .003); + Medium(6, "Glass$", 4, 0, isxfld, sxmgmx, 10., .01, .1, .003, .003); + + Medium(7, "OpAir$", 2, 0, isxfld, sxmgmx, 10., .1, 1., .003, .003); + + Medium(15, "Aluminium$", 11, 0, isxfld, sxmgmx, 10., .01, 1., .003, .003); + Medium(16, "OpticalGlass$", 24, 1, isxfld, sxmgmx, 10., .01, .1, .003, .003); + Medium(19, "OpticalGlassCathode$", 24, 1, isxfld, sxmgmx, 10., .01, .1, .003, .003); + Medium(22, "SensAir$", 2, 1, isxfld, sxmgmx, 10., .1, 1., .003, .003); + + +} + +//------------------------------------------------------------------- +void Detector::DefineOpticalProperties() +{ + +// Path of the optical properties input file + TString inputDir; + const char* aliceO2env=std::getenv("O2_ROOT"); + if (aliceO2env) inputDir=aliceO2env; + inputDir+="/share/Detectors/FIT/files/"; + + TString optPropPath =inputDir + "quartzOptProperties.txt"; + optPropPath = gSystem->ExpandPathName(optPropPath.Data()); // Expand $(ALICE_ROOT) into real system path + +// Prepare pointers for arrays read from the input file + Float_t *aPckov=NULL; + Double_t *dPckov=NULL; + Float_t *aAbsSiO2=NULL; + Float_t *rindexSiO2=NULL; + Float_t *qeff = NULL; + Int_t kNbins=0; + ReadOptProperties(optPropPath.Data(), &aPckov, &dPckov, &aAbsSiO2, &rindexSiO2, &qeff, kNbins); + // set QE + fPMTeff = new TGraph(kNbins,aPckov,qeff); + +// Prepare pointers for arrays with constant and hardcoded values (independent on wavelength) + Float_t *efficAll=NULL; + Float_t *rindexAir=NULL; + Float_t *absorAir=NULL; + Float_t *rindexCathodeNext=NULL; + Float_t *absorbCathodeNext=NULL; + Double_t *efficMet=NULL; + Double_t *aReflMet=NULL; + FillOtherOptProperties(&efficAll, &rindexAir, &absorAir, &rindexCathodeNext, + &absorbCathodeNext, &efficMet, &aReflMet, kNbins); + + TVirtualMC::GetMC()->SetCerenkov (getMediumID(kOpGlass), kNbins, aPckov, aAbsSiO2, efficAll, rindexSiO2); + // TVirtualMC::GetMC()->SetCerenkov (getMediumID(kOpGlassCathode), kNbins, aPckov, aAbsSiO2, effCathode, rindexSiO2); + TVirtualMC::GetMC()->SetCerenkov (getMediumID(kOpGlassCathode), kNbins, aPckov, aAbsSiO2, efficAll, rindexSiO2); + +//Define a border for radiator optical properties +// TODO: Maciek: The following 3 lines just generate warnings and do nothing else - could be deleted + TVirtualMC::GetMC()->DefineOpSurface("surfRd", kUnified /*kGlisur*/,kDielectric_metal,kPolished, 0.); + TVirtualMC::GetMC()->SetMaterialProperty("surfRd", "EFFICIENCY", kNbins, dPckov, efficMet); + TVirtualMC::GetMC()->SetMaterialProperty("surfRd", "REFLECTIVITY", kNbins, dPckov, aReflMet); + + DeleteOptPropertiesArr(&aPckov, &dPckov, &aAbsSiO2, &rindexSiO2, &efficAll, &rindexAir, &absorAir, &rindexCathodeNext, &absorbCathodeNext, &efficMet, &aReflMet); +} + + +void Detector::FillOtherOptProperties(Float_t **efficAll, Float_t **rindexAir, Float_t **absorAir, + Float_t **rindexCathodeNext, Float_t **absorbCathodeNext, + Double_t **efficMet, Double_t **aReflMet, const Int_t kNbins) const +{ + // Allocate memory for these arrays according to the required size + *efficAll = new Float_t[kNbins]; + *rindexAir = new Float_t[kNbins]; + *absorAir = new Float_t[kNbins]; + *rindexCathodeNext = new Float_t[kNbins]; + *absorbCathodeNext = new Float_t[kNbins]; + *efficMet = new Double_t[kNbins]; + *aReflMet = new Double_t[kNbins]; + + // Set constant values to the arrays + for(Int_t i=0; iEval(lambda); + Double_t p = gRandom->Rndm(); + + if (p > eff) + return kFALSE; + + return kTRUE; +} + + +Int_t Detector::ReadOptProperties(const std::string filePath, Float_t **e, Double_t **de, + Float_t **abs, Float_t **n, Float_t **qe, Int_t &kNbins) const{ + std::ifstream infile; + infile.open(filePath.c_str()); + + // Check if file is opened correctly + if(infile.fail()==true){ + //AliFatal(Form("Error opening ascii file: %s", filePath.c_str())); + return -1; + } + + std::string comment; // dummy, used just to read 4 first lines and move the cursor to the 5th, otherwise unused + if(!getline(infile,comment)){ // first comment line + // AliFatal(Form("Error opening ascii file (it is probably a folder!): %s", filePath.c_str())); + return -2; + } + getline(infile,comment); // 2nd comment line + + // Get number of elements required for the array + infile >> kNbins; + if(kNbins<0 || kNbins>1e4){ + // AliFatal(Form("Input arraySize out of range 0..1e4: %i. Check input file: %s", kNbins, filePath.c_str())); + return -4; + } + + // Allocate memory required for arrays + *e = new Float_t[kNbins]; + *de = new Double_t[kNbins]; + *abs = new Float_t[kNbins]; + *n = new Float_t[kNbins]; + *qe = new Float_t[kNbins]; + + getline(infile,comment); // finish 3rd line after the nEntries are read + getline(infile,comment); // 4th comment line + + // read the main body of the file (table of values: energy, absorption length and refractive index) + Int_t iLine=0; + std::string sLine; + getline(infile, sLine); + while(!infile.eof()){ + if(iLine >= kNbins){ + // AliFatal(Form("Line number: %i reaches range of declared arraySize: %i. Check input file: %s", iLine, kNbins, filePath.c_str())); + return -5; + } + std::stringstream ssLine(sLine); + ssLine >> (*de)[iLine]; + (*de)[iLine] *= 1e-9; // Convert eV -> GeV immediately + (*e)[iLine] = static_cast ((*de)[iLine]); // same value, different precision + ssLine >> (*abs)[iLine]; + ssLine >> (*n)[iLine]; + ssLine >> (*qe)[iLine]; + if(!(ssLine.good() || ssLine.eof())){ // check if there were problems with numbers conversion + // AliFatal(Form("Error while reading line %i: %s", iLine, ssLine.str().c_str())); + return -6; + } + getline(infile, sLine); + iLine++; + } + if(iLine != kNbins){ + // AliFatal(Form("Total number of lines %i is different than declared %i. Check input file: %s", iLine, kNbins, filePath.c_str())); + return -7; + } + +// AliInfo(Form("Optical properties taken from the file: %s. Number of lines read: %i",filePath.c_str(),iLine)); + return 0; +} diff --git a/Detectors/FIT/simulation/src/FITSimulationLinkDef.h b/Detectors/FIT/simulation/src/FITSimulationLinkDef.h new file mode 100644 index 0000000000000..fa22087a5f852 --- /dev/null +++ b/Detectors/FIT/simulation/src/FITSimulationLinkDef.h @@ -0,0 +1,19 @@ +// Copyright CERN and copyright holders of ALICE O2. This software is +// distributed under the terms of the GNU General Public License v3 (GPL +// Version 3), copied verbatim in the file "COPYING". +// +// See https://alice-o2.web.cern.ch/ for full licensing information. +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +#ifdef __CLING__ + +#pragma link off all globals; +#pragma link off all classes; +#pragma link off all functions; + +#pragma link C++ class o2::FIT::Detector+; + +#endif diff --git a/Detectors/FIT/simulation/src/README.md b/Detectors/FIT/simulation/src/README.md new file mode 100644 index 0000000000000..cefd65a356cbc --- /dev/null +++ b/Detectors/FIT/simulation/src/README.md @@ -0,0 +1,2 @@ +# Src directory: +Here you find the source files and the private headers From de03449b760e4c9f0a3aaf831828107fb22ae2a8 Mon Sep 17 00:00:00 2001 From: Alla Maevskaya Date: Sun, 17 Sep 2017 21:35:48 +0200 Subject: [PATCH 02/18] add FIT to TrackReference.h --- Detectors/Base/include/DetectorsBase/TrackReference.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Detectors/Base/include/DetectorsBase/TrackReference.h b/Detectors/Base/include/DetectorsBase/TrackReference.h index 4478218034a7c..60d5f0ccc0759 100644 --- a/Detectors/Base/include/DetectorsBase/TrackReference.h +++ b/Detectors/Base/include/DetectorsBase/TrackReference.h @@ -44,13 +44,13 @@ class TrackReference : public TObject kTOF = 4, kMUON = 5, kHMPID = 6, - kT0 = 7, + kFIT = 7, kEMCAL = 8, kPMD = 10, kFMD = 12, kVZERO = 14, kMFT = 16, - kHALL = 17 + kHALL = 17 }; /// Default Constructor From d3cd1dea79f493321de79a96004bbd7b87532a4b Mon Sep 17 00:00:00 2001 From: Alla Maevskaya Date: Sun, 17 Sep 2017 21:36:53 +0200 Subject: [PATCH 03/18] add FIT to Detectors/CMakeLists.txt --- Detectors/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Detectors/CMakeLists.txt b/Detectors/CMakeLists.txt index 6f481ac6267be..276aefca7820f 100644 --- a/Detectors/CMakeLists.txt +++ b/Detectors/CMakeLists.txt @@ -21,5 +21,6 @@ add_subdirectory(TPC) add_subdirectory(EMCAL) add_subdirectory(TOF) add_subdirectory(TRD) +add_subdirectory(FIT) Install(DIRECTORY Geometry gconfig DESTINATION share/Detectors/) From b3bdc93feb2031088354702aa9a31f71e6dcbc1f Mon Sep 17 00:00:00 2001 From: Alla Maevskaya Date: Sun, 17 Sep 2017 21:37:56 +0200 Subject: [PATCH 04/18] add FIT buckets --- cmake/O2Dependencies.cmake | 41 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/cmake/O2Dependencies.cmake b/cmake/O2Dependencies.cmake index 9926fecffec41..4481f272d5877 100644 --- a/cmake/O2Dependencies.cmake +++ b/cmake/O2Dependencies.cmake @@ -934,6 +934,47 @@ o2_define_bucket( ${CMAKE_SOURCE_DIR}/Detectors/Base/include ${CMAKE_SOURCE_DIR}/Detectors/TOF/base/include ) +o2_define_bucket( + NAME + fit_base_bucket + + DEPENDENCIES # library names + ExampleModule1 # another module + ExampleModule1_bucket # another bucket + Core Hist # ROOT + + INCLUDE_DIRECTORIES + ${FAIRROOT_INCLUDE_DIR} + ${ROOT_INCLUDE_DIR} + ${CMAKE_SOURCE_DIR}/DataFormats/simulation/include + ${CMAKE_SOURCE_DIR}/Common/MathUtils/include + ${CMAKE_SOURCE_DIR}/Detectors/Base/include + ${CMAKE_SOURCE_DIR}/Detectors/FIT/base/include + ) +o2_define_bucket( + NAME + fit_simulation_bucket + + DEPENDENCIES # library names + root_base_bucket + fairroot_geom + RIO + Graf + Gpad + Matrix + Physics + FITBase + DetectorsBase + SimulationDataFormat + Core Hist # ROOT + + INCLUDE_DIRECTORIES + ${FAIRROOT_INCLUDE_DIR} + ${ROOT_INCLUDE_DIR} + ${CMAKE_SOURCE_DIR}/Detectors/Base/include + ${CMAKE_SOURCE_DIR}/Detectors/FIT/base/include + ${CMAKE_SOURCE_DIR}/Detectors/Simulation/include + ${CMAKE_SOURCE_DIR}/Detectors/FIT/Simulations/include ) o2_define_bucket( NAME From 1ddb6a6ca16832eca040097cb606c23fac0aed8f Mon Sep 17 00:00:00 2001 From: sawenzel Date: Mon, 18 Sep 2017 21:25:32 +0200 Subject: [PATCH 05/18] Update Detector.cxx --- Detectors/FIT/simulation/src/Detector.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/Detectors/FIT/simulation/src/Detector.cxx b/Detectors/FIT/simulation/src/Detector.cxx index 1e8a364dc3b4a..86713db4781b9 100644 --- a/Detectors/FIT/simulation/src/Detector.cxx +++ b/Detectors/FIT/simulation/src/Detector.cxx @@ -25,6 +25,7 @@ #include "FITBase/Geometry.h" #include "FITSimulation/Detector.h" +#include using namespace o2::FIT; From 074a13b8488faa0db2ec85ff7e13bdec51f57bee Mon Sep 17 00:00:00 2001 From: Alla Maevskaya Date: Tue, 19 Sep 2017 20:18:26 +0200 Subject: [PATCH 06/18] fixed fit simulation bucket --- cmake/O2Dependencies.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmake/O2Dependencies.cmake b/cmake/O2Dependencies.cmake index 4481f272d5877..4d9de474e84f7 100644 --- a/cmake/O2Dependencies.cmake +++ b/cmake/O2Dependencies.cmake @@ -974,7 +974,10 @@ o2_define_bucket( ${CMAKE_SOURCE_DIR}/Detectors/Base/include ${CMAKE_SOURCE_DIR}/Detectors/FIT/base/include ${CMAKE_SOURCE_DIR}/Detectors/Simulation/include - ${CMAKE_SOURCE_DIR}/Detectors/FIT/Simulations/include ) + ${CMAKE_SOURCE_DIR}/Detectors/FIT/Simulations/include + ${CMAKE_SOURCE_DIR}/DataFormats/simulation/include + ${CMAKE_SOURCE_DIR}/Common/MathUtils/include +) o2_define_bucket( NAME From 3b5efdd070d0543996bb9cc4d88fedac065cdf42 Mon Sep 17 00:00:00 2001 From: Alla Maevskaya Date: Tue, 19 Sep 2017 20:58:11 +0200 Subject: [PATCH 07/18] fix O2 coding convention --- Detectors/FIT/base/FITBaseLinkDef.h | 2 +- Detectors/FIT/base/include/FITBase/Geometry.h | 4 +-- Detectors/FIT/base/include/FITBase/Hit.h | 2 +- Detectors/FIT/base/src/FITBaseLinkDef.h | 2 +- Detectors/FIT/base/src/Geometry.cxx | 2 +- Detectors/FIT/base/src/Hit.cxx | 2 +- .../include/FITSimulation/Detector.h | 8 ++--- Detectors/FIT/simulation/src/Detector.cxx | 34 +++++++++---------- .../FIT/simulation/src/FITSimulationLinkDef.h | 2 +- 9 files changed, 29 insertions(+), 29 deletions(-) diff --git a/Detectors/FIT/base/FITBaseLinkDef.h b/Detectors/FIT/base/FITBaseLinkDef.h index a87f7f4992a2b..f8892c08eccaf 100644 --- a/Detectors/FIT/base/FITBaseLinkDef.h +++ b/Detectors/FIT/base/FITBaseLinkDef.h @@ -2,7 +2,7 @@ // distributed under the terms of the GNU General Public License v3 (GPL // Version 3), copied verbatim in the file "COPYING". // -// See https://alice-o2.web.cern.ch/ for full licensing information. +// See http://alice-o2.web.cern.ch/license for full licensing information. // // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization diff --git a/Detectors/FIT/base/include/FITBase/Geometry.h b/Detectors/FIT/base/include/FITBase/Geometry.h index 1ea2beb06e157..5939e23c2b253 100644 --- a/Detectors/FIT/base/include/FITBase/Geometry.h +++ b/Detectors/FIT/base/include/FITBase/Geometry.h @@ -2,7 +2,7 @@ // distributed under the terms of the GNU General Public License v3 (GPL // Version 3), copied verbatim in the file "COPYING". // -// See https://alice-o2.web.cern.ch/ for full licensing information. +// See http://alice-o2.web.cern.ch/license for full licensing information. // // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization @@ -44,7 +44,7 @@ class Geometry : public TNamed /// /// Destructor. /// - ~Geometry() ; + virtual ~Geometry() override ; /// /// Assign operator. diff --git a/Detectors/FIT/base/include/FITBase/Hit.h b/Detectors/FIT/base/include/FITBase/Hit.h index 3cc31e6afbf13..58d2d2fb8239f 100644 --- a/Detectors/FIT/base/include/FITBase/Hit.h +++ b/Detectors/FIT/base/include/FITBase/Hit.h @@ -2,7 +2,7 @@ // distributed under the terms of the GNU General Public License v3 (GPL // Version 3), copied verbatim in the file "COPYING". // -// See https://alice-o2.web.cern.ch/ for full licensing information. +// See http://alice-o2.web.cern.ch/license for full licensing information. // // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization diff --git a/Detectors/FIT/base/src/FITBaseLinkDef.h b/Detectors/FIT/base/src/FITBaseLinkDef.h index 4ef9430bb1d6d..85adbb6dcbefb 100644 --- a/Detectors/FIT/base/src/FITBaseLinkDef.h +++ b/Detectors/FIT/base/src/FITBaseLinkDef.h @@ -2,7 +2,7 @@ // distributed under the terms of the GNU General Public License v3 (GPL // Version 3), copied verbatim in the file "COPYING". // -// See https://alice-o2.web.cern.ch/ for full licensing information. +// See http://alice-o2.web.cern.ch/license for full licensing information. // // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization diff --git a/Detectors/FIT/base/src/Geometry.cxx b/Detectors/FIT/base/src/Geometry.cxx index 580cbe4867d4b..38bcb14776e35 100644 --- a/Detectors/FIT/base/src/Geometry.cxx +++ b/Detectors/FIT/base/src/Geometry.cxx @@ -2,7 +2,7 @@ // distributed under the terms of the GNU General Public License v3 (GPL // Version 3), copied verbatim in the file "COPYING". // -// See https://alice-o2.web.cern.ch/ for full licensing information. +// See http://alice-o2.web.cern.ch/license for full licensing information. // // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization diff --git a/Detectors/FIT/base/src/Hit.cxx b/Detectors/FIT/base/src/Hit.cxx index 2ead918573d9d..bf468f4e6823c 100644 --- a/Detectors/FIT/base/src/Hit.cxx +++ b/Detectors/FIT/base/src/Hit.cxx @@ -2,7 +2,7 @@ // distributed under the terms of the GNU General Public License v3 (GPL // Version 3), copied verbatim in the file "COPYING". // -// See https://alice-o2.web.cern.ch/ for full licensing information. +// See http://alice-o2.web.cern.ch/license for full licensing information. // // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization diff --git a/Detectors/FIT/simulation/include/FITSimulation/Detector.h b/Detectors/FIT/simulation/include/FITSimulation/Detector.h index bc65255bbd6f2..dc8d8e29ad74f 100644 --- a/Detectors/FIT/simulation/include/FITSimulation/Detector.h +++ b/Detectors/FIT/simulation/include/FITSimulation/Detector.h @@ -2,7 +2,7 @@ // distributed under the terms of the GNU General Public License v3 (GPL // Version 3), copied verbatim in the file "COPYING". // -// See https://alice-o2.web.cern.ch/ for full licensing information. +// See http://alice-o2.web.cern.ch/license for full licensing information. // // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization @@ -24,7 +24,7 @@ class FairModule; class FairVolume; class TClonesArray; class TGeoVolume; - +http://alice-o2.web.cern.ch/license class TParticle; class TString; @@ -98,8 +98,8 @@ class Detector : public o2::Base::Detector private: - Int_t fIdSens1; // Sensetive volume in T0 - TGraph *fPMTeff; //pmt registration effeicincy + Int_t mIdSens1; // Sensetive volume in T0 + TGraph *mPMTeff; //pmt registration effeicincy /// Container for data points TClonesArray *mHitCollection; diff --git a/Detectors/FIT/simulation/src/Detector.cxx b/Detectors/FIT/simulation/src/Detector.cxx index 86713db4781b9..bbca087bc8110 100644 --- a/Detectors/FIT/simulation/src/Detector.cxx +++ b/Detectors/FIT/simulation/src/Detector.cxx @@ -2,7 +2,7 @@ // distributed under the terms of the GNU General Public License v3 (GPL // Version 3), copied verbatim in the file "COPYING". // -// See https://alice-o2.web.cern.ch/ for full licensing information. +// See http://alice-o2.web.cern.ch/license for full licensing information. // // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization @@ -33,8 +33,8 @@ ClassImp(Detector); Detector::Detector(const char* Name, Bool_t Active) : o2::Base::Detector(Name, Active), - fIdSens1(0), - fPMTeff(0x0), + mIdSens1(0), + mPMTeff(nullptr), mHitCollection(new TClonesArray("o2::FIT::HitType")) { // Geometry *geo = GetGeometry() ; @@ -387,24 +387,24 @@ void Detector::DefineOpticalProperties() optPropPath = gSystem->ExpandPathName(optPropPath.Data()); // Expand $(ALICE_ROOT) into real system path // Prepare pointers for arrays read from the input file - Float_t *aPckov=NULL; - Double_t *dPckov=NULL; - Float_t *aAbsSiO2=NULL; - Float_t *rindexSiO2=NULL; - Float_t *qeff = NULL; + Float_t *aPckov=nullptr; + Double_t *dPckov=nullptr; + Float_t *aAbsSiO2=nullptr; + Float_t *rindexSiO2=nullptr; + Float_t *qeff = nullptr; Int_t kNbins=0; ReadOptProperties(optPropPath.Data(), &aPckov, &dPckov, &aAbsSiO2, &rindexSiO2, &qeff, kNbins); // set QE - fPMTeff = new TGraph(kNbins,aPckov,qeff); + mPMTeff = new TGraph(kNbins,aPckov,qeff); // Prepare pointers for arrays with constant and hardcoded values (independent on wavelength) - Float_t *efficAll=NULL; - Float_t *rindexAir=NULL; - Float_t *absorAir=NULL; - Float_t *rindexCathodeNext=NULL; - Float_t *absorbCathodeNext=NULL; - Double_t *efficMet=NULL; - Double_t *aReflMet=NULL; + Float_t *efficAll=nullptr; + Float_t *rindexAir=nullptr; + Float_t *absorAir=nullptr; + Float_t *rindexCathodeNext=nullptr; + Float_t *absorbCathodeNext=nullptr; + Double_t *efficMet=nullptr; + Double_t *aReflMet=nullptr; FillOtherOptProperties(&efficAll, &rindexAir, &absorAir, &rindexCathodeNext, &absorbCathodeNext, &efficMet, &aReflMet, kNbins); @@ -472,7 +472,7 @@ Bool_t Detector::RegisterPhotoE(Double_t energy) // Float_t hc=197.326960*1.e6; //mev*nm Double_t hc=1.973*1.e-6; //gev*nm Float_t lambda=hc/energy; - Float_t eff = fPMTeff->Eval(lambda); + Float_t eff = mPMTeff->Eval(lambda); Double_t p = gRandom->Rndm(); if (p > eff) diff --git a/Detectors/FIT/simulation/src/FITSimulationLinkDef.h b/Detectors/FIT/simulation/src/FITSimulationLinkDef.h index fa22087a5f852..7a4e091c3710d 100644 --- a/Detectors/FIT/simulation/src/FITSimulationLinkDef.h +++ b/Detectors/FIT/simulation/src/FITSimulationLinkDef.h @@ -2,7 +2,7 @@ // distributed under the terms of the GNU General Public License v3 (GPL // Version 3), copied verbatim in the file "COPYING". // -// See https://alice-o2.web.cern.ch/ for full licensing information. +// See http://alice-o2.web.cern.ch/license for full licensing information. // // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization From a0abfaf10b859299a2bffd9c7f6c4e35b4cb07e1 Mon Sep 17 00:00:00 2001 From: Alla Maevskaya Date: Tue, 19 Sep 2017 21:11:50 +0200 Subject: [PATCH 08/18] typo fixed --- Detectors/FIT/simulation/include/FITSimulation/Detector.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Detectors/FIT/simulation/include/FITSimulation/Detector.h b/Detectors/FIT/simulation/include/FITSimulation/Detector.h index dc8d8e29ad74f..7e011c8e7b81a 100644 --- a/Detectors/FIT/simulation/include/FITSimulation/Detector.h +++ b/Detectors/FIT/simulation/include/FITSimulation/Detector.h @@ -24,7 +24,7 @@ class FairModule; class FairVolume; class TClonesArray; class TGeoVolume; -http://alice-o2.web.cern.ch/license + class TParticle; class TString; From 9cde3e2e61eb900ade8392509c2aec96d2bbec2b Mon Sep 17 00:00:00 2001 From: Alla Maevskaya Date: Tue, 19 Sep 2017 21:18:14 +0200 Subject: [PATCH 09/18] fix redundant virtual --- Detectors/FIT/base/include/FITBase/Geometry.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Detectors/FIT/base/include/FITBase/Geometry.h b/Detectors/FIT/base/include/FITBase/Geometry.h index 5939e23c2b253..a6828f4ac2791 100644 --- a/Detectors/FIT/base/include/FITBase/Geometry.h +++ b/Detectors/FIT/base/include/FITBase/Geometry.h @@ -44,7 +44,7 @@ class Geometry : public TNamed /// /// Destructor. /// - virtual ~Geometry() override ; + ~Geometry() override ; /// /// Assign operator. From 9258aee5a35c6cc3f337fdb3127f32f5fe53f355 Mon Sep 17 00:00:00 2001 From: Alla Maevskaya Date: Wed, 20 Sep 2017 15:31:44 +0200 Subject: [PATCH 10/18] solve obvious problems --- Detectors/FIT/base/FITBaseLinkDef.h | 4 ++-- Detectors/FIT/macros/test/run_test.sh | 13 +------------ Detectors/FIT/simulation/src/Detector.cxx | 2 -- cmake/O2Dependencies.cmake | 4 ++-- 4 files changed, 5 insertions(+), 18 deletions(-) diff --git a/Detectors/FIT/base/FITBaseLinkDef.h b/Detectors/FIT/base/FITBaseLinkDef.h index f8892c08eccaf..5d9a8df278d9a 100644 --- a/Detectors/FIT/base/FITBaseLinkDef.h +++ b/Detectors/FIT/base/FITBaseLinkDef.h @@ -14,8 +14,8 @@ #pragma link off all classes; #pragma link off all functions; -#pragma link C++ class o2::FIT::Digit; -#pragma link C++ class o2::FIT::Hit; +#pragma link C++ class o2::FIT::Digit+; +#pragma link C++ class o2::FIT::Hit+; #endif diff --git a/Detectors/FIT/macros/test/run_test.sh b/Detectors/FIT/macros/test/run_test.sh index ae25be63799ac..9e1f69e98dc2c 100755 --- a/Detectors/FIT/macros/test/run_test.sh +++ b/Detectors/FIT/macros/test/run_test.sh @@ -1,16 +1,5 @@ # nEvents=10 mcEngine=\"TGeant3\" -#To de-activate the ALPIDE response, set alp=kFALSE -alp=kTRUE # -root.exe -b -q $O2_ROOT/share/macro/run_sim_its_ALP3.C+\($nEvents,$mcEngine\) >& sim.log -#root.exe -b -q $O2_ROOT/share/macro/run_sim_its.C+\($nEvents,$mcEngine\) >& sim.log -root.exe -b -q $O2_ROOT/share/macro/run_digi_its.C+\($nEvents,$mcEngine,$alp\) >& digi.log -root.exe -b -q CheckDigits.C+\($nEvents,$mcEngine\) >& CheckDigits.log -root.exe -b -q $O2_ROOT/share/macro/run_clus_its.C+\($nEvents,$mcEngine\) >& clus.log -root.exe -b -q CheckClusters.C+\($nEvents,$mcEngine\) >& CheckClusters.log -root.exe -b -q $O2_ROOT/share/macro/run_trac_its.C+\($nEvents,$mcEngine\) >& trac.log -root.exe -b -q CheckTracks.C+\($nEvents,$mcEngine\) >& CheckTracks.log -root.exe DisplayTrack.C+\($nEvents,$mcEngine\) - +# will be fill later diff --git a/Detectors/FIT/simulation/src/Detector.cxx b/Detectors/FIT/simulation/src/Detector.cxx index bbca087bc8110..35d1e32b25c5b 100644 --- a/Detectors/FIT/simulation/src/Detector.cxx +++ b/Detectors/FIT/simulation/src/Detector.cxx @@ -279,7 +279,6 @@ void Detector::SetOneMCP(TGeoVolume *ins) Bool_t Detector::ProcessHits(FairVolume* v) { TLorentzVector position; - printf("@@@FIT ProcessHits enter \n"); static auto* refMC = TVirtualMC::GetMC(); if(refMC->IsTrackEntering()) { refMC->TrackPosition(position); @@ -293,7 +292,6 @@ Bool_t Detector::ProcessHits(FairVolume* v) float etot = refMC->Etot(); int iPart= refMC->TrackPid(); float enDep = refMC->Edep(); - printf("@@@FIT ProcessHits x %f y %f z %f DetID %i \n", x,y,z, detID); if (iPart == 50000050) // If particles is photon then ... { if(RegisterPhotoE(etot)) { diff --git a/cmake/O2Dependencies.cmake b/cmake/O2Dependencies.cmake index 4d9de474e84f7..21cf3fd23128d 100644 --- a/cmake/O2Dependencies.cmake +++ b/cmake/O2Dependencies.cmake @@ -939,8 +939,8 @@ o2_define_bucket( fit_base_bucket DEPENDENCIES # library names - ExampleModule1 # another module - ExampleModule1_bucket # another bucket + root_base_bucket + fairroot_geom Core Hist # ROOT INCLUDE_DIRECTORIES From 62e2b28ab6fb95841acd04629a565e9b448ee316 Mon Sep 17 00:00:00 2001 From: Alla Maevskaya Date: Fri, 22 Sep 2017 13:59:13 +0200 Subject: [PATCH 11/18] namespase lowercase --- Detectors/FIT/base/FITBaseLinkDef.h | 4 +- Detectors/FIT/base/include/FITBase/Geometry.h | 2 +- Detectors/FIT/base/include/FITBase/Hit.h | 2 +- Detectors/FIT/base/src/FITBaseLinkDef.h | 2 +- Detectors/FIT/base/src/Geometry.cxx | 4 +- Detectors/FIT/base/src/Hit.cxx | 4 +- .../include/FITSimulation/Detector.h | 131 ++++++++++-------- Detectors/FIT/simulation/src/Detector.cxx | 4 +- .../FIT/simulation/src/FITSimulationLinkDef.h | 2 +- 9 files changed, 82 insertions(+), 73 deletions(-) diff --git a/Detectors/FIT/base/FITBaseLinkDef.h b/Detectors/FIT/base/FITBaseLinkDef.h index 5d9a8df278d9a..1db998c6be295 100644 --- a/Detectors/FIT/base/FITBaseLinkDef.h +++ b/Detectors/FIT/base/FITBaseLinkDef.h @@ -14,8 +14,8 @@ #pragma link off all classes; #pragma link off all functions; -#pragma link C++ class o2::FIT::Digit+; -#pragma link C++ class o2::FIT::Hit+; +#pragma link C++ class o2::fit::Digit+; +#pragma link C++ class o2::fit::Hit+; #endif diff --git a/Detectors/FIT/base/include/FITBase/Geometry.h b/Detectors/FIT/base/include/FITBase/Geometry.h index a6828f4ac2791..f56c142f16489 100644 --- a/Detectors/FIT/base/include/FITBase/Geometry.h +++ b/Detectors/FIT/base/include/FITBase/Geometry.h @@ -18,7 +18,7 @@ #include namespace o2 { -namespace FIT +namespace fit { class Geometry : public TNamed diff --git a/Detectors/FIT/base/include/FITBase/Hit.h b/Detectors/FIT/base/include/FITBase/Hit.h index 58d2d2fb8239f..50bfa23767c49 100644 --- a/Detectors/FIT/base/include/FITBase/Hit.h +++ b/Detectors/FIT/base/include/FITBase/Hit.h @@ -14,7 +14,7 @@ #include "SimulationDataFormat/BaseHits.h" namespace o2 { - namespace FIT { + namespace fit { /// \class Hit /// \brief TOF simulation hit information class Hit : public o2::BasicXYZEHit { diff --git a/Detectors/FIT/base/src/FITBaseLinkDef.h b/Detectors/FIT/base/src/FITBaseLinkDef.h index 85adbb6dcbefb..aba068d7d277f 100644 --- a/Detectors/FIT/base/src/FITBaseLinkDef.h +++ b/Detectors/FIT/base/src/FITBaseLinkDef.h @@ -14,7 +14,7 @@ #pragma link off all classes; #pragma link off all functions; -#pragma link C++ class o2::FIT::Geometry; +#pragma link C++ class o2::fit::Geometry; #endif diff --git a/Detectors/FIT/base/src/Geometry.cxx b/Detectors/FIT/base/src/Geometry.cxx index 38bcb14776e35..6b363e1c005b9 100644 --- a/Detectors/FIT/base/src/Geometry.cxx +++ b/Detectors/FIT/base/src/Geometry.cxx @@ -17,9 +17,9 @@ #include -ClassImp(o2::FIT::Geometry); +ClassImp(o2::fit::Geometry); -using namespace o2::FIT; +using namespace o2::fit; // these initialisations are needed for a singleton Geometry* Geometry::sGeom = nullptr; diff --git a/Detectors/FIT/base/src/Hit.cxx b/Detectors/FIT/base/src/Hit.cxx index bf468f4e6823c..45d92b649adbf 100644 --- a/Detectors/FIT/base/src/Hit.cxx +++ b/Detectors/FIT/base/src/Hit.cxx @@ -10,9 +10,9 @@ #include "FITBase/Hit.h" -ClassImp(o2::FIT::Hit) +ClassImp(o2::fit::Hit) -using namespace o2::FIT; +using namespace o2::fit; void Hit::PrintStream(std::ostream &stream) const { stream << "FIT point: " << " in detector segment " << GetDetectorID() diff --git a/Detectors/FIT/simulation/include/FITSimulation/Detector.h b/Detectors/FIT/simulation/include/FITSimulation/Detector.h index 7e011c8e7b81a..c17ef133b35fe 100644 --- a/Detectors/FIT/simulation/include/FITSimulation/Detector.h +++ b/Detectors/FIT/simulation/include/FITSimulation/Detector.h @@ -14,10 +14,10 @@ #ifndef ALICEO2_FIT_DETECTOR_H_ #define ALICEO2_FIT_DETECTOR_H_ -#include "DetectorsBase/Detector.h" // for Detector -#include "SimulationDataFormat/BaseHits.h" -#include "FITBase/Geometry.h" #include +#include "DetectorsBase/Detector.h" // for Detector +#include "FITBase/Geometry.h" +#include "SimulationDataFormat/BaseHits.h" class FairModule; @@ -29,98 +29,107 @@ class TParticle; class TString; -namespace o2 { namespace FIT { class Geometry; }} +namespace o2 +{ +namespace fit +{ +class Geometry; +} +} -namespace o2 { -namespace FIT { +namespace o2 +{ +namespace fit +{ using HitType = o2::BasicXYZEHit; -//class Hit; +// class Hit; class Geometry; class Detector : public o2::Base::Detector { - public: - enum constants {kAir=1, kVac=3, kGlass=6, kOpAir=7, kAl=15, kOpGlass=16, kOpGlassCathode=19,kSensAir=22}; //materials - + enum constants { + kAir = 1, + kVac = 3, + kGlass = 6, + kOpAir = 7, + kAl = 15, + kOpGlass = 16, + kOpGlassCathode = 19, + kSensAir = 22 + }; // materials + /// Name : Detector Name /// Active: kTRUE for active detectors (ProcessHits() will be called) /// kFALSE for inactive detectors - Detector(const char *Name, Bool_t Active); - + Detector(const char* Name, Bool_t Active); + /// Default constructor Detector() {} - /// Initialization of the detector is done here void Initialize() override; /// This method is called for each step during simulation (see FairMCApplication::Stepping()) - Bool_t ProcessHits(FairVolume *v = nullptr) override; + Bool_t ProcessHits(FairVolume* v = nullptr) override; o2::BasicXYZEHit* AddHit(float x, float y, float z, float time, float energy, Int_t trackId, Int_t detId); - + void Register() override; - + TClonesArray* GetCollection(Int_t iColl) const final; - + void Reset() override; - - + /// Base class to create the detector geometry void CreateMaterials(); void ConstructGeometry() override; - void SetOneMCP(TGeoVolume *stl); -// Optical properties reader: e-Energy, abs-AbsorptionLength[cm], n-refractive index - Int_t ReadOptProperties(const std::string inputFilePath, Float_t **e, - Double_t **de, Float_t **abs, Float_t **n, Float_t **qe, Int_t &kNbins) const; + void SetOneMCP(TGeoVolume* stl); + // Optical properties reader: e-Energy, abs-AbsorptionLength[cm], n-refractive index + Int_t ReadOptProperties(const std::string inputFilePath, Float_t** e, Double_t** de, Float_t** abs, Float_t** n, + Float_t** qe, Int_t& kNbins) const; void DefineOpticalProperties(); - void FillOtherOptProperties(Float_t **efficAll, Float_t **rindexAir, Float_t **absorAir, - Float_t **rindexCathodeNext, Float_t **absorbCathodeNext, - Double_t **efficMet, Double_t **aReflMet, const Int_t kNbins) const; - void DeleteOptPropertiesArr(Float_t **e, Double_t **de, Float_t **abs, - Float_t **n, Float_t **efficAll, Float_t **rindexAir, Float_t **absorAir, - Float_t **rindexCathodeNext, Float_t **absorbCathodeNext, - Double_t **efficMet, Double_t **aReflMet) const; - Bool_t RegisterPhotoE(Double_t energy); - - // Geometry* GetGeometry(); - - /// Prints out the content of this class in ASCII format - /// \param ostream *os The output stream - void Print(std::ostream *os) const; - - /// Reads in the content of this class in the format of Print - /// \param istream *is The input stream - void Read(std::istream *is); - - - /// Clone this object (used in MT mode only) - // FairModule *CloneModule() const override; - - + void FillOtherOptProperties(Float_t** efficAll, Float_t** rindexAir, Float_t** absorAir, Float_t** rindexCathodeNext, + Float_t** absorbCathodeNext, Double_t** efficMet, Double_t** aReflMet, + const Int_t kNbins) const; + void DeleteOptPropertiesArr(Float_t** e, Double_t** de, Float_t** abs, Float_t** n, Float_t** efficAll, + Float_t** rindexAir, Float_t** absorAir, Float_t** rindexCathodeNext, + Float_t** absorbCathodeNext, Double_t** efficMet, Double_t** aReflMet) const; + Bool_t RegisterPhotoE(Double_t energy); + + // Geometry* GetGeometry(); + + /// Prints out the content of this class in ASCII format + /// \param ostream *os The output stream + void Print(std::ostream* os) const; + + /// Reads in the content of this class in the format of Print + /// \param istream *is The input stream + void Read(std::istream* is); + + /// Clone this object (used in MT mode only) + // FairModule *CloneModule() const override; + private: - - Int_t mIdSens1; // Sensetive volume in T0 - TGraph *mPMTeff; //pmt registration effeicincy + Int_t mIdSens1; // Sensetive volume in T0 + TGraph* mPMTeff; // pmt registration effeicincy /// Container for data points - TClonesArray *mHitCollection; - + TClonesArray* mHitCollection; /// Define the sensitive volumes of the geometry void defineSensitiveVolumes(); - Detector(const Detector &); - - Detector &operator=(const Detector &); - - Geometry *mGeometry; //! Geometry - + Detector(const Detector&); + + Detector& operator=(const Detector&); + + Geometry* mGeometry; //! Geometry + ClassDefOverride(Detector, 1) }; - + // Input and output function for standard C++ input/output. -std::ostream &operator<<(std::ostream &os, Detector &source); +std::ostream& operator<<(std::ostream& os, Detector& source); -std::istream &operator>>(std::istream &os, Detector &source); +std::istream& operator>>(std::istream& os, Detector& source); } } diff --git a/Detectors/FIT/simulation/src/Detector.cxx b/Detectors/FIT/simulation/src/Detector.cxx index 35d1e32b25c5b..2eb582b7ab972 100644 --- a/Detectors/FIT/simulation/src/Detector.cxx +++ b/Detectors/FIT/simulation/src/Detector.cxx @@ -27,7 +27,7 @@ #include "FITSimulation/Detector.h" #include -using namespace o2::FIT; +using namespace o2::fit; ClassImp(Detector); @@ -35,7 +35,7 @@ Detector::Detector(const char* Name, Bool_t Active) : o2::Base::Detector(Name, Active), mIdSens1(0), mPMTeff(nullptr), - mHitCollection(new TClonesArray("o2::FIT::HitType")) + mHitCollection(new TClonesArray("o2::fit::HitType")) { // Geometry *geo = GetGeometry() ; diff --git a/Detectors/FIT/simulation/src/FITSimulationLinkDef.h b/Detectors/FIT/simulation/src/FITSimulationLinkDef.h index 7a4e091c3710d..b302b652cdee8 100644 --- a/Detectors/FIT/simulation/src/FITSimulationLinkDef.h +++ b/Detectors/FIT/simulation/src/FITSimulationLinkDef.h @@ -14,6 +14,6 @@ #pragma link off all classes; #pragma link off all functions; -#pragma link C++ class o2::FIT::Detector+; +#pragma link C++ class o2::fit::Detector+; #endif From d8a11b6497bfa1c9a91e87b3ef67294cd3a9ba9e Mon Sep 17 00:00:00 2001 From: Alla Maevskaya Date: Fri, 22 Sep 2017 14:14:55 +0200 Subject: [PATCH 12/18] clang format --- Detectors/FIT/base/include/FITBase/Geometry.h | 13 +- Detectors/FIT/base/include/FITBase/Hit.h | 61 +- Detectors/FIT/base/src/FITBaseLinkDef.h | 1 - Detectors/FIT/base/src/Geometry.cxx | 7 +- Detectors/FIT/base/src/Hit.cxx | 14 +- Detectors/FIT/simulation/src/Detector.cxx | 576 +++++++++--------- .../FIT/simulation/src/FITSimulationLinkDef.h | 2 +- 7 files changed, 322 insertions(+), 352 deletions(-) diff --git a/Detectors/FIT/base/include/FITBase/Geometry.h b/Detectors/FIT/base/include/FITBase/Geometry.h index f56c142f16489..145ec42039c2a 100644 --- a/Detectors/FIT/base/include/FITBase/Geometry.h +++ b/Detectors/FIT/base/include/FITBase/Geometry.h @@ -20,11 +20,10 @@ namespace o2 { namespace fit { - class Geometry : public TNamed { public: - /// + /// /// Default constructor. /// It must be kept public for root persistency purposes, /// but should never be called by the outside world @@ -44,7 +43,7 @@ class Geometry : public TNamed /// /// Destructor. /// - ~Geometry() override ; + ~Geometry() override; /// /// Assign operator. @@ -61,7 +60,7 @@ class Geometry : public TNamed /// /// \return the pointer of the unique instance of the geometry /// - /// + /// // static Geometry* GetInstance(const Text_t* name, const Text_t* title = "", const Text_t* mcname = "TGeant3", // const Text_t* mctitle = ""); @@ -70,7 +69,7 @@ class Geometry : public TNamed /// /// \return the pointer of the unique instance /// -////////// + ////////// // General // // static Bool_t IsInitialized() { return Geometry::sGeom != nullptr; } @@ -79,8 +78,8 @@ class Geometry : public TNamed private: static Geometry* sGeom; ///< Pointer to the unique instance of the singleton static const Char_t* sDefaultGeometryName; ///< Default name of geometry - - private: + + private: ClassDef(Geometry, 1); }; } diff --git a/Detectors/FIT/base/include/FITBase/Hit.h b/Detectors/FIT/base/include/FITBase/Hit.h index 50bfa23767c49..fcc30c7930744 100644 --- a/Detectors/FIT/base/include/FITBase/Hit.h +++ b/Detectors/FIT/base/include/FITBase/Hit.h @@ -13,34 +13,37 @@ #include "SimulationDataFormat/BaseHits.h" -namespace o2 { - namespace fit { - /// \class Hit - /// \brief TOF simulation hit information - class Hit : public o2::BasicXYZEHit { - public: - - /// \brief Default constructor - Hit() = default; - - /// \brief Hit constructor - /// \param shunt - /// \param trackID Index of the track - /// \param detID ID of the detector segment - /// \param pos Position vector of the point - /// \param tof Time of the hit - Hit( Float_t x, Float_t y, Float_t z, Float_t time, Float_t energy, Int_t trackId, Int_t detId): - o2::BasicXYZEHit ( x, y, z, time, energy, trackId, detId) - {} - /// \brief Destructor - ~Hit() override = default; - - void PrintStream(std::ostream &stream) const; - - ClassDef(Hit, 1); - - // std::ostream &operator<<(std::ostream &stream, const Hit &point); - }; +namespace o2 +{ +namespace fit +{ +/// \class Hit +/// \brief TOF simulation hit information +class Hit : public o2::BasicXYZEHit +{ + public: + /// \brief Default constructor + Hit() = default; + + /// \brief Hit constructor + /// \param shunt + /// \param trackID Index of the track + /// \param detID ID of the detector segment + /// \param pos Position vector of the point + /// \param tof Time of the hit + Hit(Float_t x, Float_t y, Float_t z, Float_t time, Float_t energy, Int_t trackId, Int_t detId) + : o2::BasicXYZEHit(x, y, z, time, energy, trackId, detId) + { } + /// \brief Destructor + ~Hit() override = default; + + void PrintStream(std::ostream& stream) const; + + ClassDef(Hit, 1); + + // std::ostream &operator<<(std::ostream &stream, const Hit &point); +}; +} } -#endif +#endif diff --git a/Detectors/FIT/base/src/FITBaseLinkDef.h b/Detectors/FIT/base/src/FITBaseLinkDef.h index aba068d7d277f..0a5150d7f12e4 100644 --- a/Detectors/FIT/base/src/FITBaseLinkDef.h +++ b/Detectors/FIT/base/src/FITBaseLinkDef.h @@ -16,5 +16,4 @@ #pragma link C++ class o2::fit::Geometry; - #endif diff --git a/Detectors/FIT/base/src/Geometry.cxx b/Detectors/FIT/base/src/Geometry.cxx index 6b363e1c005b9..5c232987fd0a3 100644 --- a/Detectors/FIT/base/src/Geometry.cxx +++ b/Detectors/FIT/base/src/Geometry.cxx @@ -25,15 +25,10 @@ using namespace o2::fit; Geometry* Geometry::sGeom = nullptr; const Char_t* Geometry::sDefaultGeometryName = "fit"; -Geometry::Geometry(const Geometry& geo) - : TNamed(geo) -{ - -} +Geometry::Geometry(const Geometry& geo) : TNamed(geo) {} Geometry::Geometry(const Text_t* name, const Text_t* title, const Text_t* mcname, const Text_t* mctitle) : TNamed(name, title) { - } Geometry& Geometry::operator=(const Geometry& /*rvalue*/) { diff --git a/Detectors/FIT/base/src/Hit.cxx b/Detectors/FIT/base/src/Hit.cxx index 45d92b649adbf..3ac191ab40337 100644 --- a/Detectors/FIT/base/src/Hit.cxx +++ b/Detectors/FIT/base/src/Hit.cxx @@ -12,16 +12,16 @@ ClassImp(o2::fit::Hit) -using namespace o2::fit; + using namespace o2::fit; -void Hit::PrintStream(std::ostream &stream) const { - stream << "FIT point: " << " in detector segment " << GetDetectorID() - << " at position (" << GetX() << "|" << GetY() << "|" << GetZ(); +void Hit::PrintStream(std::ostream& stream) const +{ + stream << "FIT point: " + << " in detector segment " << GetDetectorID() << " at position (" << GetX() << "|" << GetY() << "|" << GetZ(); } - -std::ostream &operator<<(std::ostream &stream, const Hit &p) { +std::ostream& operator<<(std::ostream& stream, const Hit& p) +{ p.PrintStream(stream); return stream; } - diff --git a/Detectors/FIT/simulation/src/Detector.cxx b/Detectors/FIT/simulation/src/Detector.cxx index 2eb582b7ab972..2b0867f49f5c1 100644 --- a/Detectors/FIT/simulation/src/Detector.cxx +++ b/Detectors/FIT/simulation/src/Detector.cxx @@ -8,13 +8,13 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include "TSystem.h" -#include "TVirtualMC.h" #include "TClonesArray.h" #include "TGeoManager.h" // for TGeoManager #include "TLorentzVector.h" #include "TMath.h" #include "TString.h" +#include "TSystem.h" +#include "TVirtualMC.h" #include "FairLogger.h" #include "FairRootManager.h" @@ -23,9 +23,9 @@ #include "FairRootManager.h" #include "FairVolume.h" +#include #include "FITBase/Geometry.h" #include "FITSimulation/Detector.h" -#include using namespace o2::fit; @@ -33,28 +33,26 @@ ClassImp(Detector); Detector::Detector(const char* Name, Bool_t Active) : o2::Base::Detector(Name, Active), - mIdSens1(0), - mPMTeff(nullptr), + mIdSens1(0), + mPMTeff(nullptr), mHitCollection(new TClonesArray("o2::fit::HitType")) { // Geometry *geo = GetGeometry() ; - + // TString gn(geo->GetName()); - } void Detector::Initialize() {} - void Detector::ConstructGeometry() { LOG(DEBUG) << "Creating FIT geometry\n"; CreateMaterials(); - /* + /* Geometry * geom = GetGeometry() ; TString gn(geom->GetName()); gn.ToUpper(); - + if(!(geom->IsInitialized())) { LOG(ERROR) << "ConstructGeometry: FIT Geometry class has not been set up.\n"; @@ -62,244 +60,229 @@ void Detector::ConstructGeometry() */ Float_t zdetA = 333; Float_t zdetC = 82; - + Int_t idrotm[999]; - Double_t x,y,z; - Float_t pstartC[3] = {20., 20 ,5}; - Float_t pstartA[3] = {20, 20 ,5}; - Float_t pinstart[3] = {2.95,2.95,4.34}; - Float_t pmcp[3] = {2.949, 2.949, 2.8}; //MCP + Double_t x, y, z; + Float_t pstartC[3] = { 20., 20, 5 }; + Float_t pstartA[3] = { 20, 20, 5 }; + Float_t pinstart[3] = { 2.95, 2.95, 4.34 }; + Float_t pmcp[3] = { 2.949, 2.949, 2.8 }; // MCP Matrix(idrotm[901], 90., 0., 90., 90., 180., 0.); + // C side Concave Geometry - //C side Concave Geometry + Double_t crad = 82.; // define concave c-side radius here - Double_t crad = 82.; //define concave c-side radius here - - Double_t dP = pmcp[0]; //side length of mcp divided by 2 + Double_t dP = pmcp[0]; // side length of mcp divided by 2 - //uniform angle between detector faces== - Double_t btta = 2*TMath::ATan(dP/crad); - - //get noncompensated translation data - Double_t grdin[6] = {-3, -2, -1, 1, 2, 3}; + // uniform angle between detector faces== + Double_t btta = 2 * TMath::ATan(dP / crad); + + // get noncompensated translation data + Double_t grdin[6] = { -3, -2, -1, 1, 2, 3 }; Double_t gridpoints[6]; - for(Int_t i = 0; i < 6; i++){ - gridpoints[i] = crad*TMath::Sin((1 - 1/(2*TMath::Abs(grdin[i])))*grdin[i]*btta); - } - - Double_t xi[28] = {gridpoints[1],gridpoints[2],gridpoints[3],gridpoints[4], - gridpoints[0],gridpoints[1],gridpoints[2],gridpoints[3],gridpoints[4],gridpoints[5], - gridpoints[0],gridpoints[1],gridpoints[4],gridpoints[5], - gridpoints[0],gridpoints[1],gridpoints[4],gridpoints[5], - gridpoints[0],gridpoints[1],gridpoints[2],gridpoints[3],gridpoints[4],gridpoints[5], - gridpoints[1],gridpoints[2],gridpoints[3],gridpoints[4]}; - Double_t yi[28] = {gridpoints[5],gridpoints[5],gridpoints[5],gridpoints[5], - gridpoints[4],gridpoints[4],gridpoints[4],gridpoints[4],gridpoints[4],gridpoints[4], - gridpoints[3],gridpoints[3],gridpoints[3],gridpoints[3], - gridpoints[2],gridpoints[2],gridpoints[2],gridpoints[2], - gridpoints[1],gridpoints[1],gridpoints[1],gridpoints[1],gridpoints[1],gridpoints[1], - gridpoints[0],gridpoints[0],gridpoints[0],gridpoints[0]}; + for (Int_t i = 0; i < 6; i++) { + gridpoints[i] = crad * TMath::Sin((1 - 1 / (2 * TMath::Abs(grdin[i]))) * grdin[i] * btta); + } + + Double_t xi[28] = { gridpoints[1], gridpoints[2], gridpoints[3], gridpoints[4], gridpoints[0], gridpoints[1], + gridpoints[2], gridpoints[3], gridpoints[4], gridpoints[5], gridpoints[0], gridpoints[1], + gridpoints[4], gridpoints[5], gridpoints[0], gridpoints[1], gridpoints[4], gridpoints[5], + gridpoints[0], gridpoints[1], gridpoints[2], gridpoints[3], gridpoints[4], gridpoints[5], + gridpoints[1], gridpoints[2], gridpoints[3], gridpoints[4] }; + Double_t yi[28] = { gridpoints[5], gridpoints[5], gridpoints[5], gridpoints[5], gridpoints[4], gridpoints[4], + gridpoints[4], gridpoints[4], gridpoints[4], gridpoints[4], gridpoints[3], gridpoints[3], + gridpoints[3], gridpoints[3], gridpoints[2], gridpoints[2], gridpoints[2], gridpoints[2], + gridpoints[1], gridpoints[1], gridpoints[1], gridpoints[1], gridpoints[1], gridpoints[1], + gridpoints[0], gridpoints[0], gridpoints[0], gridpoints[0] }; Double_t zi[28]; - for(Int_t i = 0; i < 28; i++) { + for (Int_t i = 0; i < 28; i++) { zi[i] = TMath::Sqrt(TMath::Power(crad, 2) - TMath::Power(xi[i], 2) - TMath::Power(yi[i], 2)); } - //get rotation data + // get rotation data Double_t ac[28], bc[28], gc[28]; - for(Int_t i = 0; i < 28; i++) { - ac[i] = TMath::ATan(yi[i]/xi[i]) - TMath::Pi()/2 + 2*TMath::Pi(); - if(xi[i] < 0){ - bc[i] = TMath::ACos(zi[i]/crad); - } - else { - bc[i] = -1 * TMath::ACos(zi[i]/crad); + for (Int_t i = 0; i < 28; i++) { + ac[i] = TMath::ATan(yi[i] / xi[i]) - TMath::Pi() / 2 + 2 * TMath::Pi(); + if (xi[i] < 0) { + bc[i] = TMath::ACos(zi[i] / crad); + } else { + bc[i] = -1 * TMath::ACos(zi[i] / crad); } } Double_t xc2[28], yc2[28], zc2[28]; - - - //compensation based on node position within individual detector geometries - //determine compensated radius + + // compensation based on node position within individual detector geometries + // determine compensated radius Double_t rcomp = crad + pstartC[2] / 2.0; // - for(Int_t i = 0; i < 28; i++) { - //Get compensated translation data - xc2[i] = rcomp*TMath::Cos(ac[i] + TMath::Pi()/2)*TMath::Sin(-1*bc[i]); - yc2[i] = rcomp*TMath::Sin(ac[i] + TMath::Pi()/2)*TMath::Sin(-1*bc[i]); - zc2[i] = rcomp*TMath::Cos(bc[i]); - - //Convert angles to degrees - ac[i]*=180/TMath::Pi(); - bc[i]*=180/TMath::Pi(); + for (Int_t i = 0; i < 28; i++) { + // Get compensated translation data + xc2[i] = rcomp * TMath::Cos(ac[i] + TMath::Pi() / 2) * TMath::Sin(-1 * bc[i]); + yc2[i] = rcomp * TMath::Sin(ac[i] + TMath::Pi() / 2) * TMath::Sin(-1 * bc[i]); + zc2[i] = rcomp * TMath::Cos(bc[i]); + + // Convert angles to degrees + ac[i] *= 180 / TMath::Pi(); + bc[i] *= 180 / TMath::Pi(); gc[i] = -1 * ac[i]; } - //A Side - - Float_t xa[24] = {-11.8, -5.9, 0, 5.9, 11.8, - -11.8, -5.9, 0, 5.9, 11.8, - -12.8, -6.9, 6.9, 12.8, - -11.8, -5.9, 0, 5.9, 11.8, - -11.8, -5.9, 0, 5.9, 11.8 }; - - Float_t ya[24] = { 11.9, 11.9, 12.9, 11.9, 11.9, - 6.0, 6.0, 7.0, 6.0, 6.0, - -0.1, -0.1, 0.1, 0.1, - -6.0, -6.0, -7.0, -6.0, -6.0, - -11.9, -11.9, -12.9, -11.9, -11.9 }; - - - TGeoVolumeAssembly * stlinA = new TGeoVolumeAssembly("0STL"); // A side mother - TGeoVolumeAssembly * stlinC = new TGeoVolumeAssembly("0STR"); // C side mother - - //FIT interior - TVirtualMC::GetMC()->Gsvolu("0INS","BOX",getMediumID(kAir),pinstart,3); - TGeoVolume *ins = gGeoManager->GetVolume("0INS"); - // - TGeoTranslation *tr[52]; + // A Side + + Float_t xa[24] = { -11.8, -5.9, 0, 5.9, 11.8, -11.8, -5.9, 0, 5.9, 11.8, -12.8, -6.9, + 6.9, 12.8, -11.8, -5.9, 0, 5.9, 11.8, -11.8, -5.9, 0, 5.9, 11.8 }; + + Float_t ya[24] = { 11.9, 11.9, 12.9, 11.9, 11.9, 6.0, 6.0, 7.0, 6.0, 6.0, -0.1, -0.1, + 0.1, 0.1, -6.0, -6.0, -7.0, -6.0, -6.0, -11.9, -11.9, -12.9, -11.9, -11.9 }; + + TGeoVolumeAssembly* stlinA = new TGeoVolumeAssembly("0STL"); // A side mother + TGeoVolumeAssembly* stlinC = new TGeoVolumeAssembly("0STR"); // C side mother + + // FIT interior + TVirtualMC::GetMC()->Gsvolu("0INS", "BOX", getMediumID(kAir), pinstart, 3); + TGeoVolume* ins = gGeoManager->GetVolume("0INS"); + // + TGeoTranslation* tr[52]; TString nameTr; - - - //A side Translations - for (Int_t itr=0; itr<24; itr++) { - nameTr = Form("0TR%i",itr+1); - z=-pstartA[2]+pinstart[2]; - tr[itr] = new TGeoTranslation(nameTr.Data(),xa[itr],ya[itr], z ); - printf(" itr %i A %f %f %f \n",itr, xa[itr], ya[itr], z+zdetA); + + // A side Translations + for (Int_t itr = 0; itr < 24; itr++) { + nameTr = Form("0TR%i", itr + 1); + z = -pstartA[2] + pinstart[2]; + tr[itr] = new TGeoTranslation(nameTr.Data(), xa[itr], ya[itr], z); + printf(" itr %i A %f %f %f \n", itr, xa[itr], ya[itr], z + zdetA); tr[itr]->RegisterYourself(); - stlinA->AddNode(ins,itr,tr[itr]); + stlinA->AddNode(ins, itr, tr[itr]); } - - TGeoRotation *rot[28]; + + TGeoRotation* rot[28]; TString nameRot; - - TGeoCombiTrans *com[28]; + + TGeoCombiTrans* com[28]; TString nameCom; - //C Side Transformations - for (Int_t itr=24;itr<52; itr++) { - nameTr = Form("0TR%i",itr+1); - nameRot = Form("0Rot%i",itr+1); - //nameCom = Form("0Com%i",itr+1); - rot[itr-24] = new TGeoRotation(nameRot.Data(),ac[itr-24],bc[itr-24],gc[itr-24]); - rot[itr-24]->RegisterYourself(); - - tr[itr] = new TGeoTranslation(nameTr.Data(),xc2[itr-24],yc2[itr-24], (zc2[itr-24]-80.) ); + // C Side Transformations + for (Int_t itr = 24; itr < 52; itr++) { + nameTr = Form("0TR%i", itr + 1); + nameRot = Form("0Rot%i", itr + 1); + // nameCom = Form("0Com%i",itr+1); + rot[itr - 24] = new TGeoRotation(nameRot.Data(), ac[itr - 24], bc[itr - 24], gc[itr - 24]); + rot[itr - 24]->RegisterYourself(); + + tr[itr] = new TGeoTranslation(nameTr.Data(), xc2[itr - 24], yc2[itr - 24], (zc2[itr - 24] - 80.)); tr[itr]->RegisterYourself(); - + // com[itr-24] = new TGeoCombiTrans(tr[itr],rot[itr-24]); - com[itr-24] = new TGeoCombiTrans(xc2[itr-24],yc2[itr-24], (zc2[itr-24]-80),rot[itr-24]); - TGeoHMatrix hm = *com[itr-24]; - TGeoHMatrix *ph = new TGeoHMatrix(hm); - stlinC->AddNode(ins,itr,ph); + com[itr - 24] = new TGeoCombiTrans(xc2[itr - 24], yc2[itr - 24], (zc2[itr - 24] - 80), rot[itr - 24]); + TGeoHMatrix hm = *com[itr - 24]; + TGeoHMatrix* ph = new TGeoHMatrix(hm); + stlinC->AddNode(ins, itr, ph); } - TGeoVolume *alice = gGeoManager->GetVolume("cave"); - alice->AddNode(stlinA,1,new TGeoTranslation(0,0, zdetA ) ); + TGeoVolume* alice = gGeoManager->GetVolume("cave"); + alice->AddNode(stlinA, 1, new TGeoTranslation(0, 0, zdetA)); // alice->AddNode(stlinC,1,new TGeoTranslation(0,0, -zdetC ) ); - TGeoRotation * rotC = new TGeoRotation( "rotC",90., 0., 90., 90., 180., 0.); - alice->AddNode(stlinC,1, new TGeoCombiTrans(0., 0., -zdetC , rotC) ); + TGeoRotation* rotC = new TGeoRotation("rotC", 90., 0., 90., 90., 180., 0.); + alice->AddNode(stlinC, 1, new TGeoCombiTrans(0., 0., -zdetC, rotC)); - // MCP + 4 x wrapped radiator + 4xphotocathod + MCP + Al top in front of radiators + // MCP + 4 x wrapped radiator + 4xphotocathod + MCP + Al top in front of radiators SetOneMCP(ins); - } //_________________________________________ -void Detector::SetOneMCP(TGeoVolume *ins) +void Detector::SetOneMCP(TGeoVolume* ins) { - Double_t x,y,z; - Float_t pinstart[3] = {2.95,2.95,4.34}; - Float_t pmcp[3] = {2.949, 2.949, 2.8}; //MCP - Float_t ptop[3] = {1.324, 1.324, 1.};//cherenkov radiator - Float_t ptopref[3] = {1.3241, 1.3241, 1.};//cherenkov radiator wrapped with reflection - Float_t preg[3] = {1.324, 1.324, 0.005};//photcathode - Double_t prfv[3]= {0.0002,1.323, 1.};//vertical refracting layer bettwen radiators and bettwen radiator and not optical Air - Double_t prfh[3]= {1.323,0.0002, 1.};//horizontal refracting layer bettwen radiators a - Double_t pal[3]= {2.648,2.648, 0.25}; // 5mm Al top on th eeach radiator + Double_t x, y, z; + Float_t pinstart[3] = { 2.95, 2.95, 4.34 }; + Float_t pmcp[3] = { 2.949, 2.949, 2.8 }; // MCP + Float_t ptop[3] = { 1.324, 1.324, 1. }; // cherenkov radiator + Float_t ptopref[3] = { 1.3241, 1.3241, 1. }; // cherenkov radiator wrapped with reflection + Float_t preg[3] = { 1.324, 1.324, 0.005 }; // photcathode + Double_t prfv[3] = { 0.0002, 1.323, + 1. }; // vertical refracting layer bettwen radiators and bettwen radiator and not optical Air + Double_t prfh[3] = { 1.323, 0.0002, 1. }; // horizontal refracting layer bettwen radiators a + Double_t pal[3] = { 2.648, 2.648, 0.25 }; // 5mm Al top on th eeach radiator // Entry window (glass) - TVirtualMC::GetMC()->Gsvolu("0TOP","BOX",getMediumID(kOpGlass),ptop,3); //glass radiator - TGeoVolume *top = gGeoManager->GetVolume("0TOP"); - TVirtualMC::GetMC()->Gsvolu("0TRE","BOX",getMediumID(kAir),ptopref,3); //air: wrapped radiator - TGeoVolume *topref = gGeoManager->GetVolume("0TRE"); - TVirtualMC::GetMC()->Gsvolu ("0REG", "BOX", getMediumID(kOpGlassCathode), preg, 3); - TGeoVolume *cat = gGeoManager->GetVolume("0REG"); - TVirtualMC::GetMC()->Gsvolu("0MCP","BOX",getMediumID(kGlass),pmcp,3); //glass - TGeoVolume *mcp = gGeoManager->GetVolume("0MCP"); - TVirtualMC::GetMC()->Gsvolu("0RFV","BOX",getMediumID(kOpAir),prfv,3); //optical Air vertical - TGeoVolume *rfv = gGeoManager->GetVolume("0RFV"); - TVirtualMC::GetMC()->Gsvolu("0RFH","BOX",getMediumID(kOpAir),prfh,3); //optical Air horizontal - TGeoVolume *rfh = gGeoManager->GetVolume("0RFH"); - - TVirtualMC::GetMC()->Gsvolu("0PAL","BOX",getMediumID(kAl),pal,3); // 5mmAl top on the radiator - TGeoVolume *altop = gGeoManager->GetVolume("0PAL"); - - - //wrapped radiator + reflectiong layers - Int_t ntops=0, nrfvs=0, nrfhs=0; - Float_t xin=0, yin=0, xinv=0, yinv=0,xinh=0,yinh=0; - x=y=z=0; - topref->AddNode(top, 1, new TGeoTranslation(0,0,0) ); + TVirtualMC::GetMC()->Gsvolu("0TOP", "BOX", getMediumID(kOpGlass), ptop, 3); // glass radiator + TGeoVolume* top = gGeoManager->GetVolume("0TOP"); + TVirtualMC::GetMC()->Gsvolu("0TRE", "BOX", getMediumID(kAir), ptopref, 3); // air: wrapped radiator + TGeoVolume* topref = gGeoManager->GetVolume("0TRE"); + TVirtualMC::GetMC()->Gsvolu("0REG", "BOX", getMediumID(kOpGlassCathode), preg, 3); + TGeoVolume* cat = gGeoManager->GetVolume("0REG"); + TVirtualMC::GetMC()->Gsvolu("0MCP", "BOX", getMediumID(kGlass), pmcp, 3); // glass + TGeoVolume* mcp = gGeoManager->GetVolume("0MCP"); + TVirtualMC::GetMC()->Gsvolu("0RFV", "BOX", getMediumID(kOpAir), prfv, 3); // optical Air vertical + TGeoVolume* rfv = gGeoManager->GetVolume("0RFV"); + TVirtualMC::GetMC()->Gsvolu("0RFH", "BOX", getMediumID(kOpAir), prfh, 3); // optical Air horizontal + TGeoVolume* rfh = gGeoManager->GetVolume("0RFH"); + + TVirtualMC::GetMC()->Gsvolu("0PAL", "BOX", getMediumID(kAl), pal, 3); // 5mmAl top on the radiator + TGeoVolume* altop = gGeoManager->GetVolume("0PAL"); + + // wrapped radiator + reflectiong layers + Int_t ntops = 0, nrfvs = 0, nrfhs = 0; + Float_t xin = 0, yin = 0, xinv = 0, yinv = 0, xinh = 0, yinh = 0; + x = y = z = 0; + topref->AddNode(top, 1, new TGeoTranslation(0, 0, 0)); xinv = -ptop[0] - prfv[0]; - topref->AddNode(rfv, 1, new TGeoTranslation(xinv,0,0) ); - printf(" GEOGEO refv %f , 0,0 \n",xinv); + topref->AddNode(rfv, 1, new TGeoTranslation(xinv, 0, 0)); + printf(" GEOGEO refv %f , 0,0 \n", xinv); xinv = ptop[0] + prfv[0]; - topref->AddNode(rfv, 2, new TGeoTranslation(xinv,0,0) ); - printf(" GEOGEO refv %f , 0,0 \n",xinv); + topref->AddNode(rfv, 2, new TGeoTranslation(xinv, 0, 0)); + printf(" GEOGEO refv %f , 0,0 \n", xinv); yinv = -ptop[1] - prfh[1]; - topref->AddNode(rfh, 1, new TGeoTranslation(0,yinv,0) ); - printf(" GEOGEO refh , 0, %f, 0 \n",yinv); + topref->AddNode(rfh, 1, new TGeoTranslation(0, yinv, 0)); + printf(" GEOGEO refh , 0, %f, 0 \n", yinv); yinv = ptop[1] + prfh[1]; - topref->AddNode(rfh, 2, new TGeoTranslation(0,yinv,0) ); - - //container for radiator, cathod - for (Int_t ix=0; ix<2; ix++) { - xin = - pinstart[0] + 0.3 + (ix+0.5)*2*ptopref[0] ; - for (Int_t iy=0; iy<2 ; iy++) { - z = - pinstart[2] + 2*pal[2] + ptopref[2]; - yin = - pinstart[1] + 0.3 + (iy+0.5)*2*ptopref[1]; + topref->AddNode(rfh, 2, new TGeoTranslation(0, yinv, 0)); + + // container for radiator, cathod + for (Int_t ix = 0; ix < 2; ix++) { + xin = -pinstart[0] + 0.3 + (ix + 0.5) * 2 * ptopref[0]; + for (Int_t iy = 0; iy < 2; iy++) { + z = -pinstart[2] + 2 * pal[2] + ptopref[2]; + yin = -pinstart[1] + 0.3 + (iy + 0.5) * 2 * ptopref[1]; ntops++; - ins->AddNode(topref, ntops, new TGeoTranslation(xin,yin,z) ); + ins->AddNode(topref, ntops, new TGeoTranslation(xin, yin, z)); printf(" 0TOP full %i x %f y %f z %f \n", ntops, xin, yin, z); - z = -pinstart[2] + 2*pal[2] + 2 * ptopref[2] + preg[2]; - ins->AddNode(cat, ntops, new TGeoTranslation(xin, yin, z) ); + z = -pinstart[2] + 2 * pal[2] + 2 * ptopref[2] + preg[2]; + ins->AddNode(cat, ntops, new TGeoTranslation(xin, yin, z)); // cat->Print(); printf(" GEOGEO CATHOD x=%f , y= %f z= %f num %i\n", xin, yin, z, ntops); } } - //Al top - z=-pinstart[2] + pal[2]; - ins->AddNode(altop, 1 , new TGeoTranslation(0,0,z) ); - + // Al top + z = -pinstart[2] + pal[2]; + ins->AddNode(altop, 1, new TGeoTranslation(0, 0, z)); + // MCP - z=-pinstart[2] + 2*pal[2] + 2*ptopref[2] + 2*preg[2] + pmcp[2]; + z = -pinstart[2] + 2 * pal[2] + 2 * ptopref[2] + 2 * preg[2] + pmcp[2]; // z=-pinstart[2] + 2*ptopref[2] + preg[2]; - ins->AddNode(mcp, 1 , new TGeoTranslation(0,0,z) ); + ins->AddNode(mcp, 1, new TGeoTranslation(0, 0, z)); } Bool_t Detector::ProcessHits(FairVolume* v) -{ +{ TLorentzVector position; static auto* refMC = TVirtualMC::GetMC(); - if(refMC->IsTrackEntering()) { + if (refMC->IsTrackEntering()) { refMC->TrackPosition(position); float x = position.X(); float y = position.Y(); float z = position.Z(); - + float time = refMC->TrackTime() * 1.0e12; int trackID = refMC->GetStack()->GetCurrentTrackNumber(); int detID = v->getMCid(); float etot = refMC->Etot(); - int iPart= refMC->TrackPid(); + int iPart = refMC->TrackPid(); float enDep = refMC->Edep(); - if (iPart == 50000050) // If particles is photon then ... - { - if(RegisterPhotoE(etot)) { - // fIshunt = 2; - AddHit(x,y,z, time, enDep, trackID, detID); - - } + if (iPart == 50000050) // If particles is photon then ... + { + if (RegisterPhotoE(etot)) { + // fIshunt = 2; + AddHit(x, y, z, time, enDep, trackID, detID); } + } return kTRUE; } } @@ -311,13 +294,9 @@ HitType* Detector::AddHit(float x, float y, float z, float time, float energy, I Int_t size = clref.GetEntriesFast(); HitType* hit = new (clref[size]) HitType(x, y, z, time, energy, trackId, detId); - -} - -void Detector::Register() { - FairRootManager::Instance()->Register("FITHit", "FIT", mHitCollection, kTRUE); } +void Detector::Register() { FairRootManager::Instance()->Register("FITHit", "FIT", mHitCollection, kTRUE); } TClonesArray* Detector::GetCollection(Int_t iColl) const { if (iColl == 0) @@ -326,103 +305,98 @@ TClonesArray* Detector::GetCollection(Int_t iColl) const } void Detector::Reset() {} - - void Detector::CreateMaterials() { - Int_t isxfld = 2; // magneticField->Integ(); Float_t sxmgmx = 10.; // magneticField->Max(); // Float_t a,z,d,radl,absl,buf[1]; // Int_t nbuf; // AIR - - Float_t aAir[4]={12.0107,14.0067,15.9994,39.948}; - Float_t zAir[4]={6.,7.,8.,18.}; - Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827}; + + Float_t aAir[4] = { 12.0107, 14.0067, 15.9994, 39.948 }; + Float_t zAir[4] = { 6., 7., 8., 18. }; + Float_t wAir[4] = { 0.000124, 0.755267, 0.231781, 0.012827 }; Float_t dAir = 1.20479E-3; Float_t dAir1 = 1.20479E-11; // Radiator glass SiO2 - Float_t aglass[2]={28.0855,15.9994}; - Float_t zglass[2]={14.,8.}; - Float_t wglass[2]={1.,2.}; - Float_t dglass=2.65; + Float_t aglass[2] = { 28.0855, 15.9994 }; + Float_t zglass[2] = { 14., 8. }; + Float_t wglass[2] = { 1., 2. }; + Float_t dglass = 2.65; // MCP glass SiO2 - Float_t dglass_mcp=1.3; + Float_t dglass_mcp = 1.3; //*** Definition Of avaible FIT materials *** - Mixture(1, "Vacuum$", aAir, zAir, dAir1,4,wAir); - Mixture(2, "Air$", aAir, zAir, dAir,4,wAir); - Mixture( 4, "MCP glass $",aglass,zglass,dglass_mcp,-2,wglass); - Mixture( 24, "Radiator Optical glass$",aglass,zglass,dglass,-2,wglass); - Material(11, "Aliminium$", 26.98, 13.0, 2.7, 8.9,999); - + Mixture(1, "Vacuum$", aAir, zAir, dAir1, 4, wAir); + Mixture(2, "Air$", aAir, zAir, dAir, 4, wAir); + Mixture(4, "MCP glass $", aglass, zglass, dglass_mcp, -2, wglass); + Mixture(24, "Radiator Optical glass$", aglass, zglass, dglass, -2, wglass); + Material(11, "Aliminium$", 26.98, 13.0, 2.7, 8.9, 999); + Medium(1, "Air$", 2, 0, isxfld, sxmgmx, 10., .1, 1., .003, .003); Medium(3, "Vacuum$", 1, 0, isxfld, sxmgmx, 10., .01, .1, .003, .003); Medium(6, "Glass$", 4, 0, isxfld, sxmgmx, 10., .01, .1, .003, .003); - + Medium(7, "OpAir$", 2, 0, isxfld, sxmgmx, 10., .1, 1., .003, .003); - - Medium(15, "Aluminium$", 11, 0, isxfld, sxmgmx, 10., .01, 1., .003, .003); + + Medium(15, "Aluminium$", 11, 0, isxfld, sxmgmx, 10., .01, 1., .003, .003); Medium(16, "OpticalGlass$", 24, 1, isxfld, sxmgmx, 10., .01, .1, .003, .003); Medium(19, "OpticalGlassCathode$", 24, 1, isxfld, sxmgmx, 10., .01, .1, .003, .003); Medium(22, "SensAir$", 2, 1, isxfld, sxmgmx, 10., .1, 1., .003, .003); - - } //------------------------------------------------------------------- void Detector::DefineOpticalProperties() { - -// Path of the optical properties input file + // Path of the optical properties input file TString inputDir; - const char* aliceO2env=std::getenv("O2_ROOT"); - if (aliceO2env) inputDir=aliceO2env; - inputDir+="/share/Detectors/FIT/files/"; + const char* aliceO2env = std::getenv("O2_ROOT"); + if (aliceO2env) + inputDir = aliceO2env; + inputDir += "/share/Detectors/FIT/files/"; - TString optPropPath =inputDir + "quartzOptProperties.txt"; + TString optPropPath = inputDir + "quartzOptProperties.txt"; optPropPath = gSystem->ExpandPathName(optPropPath.Data()); // Expand $(ALICE_ROOT) into real system path -// Prepare pointers for arrays read from the input file - Float_t *aPckov=nullptr; - Double_t *dPckov=nullptr; - Float_t *aAbsSiO2=nullptr; - Float_t *rindexSiO2=nullptr; - Float_t *qeff = nullptr; - Int_t kNbins=0; + // Prepare pointers for arrays read from the input file + Float_t* aPckov = nullptr; + Double_t* dPckov = nullptr; + Float_t* aAbsSiO2 = nullptr; + Float_t* rindexSiO2 = nullptr; + Float_t* qeff = nullptr; + Int_t kNbins = 0; ReadOptProperties(optPropPath.Data(), &aPckov, &dPckov, &aAbsSiO2, &rindexSiO2, &qeff, kNbins); // set QE - mPMTeff = new TGraph(kNbins,aPckov,qeff); - -// Prepare pointers for arrays with constant and hardcoded values (independent on wavelength) - Float_t *efficAll=nullptr; - Float_t *rindexAir=nullptr; - Float_t *absorAir=nullptr; - Float_t *rindexCathodeNext=nullptr; - Float_t *absorbCathodeNext=nullptr; - Double_t *efficMet=nullptr; - Double_t *aReflMet=nullptr; - FillOtherOptProperties(&efficAll, &rindexAir, &absorAir, &rindexCathodeNext, - &absorbCathodeNext, &efficMet, &aReflMet, kNbins); - - TVirtualMC::GetMC()->SetCerenkov (getMediumID(kOpGlass), kNbins, aPckov, aAbsSiO2, efficAll, rindexSiO2); + mPMTeff = new TGraph(kNbins, aPckov, qeff); + + // Prepare pointers for arrays with constant and hardcoded values (independent on wavelength) + Float_t* efficAll = nullptr; + Float_t* rindexAir = nullptr; + Float_t* absorAir = nullptr; + Float_t* rindexCathodeNext = nullptr; + Float_t* absorbCathodeNext = nullptr; + Double_t* efficMet = nullptr; + Double_t* aReflMet = nullptr; + FillOtherOptProperties(&efficAll, &rindexAir, &absorAir, &rindexCathodeNext, &absorbCathodeNext, &efficMet, &aReflMet, + kNbins); + + TVirtualMC::GetMC()->SetCerenkov(getMediumID(kOpGlass), kNbins, aPckov, aAbsSiO2, efficAll, rindexSiO2); // TVirtualMC::GetMC()->SetCerenkov (getMediumID(kOpGlassCathode), kNbins, aPckov, aAbsSiO2, effCathode, rindexSiO2); - TVirtualMC::GetMC()->SetCerenkov (getMediumID(kOpGlassCathode), kNbins, aPckov, aAbsSiO2, efficAll, rindexSiO2); + TVirtualMC::GetMC()->SetCerenkov(getMediumID(kOpGlassCathode), kNbins, aPckov, aAbsSiO2, efficAll, rindexSiO2); -//Define a border for radiator optical properties -// TODO: Maciek: The following 3 lines just generate warnings and do nothing else - could be deleted - TVirtualMC::GetMC()->DefineOpSurface("surfRd", kUnified /*kGlisur*/,kDielectric_metal,kPolished, 0.); + // Define a border for radiator optical properties + // TODO: Maciek: The following 3 lines just generate warnings and do nothing else - could be deleted + TVirtualMC::GetMC()->DefineOpSurface("surfRd", kUnified /*kGlisur*/, kDielectric_metal, kPolished, 0.); TVirtualMC::GetMC()->SetMaterialProperty("surfRd", "EFFICIENCY", kNbins, dPckov, efficMet); TVirtualMC::GetMC()->SetMaterialProperty("surfRd", "REFLECTIVITY", kNbins, dPckov, aReflMet); - DeleteOptPropertiesArr(&aPckov, &dPckov, &aAbsSiO2, &rindexSiO2, &efficAll, &rindexAir, &absorAir, &rindexCathodeNext, &absorbCathodeNext, &efficMet, &aReflMet); + DeleteOptPropertiesArr(&aPckov, &dPckov, &aAbsSiO2, &rindexSiO2, &efficAll, &rindexAir, &absorAir, &rindexCathodeNext, + &absorbCathodeNext, &efficMet, &aReflMet); } - -void Detector::FillOtherOptProperties(Float_t **efficAll, Float_t **rindexAir, Float_t **absorAir, - Float_t **rindexCathodeNext, Float_t **absorbCathodeNext, - Double_t **efficMet, Double_t **aReflMet, const Int_t kNbins) const +void Detector::FillOtherOptProperties(Float_t** efficAll, Float_t** rindexAir, Float_t** absorAir, + Float_t** rindexCathodeNext, Float_t** absorbCathodeNext, Double_t** efficMet, + Double_t** aReflMet, const Int_t kNbins) const { // Allocate memory for these arrays according to the required size *efficAll = new Float_t[kNbins]; @@ -434,73 +408,71 @@ void Detector::FillOtherOptProperties(Float_t **efficAll, Float_t **rindexAir, F *aReflMet = new Double_t[kNbins]; // Set constant values to the arrays - for(Int_t i=0; iEval(lambda); - Double_t p = gRandom->Rndm(); - + Double_t p = gRandom->Rndm(); + if (p > eff) return kFALSE; - + return kTRUE; } - -Int_t Detector::ReadOptProperties(const std::string filePath, Float_t **e, Double_t **de, - Float_t **abs, Float_t **n, Float_t **qe, Int_t &kNbins) const{ +Int_t Detector::ReadOptProperties(const std::string filePath, Float_t** e, Double_t** de, Float_t** abs, Float_t** n, + Float_t** qe, Int_t& kNbins) const +{ std::ifstream infile; infile.open(filePath.c_str()); // Check if file is opened correctly - if(infile.fail()==true){ - //AliFatal(Form("Error opening ascii file: %s", filePath.c_str())); + if (infile.fail() == true) { + // AliFatal(Form("Error opening ascii file: %s", filePath.c_str())); return -1; } - + std::string comment; // dummy, used just to read 4 first lines and move the cursor to the 5th, otherwise unused - if(!getline(infile,comment)){ // first comment line - // AliFatal(Form("Error opening ascii file (it is probably a folder!): %s", filePath.c_str())); + if (!getline(infile, comment)) { // first comment line + // AliFatal(Form("Error opening ascii file (it is probably a folder!): %s", filePath.c_str())); return -2; - } - getline(infile,comment); // 2nd comment line + } + getline(infile, comment); // 2nd comment line // Get number of elements required for the array infile >> kNbins; - if(kNbins<0 || kNbins>1e4){ + if (kNbins < 0 || kNbins > 1e4) { // AliFatal(Form("Input arraySize out of range 0..1e4: %i. Check input file: %s", kNbins, filePath.c_str())); return -4; } @@ -512,37 +484,39 @@ Int_t Detector::ReadOptProperties(const std::string filePath, Float_t **e, Doubl *n = new Float_t[kNbins]; *qe = new Float_t[kNbins]; - getline(infile,comment); // finish 3rd line after the nEntries are read - getline(infile,comment); // 4th comment line + getline(infile, comment); // finish 3rd line after the nEntries are read + getline(infile, comment); // 4th comment line // read the main body of the file (table of values: energy, absorption length and refractive index) - Int_t iLine=0; + Int_t iLine = 0; std::string sLine; getline(infile, sLine); - while(!infile.eof()){ - if(iLine >= kNbins){ - // AliFatal(Form("Line number: %i reaches range of declared arraySize: %i. Check input file: %s", iLine, kNbins, filePath.c_str())); + while (!infile.eof()) { + if (iLine >= kNbins) { + // AliFatal(Form("Line number: %i reaches range of declared arraySize: %i. Check input file: %s", iLine, + // kNbins, filePath.c_str())); return -5; } std::stringstream ssLine(sLine); ssLine >> (*de)[iLine]; - (*de)[iLine] *= 1e-9; // Convert eV -> GeV immediately - (*e)[iLine] = static_cast ((*de)[iLine]); // same value, different precision + (*de)[iLine] *= 1e-9; // Convert eV -> GeV immediately + (*e)[iLine] = static_cast((*de)[iLine]); // same value, different precision ssLine >> (*abs)[iLine]; ssLine >> (*n)[iLine]; ssLine >> (*qe)[iLine]; - if(!(ssLine.good() || ssLine.eof())){ // check if there were problems with numbers conversion + if (!(ssLine.good() || ssLine.eof())) { // check if there were problems with numbers conversion // AliFatal(Form("Error while reading line %i: %s", iLine, ssLine.str().c_str())); return -6; } getline(infile, sLine); iLine++; } - if(iLine != kNbins){ - // AliFatal(Form("Total number of lines %i is different than declared %i. Check input file: %s", iLine, kNbins, filePath.c_str())); + if (iLine != kNbins) { + // AliFatal(Form("Total number of lines %i is different than declared %i. Check input file: %s", iLine, kNbins, + // filePath.c_str())); return -7; } - -// AliInfo(Form("Optical properties taken from the file: %s. Number of lines read: %i",filePath.c_str(),iLine)); + + // AliInfo(Form("Optical properties taken from the file: %s. Number of lines read: %i",filePath.c_str(),iLine)); return 0; } diff --git a/Detectors/FIT/simulation/src/FITSimulationLinkDef.h b/Detectors/FIT/simulation/src/FITSimulationLinkDef.h index b302b652cdee8..1f9fc6186262b 100644 --- a/Detectors/FIT/simulation/src/FITSimulationLinkDef.h +++ b/Detectors/FIT/simulation/src/FITSimulationLinkDef.h @@ -14,6 +14,6 @@ #pragma link off all classes; #pragma link off all functions; -#pragma link C++ class o2::fit::Detector+; +#pragma link C++ class o2::fit::Detector + ; #endif From a3b6b9f88283e79c4b440cb21bdf7946ecd72777 Mon Sep 17 00:00:00 2001 From: Alla Maevskaya Date: Fri, 22 Sep 2017 14:23:39 +0200 Subject: [PATCH 13/18] remove unused forward declaration --- Detectors/FIT/simulation/include/FITSimulation/Detector.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Detectors/FIT/simulation/include/FITSimulation/Detector.h b/Detectors/FIT/simulation/include/FITSimulation/Detector.h index c17ef133b35fe..2a047aaf0380c 100644 --- a/Detectors/FIT/simulation/include/FITSimulation/Detector.h +++ b/Detectors/FIT/simulation/include/FITSimulation/Detector.h @@ -25,10 +25,6 @@ class FairVolume; class TClonesArray; class TGeoVolume; -class TParticle; - -class TString; - namespace o2 { namespace fit From 3a8296542ba99259de757709e88202a08de39cbb Mon Sep 17 00:00:00 2001 From: Alla Maevskaya Date: Fri, 22 Sep 2017 14:30:54 +0200 Subject: [PATCH 14/18] ClassDefoverride Geometry.h --- Detectors/FIT/base/include/FITBase/Geometry.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Detectors/FIT/base/include/FITBase/Geometry.h b/Detectors/FIT/base/include/FITBase/Geometry.h index 145ec42039c2a..0dbf6ea44295f 100644 --- a/Detectors/FIT/base/include/FITBase/Geometry.h +++ b/Detectors/FIT/base/include/FITBase/Geometry.h @@ -80,7 +80,7 @@ class Geometry : public TNamed static const Char_t* sDefaultGeometryName; ///< Default name of geometry private: - ClassDef(Geometry, 1); + ClassDefOverride(Geometry, 1); }; } } From 15c074a7ea3dad2fd7ec99211cee4c1aa0b2a2c3 Mon Sep 17 00:00:00 2001 From: Maciej Slupecki Date: Fri, 6 Oct 2017 15:45:40 +0300 Subject: [PATCH 15/18] Replaced obsolete memory allocation method for arrays with vectors containing FIT optical properties --- .../include/FITSimulation/Detector.h | 26 ++-- Detectors/FIT/simulation/src/Detector.cxx | 130 +++++++----------- 2 files changed, 64 insertions(+), 92 deletions(-) diff --git a/Detectors/FIT/simulation/include/FITSimulation/Detector.h b/Detectors/FIT/simulation/include/FITSimulation/Detector.h index 2a047aaf0380c..9164654b32ef6 100644 --- a/Detectors/FIT/simulation/include/FITSimulation/Detector.h +++ b/Detectors/FIT/simulation/include/FITSimulation/Detector.h @@ -78,16 +78,11 @@ class Detector : public o2::Base::Detector void CreateMaterials(); void ConstructGeometry() override; void SetOneMCP(TGeoVolume* stl); + // Optical properties reader: e-Energy, abs-AbsorptionLength[cm], n-refractive index - Int_t ReadOptProperties(const std::string inputFilePath, Float_t** e, Double_t** de, Float_t** abs, Float_t** n, - Float_t** qe, Int_t& kNbins) const; void DefineOpticalProperties(); - void FillOtherOptProperties(Float_t** efficAll, Float_t** rindexAir, Float_t** absorAir, Float_t** rindexCathodeNext, - Float_t** absorbCathodeNext, Double_t** efficMet, Double_t** aReflMet, - const Int_t kNbins) const; - void DeleteOptPropertiesArr(Float_t** e, Double_t** de, Float_t** abs, Float_t** n, Float_t** efficAll, - Float_t** rindexAir, Float_t** absorAir, Float_t** rindexCathodeNext, - Float_t** absorbCathodeNext, Double_t** efficMet, Double_t** aReflMet) const; + Int_t ReadOptProperties(const std::string inputFilePath); + void FillOtherOptProperties(); Bool_t RegisterPhotoE(Double_t energy); // Geometry* GetGeometry(); @@ -107,6 +102,21 @@ class Detector : public o2::Base::Detector Int_t mIdSens1; // Sensetive volume in T0 TGraph* mPMTeff; // pmt registration effeicincy + // Optical properties to be extracted from file + std::vector photonEnergyD; + std::vector absorptionLength; + std::vector refractionIndex; + std::vector quantumEfficiency; + + // Optical properties to be set to constants + std::vector efficAll; + std::vector rindexAir; + std::vector absorAir; + std::vector rindexCathodeNext; + std::vector absorbCathodeNext; + std::vector efficMet; + std::vector aReflMet; + /// Container for data points TClonesArray* mHitCollection; diff --git a/Detectors/FIT/simulation/src/Detector.cxx b/Detectors/FIT/simulation/src/Detector.cxx index 2b0867f49f5c1..62f63e6ba6287 100644 --- a/Detectors/FIT/simulation/src/Detector.cxx +++ b/Detectors/FIT/simulation/src/Detector.cxx @@ -358,84 +358,42 @@ void Detector::DefineOpticalProperties() TString optPropPath = inputDir + "quartzOptProperties.txt"; optPropPath = gSystem->ExpandPathName(optPropPath.Data()); // Expand $(ALICE_ROOT) into real system path - // Prepare pointers for arrays read from the input file - Float_t* aPckov = nullptr; - Double_t* dPckov = nullptr; - Float_t* aAbsSiO2 = nullptr; - Float_t* rindexSiO2 = nullptr; - Float_t* qeff = nullptr; - Int_t kNbins = 0; - ReadOptProperties(optPropPath.Data(), &aPckov, &dPckov, &aAbsSiO2, &rindexSiO2, &qeff, kNbins); + if(ReadOptProperties(optPropPath.Data())<0){ + // Error reading file + return; + } + Int_t nBins = photonEnergyD.size(); // set QE - mPMTeff = new TGraph(kNbins, aPckov, qeff); + mPMTeff = new TGraph(nBins, &(photonEnergyD[0]), &(quantumEfficiency[0])); // Prepare pointers for arrays with constant and hardcoded values (independent on wavelength) - Float_t* efficAll = nullptr; - Float_t* rindexAir = nullptr; - Float_t* absorAir = nullptr; - Float_t* rindexCathodeNext = nullptr; - Float_t* absorbCathodeNext = nullptr; - Double_t* efficMet = nullptr; - Double_t* aReflMet = nullptr; - FillOtherOptProperties(&efficAll, &rindexAir, &absorAir, &rindexCathodeNext, &absorbCathodeNext, &efficMet, &aReflMet, - kNbins); - - TVirtualMC::GetMC()->SetCerenkov(getMediumID(kOpGlass), kNbins, aPckov, aAbsSiO2, efficAll, rindexSiO2); + FillOtherOptProperties(); + + // Quick conversion from vector to Double_t*: photonEnergyD -> &(photonEnergyD[0]) + TVirtualMC::GetMC()->SetCerenkov(getMediumID(kOpGlass), nBins, &(photonEnergyD[0]), &(absorptionLength[0]), &(efficAll[0]), &(refractionIndex[0])); // TVirtualMC::GetMC()->SetCerenkov (getMediumID(kOpGlassCathode), kNbins, aPckov, aAbsSiO2, effCathode, rindexSiO2); - TVirtualMC::GetMC()->SetCerenkov(getMediumID(kOpGlassCathode), kNbins, aPckov, aAbsSiO2, efficAll, rindexSiO2); + TVirtualMC::GetMC()->SetCerenkov(getMediumID(kOpGlassCathode), nBins, &(photonEnergyD[0]), &(absorptionLength[0]), &(efficAll[0]), &(refractionIndex[0])); // Define a border for radiator optical properties - // TODO: Maciek: The following 3 lines just generate warnings and do nothing else - could be deleted TVirtualMC::GetMC()->DefineOpSurface("surfRd", kUnified /*kGlisur*/, kDielectric_metal, kPolished, 0.); - TVirtualMC::GetMC()->SetMaterialProperty("surfRd", "EFFICIENCY", kNbins, dPckov, efficMet); - TVirtualMC::GetMC()->SetMaterialProperty("surfRd", "REFLECTIVITY", kNbins, dPckov, aReflMet); - - DeleteOptPropertiesArr(&aPckov, &dPckov, &aAbsSiO2, &rindexSiO2, &efficAll, &rindexAir, &absorAir, &rindexCathodeNext, - &absorbCathodeNext, &efficMet, &aReflMet); + TVirtualMC::GetMC()->SetMaterialProperty("surfRd", "EFFICIENCY", nBins, &(photonEnergyD[0]), &(efficMet[0])); + TVirtualMC::GetMC()->SetMaterialProperty("surfRd", "REFLECTIVITY", nBins, &(photonEnergyD[0]), &(aReflMet[0])); } -void Detector::FillOtherOptProperties(Float_t** efficAll, Float_t** rindexAir, Float_t** absorAir, - Float_t** rindexCathodeNext, Float_t** absorbCathodeNext, Double_t** efficMet, - Double_t** aReflMet, const Int_t kNbins) const +void Detector::FillOtherOptProperties() { - // Allocate memory for these arrays according to the required size - *efficAll = new Float_t[kNbins]; - *rindexAir = new Float_t[kNbins]; - *absorAir = new Float_t[kNbins]; - *rindexCathodeNext = new Float_t[kNbins]; - *absorbCathodeNext = new Float_t[kNbins]; - *efficMet = new Double_t[kNbins]; - *aReflMet = new Double_t[kNbins]; - - // Set constant values to the arrays - for (Int_t i = 0; i < kNbins; i++) { - (*efficAll)[i] = 1.; - (*rindexAir)[i] = 1.; - (*absorAir)[i] = 0.3; - (*rindexCathodeNext)[i] = 0; - (*absorbCathodeNext)[i] = 0; - (*efficMet)[i] = 0.; - (*aReflMet)[i] = 1.; + // Set constant values to the other arrays + for (Int_t i = 0; i < photonEnergyD.size(); i++) { + efficAll.push_back(1.); + rindexAir.push_back(1.); + absorAir.push_back(0.3); + rindexCathodeNext.push_back(0.); + absorbCathodeNext.push_back(0.); + efficMet.push_back(0.); + aReflMet.push_back(1.); } } -void Detector::DeleteOptPropertiesArr(Float_t** e, Double_t** de, Float_t** abs, Float_t** n, Float_t** efficAll, - Float_t** rindexAir, Float_t** absorAir, Float_t** rindexCathodeNext, - Float_t** absorbCathodeNext, Double_t** efficMet, Double_t** aReflMet) const -{ - delete[](*e); - delete[](*de); - delete[](*abs); - delete[](*n); - delete[](*efficAll); - delete[](*rindexAir); - delete[](*absorAir); - delete[](*rindexCathodeNext); - delete[](*absorbCathodeNext); - delete[](*efficMet); - delete[](*aReflMet); -} - //------------------------------------------------------------------------ Bool_t Detector::RegisterPhotoE(Double_t energy) { @@ -451,8 +409,7 @@ Bool_t Detector::RegisterPhotoE(Double_t energy) return kTRUE; } -Int_t Detector::ReadOptProperties(const std::string filePath, Float_t** e, Double_t** de, Float_t** abs, Float_t** n, - Float_t** qe, Int_t& kNbins) const +Int_t Detector::ReadOptProperties(const std::string filePath) { std::ifstream infile; infile.open(filePath.c_str()); @@ -471,19 +428,13 @@ Int_t Detector::ReadOptProperties(const std::string filePath, Float_t** e, Doubl getline(infile, comment); // 2nd comment line // Get number of elements required for the array - infile >> kNbins; - if (kNbins < 0 || kNbins > 1e4) { + Int_t nLines; + infile >> nLines; + if (nLines < 0 || nLines > 1e4) { // AliFatal(Form("Input arraySize out of range 0..1e4: %i. Check input file: %s", kNbins, filePath.c_str())); return -4; } - // Allocate memory required for arrays - *e = new Float_t[kNbins]; - *de = new Double_t[kNbins]; - *abs = new Float_t[kNbins]; - *n = new Float_t[kNbins]; - *qe = new Float_t[kNbins]; - getline(infile, comment); // finish 3rd line after the nEntries are read getline(infile, comment); // 4th comment line @@ -492,18 +443,29 @@ Int_t Detector::ReadOptProperties(const std::string filePath, Float_t** e, Doubl std::string sLine; getline(infile, sLine); while (!infile.eof()) { - if (iLine >= kNbins) { + if (iLine >= nLines) { // AliFatal(Form("Line number: %i reaches range of declared arraySize: %i. Check input file: %s", iLine, // kNbins, filePath.c_str())); return -5; } std::stringstream ssLine(sLine); - ssLine >> (*de)[iLine]; - (*de)[iLine] *= 1e-9; // Convert eV -> GeV immediately - (*e)[iLine] = static_cast((*de)[iLine]); // same value, different precision - ssLine >> (*abs)[iLine]; - ssLine >> (*n)[iLine]; - ssLine >> (*qe)[iLine]; + // First column: + Double_t energy; + ssLine >> energy; + energy *= 1e-9; // Convert eV -> GeV immediately + photonEnergyD.push_back(energy); + // Second column: + Double_t absorption; + ssLine >> absorption; + absorptionLength.push_back(absorption); + // Third column: + Double_t refraction; + ssLine >> refraction; + refractionIndex.push_back(refraction); + // Fourth column: + Double_t efficiency; + ssLine >> efficiency; + quantumEfficiency.push_back(efficiency); if (!(ssLine.good() || ssLine.eof())) { // check if there were problems with numbers conversion // AliFatal(Form("Error while reading line %i: %s", iLine, ssLine.str().c_str())); return -6; @@ -511,7 +473,7 @@ Int_t Detector::ReadOptProperties(const std::string filePath, Float_t** e, Doubl getline(infile, sLine); iLine++; } - if (iLine != kNbins) { + if (iLine != photonEnergyD.size()) { // AliFatal(Form("Total number of lines %i is different than declared %i. Check input file: %s", iLine, kNbins, // filePath.c_str())); return -7; From 658665ea91b01e8d1d21f2bb6b144507aac1ff69 Mon Sep 17 00:00:00 2001 From: Maciej Slupecki Date: Mon, 9 Oct 2017 15:31:33 +0300 Subject: [PATCH 16/18] Fixed naming of member variables and 2 missing return statements --- .../include/FITSimulation/Detector.h | 22 +++++----- Detectors/FIT/simulation/src/Detector.cxx | 41 ++++++++++--------- 2 files changed, 33 insertions(+), 30 deletions(-) diff --git a/Detectors/FIT/simulation/include/FITSimulation/Detector.h b/Detectors/FIT/simulation/include/FITSimulation/Detector.h index 9164654b32ef6..5bbca2b5cdfe0 100644 --- a/Detectors/FIT/simulation/include/FITSimulation/Detector.h +++ b/Detectors/FIT/simulation/include/FITSimulation/Detector.h @@ -103,19 +103,19 @@ class Detector : public o2::Base::Detector TGraph* mPMTeff; // pmt registration effeicincy // Optical properties to be extracted from file - std::vector photonEnergyD; - std::vector absorptionLength; - std::vector refractionIndex; - std::vector quantumEfficiency; + std::vector mPhotonEnergyD; + std::vector mAbsorptionLength; + std::vector mRefractionIndex; + std::vector mQuantumEfficiency; // Optical properties to be set to constants - std::vector efficAll; - std::vector rindexAir; - std::vector absorAir; - std::vector rindexCathodeNext; - std::vector absorbCathodeNext; - std::vector efficMet; - std::vector aReflMet; + std::vector mEfficAll; + std::vector mRindexAir; + std::vector mAbsorAir; + std::vector mRindexCathodeNext; + std::vector mAbsorbCathodeNext; + std::vector mEfficMet; + std::vector mReflMet; /// Container for data points TClonesArray* mHitCollection; diff --git a/Detectors/FIT/simulation/src/Detector.cxx b/Detectors/FIT/simulation/src/Detector.cxx index 62f63e6ba6287..71b520f4894b5 100644 --- a/Detectors/FIT/simulation/src/Detector.cxx +++ b/Detectors/FIT/simulation/src/Detector.cxx @@ -285,6 +285,7 @@ Bool_t Detector::ProcessHits(FairVolume* v) } return kTRUE; } + return kFALSE; } HitType* Detector::AddHit(float x, float y, float z, float time, float energy, Int_t trackId, Int_t detId) @@ -294,6 +295,8 @@ HitType* Detector::AddHit(float x, float y, float z, float time, float energy, I Int_t size = clref.GetEntriesFast(); HitType* hit = new (clref[size]) HitType(x, y, z, time, energy, trackId, detId); + + return hit; } void Detector::Register() { FairRootManager::Instance()->Register("FITHit", "FIT", mHitCollection, kTRUE); } @@ -362,35 +365,35 @@ void Detector::DefineOpticalProperties() // Error reading file return; } - Int_t nBins = photonEnergyD.size(); + Int_t nBins = mPhotonEnergyD.size(); // set QE - mPMTeff = new TGraph(nBins, &(photonEnergyD[0]), &(quantumEfficiency[0])); + mPMTeff = new TGraph(nBins, &(mPhotonEnergyD[0]), &(mQuantumEfficiency[0])); // Prepare pointers for arrays with constant and hardcoded values (independent on wavelength) FillOtherOptProperties(); // Quick conversion from vector to Double_t*: photonEnergyD -> &(photonEnergyD[0]) - TVirtualMC::GetMC()->SetCerenkov(getMediumID(kOpGlass), nBins, &(photonEnergyD[0]), &(absorptionLength[0]), &(efficAll[0]), &(refractionIndex[0])); + TVirtualMC::GetMC()->SetCerenkov(getMediumID(kOpGlass), nBins, &(mPhotonEnergyD[0]), &(mAbsorptionLength[0]), &(mEfficAll[0]), &(mRefractionIndex[0])); // TVirtualMC::GetMC()->SetCerenkov (getMediumID(kOpGlassCathode), kNbins, aPckov, aAbsSiO2, effCathode, rindexSiO2); - TVirtualMC::GetMC()->SetCerenkov(getMediumID(kOpGlassCathode), nBins, &(photonEnergyD[0]), &(absorptionLength[0]), &(efficAll[0]), &(refractionIndex[0])); + TVirtualMC::GetMC()->SetCerenkov(getMediumID(kOpGlassCathode), nBins, &(mPhotonEnergyD[0]), &(mAbsorptionLength[0]), &(mEfficAll[0]), &(mRefractionIndex[0])); // Define a border for radiator optical properties TVirtualMC::GetMC()->DefineOpSurface("surfRd", kUnified /*kGlisur*/, kDielectric_metal, kPolished, 0.); - TVirtualMC::GetMC()->SetMaterialProperty("surfRd", "EFFICIENCY", nBins, &(photonEnergyD[0]), &(efficMet[0])); - TVirtualMC::GetMC()->SetMaterialProperty("surfRd", "REFLECTIVITY", nBins, &(photonEnergyD[0]), &(aReflMet[0])); + TVirtualMC::GetMC()->SetMaterialProperty("surfRd", "EFFICIENCY", nBins, &(mPhotonEnergyD[0]), &(mEfficMet[0])); + TVirtualMC::GetMC()->SetMaterialProperty("surfRd", "REFLECTIVITY", nBins, &(mPhotonEnergyD[0]), &(mReflMet[0])); } void Detector::FillOtherOptProperties() { // Set constant values to the other arrays - for (Int_t i = 0; i < photonEnergyD.size(); i++) { - efficAll.push_back(1.); - rindexAir.push_back(1.); - absorAir.push_back(0.3); - rindexCathodeNext.push_back(0.); - absorbCathodeNext.push_back(0.); - efficMet.push_back(0.); - aReflMet.push_back(1.); + for (Int_t i = 0; i < mPhotonEnergyD.size(); i++) { + mEfficAll.push_back(1.); + mRindexAir.push_back(1.); + mAbsorAir.push_back(0.3); + mRindexCathodeNext.push_back(0.); + mAbsorbCathodeNext.push_back(0.); + mEfficMet.push_back(0.); + mReflMet.push_back(1.); } } @@ -453,19 +456,19 @@ Int_t Detector::ReadOptProperties(const std::string filePath) Double_t energy; ssLine >> energy; energy *= 1e-9; // Convert eV -> GeV immediately - photonEnergyD.push_back(energy); + mPhotonEnergyD.push_back(energy); // Second column: Double_t absorption; ssLine >> absorption; - absorptionLength.push_back(absorption); + mAbsorptionLength.push_back(absorption); // Third column: Double_t refraction; ssLine >> refraction; - refractionIndex.push_back(refraction); + mRefractionIndex.push_back(refraction); // Fourth column: Double_t efficiency; ssLine >> efficiency; - quantumEfficiency.push_back(efficiency); + mQuantumEfficiency.push_back(efficiency); if (!(ssLine.good() || ssLine.eof())) { // check if there were problems with numbers conversion // AliFatal(Form("Error while reading line %i: %s", iLine, ssLine.str().c_str())); return -6; @@ -473,7 +476,7 @@ Int_t Detector::ReadOptProperties(const std::string filePath) getline(infile, sLine); iLine++; } - if (iLine != photonEnergyD.size()) { + if (iLine != mPhotonEnergyD.size()) { // AliFatal(Form("Total number of lines %i is different than declared %i. Check input file: %s", iLine, kNbins, // filePath.c_str())); return -7; From 3fa34b8c3060dabfb9d05352469e2b18f398b69f Mon Sep 17 00:00:00 2001 From: Alla Maevskaya Date: Sun, 15 Oct 2017 14:24:47 +0200 Subject: [PATCH 17/18] Simplified Geometry --- Detectors/FIT/CMakeLists.txt | 15 --- Detectors/FIT/base/include/FITBase/Geometry.h | 60 ++--------- Detectors/FIT/base/src/Geometry.cxx | 101 +++++++++++++----- Detectors/FIT/simulation/src/Detector.cxx | 11 +- cmake/O2Dependencies.cmake | 5 + 5 files changed, 87 insertions(+), 105 deletions(-) diff --git a/Detectors/FIT/CMakeLists.txt b/Detectors/FIT/CMakeLists.txt index d986b027851dc..d5355745196a1 100644 --- a/Detectors/FIT/CMakeLists.txt +++ b/Detectors/FIT/CMakeLists.txt @@ -1,18 +1,3 @@ -# ************************************************************************** -# * Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. * -# * * -# * Author: The ALICE Off-line Project. * -# * Contributors are mentioned in the code where appropriate. * -# * * -# * Permission to use, copy, modify and distribute this software and its * -# * documentation strictly for non-commercial purposes is hereby granted * -# * without fee, provided that the above copyright notice appears in all * -# * copies and that both the copyright notice and this permission notice * -# * appear in the supporting documentation. The authors make no claims * -# * about the suitability of this software for any purpose. It is * -# * provided "as is" without express or implied warranty. * -# ************************************************************************** - # Libraries add_subdirectory(base) add_subdirectory(simulation) diff --git a/Detectors/FIT/base/include/FITBase/Geometry.h b/Detectors/FIT/base/include/FITBase/Geometry.h index 0dbf6ea44295f..420aa770ba29b 100644 --- a/Detectors/FIT/base/include/FITBase/Geometry.h +++ b/Detectors/FIT/base/include/FITBase/Geometry.h @@ -15,72 +15,26 @@ //////////////////////////////////////////////// #include -#include +#include namespace o2 { namespace fit { -class Geometry : public TNamed +// FIT is not tracking detector, Geometry could be used in future but not now. So just simple settings +class Geometry { public: /// /// Default constructor. /// It must be kept public for root persistency purposes, /// but should never be called by the outside world - Geometry() = default; - - /// - /// Constructor for normal use. - /// - /// - Geometry(const Text_t* name, const Text_t* title = "", const Text_t* mcname = "", const Text_t* mctitle = ""); - - /// - /// Copy constructor. - /// - Geometry(const Geometry& geom); - - /// - /// Destructor. - /// - ~Geometry() override; - - /// - /// Assign operator. - /// - Geometry& operator=(const Geometry& rvalue); - - /// - /// \return the pointer of the unique instance of the geometry - /// - /// It should have been set before. - /// - static Geometry* GetInstance(); - - /// - /// \return the pointer of the unique instance of the geometry - /// + Geometry(); /// - // static Geometry* GetInstance(const Text_t* name, const Text_t* title = "", const Text_t* mcname = "TGeant3", - // const Text_t* mctitle = ""); - - /// - /// Instanciate geometry depending on the run number. Mostly used in analysis and MC anchors. - /// - /// \return the pointer of the unique instance - /// - ////////// - // General - // - // static Bool_t IsInitialized() { return Geometry::sGeom != nullptr; } - // static const Char_t* GetDefaultGeometryName() {return EMCGeometry::fgkDefaultGeometryName;} - + TVector3 centerMCP(int imcp) { return mMCP[imcp]; } private: - static Geometry* sGeom; ///< Pointer to the unique instance of the singleton - static const Char_t* sDefaultGeometryName; ///< Default name of geometry + TVector3 mMCP[52]; - private: - ClassDefOverride(Geometry, 1); + ClassDefNV(Geometry, 1); }; } } diff --git a/Detectors/FIT/base/src/Geometry.cxx b/Detectors/FIT/base/src/Geometry.cxx index 5c232987fd0a3..1a1c556e4bd54 100644 --- a/Detectors/FIT/base/src/Geometry.cxx +++ b/Detectors/FIT/base/src/Geometry.cxx @@ -8,11 +8,7 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. #include - -#include -#include -#include -#include +//#include #include "FITBase/Geometry.h" #include @@ -21,29 +17,80 @@ ClassImp(o2::fit::Geometry); using namespace o2::fit; -// these initialisations are needed for a singleton -Geometry* Geometry::sGeom = nullptr; -const Char_t* Geometry::sDefaultGeometryName = "fit"; -Geometry::Geometry(const Geometry& geo) : TNamed(geo) {} -Geometry::Geometry(const Text_t* name, const Text_t* title, const Text_t* mcname, const Text_t* mctitle) - : TNamed(name, title) -{ -} -Geometry& Geometry::operator=(const Geometry& /*rvalue*/) +Geometry::Geometry() : mMCP{ { 0, 0, 0 } } { - // LOG(FATAL) << "assignment operator, not implemented\n"; - return *this; -} -Geometry::~Geometry() -{ - if (this == sGeom) { - // LOG(ERROR) << "Do not call delete on me\n"; - return; + Float_t zDetA = 333; + Float_t xa[24] = { -11.8, -5.9, 0, 5.9, 11.8, -11.8, -5.9, 0, 5.9, 11.8, -12.8, -6.9, + 6.9, 12.8, -11.8, -5.9, 0, 5.9, 11.8, -11.8, -5.9, 0, 5.9, 11.8 }; + + Float_t ya[24] = { 11.9, 11.9, 12.9, 11.9, 11.9, 6.0, 6.0, 7.0, 6.0, 6.0, -0., -0., + 0., 0., -6.0, -6.0, -7.0, -6.0, -6.0, -11.9, -11.9, -12.9, -11.9, -11.9 }; + + Float_t pmcp[3] = { 2.949, 2.949, 2.8 }; // MCP + + // Matrix(idrotm[901], 90., 0., 90., 90., 180., 0.); + + // C side Concave Geometry + + Double_t crad = 82.; // define concave c-side radius here + + Double_t dP = pmcp[0]; // side length of mcp divided by 2 + + // uniform angle between detector faces== + Double_t btta = 2 * TMath::ATan(dP / crad); + + // get noncompensated translation data + Double_t grdin[6] = { -3, -2, -1, 1, 2, 3 }; + Double_t gridpoints[6]; + for (Int_t i = 0; i < 6; i++) { + gridpoints[i] = crad * TMath::Sin((1 - 1 / (2 * TMath::Abs(grdin[i]))) * grdin[i] * btta); } -} -Geometry* Geometry::GetInstance() -{ - Geometry* rv = static_cast(sGeom); - return rv; + + Double_t xi[28] = { gridpoints[1], gridpoints[2], gridpoints[3], gridpoints[4], gridpoints[0], gridpoints[1], + gridpoints[2], gridpoints[3], gridpoints[4], gridpoints[5], gridpoints[0], gridpoints[1], + gridpoints[4], gridpoints[5], gridpoints[0], gridpoints[1], gridpoints[4], gridpoints[5], + gridpoints[0], gridpoints[1], gridpoints[2], gridpoints[3], gridpoints[4], gridpoints[5], + gridpoints[1], gridpoints[2], gridpoints[3], gridpoints[4] }; + Double_t yi[28] = { gridpoints[5], gridpoints[5], gridpoints[5], gridpoints[5], gridpoints[4], gridpoints[4], + gridpoints[4], gridpoints[4], gridpoints[4], gridpoints[4], gridpoints[3], gridpoints[3], + gridpoints[3], gridpoints[3], gridpoints[2], gridpoints[2], gridpoints[2], gridpoints[2], + gridpoints[1], gridpoints[1], gridpoints[1], gridpoints[1], gridpoints[1], gridpoints[1], + gridpoints[0], gridpoints[0], gridpoints[0], gridpoints[0] }; + Double_t zi[28]; + for (Int_t i = 0; i < 28; i++) { + zi[i] = TMath::Sqrt(TMath::Power(crad, 2) - TMath::Power(xi[i], 2) - TMath::Power(yi[i], 2)); + } + + // get rotation data + Double_t ac[28], bc[28], gc[28]; + for (Int_t i = 0; i < 28; i++) { + ac[i] = TMath::ATan(yi[i] / xi[i]) - TMath::Pi() / 2 + 2 * TMath::Pi(); + if (xi[i] < 0) { + bc[i] = TMath::ACos(zi[i] / crad); + } else { + bc[i] = -1 * TMath::ACos(zi[i] / crad); + } + } + Double_t xc2[28], yc2[28], zc2[28]; + + // compensation based on node position within individual detector geometries + // determine compensated radius + Double_t rcomp = crad /*+ pstartC[2] / 2.0*/; // + for (Int_t i = 0; i < 28; i++) { + // Get compensated translation data + xc2[i] = rcomp * TMath::Cos(ac[i] + TMath::Pi() / 2) * TMath::Sin(-1 * bc[i]); + yc2[i] = rcomp * TMath::Sin(ac[i] + TMath::Pi() / 2) * TMath::Sin(-1 * bc[i]); + zc2[i] = rcomp * TMath::Cos(bc[i]); + + // Convert angles to degrees + ac[i] *= 180 / TMath::Pi(); + bc[i] *= 180 / TMath::Pi(); + gc[i] = -1 * ac[i]; + } + // Set coordinate + for (int ipmt = 0; ipmt < 24; ipmt++) + mMCP[ipmt].SetXYZ(xa[ipmt], xa[ipmt], zDetA); + for (int ipmt = 24; ipmt < 52; ipmt++) + mMCP[ipmt].SetXYZ(xc2[ipmt - 24], yc2[ipmt - 24], zc2[ipmt - 24]); } diff --git a/Detectors/FIT/simulation/src/Detector.cxx b/Detectors/FIT/simulation/src/Detector.cxx index 71b520f4894b5..dcdd4fe8be88d 100644 --- a/Detectors/FIT/simulation/src/Detector.cxx +++ b/Detectors/FIT/simulation/src/Detector.cxx @@ -48,16 +48,7 @@ void Detector::ConstructGeometry() LOG(DEBUG) << "Creating FIT geometry\n"; CreateMaterials(); - /* - Geometry * geom = GetGeometry() ; - TString gn(geom->GetName()); - gn.ToUpper(); - - if(!(geom->IsInitialized())) - { - LOG(ERROR) << "ConstructGeometry: FIT Geometry class has not been set up.\n"; - } - */ + Float_t zdetA = 333; Float_t zdetC = 82; diff --git a/cmake/O2Dependencies.cmake b/cmake/O2Dependencies.cmake index 21cf3fd23128d..f157534afd66f 100644 --- a/cmake/O2Dependencies.cmake +++ b/cmake/O2Dependencies.cmake @@ -941,6 +941,11 @@ o2_define_bucket( DEPENDENCIES # library names root_base_bucket fairroot_geom + root_base_bucket + fairroot_base_bucket + Matrix + Physics + Geom Core Hist # ROOT INCLUDE_DIRECTORIES From df26af07e51177c946be90e4c5e6caa5e2b4ed0b Mon Sep 17 00:00:00 2001 From: Ruben Shahoyan Date: Sun, 15 Oct 2017 17:43:49 +0200 Subject: [PATCH 18/18] Fix: TClonesArrays->vector + some constants definition --- Detectors/FIT/base/include/FITBase/Geometry.h | 4 + Detectors/FIT/base/include/FITBase/Hit.h | 2 +- Detectors/FIT/base/src/Hit.cxx | 2 +- .../include/FITSimulation/Detector.h | 13 +-- Detectors/FIT/simulation/src/Detector.cxx | 84 ++++++++++--------- .../FIT/simulation/src/FITSimulationLinkDef.h | 3 +- 6 files changed, 61 insertions(+), 47 deletions(-) diff --git a/Detectors/FIT/base/include/FITBase/Geometry.h b/Detectors/FIT/base/include/FITBase/Geometry.h index 420aa770ba29b..5ddd6d0d81443 100644 --- a/Detectors/FIT/base/include/FITBase/Geometry.h +++ b/Detectors/FIT/base/include/FITBase/Geometry.h @@ -31,6 +31,10 @@ class Geometry Geometry(); /// TVector3 centerMCP(int imcp) { return mMCP[imcp]; } + + static constexpr int NCellsA = 24; // number of radiatiors on A side + static constexpr int NCellsC = 28; // number of radiatiors on C side + private: TVector3 mMCP[52]; diff --git a/Detectors/FIT/base/include/FITBase/Hit.h b/Detectors/FIT/base/include/FITBase/Hit.h index fcc30c7930744..01df70119dc45 100644 --- a/Detectors/FIT/base/include/FITBase/Hit.h +++ b/Detectors/FIT/base/include/FITBase/Hit.h @@ -40,7 +40,7 @@ class Hit : public o2::BasicXYZEHit void PrintStream(std::ostream& stream) const; - ClassDef(Hit, 1); + ClassDefOverride(Hit, 1); // std::ostream &operator<<(std::ostream &stream, const Hit &point); }; diff --git a/Detectors/FIT/base/src/Hit.cxx b/Detectors/FIT/base/src/Hit.cxx index 3ac191ab40337..59edef2afe764 100644 --- a/Detectors/FIT/base/src/Hit.cxx +++ b/Detectors/FIT/base/src/Hit.cxx @@ -10,7 +10,7 @@ #include "FITBase/Hit.h" -ClassImp(o2::fit::Hit) +ClassImp(o2::fit::Hit); using namespace o2::fit; diff --git a/Detectors/FIT/simulation/include/FITSimulation/Detector.h b/Detectors/FIT/simulation/include/FITSimulation/Detector.h index 5bbca2b5cdfe0..d7f917e1327b0 100644 --- a/Detectors/FIT/simulation/include/FITSimulation/Detector.h +++ b/Detectors/FIT/simulation/include/FITSimulation/Detector.h @@ -17,7 +17,7 @@ #include #include "DetectorsBase/Detector.h" // for Detector #include "FITBase/Geometry.h" -#include "SimulationDataFormat/BaseHits.h" +#include "FITBase/Hit.h" class FairModule; @@ -57,15 +57,15 @@ class Detector : public o2::Base::Detector /// Name : Detector Name /// Active: kTRUE for active detectors (ProcessHits() will be called) /// kFALSE for inactive detectors - Detector(const char* Name, Bool_t Active); + Detector(Bool_t Active); /// Default constructor - Detector() {} + Detector() = default; /// Initialization of the detector is done here void Initialize() override; /// This method is called for each step during simulation (see FairMCApplication::Stepping()) - Bool_t ProcessHits(FairVolume* v = nullptr) override; + Bool_t ProcessHits(FairVolume* v) override; o2::BasicXYZEHit* AddHit(float x, float y, float z, float time, float energy, Int_t trackId, Int_t detId); void Register() override; @@ -83,7 +83,7 @@ class Detector : public o2::Base::Detector void DefineOpticalProperties(); Int_t ReadOptProperties(const std::string inputFilePath); void FillOtherOptProperties(); - Bool_t RegisterPhotoE(Double_t energy); + Bool_t RegisterPhotoE(float energy); // Geometry* GetGeometry(); @@ -118,7 +118,8 @@ class Detector : public o2::Base::Detector std::vector mReflMet; /// Container for data points - TClonesArray* mHitCollection; + // TClonesArray *mHitCollection; + std::vector* mHits; /// Define the sensitive volumes of the geometry void defineSensitiveVolumes(); diff --git a/Detectors/FIT/simulation/src/Detector.cxx b/Detectors/FIT/simulation/src/Detector.cxx index dcdd4fe8be88d..d199c30c8d402 100644 --- a/Detectors/FIT/simulation/src/Detector.cxx +++ b/Detectors/FIT/simulation/src/Detector.cxx @@ -17,7 +17,7 @@ #include "TVirtualMC.h" #include "FairLogger.h" -#include "FairRootManager.h" +#include "FairGenericRootManager.h" // for FairGenericRootManager #include "FairVolume.h" #include "FairRootManager.h" @@ -28,14 +28,15 @@ #include "FITSimulation/Detector.h" using namespace o2::fit; +using o2::fit::Geometry; ClassImp(Detector); -Detector::Detector(const char* Name, Bool_t Active) - : o2::Base::Detector(Name, Active), +Detector::Detector(Bool_t Active) + : o2::Base::Detector("FIT", Active), mIdSens1(0), mPMTeff(nullptr), - mHitCollection(new TClonesArray("o2::fit::HitType")) + mHits(new std::vector) { // Geometry *geo = GetGeometry() ; @@ -43,6 +44,7 @@ Detector::Detector(const char* Name, Bool_t Active) } void Detector::Initialize() {} + void Detector::ConstructGeometry() { LOG(DEBUG) << "Creating FIT geometry\n"; @@ -77,24 +79,24 @@ void Detector::ConstructGeometry() gridpoints[i] = crad * TMath::Sin((1 - 1 / (2 * TMath::Abs(grdin[i]))) * grdin[i] * btta); } - Double_t xi[28] = { gridpoints[1], gridpoints[2], gridpoints[3], gridpoints[4], gridpoints[0], gridpoints[1], + Double_t xi[Geometry::NCellsC] = { gridpoints[1], gridpoints[2], gridpoints[3], gridpoints[4], gridpoints[0], gridpoints[1], gridpoints[2], gridpoints[3], gridpoints[4], gridpoints[5], gridpoints[0], gridpoints[1], gridpoints[4], gridpoints[5], gridpoints[0], gridpoints[1], gridpoints[4], gridpoints[5], gridpoints[0], gridpoints[1], gridpoints[2], gridpoints[3], gridpoints[4], gridpoints[5], gridpoints[1], gridpoints[2], gridpoints[3], gridpoints[4] }; - Double_t yi[28] = { gridpoints[5], gridpoints[5], gridpoints[5], gridpoints[5], gridpoints[4], gridpoints[4], + Double_t yi[Geometry::NCellsC] = { gridpoints[5], gridpoints[5], gridpoints[5], gridpoints[5], gridpoints[4], gridpoints[4], gridpoints[4], gridpoints[4], gridpoints[4], gridpoints[4], gridpoints[3], gridpoints[3], gridpoints[3], gridpoints[3], gridpoints[2], gridpoints[2], gridpoints[2], gridpoints[2], gridpoints[1], gridpoints[1], gridpoints[1], gridpoints[1], gridpoints[1], gridpoints[1], gridpoints[0], gridpoints[0], gridpoints[0], gridpoints[0] }; - Double_t zi[28]; - for (Int_t i = 0; i < 28; i++) { + Double_t zi[Geometry::NCellsC]; + for (Int_t i = 0; i < Geometry::NCellsC; i++) { zi[i] = TMath::Sqrt(TMath::Power(crad, 2) - TMath::Power(xi[i], 2) - TMath::Power(yi[i], 2)); } // get rotation data - Double_t ac[28], bc[28], gc[28]; - for (Int_t i = 0; i < 28; i++) { + Double_t ac[Geometry::NCellsC], bc[Geometry::NCellsC], gc[Geometry::NCellsC]; + for (Int_t i = 0; i < Geometry::NCellsC; i++) { ac[i] = TMath::ATan(yi[i] / xi[i]) - TMath::Pi() / 2 + 2 * TMath::Pi(); if (xi[i] < 0) { bc[i] = TMath::ACos(zi[i] / crad); @@ -102,12 +104,12 @@ void Detector::ConstructGeometry() bc[i] = -1 * TMath::ACos(zi[i] / crad); } } - Double_t xc2[28], yc2[28], zc2[28]; + Double_t xc2[Geometry::NCellsC], yc2[Geometry::NCellsC], zc2[Geometry::NCellsC]; // compensation based on node position within individual detector geometries // determine compensated radius Double_t rcomp = crad + pstartC[2] / 2.0; // - for (Int_t i = 0; i < 28; i++) { + for (Int_t i = 0; i < Geometry::NCellsC; i++) { // Get compensated translation data xc2[i] = rcomp * TMath::Cos(ac[i] + TMath::Pi() / 2) * TMath::Sin(-1 * bc[i]); yc2[i] = rcomp * TMath::Sin(ac[i] + TMath::Pi() / 2) * TMath::Sin(-1 * bc[i]); @@ -120,10 +122,10 @@ void Detector::ConstructGeometry() } // A Side - Float_t xa[24] = { -11.8, -5.9, 0, 5.9, 11.8, -11.8, -5.9, 0, 5.9, 11.8, -12.8, -6.9, + Float_t xa[Geometry::NCellsA] = { -11.8, -5.9, 0, 5.9, 11.8, -11.8, -5.9, 0, 5.9, 11.8, -12.8, -6.9, 6.9, 12.8, -11.8, -5.9, 0, 5.9, 11.8, -11.8, -5.9, 0, 5.9, 11.8 }; - Float_t ya[24] = { 11.9, 11.9, 12.9, 11.9, 11.9, 6.0, 6.0, 7.0, 6.0, 6.0, -0.1, -0.1, + Float_t ya[Geometry::NCellsA] = { 11.9, 11.9, 12.9, 11.9, 11.9, 6.0, 6.0, 7.0, 6.0, 6.0, -0.1, -0.1, 0.1, 0.1, -6.0, -6.0, -7.0, -6.0, -6.0, -11.9, -11.9, -12.9, -11.9, -11.9 }; TGeoVolumeAssembly* stlinA = new TGeoVolumeAssembly("0STL"); // A side mother @@ -133,11 +135,11 @@ void Detector::ConstructGeometry() TVirtualMC::GetMC()->Gsvolu("0INS", "BOX", getMediumID(kAir), pinstart, 3); TGeoVolume* ins = gGeoManager->GetVolume("0INS"); // - TGeoTranslation* tr[52]; + TGeoTranslation* tr[Geometry::NCellsA+Geometry::NCellsC]; TString nameTr; // A side Translations - for (Int_t itr = 0; itr < 24; itr++) { + for (Int_t itr = 0; itr < Geometry::NCellsA; itr++) { nameTr = Form("0TR%i", itr + 1); z = -pstartA[2] + pinstart[2]; tr[itr] = new TGeoTranslation(nameTr.Data(), xa[itr], ya[itr], z); @@ -146,26 +148,27 @@ void Detector::ConstructGeometry() stlinA->AddNode(ins, itr, tr[itr]); } - TGeoRotation* rot[28]; + TGeoRotation* rot[Geometry::NCellsC]; TString nameRot; - TGeoCombiTrans* com[28]; + TGeoCombiTrans* com[Geometry::NCellsC]; TString nameCom; // C Side Transformations - for (Int_t itr = 24; itr < 52; itr++) { + for (Int_t itr = Geometry::NCellsA; itr < Geometry::NCellsA+Geometry::NCellsC; itr++) { nameTr = Form("0TR%i", itr + 1); nameRot = Form("0Rot%i", itr + 1); + int ic = itr - Geometry::NCellsA; // nameCom = Form("0Com%i",itr+1); - rot[itr - 24] = new TGeoRotation(nameRot.Data(), ac[itr - 24], bc[itr - 24], gc[itr - 24]); - rot[itr - 24]->RegisterYourself(); + rot[ic] = new TGeoRotation(nameRot.Data(), ac[ic], bc[ic], gc[ic]); + rot[ic]->RegisterYourself(); - tr[itr] = new TGeoTranslation(nameTr.Data(), xc2[itr - 24], yc2[itr - 24], (zc2[itr - 24] - 80.)); + tr[itr] = new TGeoTranslation(nameTr.Data(), xc2[ic], yc2[ic], (zc2[ic] - 80.)); tr[itr]->RegisterYourself(); - // com[itr-24] = new TGeoCombiTrans(tr[itr],rot[itr-24]); - com[itr - 24] = new TGeoCombiTrans(xc2[itr - 24], yc2[itr - 24], (zc2[itr - 24] - 80), rot[itr - 24]); - TGeoHMatrix hm = *com[itr - 24]; + // com[itr-Geometry::NCellsA] = new TGeoCombiTrans(tr[itr],rot[itr-Geometry::NCellsA]); + com[ic] = new TGeoCombiTrans(xc2[ic], yc2[ic], (zc2[ic] - 80), rot[ic]); + TGeoHMatrix hm = *com[ic]; TGeoHMatrix* ph = new TGeoHMatrix(hm); stlinC->AddNode(ins, itr, ph); } @@ -281,24 +284,29 @@ Bool_t Detector::ProcessHits(FairVolume* v) HitType* Detector::AddHit(float x, float y, float z, float time, float energy, Int_t trackId, Int_t detId) { - TClonesArray& clref = *mHitCollection; - - Int_t size = clref.GetEntriesFast(); + mHits->emplace_back(x, y, z, time, energy, trackId, detId); + return &(mHits->back()); +} - HitType* hit = new (clref[size]) HitType(x, y, z, time, energy, trackId, detId); +void Detector::Register() +{ + // This will create a branch in the output tree called Hit, setting the last + // parameter to kFALSE means that this collection will not be written to the file, + // it will exist only during the simulation - return hit; + if (FairGenericRootManager::Instance()) { + FairGenericRootManager::Instance()->GetFairRootManager()->RegisterAny(addNameTo("Hit").data(), mHits, kTRUE); + } } -void Detector::Register() { FairRootManager::Instance()->Register("FITHit", "FIT", mHitCollection, kTRUE); } TClonesArray* Detector::GetCollection(Int_t iColl) const { - if (iColl == 0) - return mHitCollection; + LOG(WARNING) << "GetCollection will be deprecated" << FairLogger::endl; return nullptr; } void Detector::Reset() {} + void Detector::CreateMaterials() { Int_t isxfld = 2; // magneticField->Integ(); @@ -389,13 +397,13 @@ void Detector::FillOtherOptProperties() } //------------------------------------------------------------------------ -Bool_t Detector::RegisterPhotoE(Double_t energy) +Bool_t Detector::RegisterPhotoE(float energy) { // Float_t hc=197.326960*1.e6; //mev*nm - Double_t hc = 1.973 * 1.e-6; // gev*nm - Float_t lambda = hc / energy; - Float_t eff = mPMTeff->Eval(lambda); - Double_t p = gRandom->Rndm(); + float hc = 1.973 * 1.e-6; // gev*nm + float lambda = hc / energy; + float eff = mPMTeff->Eval(lambda); + float p = gRandom->Rndm(); if (p > eff) return kFALSE; diff --git a/Detectors/FIT/simulation/src/FITSimulationLinkDef.h b/Detectors/FIT/simulation/src/FITSimulationLinkDef.h index 1f9fc6186262b..9c2870eaca382 100644 --- a/Detectors/FIT/simulation/src/FITSimulationLinkDef.h +++ b/Detectors/FIT/simulation/src/FITSimulationLinkDef.h @@ -14,6 +14,7 @@ #pragma link off all classes; #pragma link off all functions; -#pragma link C++ class o2::fit::Detector + ; +#pragma link C++ class o2::fit::Detector+; +#pragma link C++ class o2::fit::Hit+; #endif