diff --git a/MQ/hitbuilder/startMQ_Mcbm2021.sh b/MQ/hitbuilder/startMQ_Mcbm2021.sh new file mode 100755 index 0000000000000000000000000000000000000000..1ac20e665e07f6487996819a37854ad9eb53ac23 --- /dev/null +++ b/MQ/hitbuilder/startMQ_Mcbm2021.sh @@ -0,0 +1,290 @@ +#!/bin/bash +$FAIRROOTPATH/bin/shmmonitor --cleanup + +if [ -z "$1" ]; then + _runname="359" +else + _runname=$1 +fi + +if [ -z "$2" ]; then +_reqmod=-193 +else +_reqmod=$2 +fi + +if [ -z "$3" ]; then +_pulmode=1 +else +_pulmode=$3 +fi + +if [ -z "$4" ]; then + _reqtint=100 +else + _reqtint=$4 +fi + +_Opt=$5 + +_ntimeslices=-1 +#_ntimeslices=10000 +_iUnp=1 +_batch=1 +_pulmulmin=5 +_pultotmin=50 +_pultotmax=500 +#_puldetref=12 # TSR=022 +_puldetref=16 # TSR=032 + +#_tofftof=0. +_tofftof=-30. + +if [[ $_reqmod -eq 1 ]]; then + _iUnp=1 +fi + +#_dirname=/lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2018/input/$_runname/ +_outdir=/lustre/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2021/data/ +#_datapath=~/KRONOS/CBM/cbmroot/trunk +#_dirname=$_datapath/macro/beamtime/mcbm2018/input/$_runname/ +#_outdir=$_datapath/macro/beamtime/mcbm2018/data/ + +#_filename="./tsaData/${_runname}_pn05_*.tsa;./tsaData/${_runname}_pn06_*.tsa;./tsaData/${_runname}_pn07_*.tsa" +#_filename="./tsaData2020/${_runname}_pn02_*.tsa;./tsaData2020/${_runname}_pn04_*.tsa;./tsaData2020/${_runname}_pn05_*.tsa;./tsaData2020/${_runname}_pn06_*.tsa;./tsaData2020/${_runname}_pn08_*.tsa;./tsaData2020/${_runname}_pn10_*.tsa;./tsaData2020/${_runname}_pn11_*.tsa;./tsaData2020/${_runname}_pn12_*.tsa;./tsaData2020/${_runname}_pn13_*.tsa;./tsaData2020/${_runname}_pn15_*.tsa" +_filename="./tsaData2021/${_runname}_node8_*.tsa;./tsaData2021/${_runname}_node9_*.tsa" +_digifile=$_runname.$_reqtint.$_reqmod.${_pulmode}${_Opt}.root + +# ASCII files +#_mapfile=/lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/MQ/hitbuilder/MapTofGbtx.par +_mapfile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2021/mTofPar.par +if [ $_runname -ge 707 ] && [ $_runname -lt 754 ]; then + _mapfile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2020/mTofPar_2Stack.par +else + if [ $_runname -ge 754 ] && [ $_runname -lt 900 ]; then + _mapfile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2020/mTofPar_3Stack.par + _puldetref=12 # TSR=022 + else + if [ $_runname -ge 1079 ] && [ $_runname -lt 10000 ]; then + _mapfile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2021/mTofPar2Stack.par + fi + fi +fi +#_mapfile=/lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2018/etofPar.par +#_digibdffile=/lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/parameters/tof/v18j_cosmicHD.digibdf.par +#_digiparfile=/lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/parameters/tof/tof_v18j_cosmicHD.digi.par +_digibdffile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/parameters/tof/tof_v21a_mcbm.digibdf.par +#_digiparfile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/parameters/tof/tof_v19b_mcbm.digi.par + +# ROOT files +#_geofile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2018/tof_v18l_mCbm.par.root +_geofile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2021/tof_mcbm_beam_2021_01.par.root + +# MQ ports +_pPar=5603 +_pSam=5613 +_pCmd=5623 +_pDig=5633 + +rm -v nohup.out +rm -v *log +rm all_* + +PARAMETERSERVER="parmq-server" +echo pkill $PARAMETERSERVER +pkill -9 $PARAMETERSERVER +pkill -9 $PARAMETERSERVER +sleep 1 +PARAMETERSERVER+=" --id parmq-server" +PARAMETERSERVER+=" --channel-name parameters" +PARAMETERSERVER+=" --channel-config name=parameters,type=rep,method=bind,rateLogging=0,transport=zeromq,address=tcp://127.0.0.1:$_pPar" +#PARAMETERSERVER+=" --libs-to-load libCbmTof;libCbmFlibMcbm2018" +#PARAMETERSERVER+=" --first-input-name $_mapfile;$_digiparfile;$_digibdffile" +PARAMETERSERVER+=" --first-input-name $_mapfile;$_digibdffile" +PARAMETERSERVER+=" --first-input-type ASCII" +PARAMETERSERVER+=" --second-input-name $_geofile" +PARAMETERSERVER+=" --second-input-type ROOT" +PARAMETERSERVER+=" --severity INFO" +if [[ $_batch = 1 ]]; then +PARAMETERSERVER+=" --control static" +PARAMETERSERVER+=" --log-to-file ParServ.out" +nohup /lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/build/bin/MQ/parmq/$PARAMETERSERVER & +else +xterm -geometry 80x23+0+340 -hold -e /lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/build/bin/MQ/parmq/$PARAMETERSERVER & +#xterm -geometry 80x23+500+0 -hold -e /cvmfs/fairroot.gsi.de/fairroot/v18.0.6_fairsoft-may18/bin/$PARAMETERSERVER & +fi + +SAMPLER="TsaMultiSamplerTof" +SAMPLER+=" --id sampler1" +SAMPLER+=" --max-timeslices $_ntimeslices" +#SAMPLER+=" --max-timeslices 1000000" +#SAMPLER+=" --flib-port 10" +#SAMPLER+=" --dirname $_dirname" +SAMPLER+=" --filename $_filename" +#SAMPLER+=" --flib-host myHost" +SAMPLER+=" --channel-config name=tofcomponent,type=push,method=bind,rateLogging=0,transport=zeromq,address=tcp://*:$_pSam" +SAMPLER+=" --channel-config name=syscmd,type=pub,method=bind,rateLogging=0,transport=zeromq,address=tcp://*:$_pCmd" +#SAMPLER+=" --transport shmem" +#SAMPLER+=" --transport zeromq" +#SAMPLER+=" --transport nanomsg" +#SAMPLER+=" --severity WARN" +SAMPLER+=" --severity INFO" +#SAMPLER+=" --severity DEBUG" +SAMPLER+=" --SelectComponents 1" +if [[ $_batch = 1 ]]; then +SAMPLER+=" --log-to-file Sampl.out" +SAMPLER+=" --control static" +nohup /lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/build/bin/MQ/source/$SAMPLER & +else +xterm -geometry 80x23+0+0 -hold -e /lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/build/bin/MQ/source/$SAMPLER & +fi + +while (( _iUnp > 0 )); do + +UNPACKER="UnpackTofMcbm2018" +UNPACKER+=" --id unpack$_iUnp" +UNPACKER+=" --channel-config name=tofcomponent,type=pull,method=connect,rateLogging=0,transport=zeromq,address=tcp://127.0.0.1:$_pSam" +UNPACKER+=" --channel-config name=parameters,type=req,method=connect,rateLogging=0,transport=zeromq,address=tcp://127.0.0.1:$_pPar" +UNPACKER+=" --channel-config name=tofdigis,type=push,method=connect,rateLogging=0,transport=zeromq,address=tcp://127.0.0.1:$_pDig" +UNPACKER+=" --channel-config name=syscmd,type=sub,method=connect,rateLogging=0,transport=zeromq,address=tcp://127.0.0.1:$_pCmd" +#UNPACKER+=" --transport shmem" +#UNPACKER+=" --severity DEBUG" +UNPACKER+=" --severity INFO" +UNPACKER+=" --SelectComponents 1" +#UNPACKER+=" --ReqBeam 20486" # diamond -> 0x00005006 v14a +#UNPACKER+=" --ReqBeam 10246" # diamond -> 0x00002806 v21a +if [[ $_reqmod -lt 1 ]]; then + UNPACKER+=" --ReqMode 0" + case $_reqmod in + 0) + ;; + -1) + UNPACKER+=" --ReqDet0 10246" # diamond -> 0x00002806 v21a + UNPACKER+=" --ReqDet1 32822" # RPC 031 -> 0x00008036 v21a + UNPACKER+=" --ReqDet2 32838" # RPC 041 -> 0x00008046 v21a + ;; + -2) + UNPACKER+=" --ReqDet0 20486" # diamond + UNPACKER+=" --ReqDet1 131126" # RPC 032 + UNPACKER+=" --ReqDet2 131142" # RPC 042 + ;; # for ceramics + + -3) + UNPACKER+=" --ReqDet0 20486" # diamond + UNPACKER+=" --ReqDet1 196662" # RPC 033 + UNPACKER+=" --ReqDet2 196678" # RPC 043 + ;; # for BUC + + -4) # v21a address mode + UNPACKER+=" --ReqDet0 10246" # diamond + UNPACKER+=" --ReqDet1 65542" # RPC 002 + UNPACKER+=" --ReqDet2 65574" # RPC 022 + ;; + + -190) + UNPACKER+=" --ReqDet0 20486" # diamond + UNPACKER+=" --ReqDet1 65606" # RPC 041 + UNPACKER+=" --ReqDet2 36870" # RPC 900 + UNPACKER+=" --ReqDet3 102406" # RPC 901 + ;; # for double stack calibration + + -191) + UNPACKER+=" --ReqDet0 20486" # diamond + UNPACKER+=" --ReqDet1 65606" # RPC 041 + UNPACKER+=" --ReqDet2 24582" # RPC 600 + UNPACKER+=" --ReqDet3 90118" # RPC 601 + ;; # for USTC counter analysis + + -192) + UNPACKER+=" --ReqDet0 65606" # RPC 041 + UNPACKER+=" --ReqDet1 36870" # RPC 900 + UNPACKER+=" --ReqDet2 102406" # RPC 901 + ;; # for double stack calibration + + -193) BeamBeam + UNPACKER+=" --ReqDet0 65606" # RPC 041 + UNPACKER+=" --ReqDet1 24582" # RPC 600 + UNPACKER+=" --ReqDet2 90118" # RPC 601 + ;; # for USTC counter analysis + + -194) + UNPACKER+=" --ReqDet0 20486" # diamond + UNPACKER+=" --ReqDet1 24582" # RPC 600 + UNPACKER+=" --ReqDet2 90118" # RPC 601 + ;; # for USTC counter analysis + + *) + echo ReqMode $_reqmod not yet defined, exiting + exit 1 + ;; + esac; +else + UNPACKER+=" --ReqMode $_reqmod" +fi +UNPACKER+=" --ReqTint $_reqtint" +UNPACKER+=" --PulserMode $_pulmode" +UNPACKER+=" --PulMulMin $_pulmulmin" +UNPACKER+=" --PulTotMin $_pultotmin" +UNPACKER+=" --PulTotMax $_pultotmax" +UNPACKER+=" --ToffTof $_tofftof" +UNPACKER+=" --RefModType 5" +UNPACKER+=" --RefModId 0" +UNPACKER+=" --RefCtrType 0" +UNPACKER+=" --RefCtrId 0" +if [[ $_batch = 1 ]]; then +UNPACKER+=" --control static" +UNPACKER+=" --log-to-file Unp$_iUnp.out" +#echo nohup $UNPACKER +nohup /lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/build/bin/MQ/unpacker/$UNPACKER & +else +xterm -geometry 110x23+520+0 -hold -e /lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/build/bin/MQ/unpacker/$UNPACKER & +fi + +(( _iUnp -= 1 )) +done + +HITBUILDER="HitBuilderTof" +HITBUILDER+=" --id hitbuilder1" +HITBUILDER+=" --channel-config name=tofdigis,type=pull,method=bind,rateLogging=0,transport=zeromq,address=tcp://*:$_pDig" +HITBUILDER+=" --channel-config name=parameters,type=req,method=connect,rateLogging=0,transport=zeromq,address=tcp://127.0.0.1:$_pPar" +HITBUILDER+=" --channel-config name=syscmd,type=sub,method=connect,rateLogging=0,transport=zeromq,address=tcp://127.0.0.1:$_pCmd" +#HITBUILDER+=" --channel-config name=tofhits,type=push,method=bind,transport=shmem,address=tcp://127.0.0.1:5557" +#HITBUILDER+=" --channel-config name=tofcalib,type=push,method=bind,transport=shmem,address=tcp://127.0.0.1:5558" +#HITBUILDER+=" --transport shmem" +#HITBUILDER+=" --severity DEBUG" +HITBUILDER+=" --severity INFO" +#HITBUILDER+=" --severity WARN" +HITBUILDER+=" --OutRootFile $_outdir$_digifile" +#HITBUILDER+=" --MaxEvent 10000000" +#HITBUILDER+=" --RunId 1552883952" +HITBUILDER+=" --RunId 1614415472" +HITBUILDER+=" --PulserMode $_pulmode" +HITBUILDER+=" --PulMulMin $_pulmulmin" +HITBUILDER+=" --PulTotMin $_pultotmin" +HITBUILDER+=" --PulTotMax $_pultotmax" +HITBUILDER+=" --PulDetRef $_puldetref" +HITBUILDER+=" --ReqTint $_reqtint" +#HITBUILDER+=" --ReqBeam 20486" # diamond -> 0x00005006 +HITBUILDER+=" --BRefType 5" +HITBUILDER+=" --BRefSm 0" +HITBUILDER+=" --BRefDet 0" +HITBUILDER+=" --DutType 0" +HITBUILDER+=" --DutSm 3" +HITBUILDER+=" --DutRpc 1" +HITBUILDER+=" --SelType 0" +HITBUILDER+=" --SelSm 4" +HITBUILDER+=" --SelRpc 1" +HITBUILDER+=" --Sel2Type 5" +HITBUILDER+=" --Sel2Sm 0" +HITBUILDER+=" --Sel2Rpc 0" +if [[ $_reqmod -eq 1 ]]; then +HITBUILDER+=" --Mode 1" +fi + +if [[ $_batch = 1 ]]; then +HITBUILDER+=" --control static" +HITBUILDER+=" --log-to-file HitBuild.out" +nohup /lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/build/bin/MQ/hitbuilder/$HITBUILDER & +else +xterm -geometry 120x23+1400+0 -hold -e /lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/build/bin/MQ/hitbuilder/$HITBUILDER & +fi diff --git a/fles/mcbm2018/unpacker/CbmMcbm2018UnpackerAlgoTof.cxx b/fles/mcbm2018/unpacker/CbmMcbm2018UnpackerAlgoTof.cxx index c58ea33c58bfe91d8b79e964d8b4997ed0e32b5e..3325519a4c3e94f9d8d85865c873f360deb0ef29 100644 --- a/fles/mcbm2018/unpacker/CbmMcbm2018UnpackerAlgoTof.cxx +++ b/fles/mcbm2018/unpacker/CbmMcbm2018UnpackerAlgoTof.cxx @@ -223,6 +223,8 @@ Bool_t CbmMcbm2018UnpackerAlgoTof::InitParameters() { case 0: // CBM modules if (fviRpcSide[iGbtx] < 2) { // mTof modules + LOG(info) << " Map mTof box " << fviModuleId[iGbtx] + << " at GBTX - iCh = " << iCh; const Int_t RpcMap[5] = {4, 2, 0, 3, 1}; for (Int_t iRpc = 0; iRpc < fviNrOfRpc[iGbtx]; iRpc++) { Int_t iStrMax = 32; @@ -376,7 +378,8 @@ Bool_t CbmMcbm2018UnpackerAlgoTof::InitParameters() { [[fallthrough]]; case 9: // Star2 boxes { - LOG(info) << " Map Star2 box at GBTX - iCh = " << iCh; + LOG(info) << " Map Star2 box " << fviModuleId[iGbtx] + << " at GBTX - iCh = " << iCh; const Int_t iRpc[5] = {1, -1, 1, 0, 0}; const Int_t iSide[5] = {1, -1, 0, 1, 0}; for (Int_t iFeet = 0; iFeet < 5; iFeet++) { @@ -732,7 +735,8 @@ Bool_t CbmMcbm2018UnpackerAlgoTof::ProcessMs(const fles::Timeslice& ts, if (fuNrOfGet4PerGdpb <= fuGet4Id && !pMess[uIdx].isStarTrigger() && (gdpbv100::kuChipIdMergedEpoch != fuGet4Id)) LOG(warning) << "Message with Get4 ID too high: " << fuGet4Id << " VS " - << fuNrOfGet4PerGdpb << " set in parameters."; + << fuNrOfGet4PerGdpb << " for GdpbIdx " << fuCurrDpbIdx + << " set in parameters."; /* if( 1 == uIdx && gdpbv100::MSG_EPOCH != messageType ) diff --git a/macro/beamtime/mcbm2020/ana_trks.C b/macro/beamtime/mcbm2020/ana_trks.C index 3d1dbf6a7b7f4bddf7988564406d0a1c0db50493..c6e1702d79d9af4b42139f26d4f5f625f459f2c4 100644 --- a/macro/beamtime/mcbm2020/ana_trks.C +++ b/macro/beamtime/mcbm2020/ana_trks.C @@ -73,7 +73,8 @@ void ana_trks(Int_t nEvents = 10000, if (iRun < 690) TofGeo = "v20a_mcbm"; else - TofGeo = "v20f_mcbm"; + TofGeo = "v21a_mcbm"; + cout << "Geometry version " << TofGeo << endl; TObjString* tofDigiBdfFile = new TObjString(workDir + "/parameters/tof/tof_" diff --git a/macro/beamtime/mcbm2020/init_cal_all.sh b/macro/beamtime/mcbm2020/init_cal_all.sh index a43948b01cd66532eca9c4cee5ff79fb7668830d..6a8a92903da09a98a71753715ca5db2cad5b499e 100755 --- a/macro/beamtime/mcbm2020/init_cal_all.sh +++ b/macro/beamtime/mcbm2020/init_cal_all.sh @@ -36,8 +36,8 @@ fi echo cCalSet = $cCalSet #iSet=0 #lastOpt='' -nEvi0=150000 # start value -nEvi1=50000 # increment +nEvi0=50000 # start value965311965311 +nEvi1=50000 # increment if [ -e /lustre ]; then source /lustre/cbm/users/nh/CBM/cbmroot/trunk/build/config.sh @@ -56,8 +56,8 @@ cp .rootrc ${cRun} cd ${cRun} # Global variables, for for-loops -iRestart=0 -#iRestart=29 +#iRestart=0 +iRestart=33 iStep=0 iStepLast=0 iCalSel0=0 diff --git a/macro/beamtime/mcbm2020/mcbm_event_ana.C b/macro/beamtime/mcbm2020/mcbm_event_ana.C index f7b1f19bb60e5cdaf195e7b3cc82d83feb0543fb..6d5769b2a21e3d63d0a87953d4c626c11696dd84 100644 --- a/macro/beamtime/mcbm2020/mcbm_event_ana.C +++ b/macro/beamtime/mcbm2020/mcbm_event_ana.C @@ -404,14 +404,14 @@ void mcbm_event_ana(UInt_t uRunId = 831, CbmTofExtendTracks* tofExtendTracks = new CbmTofExtendTracks("TofExtAna"); tofExtendTracks->SetCalParFileName("TofExtTracksPar.root"); tofExtendTracks->SetCalOutFileName("TofExtTracksOut.root"); - tofExtendTracks->SetStationUT(1); + tofExtendTracks->SetStationUT(2); //iLev: 0 update alignment with deviation from original tracklet //iLev: 1 update alignment with deviation from extended and refitted tracklet tofExtendTracks->SetCorSrc(0); // [iLev]0 - all hits, [ilev]1 - pulls, tofExtendTracks->SetCorMode( 210); // 2 - Y coordinate, 1 - X coordinat, 0 Time offset tofExtendTracks->SetTrkHitsMin(4); - tofExtendTracks->SetAddStations(1); + tofExtendTracks->SetAddStations(2); tofExtendTracks->SetReqStations(509); tofExtendTracks->SetCutDX(10.); tofExtendTracks->SetCutDY(10.); diff --git a/macro/beamtime/pl_all_CluRateRatio.C b/macro/beamtime/pl_all_CluRateRatio.C index af0a158cd0ea27de8cd8d124b03928405cf1ca49..8d2b054de14817f24aee223818afa24f21147096 100644 --- a/macro/beamtime/pl_all_CluRateRatio.C +++ b/macro/beamtime/pl_all_CluRateRatio.C @@ -31,7 +31,7 @@ void pl_all_CluRateRatio(Int_t iRef = 500, TH1* hRat; TH1* hDis; TH2* h2; - const Int_t iTSR[11] = {500, 41, 31, 900, 901, 700, 921, 600, 601, 800, 801}; + const Int_t iTSR[11] = {500, 41, 31, 900, 901, 910, 911, 600, 601, 800, 801}; const Double_t dArea[11] = { 1., 18., 44.0, 896., 896., 896., 896., 280., 280., 32., 4.}; const Double_t dDist[11] = { @@ -130,7 +130,9 @@ void pl_all_CluRateRatio(Int_t iRef = 500, } can->cd(2); - iCol = 1; + iCol = 1; + TLegend* leg = new TLegend(0.25, 0.7, 0.35, 0.95); + leg->SetTextSize(0.03); for (Int_t iSt = 0; iSt < iNSt; iSt++) { iRp = iTSR[iSt] % 10; iSmType = (iTSR[iSt] - iRp) / 10; @@ -153,6 +155,7 @@ void pl_all_CluRateRatio(Int_t iRef = 500, hRat->SetName(Form("hRat_%d", iTSR[iSt])); hRat->SetTitle("ratio"); hRat->GetYaxis()->SetTitle("ratio"); + leg->AddEntry(hRat, Form("%d", iTSR[iSt]), "l"); switch (iOpt) { case 0: //rate hRat->Divide(h, hRef, 1., 1., "B"); @@ -203,6 +206,7 @@ void pl_all_CluRateRatio(Int_t iRef = 500, } else { cout << "Histogram " << hname << " not existing. " << endl; } + leg->Draw(); } can->SaveAs(Form("pl_all_CluRate.pdf")); } diff --git a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v21a_mcbm.C b/macro/mcbm/geometry/tof/Create_TOF_Geometry_v21a_mcbm.C index 11a0a99a9113fd261a5520e5f484a71df0585ab3..0d187df1de2b801ab844808d27d191ae568f60f6 100644 --- a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v21a_mcbm.C +++ b/macro/mcbm/geometry/tof/Create_TOF_Geometry_v21a_mcbm.C @@ -5,8 +5,10 @@ // Changelog // -// 2020-03-11 - v21a - DE - build a double wall with 10 TOF modules -// 2018-06-23 - v18j - DE - move 2 RPCs to the front and 3 RPCs to the back inside a TOF module +// 2020-04-14 - v20b - NH - swapped double stack layer 2 with STAR2 moodule, buc kept as dummy +// 2020-04-01 - v20a - NH - move mTOF +20 cm in x direction for the Mar 2020 run +// 2019-11-28 - v19b - DE - move mTOF +12 cm in x direction for the Nov 2019 run +// 2019-07-31 - v19a - DE - this TOF March 2019 geometry is also known as v18m // 2017-11-03 - v18i - DE - shift mTOF to z=298 cm for acceptance matching with mSTS // 2017-10-06 - v18h - DE - put v18f into vertical position to fit into the mCBM cave // 2017-07-15 - v18g - DE - swap the z-position of TOF modules: 2 in the front, 3 in the back @@ -25,6 +27,7 @@ #include "TGeoPgon.h" #include "TGeoVolume.h" #include "TList.h" +#include "TMath.h" #include "TROOT.h" #include "TString.h" #include "TSystem.h" @@ -32,7 +35,8 @@ #include <iostream> // Name of geometry version and output file -const TString geoVersion = "tof_v14a"; // do not change +const TString geoVersion = "tof_v21a_mcbm"; // do not change +const TString geoVersionStand = geoVersion + "Stand"; // const TString fileTag = "tof_v21a"; const TString FileNameSim = fileTag + "_mcbm.geo.root"; @@ -40,7 +44,9 @@ const TString FileNameGeo = fileTag + "_mcbm_geo.root"; const TString FileNameInfo = fileTag + "_mcbm.geo.info"; // TOF_Z_Front corresponds to front cover of outer super module towers -const Float_t TOF_Z_Front = 203; // = z=298 mCBM@SIS18 +const Float_t TOF_Z_Front_Stand = 247.; // = z=298 mCBM@SIS18 +const Float_t TOF_X_Front_Stand = 0.; // = z=298 mCBM@SIS18 +const Float_t TOF_Z_Front = 0.; // = z=298 mCBM@SIS18 //const Float_t TOF_Z_Front = 130; // = z=225 mCBM@SIS18 //const Float_t TOF_Z_Front = 250; // SIS 100 hadron //const Float_t TOF_Z_Front = 450; // SIS 100 hadron @@ -61,81 +67,92 @@ const TString ActivGasMedium = "RPCgas"; const TString GlasMedium = "RPCglass"; const TString ElectronicsMedium = "carbon"; -const Int_t NumberOfDifferentCounterTypes = 4; -const Float_t Glass_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32.}; -const Float_t Glass_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10.}; -const Float_t Glass_Z[NumberOfDifferentCounterTypes] = {0.1, 0.1, 0.1, 0.1}; - -const Float_t GasGap_X[NumberOfDifferentCounterTypes] = {32., 52., 32., 32.}; -const Float_t GasGap_Y[NumberOfDifferentCounterTypes] = {26.9, 53., 20., 10.}; -const Float_t GasGap_Z[NumberOfDifferentCounterTypes] = {0.025, - 0.025, - 0.025, - 0.025}; - -const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {8, 8, 8, 8}; +// Counters: +// 0 MRPC3a +// 1 MRPC3b +// 2 USTC +// 3 +// 4 Diamond +// +// 6 Buc 2019 +// 7 CERN 20gap +// 8 Ceramic Pad +const Int_t NumberOfDifferentCounterTypes = 9; +const Float_t Glass_X[NumberOfDifferentCounterTypes] = + {32., 52., 32., 32., 0.2, 32., 28.8, 20., 2.4}; +const Float_t Glass_Y[NumberOfDifferentCounterTypes] = + {27.0, 53., 26.8, 10., 0.2, 10., 6., 20., 2.4}; +const Float_t Glass_Z[NumberOfDifferentCounterTypes] = + {0.1, 0.1, 0.1, 0.1, 0.01, 0.1, 0.1, 0.1, 0.1}; + +const Float_t GasGap_X[NumberOfDifferentCounterTypes] = + {32., 52., 32., 32., 0.2, 32., 28.8, 20., 2.4}; +const Float_t GasGap_Y[NumberOfDifferentCounterTypes] = + {27.0, 53., 26.8, 10., 0.2, 10., 6., 20., 2.4}; +const Float_t GasGap_Z[NumberOfDifferentCounterTypes] = + {0.025, 0.025, 0.025, 0.025, 0.01, 0.02, 0.02, 0.02, 0.025}; + +const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = + {8, 8, 8, 8, 1, 8, 10, 20, 4}; //const Int_t NumberOfGaps[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb -const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {32, - 52, - 96, - 96}; +const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = + {32, 32, 32, 32, 8, 32, 32, 20, 1}; //const Int_t NumberOfReadoutStrips[NumberOfDifferentCounterTypes] = {1,1,1,1}; //deb const Float_t SingleStackStartPosition_Z[NumberOfDifferentCounterTypes] = - {-0.6, -0.6, -0.6, -0.6}; - -const Float_t Electronics_X[NumberOfDifferentCounterTypes] = {34.0, - 53.0, - 32.0, - 32.}; -const Float_t Electronics_Y[NumberOfDifferentCounterTypes] = {5.0, - 5.0, - 1.0, - 1.}; -const Float_t Electronics_Z[NumberOfDifferentCounterTypes] = {0.3, - 0.3, - 0.3, - 0.3}; - -const Int_t NofModuleTypes = 6; - + {-0.6, -0.6, -0.6, -0.6, -0.1, -0.6, -0.6, -0.6, -1.}; + +const Float_t Electronics_X[NumberOfDifferentCounterTypes] = + {34.0, 53.0, 32.0, 32., 0.3, 0.1, 28.8, 20., 0.1}; +const Float_t Electronics_Y[NumberOfDifferentCounterTypes] = + {5.0, 5.0, 1.0, 1., 0.1, 0.1, 1.0, 1.0, 0.1}; +const Float_t Electronics_Z[NumberOfDifferentCounterTypes] = + {0.3, 0.3, 0.3, 0.3, 0.1, 0.1, 0.1, 0.1, 0.1}; + +const Int_t NofModuleTypes = 10; +// 5 Diamond +// 6 Buc +// 7 CERN 20 gap +// 8 Ceramic +// 9 Star2 // Aluminum box for all module types const Float_t Module_Size_X[NofModuleTypes] = - {180., 180., 180., 180., 180., 74.}; -const Float_t Module_Size_Y[NofModuleTypes] = {49., 49., 74., 28., 18., 18.}; -const Float_t Module_Over_Y[NofModuleTypes] = {11.5, 11.5, 11., 4.5, 4.5, 5.1}; -const Float_t Module_Size_Z[NofModuleTypes] = {10., 10., 13., 10., 10., 10.}; -const Float_t Module_Thick_Alu_X_left = 1.0; -const Float_t Module_Thick_Alu_X_right = 0.1; -const Float_t Module_Thick_Alu_Y = 0.1; -const Float_t Module_Thick_Alu_Z = 0.1; + {180., 180., 180., 180., 180., 5., 40., 30., 22.5, 100.}; +const Float_t Module_Size_Y[NofModuleTypes] = + {49., 49., 74., 28., 18., 5., 12., 30., 11., 49.}; +const Float_t Module_Over_Y[NofModuleTypes] = + {11.5, 11.5, 11., 4.5, 4.5, 0., 0., 0., 0., 0.}; +const Float_t Module_Size_Z[NofModuleTypes] = + {11., 11., 13., 11., 11., 1., 12., 6., 6.2, 11.2}; +const Float_t Module_Thick_Alu_X_left = 0.1; +const Float_t Module_Thick_Alu_X_right = 1.0; +const Float_t Module_Thick_Alu_Y = 0.1; +const Float_t Module_Thick_Alu_Z = 0.1; // Distance to the center of the TOF wall [cm]; -const Float_t Wall_Z_Position = TOF_Z_Front + 0.5 * Module_Size_Z[0] - + 3.5 * Module_Size_Z[1] - + 4.5 * Module_Size_Z[2]; -//const Float_t Wall_Z_Position = TOF_Z_Front + 98.5; // corresponds to center of front module in the inner tower -//const Float_t Wall_Z_Position = 1050; // corresponds to center of front module in the inner tower -// -// TOF z front = Wall_Z_Position - 0.5 * Module_Size_Z[0] -// - 3.5 * Module_Size_Z[1] -// - 4.5 * Module_Size_Z[2] -// = 1050 - 4.0 * 10 - 4.5 * 13 = 951.5 cm -// -// TOF z back = Wall_Z_Position + 1.5 * Module_Size_Z[0] -// = 1050 + 1.5 * 10 = 1065 +const Float_t Wall_Z_Position = 400.; +const Float_t MeanTheta = 0.; //Type of Counter for module -const Int_t CounterTypeInModule[NofModuleTypes] = {0, 0, 1, 2, 3, 3}; -const Int_t NCounterInModule[NofModuleTypes] = {5, 5, 3, 5, 5, 2}; +const Int_t CounterTypeInModule[NofModuleTypes] = + {0, 0, 1, 2, 3, 4, 6, 7, 8, 2}; +const Int_t NCounterInModule[NofModuleTypes] = {5, 5, 3, 5, 5, 1, 2, 1, 8, 2}; // Placement of the counter inside the module const Float_t CounterXStartPosition[NofModuleTypes] = - {-60.0, -66.0, -56.0, -60.0, -60.0, -16.0}; + {-60.1, -66.0, -56.0, -60.0, -60.0, 0.0, 0., 0., -7., 0.}; const Float_t CounterXDistance[NofModuleTypes] = - {30.0, 32.0, 51.0, 30.0, 30.0, 30.0}; -const Float_t CounterZDistance[NofModuleTypes] = {2.5, 0.0, 0.0, 2.5, 2.5, 2.5}; -const Float_t CounterRotationAngle[NofModuleTypes] = {0., 8.7, 7.0, 0., 0., 0.}; + {29.3, 32.0, 51.0, 30.0, 30.0, 0.0, 0., 0., 2., -1.}; +const Float_t CounterYStartPosition[NofModuleTypes] = + {0.0, 0.0, 0.0, 0.0, 0.0, 0., 0., -4., -1.3, 0.}; +const Float_t CounterYDistance[NofModuleTypes] = + {0.0, 0.0, 0.0, 0.0, 0.0, 0., 0., 8., 0., 1.}; +const Float_t CounterZDistance[NofModuleTypes] = + {-2.5, 0.0, 0.0, 2.5, 2.5, 0., 6., 0., 0.1, 4.}; +const Float_t CounterZStartPosition[NofModuleTypes] = + {0.0, 0.0, 0.0, 0.0, 0.0, 0., -3., 0., 0.0, -2.}; +const Float_t CounterRotationAngle[NofModuleTypes] = + {0., 8.7, 7.0, 0., 0., 0., 0., 0., 0., 0.}; // Pole (support structure) const Int_t MaxNumberOfPoles = 20; @@ -144,7 +161,7 @@ Float_t Pole_Col[MaxNumberOfPoles]; Int_t NumberOfPoles = 0; const Float_t Pole_Size_X = 20.; -const Float_t Pole_Size_Y = 1000.; +const Float_t Pole_Size_Y = 300.; const Float_t Pole_Size_Z = 10.; const Float_t Pole_Thick_X = 5.; const Float_t Pole_Thick_Y = 5.; @@ -168,7 +185,7 @@ const Float_t Pole_Offset = 90.0 + Pole_Size_X / 2.; // Position for module placement const Float_t Inner_Module_First_Y_Position = 16.; const Float_t Inner_Module_Last_Y_Position = 480.; -const Float_t Inner_Module_X_Offset = 2.; // centered position in x/y +const Float_t Inner_Module_X_Offset = 0.; // centered position in x/y //const Float_t Inner_Module_X_Offset=18; // shift by 16 cm in x const Int_t Inner_Module_NTypes = 3; const Float_t Inner_Module_Types[Inner_Module_NTypes] = {4., 3., 0.}; @@ -193,6 +210,45 @@ const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {9., 9., 2., 0., 0., 0., 3., 4.}; //V13_3a //const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = {1.,1.,0.,0., 0.,0.,0.,0.};//debug +const Float_t Star2_First_Z_Position = TOF_Z_Front + 15.7; +const Float_t Star2_Delta_Z_Position = 16.3; +const Float_t Star2_First_Y_Position = 31.35; // +const Float_t Star2_Delta_Y_Position = 0.; // +const Float_t Star2_rotate_Z = -90.; +const Int_t Star2_NTypes = 2; +const Float_t Star2_Types[Star2_NTypes] = {9., 9.}; +const Float_t Star2_Number[Star2_NTypes] = {1., 1.}; //debugging, V16b +const Float_t Star2_X_Offset[Star2_NTypes] = {0., 0.}; //{51.}; + +const Float_t Buc_First_Z_Position = TOF_Z_Front + 16.5; +const Float_t Buc_Delta_Z_Position = 0.; +const Float_t Buc_First_Y_Position = -32.5; // +const Float_t Buc_Delta_Y_Position = 0.; // +const Float_t Buc_rotate_Z = 180.; +const Int_t Buc_NTypes = 1; +const Float_t Buc_Types[Buc_NTypes] = {6.}; +const Float_t Buc_Number[Buc_NTypes] = {1.}; //debugging, V16b +const Float_t Buc_X_Offset[Buc_NTypes] = {0.}; + +const Int_t Cer_NTypes = 3; +const Float_t Cer_Z_Position[Cer_NTypes] = {(float) (TOF_Z_Front + 13.2), + (float) (TOF_Z_Front + 45.), + (float) (TOF_Z_Front + 45.)}; +const Float_t Cer_X_Position[Cer_NTypes] = {0., 49.8, 49.8}; +const Float_t Cer_Y_Position[Cer_NTypes] = {-1., 5., 5.}; +const Float_t Cer_rotate_Z[Cer_NTypes] = {0., 0., 0.}; +const Float_t Cer_Types[Cer_NTypes] = {5., 8., 8.}; +const Float_t Cer_Number[Cer_NTypes] = {1., 1., 1.}; //V16b + +const Float_t CERN_Z_Position = TOF_Z_Front + 50; // 20 gap +const Float_t CERN_First_Y_Position = 36.; +const Float_t CERN_X_Offset = 46.; //65.5; +const Float_t CERN_rotate_Z = 90.; +const Int_t CERN_NTypes = 1; +const Float_t CERN_Types[CERN_NTypes] = {7.}; // this is the SmType! +const Float_t CERN_Number[CERN_NTypes] = { + 1.}; // evtl. double for split signals + // some global variables TGeoManager* gGeoMan = NULL; // Pointer to TGeoManager instance TGeoVolume* gModules[NofModuleTypes]; // Global storage for module types @@ -200,6 +256,14 @@ TGeoVolume* gCounter[NumberOfDifferentCounterTypes]; TGeoVolume* gPole; TGeoVolume* gBar[MaxNumberOfBars]; +const Float_t Dia_Z_Position = -0.2 - TOF_Z_Front_Stand; +const Float_t Dia_First_Y_Position = 0.; +const Float_t Dia_X_Offset = 0.; +const Float_t Dia_rotate_Z = 0.; +const Int_t Dia_NTypes = 1; +const Float_t Dia_Types[Dia_NTypes] = {5.}; +const Float_t Dia_Number[Dia_NTypes] = {1.}; + Float_t Last_Size_Y = 0.; Float_t Last_Over_Y = 0.; @@ -216,16 +280,15 @@ void position_tof_bars(Int_t); void position_inner_tof_modules(Int_t); void position_side_tof_modules(Int_t); void position_outer_tof_modules(Int_t); +void position_Dia(Int_t); +void position_Star2(Int_t); +void position_Buc(Int_t); +void position_cer_modules(Int_t); +void position_CERN(Int_t); void dump_info_file(); void Create_TOF_Geometry_v21a_mcbm() { - // Load the necessary FairRoot libraries - // gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C"); - // basiclibs(); - // gSystem->Load("libGeoBase"); - // gSystem->Load("libParBase"); - // gSystem->Load("libBase"); // Load needed material definition from media.geo file create_materials_from_media_file(); @@ -246,19 +309,38 @@ void Create_TOF_Geometry_v21a_mcbm() { gGeoMan->SetTopVolume(top); TGeoRotation* tof_rotation = new TGeoRotation(); + tof_rotation->RotateY(0.); // angle with respect to beam axis + //tof_rotation->RotateZ( 0 ); // electronics on 9 o'clock position = +x // tof_rotation->RotateZ( 0 ); // electronics on 9 o'clock position = +x - tof_rotation->RotateZ(90); // electronics on 12 o'clock position (top) + // tof_rotation->RotateZ( 90 ); // electronics on 12 o'clock position (top) // tof_rotation->RotateZ( 180 ); // electronics on 3 o'clock position = -x // tof_rotation->RotateZ( 270 ); // electronics on 6 o'clock position (bottom) TGeoVolume* tof = new TGeoVolumeAssembly(geoVersion); - top->AddNode(tof, 1, tof_rotation); - - // 2nd wall - TGeoTranslation* wall_trans = new TGeoTranslation("", 0., 0., 30.); - TGeoCombiTrans* wall_combi_trans = - new TGeoCombiTrans(*wall_trans, *tof_rotation); - top->AddNode(tof, 2, wall_combi_trans); + // top->AddNode(tof, 1, tof_rotation); + top->AddNode(tof, 1); + + TGeoVolume* tofstand = new TGeoVolumeAssembly(geoVersionStand); + // Mar 2020 run + TGeoTranslation* stand_trans_local = + new TGeoTranslation("", TOF_X_Front_Stand, 0., 0.); + TGeoTranslation* stand_trans = + new TGeoTranslation("", 0., 0., TOF_Z_Front_Stand); + TGeoCombiTrans* stand_combi_trans = + new TGeoCombiTrans(*stand_trans, *tof_rotation); + + // Nov 2019 run + // TGeoTranslation* stand_trans = new TGeoTranslation("", 12., 0., TOF_Z_Front_Stand); + // TGeoTranslation* stand_trans = new TGeoTranslation("", 0., 0., TOF_Z_Front_Stand); + TGeoRotation* stand_rot = new TGeoRotation(); + stand_rot->RotateY(0.); + //stand_rot->RotateY(1.0); + TGeoCombiTrans* stand_combi_trans_local = + new TGeoCombiTrans(*stand_trans_local, *stand_rot); + + //tof->AddNode(tofstand, 1, stand_combi_trans); + tof->AddNode(tofstand, 1, stand_combi_trans_local); + //tof->AddNode(tofstand, 1); for (Int_t counterType = 0; counterType < NumberOfDifferentCounterTypes; counterType++) { @@ -276,6 +358,12 @@ void Create_TOF_Geometry_v21a_mcbm() { // position_side_tof_modules(1); // keep order !! // position_inner_tof_modules(2); position_inner_tof_modules(3); + position_Dia(1); + position_Star2(2); + // position_cer_modules(3); + // position_CERN(1); + position_Buc(1); + cout << "Outer Types " << Outer_Module_Types[0][0] << ", " << Outer_Module_Types[1][0] << ", col=1: " << Outer_Module_Types[0][1] << ", " << Outer_Module_Types[1][1] << endl; @@ -283,18 +371,37 @@ void Create_TOF_Geometry_v21a_mcbm() { << Outer_Module_Number[1][0] << ", col=1: " << Outer_Module_Number[0][1] << ", " << Outer_Module_Number[1][1] << endl; // position_outer_tof_modules(4); - position_tof_poles(0); - position_tof_bars(0); + // position_tof_poles(0); + // position_tof_bars(0); gGeoMan->CloseGeometry(); gGeoMan->CheckOverlaps(0.001); gGeoMan->PrintOverlaps(); + gGeoMan->CheckOverlaps(0.001, "s"); + gGeoMan->PrintOverlaps(); gGeoMan->Test(); - TFile* outfile1 = new TFile(FileNameSim, "RECREATE"); + tof->Export(FileNameSim); + TFile* geoFile = new TFile(FileNameSim, "UPDATE"); + stand_combi_trans->Write(); + geoFile->Close(); + + /* + TFile* outfile1 = new TFile(FileNameSim,"RECREATE"); top->Write(); //gGeoMan->Write(); outfile1->Close(); +*/ + //tof->RemoveNode((TGeoNode*)tofstand); + //top->AddNode(tof, 1, tof_rotation); + //tof->ReplaceNode((TGeoNode*)tofstand, 0, stand_combi_trans); + /* + CbmTransport run; + run.SetGeoFileName(FileNameGeo); + run.LoadSetup("setup_mcbm_tof_2020"); + run.SetField(new CbmFieldConst()); +*/ + //top->Export(FileNameGeo); TFile* outfile2 = new TFile(FileNameGeo, "RECREATE"); gGeoMan->Write(); @@ -506,7 +613,7 @@ TGeoVolume* create_new_counter(Int_t modType) { TGeoBBox* counter_box = new TGeoBBox("", cdx / 2., cdy / 2., cdz / 2.); TGeoVolume* counter = new TGeoVolume("counter", counter_box, noActiveGasVolMed); - counter->SetLineColor(kCyan); // set line color for the counter + counter->SetLineColor(kRed); // set line color for the counter counter->SetTransparency(70); // set transparency for the TOF // define single glass plate volume @@ -606,6 +713,7 @@ TGeoVolume* create_tof_module(Int_t modType) { } else { zpos = 0.; } + //cout << "counter z position " << zpos << endl; TGeoTranslation* counter_trans = new TGeoTranslation("", startxpos + j * dxpos, 0.0, zpos); @@ -634,6 +742,8 @@ TGeoVolume* create_new_tof_module(Int_t modType) { Float_t dxpos = CounterXDistance[modType]; Float_t startxpos = CounterXStartPosition[modType]; + Float_t dypos = CounterYDistance[modType]; + Float_t startypos = CounterYStartPosition[modType]; Float_t dzoff = CounterZDistance[modType]; Float_t rotangle = CounterRotationAngle[modType]; @@ -661,15 +771,18 @@ TGeoVolume* create_new_tof_module(Int_t modType) { for (Int_t j = 0; j < NCounterInModule[modType]; j++) { //loop over counters (modules) - Float_t zpos; + //for (Int_t j=0; j< 1; j++){ //loop over counters (modules) + Float_t xpos, ypos, zpos; if (0 == modType || 3 == modType || 4 == modType || 5 == modType) { zpos = dzoff *= -1; - zpos *= -1; // flip RPC z pos in module } else { - zpos = 0.; + zpos = CounterZStartPosition[modType] + j * dzoff; } - TGeoTranslation* counter_trans = - new TGeoTranslation("", startxpos + j * dxpos, 0.0, zpos); + //cout << "counter z position " << zpos << endl; + xpos = startxpos + j * dxpos; + ypos = startypos + j * dypos; + + TGeoTranslation* counter_trans = new TGeoTranslation("", xpos, ypos, zpos); TGeoRotation* counter_rot = new TGeoRotation(); counter_rot->RotateY(rotangle); @@ -770,17 +883,17 @@ void position_tof_poles(Int_t modType) { if (i < 2) { pole_trans = new TGeoTranslation("", -Pole_Offset + 2.0, 0., Pole_ZPos[i]); - gGeoMan->GetVolume(geoVersion)->AddNode(gPole, numPoles, pole_trans); + gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans); numPoles++; } else { Float_t xPos = Pole_Offset + Pole_Size_X / 2. + Pole_Col[i] * DxColl; Float_t zPos = Pole_ZPos[i]; pole_trans = new TGeoTranslation("", xPos, 0., zPos); - gGeoMan->GetVolume(geoVersion)->AddNode(gPole, numPoles, pole_trans); + gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans); numPoles++; pole_trans = new TGeoTranslation("", -xPos, 0., zPos); - gGeoMan->GetVolume(geoVersion)->AddNode(gPole, numPoles, pole_trans); + gGeoMan->GetVolume(geoVersionStand)->AddNode(gPole, numPoles, pole_trans); numPoles++; } cout << " Position Pole " << numPoles << " at z=" << Pole_ZPos[i] << endl; @@ -804,19 +917,19 @@ void position_tof_bars(Int_t modType) { yPos = Pole_Size_Y / 2. + Bar_Size_Y / 2.; bar_trans = new TGeoTranslation("", xPos, yPos, zPos); - gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans); + gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans); numBars++; bar_trans = new TGeoTranslation("", xPos, -yPos, zPos); - gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans); + gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans); numBars++; bar_trans = new TGeoTranslation("", -xPos, yPos, zPos); - gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans); + gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans); numBars++; bar_trans = new TGeoTranslation("", -xPos, -yPos, zPos); - gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans); + gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans); numBars++; } cout << " Position Bar " << numBars << " at z=" << Bar_ZPos[i] << endl; @@ -829,11 +942,11 @@ void position_tof_bars(Int_t modType) { zPos = Pole_ZPos[0] + Pole_Size_Z / 2.; bar_trans = new TGeoTranslation("", 0., yPos, zPos); - gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans); + gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans); numBars++; bar_trans = new TGeoTranslation("", 0., -yPos, zPos); - gGeoMan->GetVolume(geoVersion)->AddNode(gBar[i], numBars, bar_trans); + gGeoMan->GetVolume(geoVersionStand)->AddNode(gBar[i], numBars, bar_trans); numBars++; } @@ -887,54 +1000,208 @@ void position_inner_tof_modules(Int_t modNType) { << endl; /// module_trans = new TGeoTranslation("", xPos, yPos, zPos); - /// gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans); + /// gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans); /// modNum++; /// module_trans = new TGeoTranslation("", xPos, -yPos, zPos); - /// gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans); + /// gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans); /// modNum++; // // if (ii>0) { // if (ii>1) { // module_trans // = new TGeoTranslation("", xPos, yPos-DeltaY/2, zPos+Module_Size_Z[modType]); - // gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans); + // gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans); // modNum++; // module_trans // = new TGeoTranslation("", xPos, -(yPos-DeltaY/2), zPos+Module_Size_Z[modType]); - // gGeoMan->GetVolume(geoVersion)->AddNode(gModules[modType], modNum, module_trans); + // gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans); // modNum++; // } } } // module_trans = new TGeoTranslation("", xPos, -49-3, zPos); - module_trans = new TGeoTranslation("", xPos, -49 - 1, zPos); - gGeoMan->GetVolume(geoVersion) - ->AddNode(gModules[modType], modNum, module_trans); - modNum++; - - module_trans = new TGeoTranslation("", xPos, 0, zPos); - gGeoMan->GetVolume(geoVersion) - ->AddNode(gModules[modType], modNum, module_trans); - modNum++; - - // module_trans = new TGeoTranslation("", xPos, 49+3, zPos); - module_trans = new TGeoTranslation("", xPos, 49 + 1, zPos); - gGeoMan->GetVolume(geoVersion) - ->AddNode(gModules[modType], modNum, module_trans); - modNum++; - - // module_trans = new TGeoTranslation("", xPos,-26, zPos+Module_Size_Z[modType]); - module_trans = - new TGeoTranslation("", xPos, -25, zPos + Module_Size_Z[modType]); - gGeoMan->GetVolume(geoVersion) - ->AddNode(gModules[modType], modNum, module_trans); - modNum++; - - // module_trans = new TGeoTranslation("", xPos, 26, zPos+Module_Size_Z[modType]); - module_trans = - new TGeoTranslation("", xPos, 25, zPos + Module_Size_Z[modType]); - gGeoMan->GetVolume(geoVersion) - ->AddNode(gModules[modType], modNum, module_trans); - modNum++; + + // Mar2019 setup + const Int_t NModules = 5; + xPos = 0.; + yPos = 0.; + zPos = TOF_Z_Front; + const Double_t ModDx[NModules] = {-50., -50., -50., 0., 0.}; + //const Double_t ModDx[NModules]= { 1.5, 0., -1.5, 49.8, 55.8}; + const Double_t ModDy[NModules] = {0., 0., 0., 0., 0.}; + const Double_t ModDz[NModules] = {0., 16.5, 34., 0., 55.5}; // regular + //const Double_t ModDz[NModules] = {0., 16.5, 34., 55.5, 0.}; // mapping ?? + const Double_t ModAng[NModules] = {-90., -90., -90., -90., -90.0}; + TGeoRotation* module_rot = NULL; + TGeoCombiTrans* module_combi_trans = NULL; + + for (Int_t iMod = 0; iMod < NModules; iMod++) { + module_trans = new TGeoTranslation( + "", xPos + ModDx[iMod], yPos + ModDy[iMod], zPos + ModDz[iMod]); + module_rot = new TGeoRotation(); + module_rot->RotateZ(ModAng[iMod]); + module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot); + gGeoMan->GetVolume(geoVersionStand) + ->AddNode(gModules[modType], modNum, module_combi_trans); + modNum++; + } + + + /* + module_trans = new TGeoTranslation("", xPos, 0, zPos+16.5); + gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans); + modNum++; + + // module_trans = new TGeoTranslation("", xPos, 49+3, zPos); + module_trans = new TGeoTranslation("", xPos, 0, zPos+16.5+17.5); + gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans); + modNum++; + + // module_trans = new TGeoTranslation("", xPos,-26, zPos+Module_Size_Z[modType]); + module_trans = new TGeoTranslation("", xPos, -49.8, zPos); + gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans); + modNum++; + + // module_trans = new TGeoTranslation("", xPos, 26, zPos+Module_Size_Z[modType]); + module_trans = new TGeoTranslation("", xPos, -49.8, zPos+16.5); + gGeoMan->GetVolume(geoVersionStand)->AddNode(gModules[modType], modNum, module_trans); + modNum++; + */ +} + + +void position_Dia(Int_t modNType) { + TGeoTranslation* module_trans = NULL; + TGeoRotation* module_rot = new TGeoRotation(); + module_rot->RotateZ(Dia_rotate_Z); + TGeoCombiTrans* module_combi_trans = NULL; + + // Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1; + Float_t yPos = Dia_First_Y_Position; + Int_t ii = 0; + Float_t xPos = Dia_X_Offset; + Float_t zPos = Dia_Z_Position; + + Int_t modNum = 0; + for (Int_t j = 0; j < modNType; j++) { + Int_t modType = Dia_Types[j]; + for (Int_t i = 0; i < Dia_Number[j]; i++) { + ii++; + module_trans = new TGeoTranslation("", xPos, yPos, zPos); + module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot); + gGeoMan->GetVolume(geoVersionStand) + ->AddNode(gModules[modType], modNum, module_combi_trans); + modNum++; + } + } +} + +void position_Star2(Int_t modNType) { + TGeoTranslation* module_trans = NULL; + TGeoRotation* module_rot = new TGeoRotation(); + module_rot->RotateZ(Star2_rotate_Z); + TGeoCombiTrans* module_combi_trans = NULL; + + Float_t yPos = Star2_First_Y_Position; + Float_t zPos = Star2_First_Z_Position; + Int_t ii = 0; + + Int_t modNum = 0; + for (Int_t j = 0; j < modNType; j++) { + Int_t modType = Star2_Types[j]; + Float_t xPos = Star2_X_Offset[j]; + for (Int_t i = 0; i < Star2_Number[j]; i++) { + ii++; + module_trans = new TGeoTranslation("", xPos, yPos, zPos); + module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot); + gGeoMan->GetVolume(geoVersionStand) + ->AddNode(gModules[modType], modNum, module_combi_trans); + modNum++; + yPos += Star2_Delta_Y_Position; + zPos += Star2_Delta_Z_Position; + } + } +} + +void position_Buc(Int_t modNType) { + TGeoTranslation* module_trans = NULL; + TGeoRotation* module_rot = new TGeoRotation(); + module_rot->RotateZ(Buc_rotate_Z); + TGeoCombiTrans* module_combi_trans = NULL; + + Float_t yPos = Buc_First_Y_Position; + Float_t zPos = Buc_First_Z_Position; + Int_t ii = 0; + + Int_t modNum = 0; + for (Int_t j = 0; j < modNType; j++) { + Int_t modType = Buc_Types[j]; + Float_t xPos = Buc_X_Offset[j]; + for (Int_t i = 0; i < Buc_Number[j]; i++) { + ii++; + module_trans = new TGeoTranslation("", xPos, yPos, zPos); + module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot); + gGeoMan->GetVolume(geoVersionStand) + ->AddNode(gModules[modType], modNum, module_combi_trans); + modNum++; + yPos += Buc_Delta_Y_Position; + zPos += Buc_Delta_Z_Position; + } + } +} + +void position_cer_modules(Int_t modNType) { + Int_t ii = 0; + Int_t modNum = 0; + for (Int_t j = 1; j < modNType; j++) { + Int_t modType = Cer_Types[j]; + Float_t xPos = Cer_X_Position[j]; + Float_t yPos = Cer_Y_Position[j]; + Float_t zPos = Cer_Z_Position[j]; + TGeoTranslation* module_trans = NULL; + TGeoRotation* module_rot = + new TGeoRotation(Form("Cer%d", j), Cer_rotate_Z[j], -MeanTheta, 0.); + // module_rot->RotateZ(Cer_rotate_Z[j]); + TGeoCombiTrans* module_combi_trans = NULL; + + for (Int_t i = 0; i < Cer_Number[j]; i++) { + ii++; + cout << "Position Ceramic Module " << i << " of " << Cer_Number[j] + << " Type " << modType << " at X = " << xPos << ", Y = " << yPos + << ", Z = " << zPos << endl; + // Front staggered module (Top if pair), top + module_trans = new TGeoTranslation("", xPos, yPos, zPos); + module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot); + gGeoMan->GetVolume(geoVersionStand) + ->AddNode(gModules[modType], modNum, module_combi_trans); + // modNum++; + } + } +} + +void position_CERN(Int_t modNType) { + TGeoTranslation* module_trans = NULL; + TGeoRotation* module_rot = new TGeoRotation(); + module_rot->RotateZ(CERN_rotate_Z); + TGeoCombiTrans* module_combi_trans = NULL; + + // Int_t numModules=(Int_t)( (Inner_Module_Last_Y_Position-Inner_Module_First_Y_Position)/Module_Size_Y[modType])+1; + Float_t yPos = CERN_First_Y_Position; + Int_t ii = 0; + Float_t xPos = CERN_X_Offset; + Float_t zPos = CERN_Z_Position; + + for (Int_t j = 0; j < modNType; j++) { + Int_t modType = CERN_Types[j]; + Int_t modNum = 0; + for (Int_t i = 0; i < CERN_Number[j]; i++) { + ii++; + module_trans = new TGeoTranslation("", xPos, yPos, zPos); + module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot); + gGeoMan->GetVolume(geoVersionStand) + ->AddNode(gModules[modType], modNum, module_combi_trans); + modNum++; + } + } } void position_side_tof_modules(Int_t modNType) { @@ -966,51 +1233,51 @@ void position_side_tof_modules(Int_t modNType) { << " DeltaY = " << DeltaY << endl; module_trans = new TGeoTranslation("", xPos, yPos, zPos); - gGeoMan->GetVolume(geoVersion) + gGeoMan->GetVolume(geoVersionStand) ->AddNode(gModules[modType], modNum, module_trans); modNum++; module_trans = new TGeoTranslation("", -xPos, yPos, zPos); module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot); - gGeoMan->GetVolume(geoVersion) + gGeoMan->GetVolume(geoVersionStand) ->AddNode(gModules[modType], modNum, module_combi_trans); modNum++; if (ii > 1) { module_trans = new TGeoTranslation("", xPos, -yPos, zPos); - gGeoMan->GetVolume(geoVersion) + gGeoMan->GetVolume(geoVersionStand) ->AddNode(gModules[modType], modNum, module_trans); modNum++; module_trans = new TGeoTranslation("", -xPos, -yPos, zPos); module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot); - gGeoMan->GetVolume(geoVersion) + gGeoMan->GetVolume(geoVersionStand) ->AddNode(gModules[modType], modNum, module_combi_trans); modNum++; module_trans = new TGeoTranslation( "", xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]); - gGeoMan->GetVolume(geoVersion) + gGeoMan->GetVolume(geoVersionStand) ->AddNode(gModules[modType], modNum, module_trans); modNum++; module_trans = new TGeoTranslation( "", -xPos, yPos - DeltaY / 2, zPos + Module_Size_Z[modType]); module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot); - gGeoMan->GetVolume(geoVersion) + gGeoMan->GetVolume(geoVersionStand) ->AddNode(gModules[modType], modNum, module_combi_trans); modNum++; module_trans = new TGeoTranslation( "", xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]); - gGeoMan->GetVolume(geoVersion) + gGeoMan->GetVolume(geoVersionStand) ->AddNode(gModules[modType], modNum, module_trans); modNum++; module_trans = new TGeoTranslation( "", -xPos, -(yPos - DeltaY / 2), zPos + Module_Size_Z[modType]); module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot); - gGeoMan->GetVolume(geoVersion) + gGeoMan->GetVolume(geoVersionStand) ->AddNode(gModules[modType], modNum, module_combi_trans); modNum++; } @@ -1091,49 +1358,49 @@ void position_outer_tof_modules(Int_t nCol) //modType, Int_t col1, Int_t col2) << " DeltaY = " << DeltaY << endl; module_trans = new TGeoTranslation("", xPos, yPos, zPos); - gGeoMan->GetVolume(geoVersion) + gGeoMan->GetVolume(geoVersionStand) ->AddNode(gModules[modType], modNum[modType], module_trans); modNum[modType]++; module_trans = new TGeoTranslation("", -xPos, yPos, zPos); module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot); - gGeoMan->GetVolume(geoVersion) + gGeoMan->GetVolume(geoVersionStand) ->AddNode(gModules[modType], modNum[modType], module_combi_trans); modNum[modType]++; if (ii > 1) { module_trans = new TGeoTranslation("", xPos, -yPos, zPos); - gGeoMan->GetVolume(geoVersion) + gGeoMan->GetVolume(geoVersionStand) ->AddNode(gModules[modType], modNum[modType], module_trans); modNum[modType]++; module_trans = new TGeoTranslation("", -xPos, -yPos, zPos); module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot); - gGeoMan->GetVolume(geoVersion) + gGeoMan->GetVolume(geoVersionStand) ->AddNode(gModules[modType], modNum[modType], module_combi_trans); modNum[modType]++; // second layer module_trans = new TGeoTranslation("", xPos, yPos - DeltaY / 2., zPos + DzPos); - gGeoMan->GetVolume(geoVersion) + gGeoMan->GetVolume(geoVersionStand) ->AddNode(gModules[modType], modNum[modType], module_trans); modNum[modType]++; module_trans = new TGeoTranslation("", -xPos, yPos - DeltaY / 2., zPos + DzPos); module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot); - gGeoMan->GetVolume(geoVersion) + gGeoMan->GetVolume(geoVersionStand) ->AddNode(gModules[modType], modNum[modType], module_combi_trans); modNum[modType]++; module_trans = new TGeoTranslation("", xPos, -(yPos - DeltaY / 2.), zPos + DzPos); - gGeoMan->GetVolume(geoVersion) + gGeoMan->GetVolume(geoVersionStand) ->AddNode(gModules[modType], modNum[modType], module_trans); modNum[modType]++; module_trans = new TGeoTranslation("", -xPos, -(yPos - DeltaY / 2.), zPos + DzPos); module_combi_trans = new TGeoCombiTrans(*module_trans, *module_rot); - gGeoMan->GetVolume(geoVersion) + gGeoMan->GetVolume(geoVersionStand) ->AddNode(gModules[modType], modNum[modType], module_combi_trans); modNum[modType]++; } diff --git a/reco/detectors/tof/CbmTofEventClusterizer.cxx b/reco/detectors/tof/CbmTofEventClusterizer.cxx index b629186880bbe81a3423a876ba1751ac9843f4e9..87198b899167bd9008f8fd65eab52d77433ebe00 100644 --- a/reco/detectors/tof/CbmTofEventClusterizer.cxx +++ b/reco/detectors/tof/CbmTofEventClusterizer.cxx @@ -5543,11 +5543,10 @@ Bool_t CbmTofEventClusterizer::BuildClusters() { Int_t iDetIndx = fDigiBdfPar->GetDetInd(pDigi->GetAddress() & DetMask); LOG(debug) << "RawDigi" << iDigInd << " " << pDigi - << Form(" Address : 0x%08x ", pDigi->GetAddress()) << " SmT " - << pDigi->GetType() << " Sm " << pDigi->GetSm() << " Rpc " - << pDigi->GetRpc() << " Ch " << pDigi->GetChannel() << " S " - << pDigi->GetSide() << ", DetIndx " << iDetIndx << " : " - << pDigi->ToString() + << Form(" Address : 0x%08x ", pDigi->GetAddress()) << " TSRCS " + << pDigi->GetType() << pDigi->GetSm() << pDigi->GetRpc() + << pDigi->GetChannel() << pDigi->GetSide() << ", DetIndx " + << iDetIndx << " : " << pDigi->ToString() // <<" Time "<<pDigi->GetTime() // <<" Tot " <<pDigi->GetTot() ;